summaryrefslogtreecommitdiffstats
path: root/loader/dshow/outputpin.c
diff options
context:
space:
mode:
authorarpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-05-06 21:43:45 +0000
committerarpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-05-06 21:43:45 +0000
commitc8b40d3bd00cab519ea4e55116332efd12f9b381 (patch)
tree51c56b549f24c395c830c196fc099e0240c4fc21 /loader/dshow/outputpin.c
parent0742d52b569e69d3df278afb388abd76e384b7c8 (diff)
downloadmpv-c8b40d3bd00cab519ea4e55116332efd12f9b381.tar.bz2
mpv-c8b40d3bd00cab519ea4e55116332efd12f9b381.tar.xz
avifile-0.6-CVS merge
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@714 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'loader/dshow/outputpin.c')
-rw-r--r--loader/dshow/outputpin.c37
1 files changed, 27 insertions, 10 deletions
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 <cstdio>
+#include <string>
+
#include "outputpin.h"
-#include <string.h>
-#include <stdio.h>
#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");