Mercurial > mplayer.hg
comparison loader/dshow/inputpin.c @ 22305:3d1b23cf3d08
Moving duplicated (and sometimes wrong) AM_MEDIA_TYPE related code into separate file
author | voroshil |
---|---|
date | Fri, 23 Feb 2007 09:58:01 +0000 |
parents | 24dc4ec0d08d |
children | b70f5ac9c001 |
comparison
equal
deleted
inserted
replaced
22304:254733f57707 | 22305:3d1b23cf3d08 |
---|---|
3 * http://svn.mplayerhq.hu/mplayer/trunk/ | 3 * http://svn.mplayerhq.hu/mplayer/trunk/ |
4 * $Id$ | 4 * $Id$ |
5 */ | 5 */ |
6 | 6 |
7 #include "inputpin.h" | 7 #include "inputpin.h" |
8 #include "mediatype.h" | |
8 #include "wine/winerror.h" | 9 #include "wine/winerror.h" |
9 #include <string.h> | 10 #include <string.h> |
10 #include <stdio.h> | 11 #include <stdio.h> |
11 #include <stdlib.h> | 12 #include <stdlib.h> |
12 | 13 |
309 /* [out] */ AM_MEDIA_TYPE *pmt) | 310 /* [out] */ AM_MEDIA_TYPE *pmt) |
310 { | 311 { |
311 Debug printf("CInputPin_ConnectionMediaType(%p) called\n", This); | 312 Debug printf("CInputPin_ConnectionMediaType(%p) called\n", This); |
312 if (!pmt) | 313 if (!pmt) |
313 return E_INVALIDARG; | 314 return E_INVALIDARG; |
314 *pmt=((CInputPin*)This)->type; | 315 CopyMediaType(pmt,&(((CInputPin*)This)->type)); |
315 if (pmt->cbFormat > 0) | |
316 { | |
317 pmt->pbFormat=malloc(pmt->cbFormat); | |
318 memcpy(pmt->pbFormat, ((CInputPin*)This)->type.pbFormat, pmt->cbFormat); | |
319 } | |
320 return 0; | 316 return 0; |
321 } | 317 } |
322 | 318 |
323 /** | 319 /** |
324 * \brief IPin::QueryPinInfo (retrieves information about the pin) | 320 * \brief IPin::QueryPinInfo (retrieves information about the pin) |
525 * | 521 * |
526 */ | 522 */ |
527 static void CInputPin_Destroy(CInputPin* This) | 523 static void CInputPin_Destroy(CInputPin* This) |
528 { | 524 { |
529 free(This->vt); | 525 free(This->vt); |
526 FreeMediaType(&(This->type)); | |
530 free(This); | 527 free(This); |
531 } | 528 } |
532 | 529 |
533 IMPLEMENT_IUNKNOWN(CInputPin) | 530 IMPLEMENT_IUNKNOWN(CInputPin) |
534 | 531 |
548 if (!This) | 545 if (!This) |
549 return NULL; | 546 return NULL; |
550 | 547 |
551 This->refcount = 1; | 548 This->refcount = 1; |
552 This->parent = p; | 549 This->parent = p; |
553 This->type = *amt; | 550 CopyMediaType(&(This->type),amt); |
554 | 551 |
555 This->vt= (IPin_vt*) malloc(sizeof(IPin_vt)); | 552 This->vt= (IPin_vt*) malloc(sizeof(IPin_vt)); |
556 | 553 |
557 if (!This->vt) | 554 if (!This->vt) |
558 { | 555 { |