And remove the unnecessary calling convention.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qcap/avico.c | 13 +++++------ dlls/qcap/avimux.c | 26 +++++++++------------ dlls/qcap/smartteefilter.c | 40 ++++++++++++++------------------- dlls/qcap/vfwcapture.c | 14 +++++------- dlls/quartz/filesource.c | 14 +++++------- dlls/strmbase/pin.c | 6 ++--- dlls/strmbase/renderer.c | 13 +++++------ dlls/strmbase/transform.c | 27 ++++++++++------------ dlls/winegstreamer/gstdemux.c | 30 ++++++++++++------------- dlls/wineqtdecoder/qtsplitter.c | 18 +++++++-------- include/wine/strmbase.h | 9 ++++---- 11 files changed, 93 insertions(+), 117 deletions(-)
diff --git a/dlls/qcap/avico.c b/dlls/qcap/avico.c index ca904a96326..0371cd74c17 100644 --- a/dlls/qcap/avico.c +++ b/dlls/qcap/avico.c @@ -379,7 +379,7 @@ static const IPinVtbl AVICompressorInputPinVtbl = { BaseInputPinImpl_NewSegment };
-static HRESULT WINAPI AVICompressorIn_CheckMediaType(struct strmbase_pin *base, const AM_MEDIA_TYPE *pmt) +static HRESULT sink_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYPE *pmt) { AVICompressor *This = impl_from_strmbase_pin(base); VIDEOINFOHEADER *videoinfo; @@ -499,12 +499,11 @@ static HRESULT WINAPI AVICompressorIn_Receive(BaseInputPin *base, IMediaSample * return hres; }
-static const BaseInputPinFuncTable AVICompressorBaseInputPinVtbl = { - { - AVICompressorIn_CheckMediaType, - AVICompressorIn_GetMediaType - }, - AVICompressorIn_Receive +static const BaseInputPinFuncTable AVICompressorBaseInputPinVtbl = +{ + .base.pin_query_accept = sink_query_accept, + .base.pfnGetMediaType = AVICompressorIn_GetMediaType, + .pfnReceive = AVICompressorIn_Receive, };
static HRESULT WINAPI AVICompressorOut_QueryInterface(IPin *iface, REFIID riid, void **ppv) diff --git a/dlls/qcap/avimux.c b/dlls/qcap/avimux.c index 7e33e4abe6f..a61ae5600e9 100644 --- a/dlls/qcap/avimux.c +++ b/dlls/qcap/avimux.c @@ -1152,7 +1152,7 @@ static const ISpecifyPropertyPagesVtbl SpecifyPropertyPagesVtbl = { SpecifyPropertyPages_GetPages };
-static HRESULT WINAPI AviMuxOut_CheckMediaType(struct strmbase_pin *base, const AM_MEDIA_TYPE *amt) +static HRESULT source_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYPE *amt) { FIXME("(%p) stub\n", base); return S_OK; @@ -1223,13 +1223,10 @@ static HRESULT WINAPI AviMuxOut_DecideAllocator(struct strmbase_source *base,
static const struct strmbase_source_ops source_ops = { - { - AviMuxOut_CheckMediaType, - AviMuxOut_GetMediaType - }, - AviMuxOut_AttemptConnection, - NULL, - AviMuxOut_DecideAllocator, + .base.pin_query_accept = source_query_accept, + .base.pfnGetMediaType = AviMuxOut_GetMediaType, + .pfnAttemptConnection = AviMuxOut_AttemptConnection, + .pfnDecideAllocator = AviMuxOut_DecideAllocator, };
static inline AviMux *impl_from_out_IPin(IPin *iface) @@ -1372,7 +1369,7 @@ static const IQualityControlVtbl AviMuxOut_QualityControlVtbl = { AviMuxOut_QualityControl_SetSink };
-static HRESULT WINAPI AviMuxIn_CheckMediaType(struct strmbase_pin *base, const AM_MEDIA_TYPE *pmt) +static HRESULT sink_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYPE *pmt) { if(IsEqualIID(&pmt->majortype, &MEDIATYPE_Audio) && IsEqualIID(&pmt->formattype, &FORMAT_WaveFormatEx)) @@ -1495,12 +1492,11 @@ static HRESULT WINAPI AviMuxIn_Receive(BaseInputPin *base, IMediaSample *pSample return hr; }
-static const BaseInputPinFuncTable AviMuxIn_BaseInputFuncTable = { - { - AviMuxIn_CheckMediaType, - AviMuxIn_GetMediaType - }, - AviMuxIn_Receive +static const BaseInputPinFuncTable AviMuxIn_BaseInputFuncTable = +{ + .base.pin_query_accept = sink_query_accept, + .base.pfnGetMediaType = AviMuxIn_GetMediaType, + .pfnReceive = AviMuxIn_Receive, };
static inline AviMux* impl_from_in_IPin(IPin *iface) diff --git a/dlls/qcap/smartteefilter.c b/dlls/qcap/smartteefilter.c index bbf27a16b2b..98293fb4d8e 100644 --- a/dlls/qcap/smartteefilter.c +++ b/dlls/qcap/smartteefilter.c @@ -167,7 +167,7 @@ static const IPinVtbl SmartTeeFilterInputVtbl = { BaseInputPinImpl_NewSegment };
-static HRESULT WINAPI SmartTeeFilterInput_CheckMediaType(struct strmbase_pin *base, const AM_MEDIA_TYPE *pmt) +static HRESULT sink_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYPE *pmt) { SmartTeeFilter *This = impl_from_strmbase_pin(base); TRACE("(%p, AM_MEDIA_TYPE(%p))\n", This, pmt); @@ -319,12 +319,11 @@ static HRESULT WINAPI SmartTeeFilterInput_Receive(BaseInputPin *base, IMediaSamp return hrPreview; }
-static const BaseInputPinFuncTable SmartTeeFilterInputFuncs = { - { - SmartTeeFilterInput_CheckMediaType, - SmartTeeFilterInput_GetMediaType - }, - SmartTeeFilterInput_Receive +static const BaseInputPinFuncTable SmartTeeFilterInputFuncs = +{ + .base.pin_query_accept = sink_query_accept, + .base.pfnGetMediaType = SmartTeeFilterInput_GetMediaType, + .pfnReceive = SmartTeeFilterInput_Receive, };
static HRESULT WINAPI SmartTeeFilterCapture_EnumMediaTypes(IPin *iface, IEnumMediaTypes **ppEnum) @@ -362,7 +361,7 @@ static const IPinVtbl SmartTeeFilterCaptureVtbl = { BasePinImpl_NewSegment };
-static HRESULT WINAPI SmartTeeFilterCapture_CheckMediaType(struct strmbase_pin *base, const AM_MEDIA_TYPE *amt) +static HRESULT capture_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYPE *amt) { FIXME("(%p) stub\n", base); return S_OK; @@ -391,13 +390,10 @@ static HRESULT WINAPI SmartTeeFilterCapture_DecideAllocator(struct strmbase_sour
static const struct strmbase_source_ops capture_ops = { - { - SmartTeeFilterCapture_CheckMediaType, - SmartTeeFilterCapture_GetMediaType - }, - BaseOutputPinImpl_AttemptConnection, - NULL, - SmartTeeFilterCapture_DecideAllocator, + .base.pin_query_accept = capture_query_accept, + .base.pfnGetMediaType = SmartTeeFilterCapture_GetMediaType, + .pfnAttemptConnection = BaseOutputPinImpl_AttemptConnection, + .pfnDecideAllocator = SmartTeeFilterCapture_DecideAllocator, };
static HRESULT WINAPI SmartTeeFilterPreview_EnumMediaTypes(IPin *iface, IEnumMediaTypes **ppEnum) @@ -435,7 +431,7 @@ static const IPinVtbl SmartTeeFilterPreviewVtbl = { BasePinImpl_NewSegment };
-static HRESULT WINAPI SmartTeeFilterPreview_CheckMediaType(struct strmbase_pin *base, const AM_MEDIA_TYPE *amt) +static HRESULT preview_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYPE *amt) { FIXME("(%p) stub\n", base); return S_OK; @@ -464,14 +460,12 @@ static HRESULT WINAPI SmartTeeFilterPreview_DecideAllocator(struct strmbase_sour
static const struct strmbase_source_ops preview_ops = { - { - SmartTeeFilterPreview_CheckMediaType, - SmartTeeFilterPreview_GetMediaType - }, - BaseOutputPinImpl_AttemptConnection, - NULL, - SmartTeeFilterPreview_DecideAllocator, + .base.pin_query_accept = preview_query_accept, + .base.pfnGetMediaType = SmartTeeFilterPreview_GetMediaType, + .pfnAttemptConnection = BaseOutputPinImpl_AttemptConnection, + .pfnDecideAllocator = SmartTeeFilterPreview_DecideAllocator, }; + IUnknown* WINAPI QCAP_createSmartTeeFilter(IUnknown *outer, HRESULT *phr) { static const WCHAR captureW[] = {'C','a','p','t','u','r','e',0}; diff --git a/dlls/qcap/vfwcapture.c b/dlls/qcap/vfwcapture.c index 60ea7d5623b..c84baa7abc6 100644 --- a/dlls/qcap/vfwcapture.c +++ b/dlls/qcap/vfwcapture.c @@ -512,7 +512,7 @@ static inline VfwCapture *impl_from_strmbase_pin(struct strmbase_pin *pin) return CONTAINING_RECORD(pin, VfwCapture, source.pin); }
-static HRESULT WINAPI VfwPin_CheckMediaType(struct strmbase_pin *pin, const AM_MEDIA_TYPE *mt) +static HRESULT source_query_accept(struct strmbase_pin *pin, const AM_MEDIA_TYPE *mt) { VfwCapture *filter = impl_from_strmbase_pin(pin); return qcap_driver_check_format(filter->driver_info, mt); @@ -556,13 +556,11 @@ static HRESULT WINAPI VfwPin_DecideBufferSize(struct strmbase_source *iface,
static const struct strmbase_source_ops source_ops = { - { - VfwPin_CheckMediaType, - VfwPin_GetMediaType - }, - BaseOutputPinImpl_AttemptConnection, - VfwPin_DecideBufferSize, - BaseOutputPinImpl_DecideAllocator, + .base.pin_query_accept = source_query_accept, + .base.pfnGetMediaType = VfwPin_GetMediaType, + .pfnAttemptConnection = BaseOutputPinImpl_AttemptConnection, + .pfnDecideBufferSize = VfwPin_DecideBufferSize, + .pfnDecideAllocator = BaseOutputPinImpl_DecideAllocator, };
static HRESULT WINAPI VfwPin_QueryInterface(IPin * iface, REFIID riid, LPVOID * ppv) diff --git a/dlls/quartz/filesource.c b/dlls/quartz/filesource.c index b69cfeb411b..ac210824f07 100644 --- a/dlls/quartz/filesource.c +++ b/dlls/quartz/filesource.c @@ -580,7 +580,7 @@ static inline AsyncReader *impl_from_IAsyncReader(IAsyncReader *iface) return CONTAINING_RECORD(iface, AsyncReader, IAsyncReader_iface); }
-static HRESULT WINAPI FileAsyncReaderPin_CheckMediaType(struct strmbase_pin *iface, const AM_MEDIA_TYPE *pmt) +static HRESULT source_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE *pmt) { AsyncReader *filter = impl_from_strmbase_pin(iface);
@@ -703,13 +703,11 @@ static HRESULT WINAPI FileAsyncReaderPin_DecideBufferSize(struct strmbase_source
static const struct strmbase_source_ops source_ops = { - { - FileAsyncReaderPin_CheckMediaType, - FileAsyncReaderPin_GetMediaType - }, - FileAsyncReaderPin_AttemptConnection, - FileAsyncReaderPin_DecideBufferSize, - BaseOutputPinImpl_DecideAllocator, + .base.pin_query_accept = source_query_accept, + .base.pfnGetMediaType = FileAsyncReaderPin_GetMediaType, + .pfnAttemptConnection = FileAsyncReaderPin_AttemptConnection, + .pfnDecideBufferSize = FileAsyncReaderPin_DecideBufferSize, + .pfnDecideAllocator = BaseOutputPinImpl_DecideAllocator, };
static HRESULT WINAPI FileAsyncReader_QueryInterface(IAsyncReader *iface, REFIID iid, void **out) diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c index 6fe08e60b1d..3b05e5c62a1 100644 --- a/dlls/strmbase/pin.c +++ b/dlls/strmbase/pin.c @@ -292,7 +292,7 @@ HRESULT WINAPI BasePinImpl_QueryAccept(IPin * iface, const AM_MEDIA_TYPE * pmt)
TRACE("(%p)->(%p)\n", iface, pmt);
- return (This->pFuncsTable->pfnCheckMediaType(This, pmt) == S_OK ? S_OK : S_FALSE); + return (This->pFuncsTable->pin_query_accept(This, pmt) == S_OK ? S_OK : S_FALSE); }
HRESULT WINAPI BasePinImpl_EnumMediaTypes(IPin *iface, IEnumMediaTypes **enum_media_types) @@ -654,7 +654,7 @@ HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(struct strmbase_source *This, TRACE("(%p)->(%p, %p)\n", This, pReceivePin, pmt); dump_AM_MEDIA_TYPE(pmt);
- if ((hr = This->pFuncsTable->base.pfnCheckMediaType(&This->pin, pmt)) != S_OK) + if ((hr = This->pFuncsTable->base.pin_query_accept(&This->pin, pmt)) != S_OK) return hr;
This->pin.pConnectedTo = pReceivePin; @@ -780,7 +780,7 @@ HRESULT WINAPI BaseInputPinImpl_ReceiveConnection(IPin * iface, IPin * pReceiveP if (This->pin.pConnectedTo) hr = VFW_E_ALREADY_CONNECTED;
- if (SUCCEEDED(hr) && This->pin.pFuncsTable->pfnCheckMediaType(&This->pin, pmt) != S_OK) + if (SUCCEEDED(hr) && This->pin.pFuncsTable->pin_query_accept(&This->pin, pmt) != S_OK) hr = VFW_E_TYPE_NOT_ACCEPTED; /* FIXME: shouldn't we just map common errors onto * VFW_E_TYPE_NOT_ACCEPTED and pass the value on otherwise? */
diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c index 00c14eee283..6df54146568 100644 --- a/dlls/strmbase/renderer.c +++ b/dlls/strmbase/renderer.c @@ -211,7 +211,7 @@ static const struct strmbase_filter_ops filter_ops = .filter_query_interface = renderer_query_interface, };
-static HRESULT WINAPI BaseRenderer_Input_CheckMediaType(struct strmbase_pin *pin, const AM_MEDIA_TYPE *mt) +static HRESULT sink_query_accept(struct strmbase_pin *pin, const AM_MEDIA_TYPE *mt) { BaseRenderer *filter = impl_from_IPin(&pin->IPin_iface); return filter->pFuncsTable->pfnCheckMediaType(filter, mt); @@ -223,12 +223,11 @@ static HRESULT WINAPI BaseRenderer_Receive(BaseInputPin *pin, IMediaSample *samp return BaseRendererImpl_Receive(filter, sample); }
-static const BaseInputPinFuncTable input_BaseInputFuncTable = { - { - BaseRenderer_Input_CheckMediaType, - BasePinImpl_GetMediaType - }, - BaseRenderer_Receive +static const BaseInputPinFuncTable input_BaseInputFuncTable = +{ + .base.pin_query_accept = sink_query_accept, + .base.pfnGetMediaType = BasePinImpl_GetMediaType, + .pfnReceive = BaseRenderer_Receive, };
diff --git a/dlls/strmbase/transform.c b/dlls/strmbase/transform.c index 698a77de053..4bb9e7fa005 100644 --- a/dlls/strmbase/transform.c +++ b/dlls/strmbase/transform.c @@ -45,7 +45,7 @@ static inline TransformFilter *impl_from_sink_IPin(IPin *iface) return CONTAINING_RECORD(iface, TransformFilter, sink.pin.IPin_iface); }
-static HRESULT WINAPI TransformFilter_Input_CheckMediaType(struct strmbase_pin *iface, const AM_MEDIA_TYPE *pmt) +static HRESULT sink_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE *pmt) { TransformFilter *pTransform = impl_from_sink_IPin(&iface->IPin_iface);
@@ -92,7 +92,7 @@ static inline TransformFilter *impl_from_source_IPin(IPin *iface) return CONTAINING_RECORD(iface, TransformFilter, source.pin.IPin_iface); }
-static HRESULT WINAPI TransformFilter_Output_CheckMediaType(struct strmbase_pin *This, const AM_MEDIA_TYPE *pmt) +static HRESULT source_query_accept(struct strmbase_pin *This, const AM_MEDIA_TYPE *pmt) { TransformFilter *pTransformFilter = impl_from_source_IPin(&This->IPin_iface); AM_MEDIA_TYPE* outpmt = &pTransformFilter->pmt; @@ -163,23 +163,20 @@ static const struct strmbase_filter_ops filter_ops = .filter_destroy = transform_destroy, };
-static const BaseInputPinFuncTable tf_input_BaseInputFuncTable = { - { - TransformFilter_Input_CheckMediaType, - BasePinImpl_GetMediaType - }, - TransformFilter_Input_Receive +static const BaseInputPinFuncTable tf_input_BaseInputFuncTable = +{ + .base.pin_query_accept = sink_query_accept, + .base.pfnGetMediaType = BasePinImpl_GetMediaType, + .pfnReceive = TransformFilter_Input_Receive, };
static const struct strmbase_source_ops source_ops = { - { - TransformFilter_Output_CheckMediaType, - TransformFilter_Output_GetMediaType - }, - BaseOutputPinImpl_AttemptConnection, - TransformFilter_Output_DecideBufferSize, - BaseOutputPinImpl_DecideAllocator, + .base.pin_query_accept = source_query_accept, + .base.pfnGetMediaType = TransformFilter_Output_GetMediaType, + .pfnAttemptConnection = BaseOutputPinImpl_AttemptConnection, + .pfnDecideBufferSize = TransformFilter_Output_DecideBufferSize, + .pfnDecideAllocator = BaseOutputPinImpl_DecideAllocator, };
static HRESULT WINAPI TransformFilterImpl_Stop(IBaseFilter *iface) diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index a47b108e49e..7b1080207ee 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -1240,7 +1240,7 @@ static const struct strmbase_filter_ops filter_ops = .filter_destroy = gstdemux_destroy, };
-static HRESULT WINAPI sink_CheckMediaType(struct strmbase_pin *iface, const AM_MEDIA_TYPE *mt) +static HRESULT sink_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE *mt) { if (IsEqualGUID(&mt->majortype, &MEDIATYPE_Stream)) return S_OK; @@ -1249,7 +1249,7 @@ static HRESULT WINAPI sink_CheckMediaType(struct strmbase_pin *iface, const AM_M
static const BasePinFuncTable sink_ops = { - .pfnCheckMediaType = sink_CheckMediaType, + .pin_query_accept = sink_query_accept, .pfnGetMediaType = BasePinImpl_GetMediaType, };
@@ -1793,7 +1793,7 @@ static HRESULT WINAPI GSTOutPin_QueryInterface(IPin *iface, REFIID riid, void ** return E_NOINTERFACE; }
-static HRESULT WINAPI GSTOutPin_CheckMediaType(struct strmbase_pin *base, const AM_MEDIA_TYPE *amt) +static HRESULT source_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYPE *amt) { FIXME("(%p) stub\n", base); return S_OK; @@ -1906,13 +1906,11 @@ static const IPinVtbl GST_OutputPin_Vtbl = {
static const struct strmbase_source_ops source_ops = { - { - GSTOutPin_CheckMediaType, - GSTOutPin_GetMediaType - }, - BaseOutputPinImpl_AttemptConnection, - GSTOutPin_DecideBufferSize, - GSTOutPin_DecideAllocator, + .base.pin_query_accept = source_query_accept, + .base.pfnGetMediaType = GSTOutPin_GetMediaType, + .pfnAttemptConnection = BaseOutputPinImpl_AttemptConnection, + .pfnDecideBufferSize = GSTOutPin_DecideBufferSize, + .pfnDecideAllocator = GSTOutPin_DecideAllocator, };
static struct gstdemux_source *create_pin(struct gstdemux *filter, const WCHAR *name) @@ -2304,7 +2302,7 @@ void start_dispatch_thread(void) CloseHandle(CreateThread(NULL, 0, &dispatch_thread, NULL, 0, NULL)); }
-static HRESULT WINAPI wave_parser_sink_CheckMediaType(struct strmbase_pin *iface, const AM_MEDIA_TYPE *mt) +static HRESULT wave_parser_sink_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE *mt) { if (!IsEqualGUID(&mt->majortype, &MEDIATYPE_Stream)) return S_FALSE; @@ -2317,7 +2315,7 @@ static HRESULT WINAPI wave_parser_sink_CheckMediaType(struct strmbase_pin *iface
static const BasePinFuncTable wave_parser_sink_ops = { - .pfnCheckMediaType = wave_parser_sink_CheckMediaType, + .pin_query_accept = wave_parser_sink_query_accept, .pfnGetMediaType = BasePinImpl_GetMediaType, };
@@ -2413,7 +2411,7 @@ IUnknown * CALLBACK wave_parser_create(IUnknown *outer, HRESULT *phr) return &object->filter.IUnknown_inner; }
-static HRESULT WINAPI avi_splitter_sink_CheckMediaType(struct strmbase_pin *iface, const AM_MEDIA_TYPE *mt) +static HRESULT avi_splitter_sink_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE *mt) { if (IsEqualGUID(&mt->majortype, &MEDIATYPE_Stream) && IsEqualGUID(&mt->subtype, &MEDIASUBTYPE_Avi)) @@ -2423,7 +2421,7 @@ static HRESULT WINAPI avi_splitter_sink_CheckMediaType(struct strmbase_pin *ifac
static const BasePinFuncTable avi_splitter_sink_ops = { - .pfnCheckMediaType = avi_splitter_sink_CheckMediaType, + .pin_query_accept = avi_splitter_sink_query_accept, .pfnGetMediaType = BasePinImpl_GetMediaType, };
@@ -2520,7 +2518,7 @@ IUnknown * CALLBACK avi_splitter_create(IUnknown *outer, HRESULT *phr) return &object->filter.IUnknown_inner; }
-static HRESULT WINAPI mpeg_splitter_sink_CheckMediaType(struct strmbase_pin *iface, const AM_MEDIA_TYPE *mt) +static HRESULT mpeg_splitter_sink_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE *mt) { if (!IsEqualGUID(&mt->majortype, &MEDIATYPE_Stream)) return S_FALSE; @@ -2535,7 +2533,7 @@ static HRESULT WINAPI mpeg_splitter_sink_CheckMediaType(struct strmbase_pin *ifa
static const BasePinFuncTable mpeg_splitter_sink_ops = { - .pfnCheckMediaType = mpeg_splitter_sink_CheckMediaType, + .pin_query_accept = mpeg_splitter_sink_query_accept, .pfnGetMediaType = BasePinImpl_GetMediaType, };
diff --git a/dlls/wineqtdecoder/qtsplitter.c b/dlls/wineqtdecoder/qtsplitter.c index 5e034a511bf..371c0f1ddaf 100644 --- a/dlls/wineqtdecoder/qtsplitter.c +++ b/dlls/wineqtdecoder/qtsplitter.c @@ -290,7 +290,7 @@ static const struct strmbase_filter_ops filter_ops = .filter_destroy = qt_splitter_destroy, };
-static HRESULT WINAPI sink_CheckMediaType(struct strmbase_pin *iface, const AM_MEDIA_TYPE *mt) +static HRESULT sink_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE *mt) { QTInPin *pin = impl_from_IPin(&iface->IPin_iface);
@@ -304,7 +304,7 @@ static HRESULT WINAPI sink_CheckMediaType(struct strmbase_pin *iface, const AM_M
static const BasePinFuncTable sink_ops = { - .pfnCheckMediaType = sink_CheckMediaType, + .pin_query_accept = sink_query_accept, .pfnGetMediaType = BasePinImpl_GetMediaType, };
@@ -1289,7 +1289,7 @@ static HRESULT WINAPI QTOutPin_QueryInterface(IPin *iface, REFIID riid, void **p return E_NOINTERFACE; }
-static HRESULT WINAPI QTOutPin_CheckMediaType(struct strmbase_pin *base, const AM_MEDIA_TYPE *amt) +static HRESULT source_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYPE *amt) { FIXME("(%p) stub\n", base); return S_OK; @@ -1406,13 +1406,11 @@ static const IQualityControlVtbl QTOutPin_QualityControl_Vtbl = {
static const struct strmbase_source_ops source_ops = { - { - QTOutPin_CheckMediaType, - QTOutPin_GetMediaType - }, - BaseOutputPinImpl_AttemptConnection, - QTOutPin_DecideBufferSize, - QTOutPin_DecideAllocator, + .base.pin_query_accept = source_query_accept, + .base.pfnGetMediaType = QTOutPin_GetMediaType, + .pfnAttemptConnection = BaseOutputPinImpl_AttemptConnection, + .pfnDecideBufferSize = QTOutPin_DecideBufferSize, + .pfnDecideAllocator = QTOutPin_DecideAllocator, };
static const OutputQueueFuncTable output_OutputQueueFuncTable = { diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index f4654b964fc..cd9448775e6 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -42,15 +42,14 @@ struct strmbase_pin const struct BasePinFuncTable* pFuncsTable; };
-typedef HRESULT (WINAPI *BasePin_CheckMediaType)(struct strmbase_pin *pin, const AM_MEDIA_TYPE *mt); typedef LONG (WINAPI *BasePin_GetMediaTypeVersion)(struct strmbase_pin *pin); typedef HRESULT (WINAPI *BasePin_GetMediaType)(struct strmbase_pin *pin, int index, AM_MEDIA_TYPE *mt);
typedef struct BasePinFuncTable { - /* Required for QueryAccept(), Connect(), ReceiveConnection(). */ - BasePin_CheckMediaType pfnCheckMediaType; - /* Required for BasePinImpl_EnumMediaTypes */ - BasePin_GetMediaType pfnGetMediaType; + /* Required for QueryAccept(), Connect(), ReceiveConnection(). */ + HRESULT (*pin_query_accept)(struct strmbase_pin *pin, const AM_MEDIA_TYPE *mt); + /* Required for EnumMediaTypes(). */ + BasePin_GetMediaType pfnGetMediaType; } BasePinFuncTable;
struct strmbase_source
And remove the unnecessary calling convention.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qcap/avico.c | 21 ++++++--------------- dlls/qcap/avimux.c | 11 +++-------- dlls/qcap/smartteefilter.c | 12 ++++++------ dlls/qcap/vfwcapture.c | 4 ++-- dlls/quartz/filesource.c | 4 ++-- dlls/strmbase/mediatype.c | 4 ++-- dlls/strmbase/pin.c | 2 +- dlls/strmbase/renderer.c | 2 +- dlls/strmbase/transform.c | 6 +++--- dlls/winegstreamer/gstdemux.c | 12 ++++++------ dlls/wineqtdecoder/qtsplitter.c | 6 +++--- include/wine/strmbase.h | 7 ++----- 12 files changed, 37 insertions(+), 54 deletions(-)
diff --git a/dlls/qcap/avico.c b/dlls/qcap/avico.c index 0371cd74c17..43cca04a064 100644 --- a/dlls/qcap/avico.c +++ b/dlls/qcap/avico.c @@ -406,12 +406,6 @@ static HRESULT sink_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYPE return res == ICERR_OK ? S_OK : S_FALSE; }
-static HRESULT WINAPI AVICompressorIn_GetMediaType(struct strmbase_pin *base, int iPosition, AM_MEDIA_TYPE *amt) -{ - TRACE("(%p)->(%d %p)\n", base, iPosition, amt); - return S_FALSE; -} - static HRESULT WINAPI AVICompressorIn_Receive(BaseInputPin *base, IMediaSample *pSample) { AVICompressor *This = impl_from_strmbase_pin(&base->pin); @@ -502,7 +496,7 @@ static HRESULT WINAPI AVICompressorIn_Receive(BaseInputPin *base, IMediaSample * static const BaseInputPinFuncTable AVICompressorBaseInputPinVtbl = { .base.pin_query_accept = sink_query_accept, - .base.pfnGetMediaType = AVICompressorIn_GetMediaType, + .base.pin_get_media_type = strmbase_pin_get_media_type, .pfnReceive = AVICompressorIn_Receive, };
@@ -532,7 +526,7 @@ static const IPinVtbl AVICompressorOutputPinVtbl = { BasePinImpl_NewSegment };
-static HRESULT WINAPI AVICompressorOut_GetMediaType(struct strmbase_pin *base, int iPosition, AM_MEDIA_TYPE *amt) +static HRESULT source_get_media_type(struct strmbase_pin *base, int iPosition, AM_MEDIA_TYPE *amt) { AVICompressor *This = impl_from_strmbase_filter(base->filter);
@@ -580,13 +574,10 @@ static HRESULT WINAPI AVICompressorOut_DecideAllocator(struct strmbase_source *b
static const struct strmbase_source_ops source_ops = { - { - NULL, - AVICompressorOut_GetMediaType - }, - BaseOutputPinImpl_AttemptConnection, - AVICompressorOut_DecideBufferSize, - AVICompressorOut_DecideAllocator, + .base.pin_get_media_type = source_get_media_type, + .pfnAttemptConnection = BaseOutputPinImpl_AttemptConnection, + .pfnDecideBufferSize = AVICompressorOut_DecideBufferSize, + .pfnDecideAllocator = AVICompressorOut_DecideAllocator, };
IUnknown* WINAPI QCAP_createAVICompressor(IUnknown *outer, HRESULT *phr) diff --git a/dlls/qcap/avimux.c b/dlls/qcap/avimux.c index a61ae5600e9..f969e73a8ca 100644 --- a/dlls/qcap/avimux.c +++ b/dlls/qcap/avimux.c @@ -1174,7 +1174,7 @@ static HRESULT WINAPI AviMuxOut_AttemptConnection(struct strmbase_source *base, return BaseOutputPinImpl_AttemptConnection(base, pReceivePin, pmt); }
-static HRESULT WINAPI AviMuxOut_GetMediaType(struct strmbase_pin *base, int iPosition, AM_MEDIA_TYPE *amt) +static HRESULT source_get_media_type(struct strmbase_pin *base, int iPosition, AM_MEDIA_TYPE *amt) { TRACE("(%p)->(%d %p)\n", base, iPosition, amt);
@@ -1224,7 +1224,7 @@ static HRESULT WINAPI AviMuxOut_DecideAllocator(struct strmbase_source *base, static const struct strmbase_source_ops source_ops = { .base.pin_query_accept = source_query_accept, - .base.pfnGetMediaType = AviMuxOut_GetMediaType, + .base.pin_get_media_type = source_get_media_type, .pfnAttemptConnection = AviMuxOut_AttemptConnection, .pfnDecideAllocator = AviMuxOut_DecideAllocator, }; @@ -1384,11 +1384,6 @@ static HRESULT sink_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYPE return S_FALSE; }
-static HRESULT WINAPI AviMuxIn_GetMediaType(struct strmbase_pin *base, int iPosition, AM_MEDIA_TYPE *amt) -{ - return S_FALSE; -} - static HRESULT WINAPI AviMuxIn_Receive(BaseInputPin *base, IMediaSample *pSample) { AviMux *avimux = impl_from_strmbase_filter(base->pin.filter); @@ -1495,7 +1490,7 @@ static HRESULT WINAPI AviMuxIn_Receive(BaseInputPin *base, IMediaSample *pSample static const BaseInputPinFuncTable AviMuxIn_BaseInputFuncTable = { .base.pin_query_accept = sink_query_accept, - .base.pfnGetMediaType = AviMuxIn_GetMediaType, + .base.pin_get_media_type = strmbase_pin_get_media_type, .pfnReceive = AviMuxIn_Receive, };
diff --git a/dlls/qcap/smartteefilter.c b/dlls/qcap/smartteefilter.c index 98293fb4d8e..390bfa8e20d 100644 --- a/dlls/qcap/smartteefilter.c +++ b/dlls/qcap/smartteefilter.c @@ -179,7 +179,7 @@ static HRESULT sink_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYPE return S_OK; }
-static HRESULT WINAPI SmartTeeFilterInput_GetMediaType(struct strmbase_pin *base, int iPosition, AM_MEDIA_TYPE *amt) +static HRESULT sink_get_media_type(struct strmbase_pin *base, int iPosition, AM_MEDIA_TYPE *amt) { SmartTeeFilter *This = impl_from_strmbase_pin(base); HRESULT hr; @@ -322,7 +322,7 @@ static HRESULT WINAPI SmartTeeFilterInput_Receive(BaseInputPin *base, IMediaSamp static const BaseInputPinFuncTable SmartTeeFilterInputFuncs = { .base.pin_query_accept = sink_query_accept, - .base.pfnGetMediaType = SmartTeeFilterInput_GetMediaType, + .base.pin_get_media_type = sink_get_media_type, .pfnReceive = SmartTeeFilterInput_Receive, };
@@ -367,7 +367,7 @@ static HRESULT capture_query_accept(struct strmbase_pin *base, const AM_MEDIA_TY return S_OK; }
-static HRESULT WINAPI SmartTeeFilterCapture_GetMediaType(struct strmbase_pin *base, int iPosition, AM_MEDIA_TYPE *amt) +static HRESULT capture_get_media_type(struct strmbase_pin *base, int iPosition, AM_MEDIA_TYPE *amt) { SmartTeeFilter *This = impl_from_strmbase_pin(base); TRACE("(%p, %d, %p)\n", This, iPosition, amt); @@ -391,7 +391,7 @@ static HRESULT WINAPI SmartTeeFilterCapture_DecideAllocator(struct strmbase_sour static const struct strmbase_source_ops capture_ops = { .base.pin_query_accept = capture_query_accept, - .base.pfnGetMediaType = SmartTeeFilterCapture_GetMediaType, + .base.pin_get_media_type = capture_get_media_type, .pfnAttemptConnection = BaseOutputPinImpl_AttemptConnection, .pfnDecideAllocator = SmartTeeFilterCapture_DecideAllocator, }; @@ -437,7 +437,7 @@ static HRESULT preview_query_accept(struct strmbase_pin *base, const AM_MEDIA_TY return S_OK; }
-static HRESULT WINAPI SmartTeeFilterPreview_GetMediaType(struct strmbase_pin *base, int iPosition, AM_MEDIA_TYPE *amt) +static HRESULT preview_get_media_type(struct strmbase_pin *base, int iPosition, AM_MEDIA_TYPE *amt) { SmartTeeFilter *This = impl_from_strmbase_pin(base); TRACE("(%p, %d, %p)\n", This, iPosition, amt); @@ -461,7 +461,7 @@ static HRESULT WINAPI SmartTeeFilterPreview_DecideAllocator(struct strmbase_sour static const struct strmbase_source_ops preview_ops = { .base.pin_query_accept = preview_query_accept, - .base.pfnGetMediaType = SmartTeeFilterPreview_GetMediaType, + .base.pin_get_media_type = preview_get_media_type, .pfnAttemptConnection = BaseOutputPinImpl_AttemptConnection, .pfnDecideAllocator = SmartTeeFilterPreview_DecideAllocator, }; diff --git a/dlls/qcap/vfwcapture.c b/dlls/qcap/vfwcapture.c index c84baa7abc6..551dad61f33 100644 --- a/dlls/qcap/vfwcapture.c +++ b/dlls/qcap/vfwcapture.c @@ -518,7 +518,7 @@ static HRESULT source_query_accept(struct strmbase_pin *pin, const AM_MEDIA_TYPE return qcap_driver_check_format(filter->driver_info, mt); }
-static HRESULT WINAPI VfwPin_GetMediaType(struct strmbase_pin *pin, int iPosition, AM_MEDIA_TYPE *pmt) +static HRESULT source_get_media_type(struct strmbase_pin *pin, int iPosition, AM_MEDIA_TYPE *pmt) { VfwCapture *filter = impl_from_strmbase_pin(pin); AM_MEDIA_TYPE *vfw_pmt; @@ -557,7 +557,7 @@ static HRESULT WINAPI VfwPin_DecideBufferSize(struct strmbase_source *iface, static const struct strmbase_source_ops source_ops = { .base.pin_query_accept = source_query_accept, - .base.pfnGetMediaType = VfwPin_GetMediaType, + .base.pin_get_media_type = source_get_media_type, .pfnAttemptConnection = BaseOutputPinImpl_AttemptConnection, .pfnDecideBufferSize = VfwPin_DecideBufferSize, .pfnDecideAllocator = BaseOutputPinImpl_DecideAllocator, diff --git a/dlls/quartz/filesource.c b/dlls/quartz/filesource.c index ac210824f07..031307e1839 100644 --- a/dlls/quartz/filesource.c +++ b/dlls/quartz/filesource.c @@ -591,7 +591,7 @@ static HRESULT source_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TY return S_FALSE; }
-static HRESULT WINAPI FileAsyncReaderPin_GetMediaType(struct strmbase_pin *iface, int index, AM_MEDIA_TYPE *mt) +static HRESULT source_get_media_type(struct strmbase_pin *iface, int index, AM_MEDIA_TYPE *mt) { AsyncReader *filter = impl_from_strmbase_pin(iface);
@@ -704,7 +704,7 @@ static HRESULT WINAPI FileAsyncReaderPin_DecideBufferSize(struct strmbase_source static const struct strmbase_source_ops source_ops = { .base.pin_query_accept = source_query_accept, - .base.pfnGetMediaType = FileAsyncReaderPin_GetMediaType, + .base.pin_get_media_type = source_get_media_type, .pfnAttemptConnection = FileAsyncReaderPin_AttemptConnection, .pfnDecideBufferSize = FileAsyncReaderPin_DecideBufferSize, .pfnDecideAllocator = BaseOutputPinImpl_DecideAllocator, diff --git a/dlls/strmbase/mediatype.c b/dlls/strmbase/mediatype.c index df8d5702933..931e00a5cba 100644 --- a/dlls/strmbase/mediatype.c +++ b/dlls/strmbase/mediatype.c @@ -169,7 +169,7 @@ static HRESULT WINAPI IEnumMediaTypesImpl_Next(IEnumMediaTypes *iface, for (i = 0; i < count && enummt->uIndex + i < enummt->count; i++) { if (!(mts[i] = CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE))) - || FAILED(enummt->basePin->pFuncsTable->pfnGetMediaType(enummt->basePin, enummt->uIndex + i, mts[i]))) + || FAILED(enummt->basePin->pFuncsTable->pin_get_media_type(enummt->basePin, enummt->uIndex + i, mts[i]))) { while (i--) DeleteMediaType(mts[i]); @@ -206,7 +206,7 @@ static HRESULT WINAPI IEnumMediaTypesImpl_Reset(IEnumMediaTypes * iface) TRACE("(%p)->()\n", iface);
i = 0; - while (This->basePin->pFuncsTable->pfnGetMediaType(This->basePin, i, &amt) == S_OK) + while (This->basePin->pFuncsTable->pin_get_media_type(This->basePin, i, &amt) == S_OK) { FreeMediaType(&amt); i++; diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c index 3b05e5c62a1..4a7b3b20bfe 100644 --- a/dlls/strmbase/pin.c +++ b/dlls/strmbase/pin.c @@ -153,7 +153,7 @@ static BOOL CompareMediaTypes(const AM_MEDIA_TYPE * pmt1, const AM_MEDIA_TYPE * }
/*** Common Base Pin function */ -HRESULT WINAPI BasePinImpl_GetMediaType(struct strmbase_pin *iface, int iPosition, AM_MEDIA_TYPE *pmt) +HRESULT strmbase_pin_get_media_type(struct strmbase_pin *iface, int iPosition, AM_MEDIA_TYPE *pmt) { if (iPosition < 0) return E_INVALIDARG; diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c index 6df54146568..c8a6249227c 100644 --- a/dlls/strmbase/renderer.c +++ b/dlls/strmbase/renderer.c @@ -226,7 +226,7 @@ static HRESULT WINAPI BaseRenderer_Receive(BaseInputPin *pin, IMediaSample *samp static const BaseInputPinFuncTable input_BaseInputFuncTable = { .base.pin_query_accept = sink_query_accept, - .base.pfnGetMediaType = BasePinImpl_GetMediaType, + .base.pin_get_media_type = strmbase_pin_get_media_type, .pfnReceive = BaseRenderer_Receive, };
diff --git a/dlls/strmbase/transform.c b/dlls/strmbase/transform.c index 4bb9e7fa005..fc2f0b1d2d4 100644 --- a/dlls/strmbase/transform.c +++ b/dlls/strmbase/transform.c @@ -110,7 +110,7 @@ static HRESULT WINAPI TransformFilter_Output_DecideBufferSize(struct strmbase_so return pTransformFilter->pFuncsTable->pfnDecideBufferSize(pTransformFilter, pAlloc, ppropInputRequest); }
-static HRESULT WINAPI TransformFilter_Output_GetMediaType(struct strmbase_pin *This, int iPosition, AM_MEDIA_TYPE *pmt) +static HRESULT source_get_media_type(struct strmbase_pin *This, int iPosition, AM_MEDIA_TYPE *pmt) { TransformFilter *pTransform = impl_from_source_IPin(&This->IPin_iface);
@@ -166,14 +166,14 @@ static const struct strmbase_filter_ops filter_ops = static const BaseInputPinFuncTable tf_input_BaseInputFuncTable = { .base.pin_query_accept = sink_query_accept, - .base.pfnGetMediaType = BasePinImpl_GetMediaType, + .base.pin_get_media_type = strmbase_pin_get_media_type, .pfnReceive = TransformFilter_Input_Receive, };
static const struct strmbase_source_ops source_ops = { .base.pin_query_accept = source_query_accept, - .base.pfnGetMediaType = TransformFilter_Output_GetMediaType, + .base.pin_get_media_type = source_get_media_type, .pfnAttemptConnection = BaseOutputPinImpl_AttemptConnection, .pfnDecideBufferSize = TransformFilter_Output_DecideBufferSize, .pfnDecideAllocator = BaseOutputPinImpl_DecideAllocator, diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index 7b1080207ee..b9ff1fdc039 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -1250,7 +1250,7 @@ static HRESULT sink_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE static const BasePinFuncTable sink_ops = { .pin_query_accept = sink_query_accept, - .pfnGetMediaType = BasePinImpl_GetMediaType, + .pin_get_media_type = strmbase_pin_get_media_type, };
static BOOL gstdecoder_init_gst(struct gstdemux *filter) @@ -1799,7 +1799,7 @@ static HRESULT source_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYP return S_OK; }
-static HRESULT WINAPI GSTOutPin_GetMediaType(struct strmbase_pin *iface, int iPosition, AM_MEDIA_TYPE *pmt) +static HRESULT source_get_media_type(struct strmbase_pin *iface, int iPosition, AM_MEDIA_TYPE *pmt) { struct gstdemux_source *This = impl_source_from_IPin(&iface->IPin_iface);
@@ -1907,7 +1907,7 @@ static const IPinVtbl GST_OutputPin_Vtbl = { static const struct strmbase_source_ops source_ops = { .base.pin_query_accept = source_query_accept, - .base.pfnGetMediaType = GSTOutPin_GetMediaType, + .base.pin_get_media_type = source_get_media_type, .pfnAttemptConnection = BaseOutputPinImpl_AttemptConnection, .pfnDecideBufferSize = GSTOutPin_DecideBufferSize, .pfnDecideAllocator = GSTOutPin_DecideAllocator, @@ -2316,7 +2316,7 @@ static HRESULT wave_parser_sink_query_accept(struct strmbase_pin *iface, const A static const BasePinFuncTable wave_parser_sink_ops = { .pin_query_accept = wave_parser_sink_query_accept, - .pfnGetMediaType = BasePinImpl_GetMediaType, + .pin_get_media_type = strmbase_pin_get_media_type, };
static BOOL wave_parser_init_gst(struct gstdemux *filter) @@ -2422,7 +2422,7 @@ static HRESULT avi_splitter_sink_query_accept(struct strmbase_pin *iface, const static const BasePinFuncTable avi_splitter_sink_ops = { .pin_query_accept = avi_splitter_sink_query_accept, - .pfnGetMediaType = BasePinImpl_GetMediaType, + .pin_get_media_type = strmbase_pin_get_media_type, };
static BOOL avi_splitter_init_gst(struct gstdemux *filter) @@ -2534,7 +2534,7 @@ static HRESULT mpeg_splitter_sink_query_accept(struct strmbase_pin *iface, const static const BasePinFuncTable mpeg_splitter_sink_ops = { .pin_query_accept = mpeg_splitter_sink_query_accept, - .pfnGetMediaType = BasePinImpl_GetMediaType, + .pin_get_media_type = strmbase_pin_get_media_type, };
static BOOL mpeg_splitter_init_gst(struct gstdemux *filter) diff --git a/dlls/wineqtdecoder/qtsplitter.c b/dlls/wineqtdecoder/qtsplitter.c index 371c0f1ddaf..17d22b4d8da 100644 --- a/dlls/wineqtdecoder/qtsplitter.c +++ b/dlls/wineqtdecoder/qtsplitter.c @@ -305,7 +305,7 @@ static HRESULT sink_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE static const BasePinFuncTable sink_ops = { .pin_query_accept = sink_query_accept, - .pfnGetMediaType = BasePinImpl_GetMediaType, + .pin_get_media_type = strmbase_pin_get_media_type, };
IUnknown * CALLBACK QTSplitter_create(IUnknown *outer, HRESULT *phr) @@ -1295,7 +1295,7 @@ static HRESULT source_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYP return S_OK; }
-static HRESULT WINAPI QTOutPin_GetMediaType(struct strmbase_pin *iface, int iPosition, AM_MEDIA_TYPE *pmt) +static HRESULT source_get_media_type(struct strmbase_pin *iface, int iPosition, AM_MEDIA_TYPE *pmt) { QTOutPin *This = impl_sink_from_strmbase_pin(iface);
@@ -1407,7 +1407,7 @@ static const IQualityControlVtbl QTOutPin_QualityControl_Vtbl = { static const struct strmbase_source_ops source_ops = { .base.pin_query_accept = source_query_accept, - .base.pfnGetMediaType = QTOutPin_GetMediaType, + .base.pin_get_media_type = source_get_media_type, .pfnAttemptConnection = BaseOutputPinImpl_AttemptConnection, .pfnDecideBufferSize = QTOutPin_DecideBufferSize, .pfnDecideAllocator = QTOutPin_DecideAllocator, diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index cd9448775e6..fc18b22d6d3 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -42,14 +42,11 @@ struct strmbase_pin const struct BasePinFuncTable* pFuncsTable; };
-typedef LONG (WINAPI *BasePin_GetMediaTypeVersion)(struct strmbase_pin *pin); -typedef HRESULT (WINAPI *BasePin_GetMediaType)(struct strmbase_pin *pin, int index, AM_MEDIA_TYPE *mt); - typedef struct BasePinFuncTable { /* Required for QueryAccept(), Connect(), ReceiveConnection(). */ HRESULT (*pin_query_accept)(struct strmbase_pin *pin, const AM_MEDIA_TYPE *mt); /* Required for EnumMediaTypes(). */ - BasePin_GetMediaType pfnGetMediaType; + HRESULT (*pin_get_media_type)(struct strmbase_pin *pin, int index, AM_MEDIA_TYPE *mt); } BasePinFuncTable;
struct strmbase_source @@ -98,7 +95,7 @@ typedef struct BaseInputPinFuncTable { } BaseInputPinFuncTable;
/* Base Pin */ -HRESULT WINAPI BasePinImpl_GetMediaType(struct strmbase_pin *pin, int index, AM_MEDIA_TYPE *mt); +HRESULT strmbase_pin_get_media_type(struct strmbase_pin *pin, int index, AM_MEDIA_TYPE *mt); LONG WINAPI BasePinImpl_GetMediaTypeVersion(struct strmbase_pin *pin); ULONG WINAPI BasePinImpl_AddRef(IPin *iface); ULONG WINAPI BasePinImpl_Release(IPin *iface);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qcap/avico.c | 4 +--- dlls/qcap/avimux.c | 4 +--- dlls/qcap/smartteefilter.c | 9 ++++++--- dlls/qcap/vfwcapture.c | 5 ++--- dlls/quartz/filesource.c | 6 ++---- dlls/strmbase/pin.c | 5 +---- dlls/strmbase/transform.c | 4 +--- dlls/winegstreamer/gstdemux.c | 7 +------ dlls/wineqtdecoder/qtsplitter.c | 4 +--- include/wine/strmbase.h | 4 ++-- 10 files changed, 18 insertions(+), 34 deletions(-)
diff --git a/dlls/qcap/avico.c b/dlls/qcap/avico.c index 43cca04a064..33d1c7fab2e 100644 --- a/dlls/qcap/avico.c +++ b/dlls/qcap/avico.c @@ -526,12 +526,10 @@ static const IPinVtbl AVICompressorOutputPinVtbl = { BasePinImpl_NewSegment };
-static HRESULT source_get_media_type(struct strmbase_pin *base, int iPosition, AM_MEDIA_TYPE *amt) +static HRESULT source_get_media_type(struct strmbase_pin *base, unsigned int iPosition, AM_MEDIA_TYPE *amt) { AVICompressor *This = impl_from_strmbase_filter(base->filter);
- TRACE("(%p)->(%d %p)\n", base, iPosition, amt); - if(iPosition || !This->videoinfo) return S_FALSE;
diff --git a/dlls/qcap/avimux.c b/dlls/qcap/avimux.c index f969e73a8ca..42b198deea4 100644 --- a/dlls/qcap/avimux.c +++ b/dlls/qcap/avimux.c @@ -1174,12 +1174,10 @@ static HRESULT WINAPI AviMuxOut_AttemptConnection(struct strmbase_source *base, return BaseOutputPinImpl_AttemptConnection(base, pReceivePin, pmt); }
-static HRESULT source_get_media_type(struct strmbase_pin *base, int iPosition, AM_MEDIA_TYPE *amt) +static HRESULT source_get_media_type(struct strmbase_pin *base, unsigned int iPosition, AM_MEDIA_TYPE *amt) { TRACE("(%p)->(%d %p)\n", base, iPosition, amt);
- if(iPosition < 0) - return E_INVALIDARG; if(iPosition > 0) return VFW_S_NO_MORE_ITEMS;
diff --git a/dlls/qcap/smartteefilter.c b/dlls/qcap/smartteefilter.c index 390bfa8e20d..7bb053d5507 100644 --- a/dlls/qcap/smartteefilter.c +++ b/dlls/qcap/smartteefilter.c @@ -179,7 +179,8 @@ static HRESULT sink_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYPE return S_OK; }
-static HRESULT sink_get_media_type(struct strmbase_pin *base, int iPosition, AM_MEDIA_TYPE *amt) +static HRESULT sink_get_media_type(struct strmbase_pin *base, + unsigned int iPosition, AM_MEDIA_TYPE *amt) { SmartTeeFilter *This = impl_from_strmbase_pin(base); HRESULT hr; @@ -367,7 +368,8 @@ static HRESULT capture_query_accept(struct strmbase_pin *base, const AM_MEDIA_TY return S_OK; }
-static HRESULT capture_get_media_type(struct strmbase_pin *base, int iPosition, AM_MEDIA_TYPE *amt) +static HRESULT capture_get_media_type(struct strmbase_pin *base, + unsigned int iPosition, AM_MEDIA_TYPE *amt) { SmartTeeFilter *This = impl_from_strmbase_pin(base); TRACE("(%p, %d, %p)\n", This, iPosition, amt); @@ -437,7 +439,8 @@ static HRESULT preview_query_accept(struct strmbase_pin *base, const AM_MEDIA_TY return S_OK; }
-static HRESULT preview_get_media_type(struct strmbase_pin *base, int iPosition, AM_MEDIA_TYPE *amt) +static HRESULT preview_get_media_type(struct strmbase_pin *base, + unsigned int iPosition, AM_MEDIA_TYPE *amt) { SmartTeeFilter *This = impl_from_strmbase_pin(base); TRACE("(%p, %d, %p)\n", This, iPosition, amt); diff --git a/dlls/qcap/vfwcapture.c b/dlls/qcap/vfwcapture.c index 551dad61f33..a5664b7c1c6 100644 --- a/dlls/qcap/vfwcapture.c +++ b/dlls/qcap/vfwcapture.c @@ -518,14 +518,13 @@ static HRESULT source_query_accept(struct strmbase_pin *pin, const AM_MEDIA_TYPE return qcap_driver_check_format(filter->driver_info, mt); }
-static HRESULT source_get_media_type(struct strmbase_pin *pin, int iPosition, AM_MEDIA_TYPE *pmt) +static HRESULT source_get_media_type(struct strmbase_pin *pin, + unsigned int iPosition, AM_MEDIA_TYPE *pmt) { VfwCapture *filter = impl_from_strmbase_pin(pin); AM_MEDIA_TYPE *vfw_pmt; HRESULT hr;
- if (iPosition < 0) - return E_INVALIDARG; if (iPosition > 0) return VFW_S_NO_MORE_ITEMS;
diff --git a/dlls/quartz/filesource.c b/dlls/quartz/filesource.c index 031307e1839..160b814738c 100644 --- a/dlls/quartz/filesource.c +++ b/dlls/quartz/filesource.c @@ -591,13 +591,11 @@ static HRESULT source_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TY return S_FALSE; }
-static HRESULT source_get_media_type(struct strmbase_pin *iface, int index, AM_MEDIA_TYPE *mt) +static HRESULT source_get_media_type(struct strmbase_pin *iface, unsigned int index, AM_MEDIA_TYPE *mt) { AsyncReader *filter = impl_from_strmbase_pin(iface);
- if (index < 0) - return E_INVALIDARG; - else if (index > 1) + if (index > 1) return VFW_S_NO_MORE_ITEMS;
if (index == 0) diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c index 4a7b3b20bfe..403e468550d 100644 --- a/dlls/strmbase/pin.c +++ b/dlls/strmbase/pin.c @@ -152,11 +152,8 @@ static BOOL CompareMediaTypes(const AM_MEDIA_TYPE * pmt1, const AM_MEDIA_TYPE * ((bWildcards && (IsEqualGUID(&pmt1->subtype, &GUID_NULL) || IsEqualGUID(&pmt2->subtype, &GUID_NULL))) || IsEqualGUID(&pmt1->subtype, &pmt2->subtype))); }
-/*** Common Base Pin function */ -HRESULT strmbase_pin_get_media_type(struct strmbase_pin *iface, int iPosition, AM_MEDIA_TYPE *pmt) +HRESULT strmbase_pin_get_media_type(struct strmbase_pin *iface, unsigned int index, AM_MEDIA_TYPE *mt) { - if (iPosition < 0) - return E_INVALIDARG; return VFW_S_NO_MORE_ITEMS; }
diff --git a/dlls/strmbase/transform.c b/dlls/strmbase/transform.c index fc2f0b1d2d4..fa041b66bd2 100644 --- a/dlls/strmbase/transform.c +++ b/dlls/strmbase/transform.c @@ -110,12 +110,10 @@ static HRESULT WINAPI TransformFilter_Output_DecideBufferSize(struct strmbase_so return pTransformFilter->pFuncsTable->pfnDecideBufferSize(pTransformFilter, pAlloc, ppropInputRequest); }
-static HRESULT source_get_media_type(struct strmbase_pin *This, int iPosition, AM_MEDIA_TYPE *pmt) +static HRESULT source_get_media_type(struct strmbase_pin *This, unsigned int iPosition, AM_MEDIA_TYPE *pmt) { TransformFilter *pTransform = impl_from_source_IPin(&This->IPin_iface);
- if (iPosition < 0) - return E_INVALIDARG; if (iPosition > 0) return VFW_S_NO_MORE_ITEMS; CopyMediaType(pmt, &pTransform->pmt); diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index b9ff1fdc039..de3bc996877 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -1799,15 +1799,10 @@ static HRESULT source_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYP return S_OK; }
-static HRESULT source_get_media_type(struct strmbase_pin *iface, int iPosition, AM_MEDIA_TYPE *pmt) +static HRESULT source_get_media_type(struct strmbase_pin *iface, unsigned int iPosition, AM_MEDIA_TYPE *pmt) { struct gstdemux_source *This = impl_source_from_IPin(&iface->IPin_iface);
- TRACE("(%p)->(%i, %p)\n", This, iPosition, pmt); - - if (iPosition < 0) - return E_INVALIDARG; - if (iPosition > 0) return VFW_S_NO_MORE_ITEMS;
diff --git a/dlls/wineqtdecoder/qtsplitter.c b/dlls/wineqtdecoder/qtsplitter.c index 17d22b4d8da..d3b9596375d 100644 --- a/dlls/wineqtdecoder/qtsplitter.c +++ b/dlls/wineqtdecoder/qtsplitter.c @@ -1295,12 +1295,10 @@ static HRESULT source_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYP return S_OK; }
-static HRESULT source_get_media_type(struct strmbase_pin *iface, int iPosition, AM_MEDIA_TYPE *pmt) +static HRESULT source_get_media_type(struct strmbase_pin *iface, unsigned int iPosition, AM_MEDIA_TYPE *pmt) { QTOutPin *This = impl_sink_from_strmbase_pin(iface);
- if (iPosition < 0) - return E_INVALIDARG; if (iPosition > 0) return VFW_S_NO_MORE_ITEMS; CopyMediaType(pmt, This->pmt); diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index fc18b22d6d3..65ba180caa7 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -46,7 +46,7 @@ typedef struct BasePinFuncTable { /* Required for QueryAccept(), Connect(), ReceiveConnection(). */ HRESULT (*pin_query_accept)(struct strmbase_pin *pin, const AM_MEDIA_TYPE *mt); /* Required for EnumMediaTypes(). */ - HRESULT (*pin_get_media_type)(struct strmbase_pin *pin, int index, AM_MEDIA_TYPE *mt); + HRESULT (*pin_get_media_type)(struct strmbase_pin *pin, unsigned int index, AM_MEDIA_TYPE *mt); } BasePinFuncTable;
struct strmbase_source @@ -95,7 +95,7 @@ typedef struct BaseInputPinFuncTable { } BaseInputPinFuncTable;
/* Base Pin */ -HRESULT strmbase_pin_get_media_type(struct strmbase_pin *pin, int index, AM_MEDIA_TYPE *mt); +HRESULT strmbase_pin_get_media_type(struct strmbase_pin *pin, unsigned int index, AM_MEDIA_TYPE *mt); LONG WINAPI BasePinImpl_GetMediaTypeVersion(struct strmbase_pin *pin); ULONG WINAPI BasePinImpl_AddRef(IPin *iface); ULONG WINAPI BasePinImpl_Release(IPin *iface);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qcap/vfwcapture.c | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-)
diff --git a/dlls/qcap/vfwcapture.c b/dlls/qcap/vfwcapture.c index a5664b7c1c6..e5278152edd 100644 --- a/dlls/qcap/vfwcapture.c +++ b/dlls/qcap/vfwcapture.c @@ -586,28 +586,6 @@ static HRESULT WINAPI VfwPin_QueryInterface(IPin * iface, REFIID riid, LPVOID * return E_NOINTERFACE; }
-static HRESULT WINAPI -VfwPin_EnumMediaTypes(IPin * iface, IEnumMediaTypes ** ppEnum) -{ - VfwCapture *filter = impl_from_IPin(iface); - AM_MEDIA_TYPE *pmt; - HRESULT hr; - - hr = qcap_driver_get_format(filter->driver_info, &pmt); - if (SUCCEEDED(hr)) { - hr = BasePinImpl_EnumMediaTypes(iface, ppEnum); - DeleteMediaType(pmt); - } - return hr; -} - -static HRESULT WINAPI -VfwPin_QueryInternalConnections(IPin * iface, IPin ** apPin, ULONG * cPin) -{ - TRACE("(%p)->(%p, %p)\n", iface, apPin, cPin); - return E_NOTIMPL; -} - static const IPinVtbl VfwPin_Vtbl = { VfwPin_QueryInterface, @@ -622,8 +600,8 @@ static const IPinVtbl VfwPin_Vtbl = BasePinImpl_QueryDirection, BasePinImpl_QueryId, BasePinImpl_QueryAccept, - VfwPin_EnumMediaTypes, - VfwPin_QueryInternalConnections, + BasePinImpl_EnumMediaTypes, + BasePinImpl_QueryInternalConnections, BaseOutputPinImpl_EndOfStream, BaseOutputPinImpl_BeginFlush, BaseOutputPinImpl_EndFlush,
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qcap/smartteefilter.c | 78 ++++++++++---------------------------- dlls/strmbase/pin.c | 7 ++++ 2 files changed, 27 insertions(+), 58 deletions(-)
diff --git a/dlls/qcap/smartteefilter.c b/dlls/qcap/smartteefilter.c index 7bb053d5507..e7ff5f9b345 100644 --- a/dlls/qcap/smartteefilter.c +++ b/dlls/qcap/smartteefilter.c @@ -57,11 +57,6 @@ static inline SmartTeeFilter *impl_from_strmbase_pin(struct strmbase_pin *pin) return impl_from_strmbase_filter(pin->filter); }
-static inline SmartTeeFilter *impl_from_IPin(IPin *iface) -{ - return impl_from_strmbase_filter(CONTAINING_RECORD(iface, struct strmbase_pin, IPin_iface)->filter); -} - static HRESULT WINAPI SmartTeeFilter_Stop(IBaseFilter *iface) { SmartTeeFilter *This = impl_from_IBaseFilter(iface); @@ -327,20 +322,6 @@ static const BaseInputPinFuncTable SmartTeeFilterInputFuncs = .pfnReceive = SmartTeeFilterInput_Receive, };
-static HRESULT WINAPI SmartTeeFilterCapture_EnumMediaTypes(IPin *iface, IEnumMediaTypes **ppEnum) -{ - SmartTeeFilter *This = impl_from_IPin(iface); - HRESULT hr; - TRACE("(%p)->(%p)\n", This, ppEnum); - EnterCriticalSection(&This->filter.csFilter); - if (This->sink.pin.pConnectedTo) - hr = BasePinImpl_EnumMediaTypes(iface, ppEnum); - else - hr = VFW_E_NOT_CONNECTED; - LeaveCriticalSection(&This->filter.csFilter); - return hr; -} - static const IPinVtbl SmartTeeFilterCaptureVtbl = { BaseOutputPinImpl_QueryInterface, BasePinImpl_AddRef, @@ -354,7 +335,7 @@ static const IPinVtbl SmartTeeFilterCaptureVtbl = { BasePinImpl_QueryDirection, BasePinImpl_QueryId, BasePinImpl_QueryAccept, - SmartTeeFilterCapture_EnumMediaTypes, + BasePinImpl_EnumMediaTypes, BasePinImpl_QueryInternalConnections, BaseOutputPinImpl_EndOfStream, BaseOutputPinImpl_BeginFlush, @@ -368,16 +349,23 @@ static HRESULT capture_query_accept(struct strmbase_pin *base, const AM_MEDIA_TY return S_OK; }
-static HRESULT capture_get_media_type(struct strmbase_pin *base, - unsigned int iPosition, AM_MEDIA_TYPE *amt) +static HRESULT source_get_media_type(struct strmbase_pin *iface, + unsigned int index, AM_MEDIA_TYPE *mt) { - SmartTeeFilter *This = impl_from_strmbase_pin(base); - TRACE("(%p, %d, %p)\n", This, iPosition, amt); - if (iPosition == 0) { - CopyMediaType(amt, &This->sink.pin.mtCurrent); - return S_OK; - } else - return S_FALSE; + SmartTeeFilter *filter = impl_from_strmbase_pin(iface); + HRESULT hr = S_OK; + + EnterCriticalSection(&filter->filter.csFilter); + + if (!filter->sink.pin.pConnectedTo) + hr = VFW_E_NOT_CONNECTED; + else if (!index) + CopyMediaType(mt, &filter->sink.pin.mtCurrent); + else + hr = VFW_S_NO_MORE_ITEMS; + + LeaveCriticalSection(&filter->filter.csFilter); + return hr; }
static HRESULT WINAPI SmartTeeFilterCapture_DecideAllocator(struct strmbase_source *base, @@ -393,25 +381,11 @@ static HRESULT WINAPI SmartTeeFilterCapture_DecideAllocator(struct strmbase_sour static const struct strmbase_source_ops capture_ops = { .base.pin_query_accept = capture_query_accept, - .base.pin_get_media_type = capture_get_media_type, + .base.pin_get_media_type = source_get_media_type, .pfnAttemptConnection = BaseOutputPinImpl_AttemptConnection, .pfnDecideAllocator = SmartTeeFilterCapture_DecideAllocator, };
-static HRESULT WINAPI SmartTeeFilterPreview_EnumMediaTypes(IPin *iface, IEnumMediaTypes **ppEnum) -{ - SmartTeeFilter *This = impl_from_IPin(iface); - HRESULT hr; - TRACE("(%p)->(%p)\n", This, ppEnum); - EnterCriticalSection(&This->filter.csFilter); - if (This->sink.pin.pConnectedTo) - hr = BasePinImpl_EnumMediaTypes(iface, ppEnum); - else - hr = VFW_E_NOT_CONNECTED; - LeaveCriticalSection(&This->filter.csFilter); - return hr; -} - static const IPinVtbl SmartTeeFilterPreviewVtbl = { BaseOutputPinImpl_QueryInterface, BasePinImpl_AddRef, @@ -425,7 +399,7 @@ static const IPinVtbl SmartTeeFilterPreviewVtbl = { BasePinImpl_QueryDirection, BasePinImpl_QueryId, BasePinImpl_QueryAccept, - SmartTeeFilterPreview_EnumMediaTypes, + BasePinImpl_EnumMediaTypes, BasePinImpl_QueryInternalConnections, BaseOutputPinImpl_EndOfStream, BaseOutputPinImpl_BeginFlush, @@ -439,18 +413,6 @@ static HRESULT preview_query_accept(struct strmbase_pin *base, const AM_MEDIA_TY return S_OK; }
-static HRESULT preview_get_media_type(struct strmbase_pin *base, - unsigned int iPosition, AM_MEDIA_TYPE *amt) -{ - SmartTeeFilter *This = impl_from_strmbase_pin(base); - TRACE("(%p, %d, %p)\n", This, iPosition, amt); - if (iPosition == 0) { - CopyMediaType(amt, &This->sink.pin.mtCurrent); - return S_OK; - } else - return S_FALSE; -} - static HRESULT WINAPI SmartTeeFilterPreview_DecideAllocator(struct strmbase_source *base, IMemInputPin *pPin, IMemAllocator **pAlloc) { @@ -464,7 +426,7 @@ static HRESULT WINAPI SmartTeeFilterPreview_DecideAllocator(struct strmbase_sour static const struct strmbase_source_ops preview_ops = { .base.pin_query_accept = preview_query_accept, - .base.pin_get_media_type = preview_get_media_type, + .base.pin_get_media_type = source_get_media_type, .pfnAttemptConnection = BaseOutputPinImpl_AttemptConnection, .pfnDecideAllocator = SmartTeeFilterPreview_DecideAllocator, }; diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c index 403e468550d..2cc6ef5259d 100644 --- a/dlls/strmbase/pin.c +++ b/dlls/strmbase/pin.c @@ -295,9 +295,16 @@ HRESULT WINAPI BasePinImpl_QueryAccept(IPin * iface, const AM_MEDIA_TYPE * pmt) HRESULT WINAPI BasePinImpl_EnumMediaTypes(IPin *iface, IEnumMediaTypes **enum_media_types) { struct strmbase_pin *pin = impl_from_IPin(iface); + AM_MEDIA_TYPE mt; + HRESULT hr;
TRACE("iface %p, enum_media_types %p.\n", iface, enum_media_types);
+ if (FAILED(hr = pin->pFuncsTable->pin_get_media_type(pin, 0, &mt))) + return hr; + if (hr == S_OK) + FreeMediaType(&mt); + return enum_media_types_create(pin, enum_media_types); }