Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/mpegsplit.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/dlls/quartz/mpegsplit.c b/dlls/quartz/mpegsplit.c index 24e61feb106..b64385bf5d8 100644 --- a/dlls/quartz/mpegsplit.c +++ b/dlls/quartz/mpegsplit.c @@ -795,7 +795,7 @@ static const IBaseFilterVtbl MPEGSplitter_Vtbl = { MPEGSplitter_QueryInterface, Parser_AddRef, - Parser_Release, + BaseFilterImpl_Release, Parser_GetClassID, Parser_Stop, Parser_Pause, @@ -868,9 +868,16 @@ static const IAMStreamSelectVtbl AMStreamSelectVtbl = AMStreamSelect_Enable };
+static void mpeg_splitter_destroy(BaseFilter *iface) +{ + MPEGSplitterImpl *filter = impl_from_IBaseFilter(&iface->IBaseFilter_iface); + Parser_Destroy(&filter->Parser); +} + static const BaseFilterFuncTable mpeg_splitter_func_table = { .filter_get_pin = parser_get_pin, + .filter_destroy = mpeg_splitter_destroy, };
HRESULT MPEGSplitter_create(IUnknown * pUnkOuter, LPVOID * ppv)
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/parser.c | 13 ------------- dlls/quartz/parser.h | 1 - dlls/quartz/waveparser.c | 9 ++++++++- 3 files changed, 8 insertions(+), 15 deletions(-)
diff --git a/dlls/quartz/parser.c b/dlls/quartz/parser.c index 433502ced70..095ec5eb17b 100644 --- a/dlls/quartz/parser.c +++ b/dlls/quartz/parser.c @@ -191,19 +191,6 @@ void Parser_Destroy(ParserImpl *This) CoTaskMemFree(This); }
-ULONG WINAPI Parser_Release(IBaseFilter * iface) -{ - ParserImpl *This = impl_from_IBaseFilter(iface); - ULONG refCount = InterlockedDecrement(&This->filter.refCount); - - TRACE("(%p)->() Release from %d\n", This, refCount + 1); - - if (!refCount) - Parser_Destroy(This); - - return refCount; -} - /** IPersist methods **/
HRESULT WINAPI Parser_GetClassID(IBaseFilter * iface, CLSID * pClsid) diff --git a/dlls/quartz/parser.h b/dlls/quartz/parser.h index d221eec555f..4d51e3afd83 100644 --- a/dlls/quartz/parser.h +++ b/dlls/quartz/parser.h @@ -63,7 +63,6 @@ extern void Parser_Destroy(ParserImpl *This);
extern HRESULT WINAPI Parser_QueryInterface(IBaseFilter * iface, REFIID riid, LPVOID * ppv); extern ULONG WINAPI Parser_AddRef(IBaseFilter * iface); -extern ULONG WINAPI Parser_Release(IBaseFilter * iface); extern HRESULT WINAPI Parser_GetClassID(IBaseFilter * iface, CLSID * pClsid); extern HRESULT WINAPI Parser_Stop(IBaseFilter * iface); extern HRESULT WINAPI Parser_Pause(IBaseFilter * iface); diff --git a/dlls/quartz/waveparser.c b/dlls/quartz/waveparser.c index 6240b7817f3..1b18f69241e 100644 --- a/dlls/quartz/waveparser.c +++ b/dlls/quartz/waveparser.c @@ -398,7 +398,7 @@ static const IBaseFilterVtbl WAVEParser_Vtbl = { Parser_QueryInterface, Parser_AddRef, - Parser_Release, + BaseFilterImpl_Release, Parser_GetClassID, Parser_Stop, Parser_Pause, @@ -413,9 +413,16 @@ static const IBaseFilterVtbl WAVEParser_Vtbl = Parser_QueryVendorInfo };
+static void wave_parser_destroy(BaseFilter *iface) +{ + WAVEParserImpl *filter = impl_from_IBaseFilter(&iface->IBaseFilter_iface); + Parser_Destroy(&filter->Parser); +} + static const BaseFilterFuncTable wave_parser_func_table = { .filter_get_pin = parser_get_pin, + .filter_destroy = wave_parser_destroy, };
HRESULT WAVEParser_create(IUnknown * pUnkOuter, LPVOID * ppv)
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/avisplit.c | 16 ++++++++-------- dlls/quartz/mpegsplit.c | 14 +++++++------- dlls/quartz/parser.c | 40 ---------------------------------------- dlls/quartz/parser.h | 8 -------- dlls/quartz/waveparser.c | 16 ++++++++-------- 5 files changed, 23 insertions(+), 71 deletions(-)
diff --git a/dlls/quartz/avisplit.c b/dlls/quartz/avisplit.c index f77efa37c5a..d5b716c1142 100644 --- a/dlls/quartz/avisplit.c +++ b/dlls/quartz/avisplit.c @@ -1394,21 +1394,21 @@ static HRESULT WINAPI AVISplitter_seek(IMediaSeeking *iface)
static const IBaseFilterVtbl AVISplitterImpl_Vtbl = { - Parser_QueryInterface, - Parser_AddRef, + BaseFilterImpl_QueryInterface, + BaseFilterImpl_AddRef, BaseFilterImpl_Release, - Parser_GetClassID, + BaseFilterImpl_GetClassID, Parser_Stop, Parser_Pause, Parser_Run, Parser_GetState, Parser_SetSyncSource, - Parser_GetSyncSource, - Parser_EnumPins, + BaseFilterImpl_GetSyncSource, + BaseFilterImpl_EnumPins, BaseFilterImpl_FindPin, - Parser_QueryFilterInfo, - Parser_JoinFilterGraph, - Parser_QueryVendorInfo + BaseFilterImpl_QueryFilterInfo, + BaseFilterImpl_JoinFilterGraph, + BaseFilterImpl_QueryVendorInfo, };
static void avi_splitter_destroy(BaseFilter *iface) diff --git a/dlls/quartz/mpegsplit.c b/dlls/quartz/mpegsplit.c index b64385bf5d8..0afdcbdf3b0 100644 --- a/dlls/quartz/mpegsplit.c +++ b/dlls/quartz/mpegsplit.c @@ -794,20 +794,20 @@ static HRESULT WINAPI MPEGSplitter_QueryInterface(IBaseFilter *iface, REFIID rii static const IBaseFilterVtbl MPEGSplitter_Vtbl = { MPEGSplitter_QueryInterface, - Parser_AddRef, + BaseFilterImpl_AddRef, BaseFilterImpl_Release, - Parser_GetClassID, + BaseFilterImpl_GetClassID, Parser_Stop, Parser_Pause, Parser_Run, Parser_GetState, Parser_SetSyncSource, - Parser_GetSyncSource, - Parser_EnumPins, + BaseFilterImpl_GetSyncSource, + BaseFilterImpl_EnumPins, BaseFilterImpl_FindPin, - Parser_QueryFilterInfo, - Parser_JoinFilterGraph, - Parser_QueryVendorInfo + BaseFilterImpl_QueryFilterInfo, + BaseFilterImpl_JoinFilterGraph, + BaseFilterImpl_QueryVendorInfo, };
static HRESULT WINAPI AMStreamSelect_QueryInterface(IAMStreamSelect *iface, REFIID riid, void **ppv) diff --git a/dlls/quartz/parser.c b/dlls/quartz/parser.c index 095ec5eb17b..4a3bc2e7469 100644 --- a/dlls/quartz/parser.c +++ b/dlls/quartz/parser.c @@ -191,19 +191,6 @@ void Parser_Destroy(ParserImpl *This) CoTaskMemFree(This); }
-/** IPersist methods **/ - -HRESULT WINAPI Parser_GetClassID(IBaseFilter * iface, CLSID * pClsid) -{ - ParserImpl *This = impl_from_IBaseFilter(iface); - - TRACE("%p->(%p)\n", This, pClsid); - - *pClsid = This->filter.clsid; - - return S_OK; -} - /** IMediaFilter methods **/
HRESULT WINAPI Parser_Stop(IBaseFilter * iface) @@ -362,33 +349,6 @@ HRESULT WINAPI Parser_SetSyncSource(IBaseFilter * iface, IReferenceClock *pClock return S_OK; }
-HRESULT WINAPI Parser_GetSyncSource(IBaseFilter * iface, IReferenceClock **ppClock) -{ - return BaseFilterImpl_GetSyncSource(iface, ppClock); -} - -/** IBaseFilter implementation **/ - -HRESULT WINAPI Parser_EnumPins(IBaseFilter * iface, IEnumPins **ppEnum) -{ - return BaseFilterImpl_EnumPins(iface,ppEnum); -} - -HRESULT WINAPI Parser_QueryFilterInfo(IBaseFilter * iface, FILTER_INFO *pInfo) -{ - return BaseFilterImpl_QueryFilterInfo(iface, pInfo); -} - -HRESULT WINAPI Parser_JoinFilterGraph(IBaseFilter * iface, IFilterGraph *pGraph, LPCWSTR pName) -{ - return BaseFilterImpl_JoinFilterGraph(iface, pGraph, pName); -} - -HRESULT WINAPI Parser_QueryVendorInfo(IBaseFilter * iface, LPWSTR *pVendorInfo) -{ - return BaseFilterImpl_QueryVendorInfo(iface, pVendorInfo); -} - static const BaseOutputPinFuncTable output_BaseOutputFuncTable = { { Parser_OutputPin_CheckMediaType, diff --git a/dlls/quartz/parser.h b/dlls/quartz/parser.h index 4d51e3afd83..aeeb55a85f2 100644 --- a/dlls/quartz/parser.h +++ b/dlls/quartz/parser.h @@ -61,19 +61,11 @@ HRESULT Parser_Create(ParserImpl *parser, const IBaseFilterVtbl *vtbl, /* Override the _Release function and call this when releasing */ extern void Parser_Destroy(ParserImpl *This);
-extern HRESULT WINAPI Parser_QueryInterface(IBaseFilter * iface, REFIID riid, LPVOID * ppv); -extern ULONG WINAPI Parser_AddRef(IBaseFilter * iface); -extern HRESULT WINAPI Parser_GetClassID(IBaseFilter * iface, CLSID * pClsid); extern HRESULT WINAPI Parser_Stop(IBaseFilter * iface); extern HRESULT WINAPI Parser_Pause(IBaseFilter * iface); extern HRESULT WINAPI Parser_Run(IBaseFilter * iface, REFERENCE_TIME tStart); extern HRESULT WINAPI Parser_GetState(IBaseFilter * iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState); extern HRESULT WINAPI Parser_SetSyncSource(IBaseFilter * iface, IReferenceClock *pClock); -extern HRESULT WINAPI Parser_GetSyncSource(IBaseFilter * iface, IReferenceClock **ppClock); -extern HRESULT WINAPI Parser_EnumPins(IBaseFilter * iface, IEnumPins **ppEnum); -extern HRESULT WINAPI Parser_QueryFilterInfo(IBaseFilter * iface, FILTER_INFO *pInfo); -extern HRESULT WINAPI Parser_JoinFilterGraph(IBaseFilter * iface, IFilterGraph *pGraph, LPCWSTR pName); -extern HRESULT WINAPI Parser_QueryVendorInfo(IBaseFilter * iface, LPWSTR *pVendorInfo);
IPin *parser_get_pin(BaseFilter *iface, unsigned int index) DECLSPEC_HIDDEN;
diff --git a/dlls/quartz/waveparser.c b/dlls/quartz/waveparser.c index 1b18f69241e..7cc01afecb0 100644 --- a/dlls/quartz/waveparser.c +++ b/dlls/quartz/waveparser.c @@ -396,21 +396,21 @@ static HRESULT WAVEParser_disconnect(LPVOID iface)
static const IBaseFilterVtbl WAVEParser_Vtbl = { - Parser_QueryInterface, - Parser_AddRef, + BaseFilterImpl_QueryInterface, + BaseFilterImpl_AddRef, BaseFilterImpl_Release, - Parser_GetClassID, + BaseFilterImpl_GetClassID, Parser_Stop, Parser_Pause, Parser_Run, Parser_GetState, Parser_SetSyncSource, - Parser_GetSyncSource, - Parser_EnumPins, + BaseFilterImpl_GetSyncSource, + BaseFilterImpl_EnumPins, BaseFilterImpl_FindPin, - Parser_QueryFilterInfo, - Parser_JoinFilterGraph, - Parser_QueryVendorInfo + BaseFilterImpl_QueryFilterInfo, + BaseFilterImpl_JoinFilterGraph, + BaseFilterImpl_QueryVendorInfo, };
static void wave_parser_destroy(BaseFilter *iface)
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qcap/avimux.c | 51 +++++++++++++++++++++------------------------- 1 file changed, 23 insertions(+), 28 deletions(-)
diff --git a/dlls/qcap/avimux.c b/dlls/qcap/avimux.c index 77e5898aeee..3ca55ca99bb 100644 --- a/dlls/qcap/avimux.c +++ b/dlls/qcap/avimux.c @@ -134,8 +134,30 @@ static IPin *avi_mux_get_pin(BaseFilter *iface, unsigned int index) return NULL; }
+static void avi_mux_destroy(BaseFilter *iface) +{ + AviMux *filter = impl_from_BaseFilter(iface); + int i; + + BaseOutputPinImpl_Release(&filter->out->pin.pin.IPin_iface); + + for (i = 0; i < filter->input_pin_no; ++i) + { + IPin_Disconnect(&filter->in[i]->pin.pin.IPin_iface); + IMemAllocator_Release(filter->in[i]->samples_allocator); + filter->in[i]->samples_allocator = NULL; + BaseInputPinImpl_Release(&filter->in[i]->pin.pin.IPin_iface); + } + + heap_free(filter->idx1); + strmbase_filter_cleanup(&filter->filter); + heap_free(filter); + ObjectRefCount(FALSE); +} + static const BaseFilterFuncTable filter_func_table = { .filter_get_pin = avi_mux_get_pin, + .filter_destroy = avi_mux_destroy, };
static inline AviMux* impl_from_IBaseFilter(IBaseFilter *iface) @@ -173,33 +195,6 @@ static HRESULT WINAPI AviMux_QueryInterface(IBaseFilter *iface, REFIID riid, voi return S_OK; }
-static ULONG WINAPI AviMux_Release(IBaseFilter *iface) -{ - AviMux *This = impl_from_IBaseFilter(iface); - ULONG ref = InterlockedDecrement(&This->filter.refCount); - - TRACE("(%p) new refcount: %u\n", This, ref); - - if(!ref) { - int i; - - BaseOutputPinImpl_Release(&This->out->pin.pin.IPin_iface); - - for(i=0; i<This->input_pin_no; i++) { - IPin_Disconnect(&This->in[i]->pin.pin.IPin_iface); - IMemAllocator_Release(This->in[i]->samples_allocator); - This->in[i]->samples_allocator = NULL; - BaseInputPinImpl_Release(&This->in[i]->pin.pin.IPin_iface); - } - - HeapFree(GetProcessHeap(), 0, This->idx1); - strmbase_filter_cleanup(&This->filter); - HeapFree(GetProcessHeap(), 0, This); - ObjectRefCount(FALSE); - } - return ref; -} - static HRESULT out_flush(AviMux *This) { ULONG written; @@ -766,7 +761,7 @@ static HRESULT WINAPI AviMux_QueryVendorInfo(IBaseFilter *iface, LPWSTR *pVendor static const IBaseFilterVtbl AviMuxVtbl = { AviMux_QueryInterface, BaseFilterImpl_AddRef, - AviMux_Release, + BaseFilterImpl_Release, BaseFilterImpl_GetClassID, AviMux_Stop, AviMux_Pause,
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qcap/avimux.c | 57 ++++------------------------------------------ 1 file changed, 4 insertions(+), 53 deletions(-)
diff --git a/dlls/qcap/avimux.c b/dlls/qcap/avimux.c index 3ca55ca99bb..bf10fe3a355 100644 --- a/dlls/qcap/avimux.c +++ b/dlls/qcap/avimux.c @@ -709,55 +709,6 @@ static HRESULT WINAPI AviMux_Run(IBaseFilter *iface, REFERENCE_TIME tStart) return S_OK; }
-static HRESULT WINAPI AviMux_EnumPins(IBaseFilter *iface, IEnumPins **ppEnum) -{ - AviMux *This = impl_from_IBaseFilter(iface); - TRACE("(%p)->(%p)\n", This, ppEnum); - return BaseFilterImpl_EnumPins(iface, ppEnum); -} - -static HRESULT WINAPI AviMux_FindPin(IBaseFilter *iface, LPCWSTR Id, IPin **ppPin) -{ - AviMux *This = impl_from_IBaseFilter(iface); - int i; - - TRACE("(%p)->(%s %p)\n", This, debugstr_w(Id), ppPin); - - if(!Id || !ppPin) - return E_POINTER; - - if(!lstrcmpiW(Id, This->out->pin.pin.pinInfo.achName)) { - IPin_AddRef(&This->out->pin.pin.IPin_iface); - *ppPin = &This->out->pin.pin.IPin_iface; - return S_OK; - } - - for(i=0; i<This->input_pin_no; i++) { - if(lstrcmpiW(Id, This->in[i]->pin.pin.pinInfo.achName)) - continue; - - IPin_AddRef(&This->in[i]->pin.pin.IPin_iface); - *ppPin = &This->in[i]->pin.pin.IPin_iface; - return S_OK; - } - - return VFW_E_NOT_FOUND; -} - -static HRESULT WINAPI AviMux_QueryFilterInfo(IBaseFilter *iface, FILTER_INFO *pInfo) -{ - AviMux *This = impl_from_IBaseFilter(iface); - FIXME("(%p)->(%p)\n", This, pInfo); - return E_NOTIMPL; -} - -static HRESULT WINAPI AviMux_QueryVendorInfo(IBaseFilter *iface, LPWSTR *pVendorInfo) -{ - AviMux *This = impl_from_IBaseFilter(iface); - FIXME("(%p)->(%p)\n", This, pVendorInfo); - return E_NOTIMPL; -} - static const IBaseFilterVtbl AviMuxVtbl = { AviMux_QueryInterface, BaseFilterImpl_AddRef, @@ -769,11 +720,11 @@ static const IBaseFilterVtbl AviMuxVtbl = { BaseFilterImpl_GetState, BaseFilterImpl_SetSyncSource, BaseFilterImpl_GetSyncSource, - AviMux_EnumPins, - AviMux_FindPin, - AviMux_QueryFilterInfo, + BaseFilterImpl_EnumPins, + BaseFilterImpl_FindPin, + BaseFilterImpl_QueryFilterInfo, BaseFilterImpl_JoinFilterGraph, - AviMux_QueryVendorInfo + BaseFilterImpl_QueryVendorInfo };
static inline AviMux* impl_from_IConfigAviMux(IConfigAviMux *iface)