changeset 3130:623cdb771e97

avifile sync. seems to some bugs fixed...
author arpi
date Mon, 26 Nov 2001 00:56:11 +0000
parents 6d965759dd01
children 1356a5a69073
files loader/dshow/DS_Filter.c loader/dshow/allocator.h loader/dshow/cmediasample.h loader/dshow/inputpin.c loader/dshow/inputpin.h loader/dshow/outputpin.c loader/dshow/outputpin.h
diffstat 7 files changed, 38 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/loader/dshow/DS_Filter.c	Mon Nov 26 00:49:39 2001 +0000
+++ b/loader/dshow/DS_Filter.c	Mon Nov 26 00:56:11 2001 +0000
@@ -76,7 +76,7 @@
     if (This->m_pOurOutput)
 	This->m_pOurOutput->vt->Release((IUnknown*)This->m_pOurOutput);
     if (This->m_pParentFilter)
-	This->m_pSrcFilter->vt->Release((IUnknown*)This->m_pParentFilter);
+	This->m_pParentFilter->vt->Release((IUnknown*)This->m_pParentFilter);
     if (This->m_pSrcFilter)
 	This->m_pSrcFilter->vt->Release((IUnknown*)This->m_pSrcFilter);
 
--- a/loader/dshow/allocator.h	Mon Nov 26 00:49:39 2001 +0000
+++ b/loader/dshow/allocator.h	Mon Nov 26 00:56:11 2001 +0000
@@ -15,13 +15,13 @@
 struct _MemAllocator
 {
     IMemAllocator_vt* vt;
+    DECLARE_IUNKNOWN();
     ALLOCATOR_PROPERTIES props;
     avm_list_t* used_list;
     avm_list_t* free_list;
     char* new_pointer;
     CMediaSample* modified_sample;
     GUID interfaces[2];
-    DECLARE_IUNKNOWN();
 
     void ( *SetPointer )(MemAllocator* This, char* pointer);
     void ( *ResetPointer )(MemAllocator* This);
--- a/loader/dshow/cmediasample.h	Mon Nov 26 00:49:39 2001 +0000
+++ b/loader/dshow/cmediasample.h	Mon Nov 26 00:56:11 2001 +0000
@@ -8,12 +8,12 @@
 struct _CMediaSample
 {
     IMediaSample_vt* vt;
+    DECLARE_IUNKNOWN();
     IMemAllocator* all;
     int size;
     int actual_size;
     char* block;
     char* own_block;
-    int refcount;
     int isPreroll;
     int isSyncPoint;
     AM_MEDIA_TYPE media_type;
--- a/loader/dshow/inputpin.c	Mon Nov 26 00:49:39 2001 +0000
+++ b/loader/dshow/inputpin.c	Mon Nov 26 00:56:11 2001 +0000
@@ -26,8 +26,8 @@
 
 static long STDCALL CEnumPins_Next(IEnumPins* This,
 				   /* [in] */ unsigned long cMediaTypes,
-				   /* [size_is][out] */ IPin **ppMediaTypes,
-				   /* [out] */ unsigned long *pcFetched)
+				   /* [size_is][out] */ IPin** ppMediaTypes,
+				   /* [out] */ unsigned long* pcFetched)
 {
     CEnumPins* pin = (CEnumPins*)This;
 
@@ -127,9 +127,9 @@
  * InputPin
  ***********/
 
-static long STDCALL CInputPin_Connect(IPin * This,
-				      /* [in] */ IPin *pReceivePin,
-				      /* [in] */ AM_MEDIA_TYPE *pmt)
+static long STDCALL CInputPin_Connect(IPin* This,
+				      /* [in] */ IPin* pReceivePin,
+				      /* [in] */ AM_MEDIA_TYPE* pmt)
 {
     Debug unimplemented("CInputPin_Connect", This);
     return E_NOTIMPL;
@@ -199,21 +199,21 @@
 }
 
 static long STDCALL CInputPin_QueryAccept(IPin* This,
-					  /* [in] */ const AM_MEDIA_TYPE *pmt)
+					  /* [in] */ const AM_MEDIA_TYPE* pmt)
 {
     Debug unimplemented("CInputPin_QueryAccept", This);
     return E_NOTIMPL;
 }
 
 static long STDCALL CInputPin_EnumMediaTypes(IPin* This,
-					     /* [out] */ IEnumMediaTypes **ppEnum)
+					     /* [out] */ IEnumMediaTypes** ppEnum)
 {
     Debug unimplemented("CInputPin_EnumMediaTypes", This);
     return E_NOTIMPL;
 }
 
 static long STDCALL CInputPin_QueryInternalConnections(IPin* This,
-						       /* [out] */ IPin **apPin,
+						       /* [out] */ IPin** apPin,
 						       /* [out][in] */ unsigned long *nPin)
 {
     Debug unimplemented("CInputPin_QueryInternalConnections", This);
@@ -234,13 +234,13 @@
 }
 
 
-static long STDCALL CInputPin_EndFlush(IPin * This)
+static long STDCALL CInputPin_EndFlush(IPin* This)
 {
     Debug unimplemented("CInputPin_EndFlush", This);
     return E_NOTIMPL;
 }
 
-static long STDCALL CInputPin_NewSegment(IPin * This,
+static long STDCALL CInputPin_NewSegment(IPin* This,
 					  /* [in] */ REFERENCE_TIME tStart,
 					  /* [in] */ REFERENCE_TIME tStop,
 					  /* [in] */ double dRate)
@@ -360,7 +360,7 @@
     return E_NOTIMPL;
 }
 
-static long STDCALL CBaseFilter_QueryFilterInfo(IBaseFilter * This,
+static long STDCALL CBaseFilter_QueryFilterInfo(IBaseFilter* This,
 						// /* [out] */ FILTER_INFO *pInfo)
 						void* pInfo)
 {
@@ -368,16 +368,16 @@
     return E_NOTIMPL;
 }
 
-static long STDCALL CBaseFilter_JoinFilterGraph(IBaseFilter * This,
-						/* [in] */ IFilterGraph *pGraph,
+static long STDCALL CBaseFilter_JoinFilterGraph(IBaseFilter* This,
+						/* [in] */ IFilterGraph* pGraph,
 						/* [string][in] */ const unsigned short* pName)
 {
     Debug unimplemented("CBaseFilter_JoinFilterGraph", This);
     return E_NOTIMPL;
 }
 
-static long STDCALL CBaseFilter_QueryVendorInfo(IBaseFilter * This,
-						/* [string][out] */ unsigned short* *pVendorInfo)
+static long STDCALL CBaseFilter_QueryVendorInfo(IBaseFilter* This,
+						/* [string][out] */ unsigned short** pVendorInfo)
 {
     Debug unimplemented("CBaseFilter_QueryVendorInfo", This);
     return E_NOTIMPL;
@@ -443,26 +443,26 @@
  **************/
 
 
-static long STDCALL CBaseFilter2_GetClassID(IBaseFilter * This,
-					     /* [out] */ CLSID *pClassID)
+static long STDCALL CBaseFilter2_GetClassID(IBaseFilter* This,
+					     /* [out] */ CLSID* pClassID)
 {
     Debug unimplemented("CBaseFilter2_GetClassID", This);
     return E_NOTIMPL;
 }
 
-static long STDCALL CBaseFilter2_Stop(IBaseFilter * This)
+static long STDCALL CBaseFilter2_Stop(IBaseFilter* This)
 {
     Debug unimplemented("CBaseFilter2_Stop", This);
     return E_NOTIMPL;
 }
 
-static long STDCALL CBaseFilter2_Pause(IBaseFilter * This)
+static long STDCALL CBaseFilter2_Pause(IBaseFilter* This)
 {
     Debug unimplemented("CBaseFilter2_Pause", This);
     return E_NOTIMPL;
 }
 
-static long STDCALL CBaseFilter2_Run(IBaseFilter * This, REFERENCE_TIME tStart)
+static long STDCALL CBaseFilter2_Run(IBaseFilter* This, REFERENCE_TIME tStart)
 {
     Debug unimplemented("CBaseFilter2_Run", This);
     return E_NOTIMPL;
@@ -540,6 +540,7 @@
 
 static void CBaseFilter2_Destroy(CBaseFilter2* This)
 {
+    Debug printf("CBaseFilter2_Destroy(%p) called\n", This);
     This->pin->vt->Release((IUnknown*) This->pin);
     free(This->vt);
     free(This);
@@ -607,7 +608,7 @@
 }
 
 static long STDCALL CRemotePin_QueryDirection(IPin* This,
-					      /* [out] */ PIN_DIRECTION *pPinDir)
+					      /* [out] */ PIN_DIRECTION* pPinDir)
 {
     Debug printf("CRemotePin_QueryDirection(%p) called\n", This);
     if (!pPinDir)
@@ -668,12 +669,12 @@
 
 
 /*************
- * CRemotePin
+ * CRemotePin2
  *************/
 
 
-static long STDCALL CRemotePin2_QueryPinInfo(IPin * This,
-				       /* [out] */ PIN_INFO *pInfo)
+static long STDCALL CRemotePin2_QueryPinInfo(IPin* This,
+					     /* [out] */ PIN_INFO* pInfo)
 {
     CBaseFilter2* lparent=((CRemotePin2*)This)->parent;
     Debug printf("CRemotePin2_QueryPinInfo(%p) called\n", This);
@@ -684,6 +685,7 @@
     return 0;
 }
 
+// FIXME - not being released!
 static void CRemotePin2_Destroy(CRemotePin2* This)
 {
     Debug printf("CRemotePin2_Destroy(%p) called\n", This);
--- a/loader/dshow/inputpin.h	Mon Nov 26 00:49:39 2001 +0000
+++ b/loader/dshow/inputpin.h	Mon Nov 26 00:56:11 2001 +0000
@@ -7,9 +7,9 @@
 struct _CBaseFilter2
 {
     IBaseFilter_vt* vt;
+    DECLARE_IUNKNOWN();
     IPin* pin;
     GUID interfaces[5];
-    DECLARE_IUNKNOWN();
 
     IPin* ( *GetPin )(CBaseFilter2* This);
 };
@@ -21,10 +21,10 @@
 struct _CBaseFilter
 {
     IBaseFilter_vt* vt;
+    DECLARE_IUNKNOWN();  // has to match CBaseFilter2 - INHERITANCE!!
     IPin* pin;
     IPin* unused_pin;
     GUID interfaces[2];
-    DECLARE_IUNKNOWN();
 
     IPin* ( *GetPin )(CBaseFilter* This);
     IPin* ( *GetUnusedPin )(CBaseFilter* This);
@@ -37,10 +37,10 @@
 struct _CInputPin
 {
     IPin_vt* vt;
+    DECLARE_IUNKNOWN();
     AM_MEDIA_TYPE type;
     CBaseFilter* parent;
     GUID interfaces[1];
-    DECLARE_IUNKNOWN();
 };
 
 CInputPin* CInputPinCreate(CBaseFilter* parent, const AM_MEDIA_TYPE* vhdr);
@@ -49,10 +49,10 @@
 typedef struct CRemotePin
 {
     IPin_vt* vt;
+    DECLARE_IUNKNOWN();
     CBaseFilter* parent;
+    GUID interfaces[1];
     IPin* remote_pin;
-    GUID interfaces[1];
-    DECLARE_IUNKNOWN();
 } CRemotePin;
 
 CRemotePin* CRemotePinCreate(CBaseFilter* pt, IPin* rpin);
@@ -61,9 +61,9 @@
 typedef struct CRemotePin2
 {
     IPin_vt* vt;
+    DECLARE_IUNKNOWN();
     CBaseFilter2* parent;
     GUID interfaces[1];
-    DECLARE_IUNKNOWN();
 } CRemotePin2;
 
 CRemotePin2* CRemotePin2Create(CBaseFilter2* parent);
--- a/loader/dshow/outputpin.c	Mon Nov 26 00:49:39 2001 +0000
+++ b/loader/dshow/outputpin.c	Mon Nov 26 00:56:11 2001 +0000
@@ -497,6 +497,7 @@
     This->mempin->frame_size_pointer = 0;
     This->mempin->frame_pointer = 0;
     This->mempin->pAllocator = 0;
+    This->mempin->refcount = 1;
     This->mempin->parent = This;
 
     This->SetPointer2 = COutputPin_SetPointer2;
--- a/loader/dshow/outputpin.h	Mon Nov 26 00:49:39 2001 +0000
+++ b/loader/dshow/outputpin.h	Mon Nov 26 00:56:11 2001 +0000
@@ -11,6 +11,7 @@
 struct _COutputMemPin
 {
     IMemInputPin_vt* vt;
+    DECLARE_IUNKNOWN();
     char** frame_pointer;
     long* frame_size_pointer;
     MemAllocator* pAllocator;
@@ -20,8 +21,8 @@
 struct _COutputPin
 {
     IPin_vt* vt;
+    DECLARE_IUNKNOWN();
     COutputMemPin* mempin;
-    int refcount;
     AM_MEDIA_TYPE type;
     IPin* remote;
     void ( *SetFramePointer )(COutputPin*, char** z);