diff --git a/loader/dshow/DS_Filter.c b/loader/dshow/DS_Filter.c index 99124074be..4bef2ffd74 100644 --- a/loader/dshow/DS_Filter.c +++ b/loader/dshow/DS_Filter.c @@ -76,7 +76,7 @@ void DS_Filter_Destroy(DS_Filter* This) 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); diff --git a/loader/dshow/allocator.h b/loader/dshow/allocator.h index f853001d37..8556370635 100644 --- a/loader/dshow/allocator.h +++ b/loader/dshow/allocator.h @@ -15,13 +15,13 @@ typedef struct _MemAllocator MemAllocator; 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); diff --git a/loader/dshow/cmediasample.h b/loader/dshow/cmediasample.h index 569b230907..0b6b5b7881 100644 --- a/loader/dshow/cmediasample.h +++ b/loader/dshow/cmediasample.h @@ -8,12 +8,12 @@ typedef struct _CMediaSample CMediaSample; 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; diff --git a/loader/dshow/inputpin.c b/loader/dshow/inputpin.c index 47d7a0f916..2a4718e33f 100644 --- a/loader/dshow/inputpin.c +++ b/loader/dshow/inputpin.c @@ -26,8 +26,8 @@ typedef struct 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 @@ static CEnumPins* CEnumPinsCreate(IPin* p, IPin* pp) * 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_QueryId(IPin* This, } 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_BeginFlush(IPin * This) } -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 @@ static long STDCALL CBaseFilter_FindPin(IBaseFilter* This, 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 @@ static long STDCALL CBaseFilter_QueryFilterInfo(IBaseFilter * This, 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 @@ CBaseFilter* CBaseFilterCreate(const AM_MEDIA_TYPE* type, CBaseFilter2* parent) **************/ -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 IPin* CBaseFilter2_GetPin(CBaseFilter2* This) 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_ConnectedTo(IPin* This, /* [out] */ IPin** pPin) } 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* CRemotePinCreate(CBaseFilter* pt, IPin* rpin) /************* - * 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 @@ static long STDCALL CRemotePin2_QueryPinInfo(IPin * This, return 0; } +// FIXME - not being released! static void CRemotePin2_Destroy(CRemotePin2* This) { Debug printf("CRemotePin2_Destroy(%p) called\n", This); diff --git a/loader/dshow/inputpin.h b/loader/dshow/inputpin.h index 031823d7eb..7c96624f51 100644 --- a/loader/dshow/inputpin.h +++ b/loader/dshow/inputpin.h @@ -7,9 +7,9 @@ typedef struct _CBaseFilter2 CBaseFilter2; struct _CBaseFilter2 { IBaseFilter_vt* vt; + DECLARE_IUNKNOWN(); IPin* pin; GUID interfaces[5]; - DECLARE_IUNKNOWN(); IPin* ( *GetPin )(CBaseFilter2* This); }; @@ -21,10 +21,10 @@ typedef struct _CBaseFilter CBaseFilter; 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 @@ typedef struct _CInputPin CInputPin; 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 @@ CInputPin* CInputPinCreate(CBaseFilter* parent, const AM_MEDIA_TYPE* vhdr); typedef struct CRemotePin { IPin_vt* vt; - CBaseFilter* parent; - IPin* remote_pin; - GUID interfaces[1]; DECLARE_IUNKNOWN(); + CBaseFilter* parent; + GUID interfaces[1]; + IPin* remote_pin; } CRemotePin; CRemotePin* CRemotePinCreate(CBaseFilter* pt, IPin* rpin); @@ -61,9 +61,9 @@ CRemotePin* CRemotePinCreate(CBaseFilter* pt, IPin* rpin); typedef struct CRemotePin2 { IPin_vt* vt; + DECLARE_IUNKNOWN(); CBaseFilter2* parent; GUID interfaces[1]; - DECLARE_IUNKNOWN(); } CRemotePin2; CRemotePin2* CRemotePin2Create(CBaseFilter2* parent); diff --git a/loader/dshow/outputpin.c b/loader/dshow/outputpin.c index 2d2ed6d5f2..9d000a2a74 100644 --- a/loader/dshow/outputpin.c +++ b/loader/dshow/outputpin.c @@ -497,6 +497,7 @@ COutputPin* COutputPinCreate(const AM_MEDIA_TYPE* amt) 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; diff --git a/loader/dshow/outputpin.h b/loader/dshow/outputpin.h index 47ef9f43ef..016b36787f 100644 --- a/loader/dshow/outputpin.h +++ b/loader/dshow/outputpin.h @@ -11,6 +11,7 @@ typedef struct _COutputMemPin COutputMemPin; struct _COutputMemPin { IMemInputPin_vt* vt; + DECLARE_IUNKNOWN(); char** frame_pointer; long* frame_size_pointer; MemAllocator* pAllocator; @@ -20,8 +21,8 @@ struct _COutputMemPin struct _COutputPin { IPin_vt* vt; + DECLARE_IUNKNOWN(); COutputMemPin* mempin; - int refcount; AM_MEDIA_TYPE type; IPin* remote; void ( *SetFramePointer )(COutputPin*, char** z);