From 289bdc4f4538ce9608344ae894a0f099db971846 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 6 Jan 2014 17:54:13 +0100 Subject: [PATCH] strmbase: Store BasePinFuncTable inside Base*PinFuncTable structs. --- dlls/amstream/mediastreamfilter.c | 15 +++++++-------- dlls/qcap/avico.c | 32 ++++++++++++++----------------- dlls/qcap/avimux.c | 32 ++++++++++++++----------------- dlls/qcap/vfwcapture.c | 15 +++++++-------- dlls/quartz/filesource.c | 15 +++++++-------- dlls/quartz/parser.c | 15 +++++++-------- dlls/strmbase/pin.c | 24 +++++++++++------------ dlls/strmbase/renderer.c | 17 ++++++++-------- dlls/strmbase/transform.c | 30 ++++++++++++++--------------- dlls/winegstreamer/gstdemux.c | 15 +++++++-------- dlls/wineqtdecoder/qtsplitter.c | 15 +++++++-------- include/wine/strmbase.h | 7 +++++-- 12 files changed, 109 insertions(+), 123 deletions(-) diff --git a/dlls/amstream/mediastreamfilter.c b/dlls/amstream/mediastreamfilter.c index defabd9f895..88114558a16 100644 --- a/dlls/amstream/mediastreamfilter.c +++ b/dlls/amstream/mediastreamfilter.c @@ -191,14 +191,13 @@ static HRESULT WINAPI BasePinImp_GetMediaType(BasePin *This, int index, AM_MEDIA return S_OK; } -static const BasePinFuncTable input_BaseFuncTable = { - BasePinImpl_CheckMediaType, - NULL, - BasePinImp_GetMediaTypeVersion, - BasePinImp_GetMediaType -}; - static const BaseInputPinFuncTable input_BaseInputFuncTable = { + { + BasePinImpl_CheckMediaType, + NULL, + BasePinImp_GetMediaTypeVersion, + BasePinImp_GetMediaType + }, NULL }; @@ -367,7 +366,7 @@ static HRESULT WINAPI MediaStreamFilterImpl_AddMediaStream(IMediaStreamFilter* i /* Pin name is "I{guid MSPID_PrimaryVideo or MSPID_PrimaryAudio}" */ info.achName[0] = 'I'; StringFromGUID2(&purpose_id, info.achName + 1, 40); - hr = BaseInputPin_Construct(&MediaStreamFilter_InputPin_Vtbl, sizeof(BaseInputPin), &info, &input_BaseFuncTable, + hr = BaseInputPin_Construct(&MediaStreamFilter_InputPin_Vtbl, sizeof(BaseInputPin), &info, &input_BaseInputFuncTable, &This->filter.csFilter, NULL, &This->pins[This->nb_streams]); if (FAILED(hr)) return hr; diff --git a/dlls/qcap/avico.c b/dlls/qcap/avico.c index 2e44282897d..aedcf2728d2 100644 --- a/dlls/qcap/avico.c +++ b/dlls/qcap/avico.c @@ -479,13 +479,6 @@ static HRESULT WINAPI AVICompressorIn_GetMediaType(BasePin *base, int iPosition, return S_FALSE; } -static const BasePinFuncTable AVICompressorInputBasePinVtbl = { - AVICompressorIn_CheckMediaType, - NULL, - AVICompressorIn_GetMediaTypeVersion, - AVICompressorIn_GetMediaType -}; - static HRESULT WINAPI AVICompressorIn_Receive(BaseInputPin *base, IMediaSample *pSample) { AVICompressor *This = impl_from_BasePin(&base->pin); @@ -573,6 +566,12 @@ static HRESULT WINAPI AVICompressorIn_Receive(BaseInputPin *base, IMediaSample * } static const BaseInputPinFuncTable AVICompressorBaseInputPinVtbl = { + { + AVICompressorIn_CheckMediaType, + NULL, + AVICompressorIn_GetMediaTypeVersion, + AVICompressorIn_GetMediaType + }, AVICompressorIn_Receive }; @@ -641,13 +640,6 @@ static HRESULT WINAPI AVICompressorOut_GetMediaType(BasePin *base, int iPosition return S_OK; } -static const BasePinFuncTable AVICompressorOutputBasePinVtbl = { - NULL, - BaseOutputPinImpl_AttemptConnection, - AVICompressorOut_GetMediaTypeVersion, - AVICompressorOut_GetMediaType -}; - static HRESULT WINAPI AVICompressorOut_DecideBufferSize(BaseOutputPin *base, IMemAllocator *alloc, ALLOCATOR_PROPERTIES *ppropInputRequest) { AVICompressor *This = impl_from_BasePin(&base->pin); @@ -679,6 +671,12 @@ static HRESULT WINAPI AVICompressorOut_BreakConnect(BaseOutputPin *base) } static const BaseOutputPinFuncTable AVICompressorBaseOutputPinVtbl = { + { + NULL, + BaseOutputPinImpl_AttemptConnection, + AVICompressorOut_GetMediaTypeVersion, + AVICompressorOut_GetMediaType + }, AVICompressorOut_DecideBufferSize, AVICompressorOut_DecideAllocator, AVICompressorOut_BreakConnect @@ -706,8 +704,7 @@ IUnknown* WINAPI QCAP_createAVICompressor(IUnknown *outer, HRESULT *phr) in_pin_info.pFilter = &compressor->filter.IBaseFilter_iface; hres = BaseInputPin_Construct(&AVICompressorInputPinVtbl, sizeof(BaseInputPin), &in_pin_info, - &AVICompressorInputBasePinVtbl, &AVICompressorBaseInputPinVtbl, - &compressor->filter.csFilter, NULL, (IPin**)&compressor->in); + &AVICompressorBaseInputPinVtbl, &compressor->filter.csFilter, NULL, (IPin**)&compressor->in); if(FAILED(hres)) { IBaseFilter_Release(&compressor->filter.IBaseFilter_iface); *phr = hres; @@ -716,8 +713,7 @@ IUnknown* WINAPI QCAP_createAVICompressor(IUnknown *outer, HRESULT *phr) out_pin_info.pFilter = &compressor->filter.IBaseFilter_iface; hres = BaseOutputPin_Construct(&AVICompressorOutputPinVtbl, sizeof(BaseOutputPin), &out_pin_info, - &AVICompressorOutputBasePinVtbl, &AVICompressorBaseOutputPinVtbl, - &compressor->filter.csFilter, (IPin**)&compressor->out); + &AVICompressorBaseOutputPinVtbl, &compressor->filter.csFilter, (IPin**)&compressor->out); if(FAILED(hres)) { IBaseFilter_Release(&compressor->filter.IBaseFilter_iface); *phr = hres; diff --git a/dlls/qcap/avimux.c b/dlls/qcap/avimux.c index cfd0fd6ab6d..c5a16f8a115 100644 --- a/dlls/qcap/avimux.c +++ b/dlls/qcap/avimux.c @@ -696,13 +696,6 @@ static HRESULT WINAPI AviMuxOut_GetMediaType(BasePin *base, int iPosition, AM_ME return S_OK; } -static const BasePinFuncTable AviMuxOut_BaseFuncTable = { - NULL, - AviMuxOut_AttemptConnection, - AviMuxOut_GetMediaTypeVersion, - AviMuxOut_GetMediaType -}; - static HRESULT WINAPI AviMuxOut_DecideAllocator(BaseOutputPin *base, IMemInputPin *pPin, IMemAllocator **pAlloc) { @@ -736,6 +729,12 @@ static HRESULT WINAPI AviMuxOut_BreakConnect(BaseOutputPin *base) } static const BaseOutputPinFuncTable AviMuxOut_BaseOutputFuncTable = { + { + NULL, + AviMuxOut_AttemptConnection, + AviMuxOut_GetMediaTypeVersion, + AviMuxOut_GetMediaType + }, NULL, AviMuxOut_DecideAllocator, AviMuxOut_BreakConnect @@ -1019,13 +1018,6 @@ static HRESULT WINAPI AviMuxIn_GetMediaType(BasePin *base, int iPosition, AM_MED return S_FALSE; } -static const BasePinFuncTable AviMuxIn_BaseFuncTable = { - AviMuxIn_CheckMediaType, - NULL, - AviMuxIn_GetMediaTypeVersion, - AviMuxIn_GetMediaType -}; - static HRESULT WINAPI AviMuxIn_Receive(BaseInputPin *base, IMediaSample *pSample) { FIXME("(%p:%s)->(%p)\n", base, debugstr_w(base->pin.pinInfo.achName), pSample); @@ -1033,6 +1025,12 @@ static HRESULT WINAPI AviMuxIn_Receive(BaseInputPin *base, IMediaSample *pSample } static const BaseInputPinFuncTable AviMuxIn_BaseInputFuncTable = { + { + AviMuxIn_CheckMediaType, + NULL, + AviMuxIn_GetMediaTypeVersion, + AviMuxIn_GetMediaType + }, AviMuxIn_Receive }; @@ -1532,8 +1530,7 @@ static HRESULT create_input_pin(AviMux *avimux) info.achName[6] = '0' + (avimux->input_pin_no+1) / 10; hr = BaseInputPin_Construct(&AviMuxIn_PinVtbl, sizeof(AviMuxIn), &info, - &AviMuxIn_BaseFuncTable, &AviMuxIn_BaseInputFuncTable, - &avimux->filter.csFilter, NULL, (IPin**)&avimux->in[avimux->input_pin_no]); + &AviMuxIn_BaseInputFuncTable, &avimux->filter.csFilter, NULL, (IPin**)&avimux->in[avimux->input_pin_no]); if(FAILED(hr)) return hr; avimux->in[avimux->input_pin_no]->IAMStreamControl_iface.lpVtbl = &AviMuxIn_AMStreamControlVtbl; @@ -1579,8 +1576,7 @@ IUnknown* WINAPI QCAP_createAVIMux(IUnknown *pUnkOuter, HRESULT *phr) info.pFilter = &avimux->filter.IBaseFilter_iface; lstrcpyW(info.achName, output_name); hr = BaseOutputPin_Construct(&AviMuxOut_PinVtbl, sizeof(AviMuxOut), &info, - &AviMuxOut_BaseFuncTable, &AviMuxOut_BaseOutputFuncTable, - &avimux->filter.csFilter, (IPin**)&avimux->out); + &AviMuxOut_BaseOutputFuncTable, &avimux->filter.csFilter, (IPin**)&avimux->out); if(FAILED(hr)) { BaseFilterImpl_Release(&avimux->filter.IBaseFilter_iface); HeapFree(GetProcessHeap(), 0, avimux); diff --git a/dlls/qcap/vfwcapture.c b/dlls/qcap/vfwcapture.c index 227a671ceff..41a05a5f616 100644 --- a/dlls/qcap/vfwcapture.c +++ b/dlls/qcap/vfwcapture.c @@ -706,14 +706,13 @@ static HRESULT WINAPI VfwPin_DecideBufferSize(BaseOutputPin *iface, IMemAllocato return IMemAllocator_SetProperties(pAlloc, ppropInputRequest, &actual); } -static const BasePinFuncTable output_BaseFuncTable = { - NULL, - BaseOutputPinImpl_AttemptConnection, - VfwPin_GetMediaTypeVersion, - VfwPin_GetMediaType -}; - static const BaseOutputPinFuncTable output_BaseOutputFuncTable = { + { + NULL, + BaseOutputPinImpl_AttemptConnection, + VfwPin_GetMediaTypeVersion, + VfwPin_GetMediaType + }, VfwPin_DecideBufferSize, BaseOutputPinImpl_DecideAllocator, BaseOutputPinImpl_BreakConnect @@ -734,7 +733,7 @@ VfwPin_Construct( IBaseFilter * pBaseFilter, LPCRITICAL_SECTION pCritSec, lstrcpyW(piOutput.achName, wszOutputPinName); ObjectRefCount(TRUE); - hr = BaseOutputPin_Construct(&VfwPin_Vtbl, sizeof(VfwPinImpl), &piOutput, &output_BaseFuncTable, &output_BaseOutputFuncTable, pCritSec, ppPin); + hr = BaseOutputPin_Construct(&VfwPin_Vtbl, sizeof(VfwPinImpl), &piOutput, &output_BaseOutputFuncTable, pCritSec, ppPin); if (SUCCEEDED(hr)) { diff --git a/dlls/quartz/filesource.c b/dlls/quartz/filesource.c index aee6d975914..a0af3a4a50e 100644 --- a/dlls/quartz/filesource.c +++ b/dlls/quartz/filesource.c @@ -924,14 +924,13 @@ static HRESULT WINAPI FileAsyncReaderPin_DecideBufferSize(BaseOutputPin *iface, return IMemAllocator_SetProperties(pAlloc, &This->allocProps, &actual); } -static const BasePinFuncTable output_BaseFuncTable = { - NULL, - FileAsyncReaderPin_AttemptConnection, - BasePinImpl_GetMediaTypeVersion, - FileAsyncReaderPin_GetMediaType -}; - static const BaseOutputPinFuncTable output_BaseOutputFuncTable = { + { + NULL, + FileAsyncReaderPin_AttemptConnection, + BasePinImpl_GetMediaTypeVersion, + FileAsyncReaderPin_GetMediaType + }, FileAsyncReaderPin_DecideBufferSize, BaseOutputPinImpl_DecideAllocator, BaseOutputPinImpl_BreakConnect @@ -946,7 +945,7 @@ static HRESULT FileAsyncReader_Construct(HANDLE hFile, IBaseFilter * pBaseFilter piOutput.dir = PINDIR_OUTPUT; piOutput.pFilter = pBaseFilter; strcpyW(piOutput.achName, wszOutputPinName); - hr = BaseOutputPin_Construct(&FileAsyncReaderPin_Vtbl, sizeof(FileAsyncReader), &piOutput, &output_BaseFuncTable, &output_BaseOutputFuncTable, pCritSec, ppPin); + hr = BaseOutputPin_Construct(&FileAsyncReaderPin_Vtbl, sizeof(FileAsyncReader), &piOutput, &output_BaseOutputFuncTable, pCritSec, ppPin); if (SUCCEEDED(hr)) { diff --git a/dlls/quartz/parser.c b/dlls/quartz/parser.c index f0b1b9357af..f702c62825d 100644 --- a/dlls/quartz/parser.c +++ b/dlls/quartz/parser.c @@ -419,14 +419,13 @@ HRESULT WINAPI Parser_QueryVendorInfo(IBaseFilter * iface, LPWSTR *pVendorInfo) return BaseFilterImpl_QueryVendorInfo(iface, pVendorInfo); } -static const BasePinFuncTable output_BaseFuncTable = { - NULL, - BaseOutputPinImpl_AttemptConnection, - BasePinImpl_GetMediaTypeVersion, - Parser_OutputPin_GetMediaType -}; - static const BaseOutputPinFuncTable output_BaseOutputFuncTable = { + { + NULL, + BaseOutputPinImpl_AttemptConnection, + BasePinImpl_GetMediaTypeVersion, + Parser_OutputPin_GetMediaType + }, Parser_OutputPin_DecideBufferSize, Parser_OutputPin_DecideAllocator, Parser_OutputPin_BreakConnect @@ -442,7 +441,7 @@ HRESULT Parser_AddPin(ParserImpl * This, const PIN_INFO * piOutput, ALLOCATOR_PR This->ppPins = CoTaskMemAlloc((This->cStreams + 2) * sizeof(IPin *)); memcpy(This->ppPins, ppOldPins, (This->cStreams + 1) * sizeof(IPin *)); - hr = BaseOutputPin_Construct(&Parser_OutputPin_Vtbl, sizeof(Parser_OutputPin), piOutput, &output_BaseFuncTable, &output_BaseOutputFuncTable, &This->filter.csFilter, This->ppPins + (This->cStreams + 1)); + hr = BaseOutputPin_Construct(&Parser_OutputPin_Vtbl, sizeof(Parser_OutputPin), piOutput, &output_BaseOutputFuncTable, &This->filter.csFilter, This->ppPins + (This->cStreams + 1)); if (SUCCEEDED(hr)) { diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c index e4ddd38b9dc..4920784e820 100644 --- a/dlls/strmbase/pin.c +++ b/dlls/strmbase/pin.c @@ -795,7 +795,7 @@ HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(BasePin* iface, IPin * pRecei return hr; } -static HRESULT OutputPin_Init(const IPinVtbl *OutputPin_Vtbl, const PIN_INFO * pPinInfo, const BasePinFuncTable* pBaseFuncsTable, const BaseOutputPinFuncTable* pBaseOutputFuncsTable, LPCRITICAL_SECTION pCritSec, BaseOutputPin * pPinImpl) +static HRESULT OutputPin_Init(const IPinVtbl *OutputPin_Vtbl, const PIN_INFO * pPinInfo, const BaseOutputPinFuncTable* vtbl, LPCRITICAL_SECTION pCritSec, BaseOutputPin * pPinImpl) { TRACE("\n"); @@ -808,18 +808,18 @@ static HRESULT OutputPin_Init(const IPinVtbl *OutputPin_Vtbl, const PIN_INFO * p pPinImpl->pin.tStop = 0; pPinImpl->pin.dRate = 1.0; Copy_PinInfo(&pPinImpl->pin.pinInfo, pPinInfo); - pPinImpl->pin.pFuncsTable = pBaseFuncsTable; + pPinImpl->pin.pFuncsTable = &vtbl->base; ZeroMemory(&pPinImpl->pin.mtCurrent, sizeof(AM_MEDIA_TYPE)); /* Output pin attributes */ pPinImpl->pMemInputPin = NULL; pPinImpl->pAllocator = NULL; - pPinImpl->pFuncsTable = pBaseOutputFuncsTable; + pPinImpl->pFuncsTable = vtbl; return S_OK; } -HRESULT WINAPI BaseOutputPin_Construct(const IPinVtbl *OutputPin_Vtbl, LONG outputpin_size, const PIN_INFO * pPinInfo, const BasePinFuncTable* pBaseFuncsTable, const BaseOutputPinFuncTable* pBaseOutputFuncsTable, LPCRITICAL_SECTION pCritSec, IPin ** ppPin) +HRESULT WINAPI BaseOutputPin_Construct(const IPinVtbl *OutputPin_Vtbl, LONG outputpin_size, const PIN_INFO * pPinInfo, const BaseOutputPinFuncTable* vtbl, LPCRITICAL_SECTION pCritSec, IPin ** ppPin) { BaseOutputPin * pPinImpl; @@ -832,14 +832,14 @@ HRESULT WINAPI BaseOutputPin_Construct(const IPinVtbl *OutputPin_Vtbl, LONG outp } assert(outputpin_size >= sizeof(BaseOutputPin)); - assert(pBaseFuncsTable->pfnAttemptConnection); + assert(vtbl->base.pfnAttemptConnection); pPinImpl = CoTaskMemAlloc(outputpin_size); if (!pPinImpl) return E_OUTOFMEMORY; - if (SUCCEEDED(OutputPin_Init(OutputPin_Vtbl, pPinInfo, pBaseFuncsTable, pBaseOutputFuncsTable, pCritSec, pPinImpl))) + if (SUCCEEDED(OutputPin_Init(OutputPin_Vtbl, pPinInfo, vtbl, pCritSec, pPinImpl))) { *ppPin = &pPinImpl->pin.IPin_iface; return S_OK; @@ -1214,7 +1214,7 @@ static const IMemInputPinVtbl MemInputPin_Vtbl = }; static HRESULT InputPin_Init(const IPinVtbl *InputPin_Vtbl, const PIN_INFO * pPinInfo, - const BasePinFuncTable* pBaseFuncsTable, const BaseInputPinFuncTable* pBaseInputFuncsTable, + const BaseInputPinFuncTable* vtbl, LPCRITICAL_SECTION pCritSec, IMemAllocator *allocator, BaseInputPin * pPinImpl) { TRACE("\n"); @@ -1228,10 +1228,10 @@ static HRESULT InputPin_Init(const IPinVtbl *InputPin_Vtbl, const PIN_INFO * pPi pPinImpl->pin.dRate = 1.0; Copy_PinInfo(&pPinImpl->pin.pinInfo, pPinInfo); ZeroMemory(&pPinImpl->pin.mtCurrent, sizeof(AM_MEDIA_TYPE)); - pPinImpl->pin.pFuncsTable = pBaseFuncsTable; + pPinImpl->pin.pFuncsTable = &vtbl->base; /* Input pin attributes */ - pPinImpl->pFuncsTable = pBaseInputFuncsTable; + pPinImpl->pFuncsTable = vtbl; pPinImpl->pAllocator = pPinImpl->preferred_allocator = allocator; if (pPinImpl->preferred_allocator) IMemAllocator_AddRef(pPinImpl->preferred_allocator); @@ -1243,7 +1243,7 @@ static HRESULT InputPin_Init(const IPinVtbl *InputPin_Vtbl, const PIN_INFO * pPi } HRESULT BaseInputPin_Construct(const IPinVtbl *InputPin_Vtbl, LONG inputpin_size, const PIN_INFO * pPinInfo, - const BasePinFuncTable* pBaseFuncsTable, const BaseInputPinFuncTable* pBaseInputFuncsTable, + const BaseInputPinFuncTable* vtbl, LPCRITICAL_SECTION pCritSec, IMemAllocator *allocator, IPin ** ppPin) { BaseInputPin * pPinImpl; @@ -1251,7 +1251,7 @@ HRESULT BaseInputPin_Construct(const IPinVtbl *InputPin_Vtbl, LONG inputpin_size *ppPin = NULL; assert(inputpin_size >= sizeof(BaseInputPin)); - assert(pBaseFuncsTable->pfnCheckMediaType); + assert(vtbl->base.pfnCheckMediaType); if (pPinInfo->dir != PINDIR_INPUT) { @@ -1264,7 +1264,7 @@ HRESULT BaseInputPin_Construct(const IPinVtbl *InputPin_Vtbl, LONG inputpin_size if (!pPinImpl) return E_OUTOFMEMORY; - if (SUCCEEDED(InputPin_Init(InputPin_Vtbl, pPinInfo, pBaseFuncsTable, pBaseInputFuncsTable, pCritSec, allocator, pPinImpl))) + if (SUCCEEDED(InputPin_Init(InputPin_Vtbl, pPinInfo, vtbl, pCritSec, allocator, pPinImpl))) { *ppPin = (IPin *)pPinImpl; return S_OK; diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c index 6334284dd9e..bb91236c64b 100644 --- a/dlls/strmbase/renderer.c +++ b/dlls/strmbase/renderer.c @@ -227,15 +227,14 @@ static const BaseFilterFuncTable RendererBaseFilterFuncTable = { BaseRenderer_GetPinCount }; -static const BasePinFuncTable input_BaseFuncTable = { - BaseRenderer_Input_CheckMediaType, - NULL, - BasePinImpl_GetMediaTypeVersion, - BasePinImpl_GetMediaType -}; - static const BaseInputPinFuncTable input_BaseInputFuncTable = { - BaseRenderer_Receive + { + BaseRenderer_Input_CheckMediaType, + NULL, + BasePinImpl_GetMediaTypeVersion, + BasePinImpl_GetMediaType + }, + BaseRenderer_Receive }; @@ -253,7 +252,7 @@ HRESULT WINAPI BaseRenderer_Init(BaseRenderer * This, const IBaseFilterVtbl *Vtb piInput.pFilter = &This->filter.IBaseFilter_iface; lstrcpynW(piInput.achName, wcsInputPinName, sizeof(piInput.achName) / sizeof(piInput.achName[0])); - hr = BaseInputPin_Construct(&BaseRenderer_InputPin_Vtbl, sizeof(BaseInputPin), &piInput, &input_BaseFuncTable, + hr = BaseInputPin_Construct(&BaseRenderer_InputPin_Vtbl, sizeof(BaseInputPin), &piInput, &input_BaseInputFuncTable, &This->filter.csFilter, NULL, (IPin **)&This->pInputPin); if (SUCCEEDED(hr)) diff --git a/dlls/strmbase/transform.c b/dlls/strmbase/transform.c index 8cf9ee8414b..eba7ad2ee06 100644 --- a/dlls/strmbase/transform.c +++ b/dlls/strmbase/transform.c @@ -175,25 +175,23 @@ static const BaseFilterFuncTable tfBaseFuncTable = { TransformFilter_GetPinCount }; -static const BasePinFuncTable tf_input_BaseFuncTable = { - TransformFilter_Input_CheckMediaType, - NULL, - BasePinImpl_GetMediaTypeVersion, - BasePinImpl_GetMediaType -}; - static const BaseInputPinFuncTable tf_input_BaseInputFuncTable = { + { + TransformFilter_Input_CheckMediaType, + NULL, + BasePinImpl_GetMediaTypeVersion, + BasePinImpl_GetMediaType + }, TransformFilter_Input_Receive }; -static const BasePinFuncTable tf_output_BaseFuncTable = { - NULL, - BaseOutputPinImpl_AttemptConnection, - BasePinImpl_GetMediaTypeVersion, - TransformFilter_Output_GetMediaType -}; - static const BaseOutputPinFuncTable tf_output_BaseOutputFuncTable = { + { + NULL, + BaseOutputPinImpl_AttemptConnection, + BasePinImpl_GetMediaTypeVersion, + TransformFilter_Output_GetMediaType + }, TransformFilter_Output_DecideBufferSize, BaseOutputPinImpl_DecideAllocator, BaseOutputPinImpl_BreakConnect @@ -225,12 +223,12 @@ static HRESULT TransformFilter_Init(const IBaseFilterVtbl *pVtbl, const CLSID* p piOutput.pFilter = &pTransformFilter->filter.IBaseFilter_iface; lstrcpynW(piOutput.achName, wcsOutputPinName, sizeof(piOutput.achName) / sizeof(piOutput.achName[0])); - hr = BaseInputPin_Construct(&TransformFilter_InputPin_Vtbl, sizeof(BaseInputPin), &piInput, &tf_input_BaseFuncTable, + hr = BaseInputPin_Construct(&TransformFilter_InputPin_Vtbl, sizeof(BaseInputPin), &piInput, &tf_input_BaseInputFuncTable, &pTransformFilter->filter.csFilter, NULL, &pTransformFilter->ppPins[0]); if (SUCCEEDED(hr)) { - hr = BaseOutputPin_Construct(&TransformFilter_OutputPin_Vtbl, sizeof(BaseOutputPin), &piOutput, &tf_output_BaseFuncTable, &tf_output_BaseOutputFuncTable, &pTransformFilter->filter.csFilter, &pTransformFilter->ppPins[1]); + hr = BaseOutputPin_Construct(&TransformFilter_OutputPin_Vtbl, sizeof(BaseOutputPin), &piOutput, &tf_output_BaseOutputFuncTable, &pTransformFilter->filter.csFilter, &pTransformFilter->ppPins[1]); if (FAILED(hr)) ERR("Cannot create output pin (%x)\n", hr); diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index 0b76ff641e4..3694b545782 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -1566,14 +1566,13 @@ static const IPinVtbl GST_OutputPin_Vtbl = { BasePinImpl_NewSegment }; -static const BasePinFuncTable output_BaseFuncTable = { - NULL, - BaseOutputPinImpl_AttemptConnection, - BasePinImpl_GetMediaTypeVersion, - GSTOutPin_GetMediaType -}; - static const BaseOutputPinFuncTable output_BaseOutputFuncTable = { + { + NULL, + BaseOutputPinImpl_AttemptConnection, + BasePinImpl_GetMediaTypeVersion, + GSTOutPin_GetMediaType + }, GSTOutPin_DecideBufferSize, GSTOutPin_DecideAllocator, GSTOutPin_BreakConnect @@ -1583,7 +1582,7 @@ static HRESULT GST_AddPin(GSTImpl *This, const PIN_INFO *piOutput, const AM_MEDI HRESULT hr; This->ppPins = CoTaskMemRealloc(This->ppPins, (This->cStreams + 1) * sizeof(IPin *)); - hr = BaseOutputPin_Construct(&GST_OutputPin_Vtbl, sizeof(GSTOutPin), piOutput, &output_BaseFuncTable, &output_BaseOutputFuncTable, &This->filter.csFilter, (IPin**)(This->ppPins + This->cStreams)); + hr = BaseOutputPin_Construct(&GST_OutputPin_Vtbl, sizeof(GSTOutPin), piOutput, &output_BaseOutputFuncTable, &This->filter.csFilter, (IPin**)(This->ppPins + This->cStreams)); if (SUCCEEDED(hr)) { GSTOutPin *pin = This->ppPins[This->cStreams]; pin->pmt = CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE)); diff --git a/dlls/wineqtdecoder/qtsplitter.c b/dlls/wineqtdecoder/qtsplitter.c index e4ebef3efca..35dc8071a89 100644 --- a/dlls/wineqtdecoder/qtsplitter.c +++ b/dlls/wineqtdecoder/qtsplitter.c @@ -1496,14 +1496,13 @@ static const IQualityControlVtbl QTOutPin_QualityControl_Vtbl = { QT_QualityControl_SetSink }; -static const BasePinFuncTable output_BaseFuncTable = { - NULL, - BaseOutputPinImpl_AttemptConnection, - BasePinImpl_GetMediaTypeVersion, - QTOutPin_GetMediaType -}; - static const BaseOutputPinFuncTable output_BaseOutputFuncTable = { + { + NULL, + BaseOutputPinImpl_AttemptConnection, + BasePinImpl_GetMediaTypeVersion, + QTOutPin_GetMediaType + }, QTOutPin_DecideBufferSize, QTOutPin_DecideAllocator, QTOutPin_BreakConnect @@ -1529,7 +1528,7 @@ static HRESULT QT_AddPin(QTSplitter *This, const PIN_INFO *piOutput, const AM_ME return E_FAIL; } - hr = BaseOutputPin_Construct(&QT_OutputPin_Vtbl, sizeof(QTOutPin), piOutput, &output_BaseFuncTable, &output_BaseOutputFuncTable, &This->filter.csFilter, (IPin**)target); + hr = BaseOutputPin_Construct(&QT_OutputPin_Vtbl, sizeof(QTOutPin), piOutput, &output_BaseOutputFuncTable, &This->filter.csFilter, (IPin**)target); if (SUCCEEDED(hr)) { QTOutPin *pin = (QTOutPin*)*target; diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index b2046d4db11..9727fb419e2 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -71,6 +71,8 @@ typedef HRESULT (WINAPI *BaseOutputPin_DecideAllocator)(BaseOutputPin *This, IMe typedef HRESULT (WINAPI *BaseOutputPin_BreakConnect)(BaseOutputPin * This); typedef struct BaseOutputPinFuncTable { + BasePinFuncTable base; + /* Required for BaseOutputPinImpl_DecideAllocator */ BaseOutputPin_DecideBufferSize pfnDecideBufferSize; /* Required for BaseOutputPinImpl_AttemptConnection */ @@ -94,6 +96,7 @@ typedef struct BaseInputPin typedef HRESULT (WINAPI *BaseInputPin_Receive)(BaseInputPin *This, IMediaSample *pSample); typedef struct BaseInputPinFuncTable { + BasePinFuncTable base; /* Optional */ BaseInputPin_Receive pfnReceive; } BaseInputPinFuncTable; @@ -132,7 +135,7 @@ HRESULT WINAPI BaseOutputPinImpl_InitAllocator(BaseOutputPin *This, IMemAllocato HRESULT WINAPI BaseOutputPinImpl_DecideAllocator(BaseOutputPin *This, IMemInputPin *pPin, IMemAllocator **pAlloc); HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(BasePin *This, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt); -HRESULT WINAPI BaseOutputPin_Construct(const IPinVtbl *OutputPin_Vtbl, LONG outputpin_size, const PIN_INFO * pPinInfo, const BasePinFuncTable* pBaseFuncsTable, const BaseOutputPinFuncTable* pBaseOutputFuncsTable, LPCRITICAL_SECTION pCritSec, IPin ** ppPin); +HRESULT WINAPI BaseOutputPin_Construct(const IPinVtbl *OutputPin_Vtbl, LONG outputpin_size, const PIN_INFO * pPinInfo, const BaseOutputPinFuncTable* pBaseOutputFuncsTable, LPCRITICAL_SECTION pCritSec, IPin ** ppPin); /* Base Input Pin */ HRESULT WINAPI BaseInputPinImpl_QueryInterface(IPin * iface, REFIID riid, LPVOID * ppv); @@ -146,7 +149,7 @@ HRESULT WINAPI BaseInputPinImpl_EndFlush(IPin * iface); HRESULT WINAPI BaseInputPinImpl_NewSegment(IPin * iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate); HRESULT BaseInputPin_Construct(const IPinVtbl *InputPin_Vtbl, LONG inputpin_size, const PIN_INFO * pPinInfo, - const BasePinFuncTable* pBaseFuncsTable, const BaseInputPinFuncTable* pBaseInputFuncsTable, + const BaseInputPinFuncTable* pBaseInputFuncsTable, LPCRITICAL_SECTION pCritSec, IMemAllocator *, IPin ** ppPin); typedef struct BaseFilter