From c8b40d3bd00cab519ea4e55116332efd12f9b381 Mon Sep 17 00:00:00 2001 From: arpi_esp Date: Sun, 6 May 2001 21:43:45 +0000 Subject: avifile-0.6-CVS merge git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@714 b3059339-0415-0410-9bf9-f77b7e298cf2 --- loader/dshow/outputpin.c | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) (limited to 'loader/dshow/outputpin.c') diff --git a/loader/dshow/outputpin.c b/loader/dshow/outputpin.c index cfb0f32aae..ce1429c37b 100644 --- a/loader/dshow/outputpin.c +++ b/loader/dshow/outputpin.c @@ -1,8 +1,11 @@ + +#include +#include + #include "outputpin.h" -#include -#include #include "allocator.h" #include "iunk.h" + #define E_NOTIMPL 0x80004001 /* An object beyond interface IEnumMediaTypes. @@ -112,7 +115,7 @@ HRESULT STDCALL CEnumMediaTypes::Clone ( COutputPin::COutputPin(const AM_MEDIA_TYPE& vh) :refcount(1), type(vh), remote(0), frame_pointer(0), frame_size_pointer(0) { - IPin::vt=new IPin_vt; + IPin::vt = new IPin_vt; IPin::vt->QueryInterface = QueryInterface; IPin::vt->AddRef = AddRef; IPin::vt->Release = Release; @@ -142,6 +145,15 @@ COutputPin::COutputPin(const AM_MEDIA_TYPE& vh) :refcount(1), type(vh), remote(0 IMemInputPin::vt->Receive = Receive; IMemInputPin::vt->ReceiveMultiple = ReceiveMultiple; IMemInputPin::vt->ReceiveCanBlock = ReceiveCanBlock; + + pAllocator = 0; + frame_pointer = 0; +} + +COutputPin::~COutputPin() +{ + delete IPin::vt; + delete IMemInputPin::vt; } // IPin->IUnknown methods @@ -164,19 +176,22 @@ HRESULT STDCALL COutputPin::QueryInterface(IUnknown* This, GUID* iid, void** ppv } Debug printf("Unknown interface : %08x-%04x-%04x-%02x%02x-" \ - "%02x%02x%02x%02x%02x%02x\n", - iid->f1, iid->f2, iid->f3, - (unsigned char)iid->f4[1], (unsigned char)iid->f4[0], - (unsigned char)iid->f4[2],(unsigned char)iid->f4[3],(unsigned char)iid->f4[4], - (unsigned char)iid->f4[5],(unsigned char)iid->f4[6],(unsigned char)iid->f4[7]); + "%02x%02x%02x%02x%02x%02x\n", + iid->f1, iid->f2, iid->f3, + (unsigned char)iid->f4[1], (unsigned char)iid->f4[0], + (unsigned char)iid->f4[2], (unsigned char)iid->f4[3], + (unsigned char)iid->f4[4], (unsigned char)iid->f4[5], + (unsigned char)iid->f4[6], (unsigned char)iid->f4[7]); return 0x80004002; } + HRESULT STDCALL COutputPin::AddRef(IUnknown* This) { Debug printf("COutputPin::AddRef() called\n"); ((COutputPin*)This)->refcount++; return 0; } + HRESULT STDCALL COutputPin::Release(IUnknown* This) { Debug printf("COutputPin::Release() called\n"); @@ -278,7 +293,6 @@ HRESULT STDCALL COutputPin::QueryId ( return E_NOTIMPL; } - HRESULT STDCALL COutputPin::QueryAccept ( IPin * This, /* [in] */ const AM_MEDIA_TYPE *pmt) @@ -426,6 +440,8 @@ HRESULT STDCALL COutputPin::NotifyAllocator( /* [in] */ int bReadOnly) { Debug printf("COutputPin::NotifyAllocator() called\n"); + COutputPin* pPin=(COutputPin*)This; + pPin->pAllocator=(MemAllocator*)pAllocator; return 0; } @@ -450,7 +466,8 @@ HRESULT STDCALL COutputPin::Receive( int len=pSample->vt->GetActualDataLength(pSample); if(len==0)len=pSample->vt->GetSize(pSample);//for iv50 //if(me.frame_pointer)memcpy(me.frame_pointer, pointer, len); - *me.frame_pointer=pointer; + if(me.frame_pointer) + *me.frame_pointer=pointer; if(me.frame_size_pointer)*me.frame_size_pointer=len; /* FILE* file=fopen("./uncompr.bmp", "wb"); -- cgit v1.2.3