Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qcap/avico.c | 28 ++++++++++-------- dlls/qcap/smartteefilter.c | 20 +++++++++++-- dlls/qcap/vfwcapture.c | 47 +++++++++++------------------- dlls/strmbase/pin.c | 59 -------------------------------------- include/wine/strmbase.h | 2 -- 5 files changed, 50 insertions(+), 106 deletions(-)
diff --git a/dlls/qcap/avico.c b/dlls/qcap/avico.c index 33d1c7fab2e..89e8dda08f8 100644 --- a/dlls/qcap/avico.c +++ b/dlls/qcap/avico.c @@ -318,11 +318,6 @@ static inline AVICompressor *impl_from_IPin(IPin *iface) return impl_from_strmbase_filter(CONTAINING_RECORD(iface, struct strmbase_pin, IPin_iface)->filter); }
-static HRESULT WINAPI AVICompressorIn_QueryInterface(IPin *iface, REFIID riid, void **ppv) -{ - return BaseInputPinImpl_QueryInterface(iface, riid, ppv); -} - static HRESULT WINAPI AVICompressorIn_ReceiveConnection(IPin *iface, IPin *pConnector, const AM_MEDIA_TYPE *pmt) { @@ -359,7 +354,7 @@ static HRESULT WINAPI AVICompressorIn_Disconnect(IPin *iface) }
static const IPinVtbl AVICompressorInputPinVtbl = { - AVICompressorIn_QueryInterface, + BasePinImpl_QueryInterface, BasePinImpl_AddRef, BasePinImpl_Release, BaseInputPinImpl_Connect, @@ -406,6 +401,19 @@ static HRESULT sink_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYPE return res == ICERR_OK ? S_OK : S_FALSE; }
+static HRESULT sink_query_interface(struct strmbase_pin *iface, REFIID iid, void **out) +{ + AVICompressor *filter = impl_from_strmbase_pin(iface); + + if (IsEqualGUID(iid, &IID_IMemInputPin)) + *out = &filter->sink.IMemInputPin_iface; + else + return E_NOINTERFACE; + + IUnknown_AddRef((IUnknown *)*out); + return S_OK; +} + static HRESULT WINAPI AVICompressorIn_Receive(BaseInputPin *base, IMediaSample *pSample) { AVICompressor *This = impl_from_strmbase_pin(&base->pin); @@ -497,16 +505,12 @@ static const BaseInputPinFuncTable AVICompressorBaseInputPinVtbl = { .base.pin_query_accept = sink_query_accept, .base.pin_get_media_type = strmbase_pin_get_media_type, + .base.pin_query_interface = sink_query_interface, .pfnReceive = AVICompressorIn_Receive, };
-static HRESULT WINAPI AVICompressorOut_QueryInterface(IPin *iface, REFIID riid, void **ppv) -{ - return BaseInputPinImpl_QueryInterface(iface, riid, ppv); -} - static const IPinVtbl AVICompressorOutputPinVtbl = { - AVICompressorOut_QueryInterface, + BasePinImpl_QueryInterface, BasePinImpl_AddRef, BasePinImpl_Release, BaseOutputPinImpl_Connect, diff --git a/dlls/qcap/smartteefilter.c b/dlls/qcap/smartteefilter.c index e7ff5f9b345..b2e5496b7dd 100644 --- a/dlls/qcap/smartteefilter.c +++ b/dlls/qcap/smartteefilter.c @@ -142,7 +142,7 @@ static const struct strmbase_filter_ops filter_ops = };
static const IPinVtbl SmartTeeFilterInputVtbl = { - BaseInputPinImpl_QueryInterface, + BasePinImpl_QueryInterface, BasePinImpl_AddRef, BasePinImpl_Release, BaseInputPinImpl_Connect, @@ -194,6 +194,19 @@ static HRESULT sink_get_media_type(struct strmbase_pin *base, return hr; }
+static HRESULT sink_query_interface(struct strmbase_pin *iface, REFIID iid, void **out) +{ + SmartTeeFilter *filter = impl_from_strmbase_pin(iface); + + if (IsEqualGUID(iid, &IID_IMemInputPin)) + *out = &filter->sink.IMemInputPin_iface; + else + return E_NOINTERFACE; + + IUnknown_AddRef((IUnknown *)*out); + return S_OK; +} + static HRESULT copy_sample(IMediaSample *inputSample, IMemAllocator *allocator, IMediaSample **pOutputSample) { REFERENCE_TIME startTime, endTime; @@ -319,11 +332,12 @@ static const BaseInputPinFuncTable SmartTeeFilterInputFuncs = { .base.pin_query_accept = sink_query_accept, .base.pin_get_media_type = sink_get_media_type, + .base.pin_query_interface = sink_query_interface, .pfnReceive = SmartTeeFilterInput_Receive, };
static const IPinVtbl SmartTeeFilterCaptureVtbl = { - BaseOutputPinImpl_QueryInterface, + BasePinImpl_QueryInterface, BasePinImpl_AddRef, BasePinImpl_Release, BaseOutputPinImpl_Connect, @@ -387,7 +401,7 @@ static const struct strmbase_source_ops capture_ops = };
static const IPinVtbl SmartTeeFilterPreviewVtbl = { - BaseOutputPinImpl_QueryInterface, + BasePinImpl_QueryInterface, BasePinImpl_AddRef, BasePinImpl_Release, BaseOutputPinImpl_Connect, diff --git a/dlls/qcap/vfwcapture.c b/dlls/qcap/vfwcapture.c index e5278152edd..e2608f43581 100644 --- a/dlls/qcap/vfwcapture.c +++ b/dlls/qcap/vfwcapture.c @@ -82,11 +82,6 @@ static inline VfwCapture *impl_from_IPersistPropertyBag(IPersistPropertyBag *ifa return CONTAINING_RECORD(iface, VfwCapture, IPersistPropertyBag_iface); }
-static inline VfwCapture *impl_from_IPin(IPin *iface) -{ - return CONTAINING_RECORD(iface, VfwCapture, source.pin.IPin_iface); -} - static IPin *vfw_capture_get_pin(struct strmbase_filter *iface, unsigned int index) { VfwCapture *This = impl_from_strmbase_filter(iface); @@ -536,6 +531,21 @@ static HRESULT source_get_media_type(struct strmbase_pin *pin, return hr; }
+static HRESULT source_query_interface(struct strmbase_pin *iface, REFIID iid, void **out) +{ + VfwCapture *filter = impl_from_strmbase_pin(iface); + + if (IsEqualGUID(iid, &IID_IKsPropertySet)) + *out = &filter->IKsPropertySet_iface; + else if (IsEqualGUID(iid, &IID_IAMStreamConfig)) + *out = &filter->IAMStreamConfig_iface; + else + return E_NOINTERFACE; + + IUnknown_AddRef((IUnknown *)*out); + return S_OK; +} + static HRESULT WINAPI VfwPin_DecideBufferSize(struct strmbase_source *iface, IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest) { @@ -557,38 +567,15 @@ static const struct strmbase_source_ops source_ops = { .base.pin_query_accept = source_query_accept, .base.pin_get_media_type = source_get_media_type, + .base.pin_query_interface = source_query_interface, .pfnAttemptConnection = BaseOutputPinImpl_AttemptConnection, .pfnDecideBufferSize = VfwPin_DecideBufferSize, .pfnDecideAllocator = BaseOutputPinImpl_DecideAllocator, };
-static HRESULT WINAPI VfwPin_QueryInterface(IPin * iface, REFIID riid, LPVOID * ppv) -{ - VfwCapture *filter = impl_from_IPin(iface); - - TRACE("%s %p\n", debugstr_guid(riid), ppv); - - *ppv = NULL; - if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IPin)) - *ppv = &filter->source.pin.IPin_iface; - else if (IsEqualIID(riid, &IID_IKsPropertySet)) - *ppv = &filter->IKsPropertySet_iface; - else if (IsEqualIID(riid, &IID_IAMStreamConfig)) - *ppv = &filter->IAMStreamConfig_iface; - - if (*ppv) - { - IUnknown_AddRef((IUnknown *)(*ppv)); - return S_OK; - } - - FIXME("No interface for %s!\n", debugstr_guid(riid)); - return E_NOINTERFACE; -} - static const IPinVtbl VfwPin_Vtbl = { - VfwPin_QueryInterface, + BasePinImpl_QueryInterface, BasePinImpl_AddRef, BasePinImpl_Release, BaseOutputPinImpl_Connect, diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c index 1dbfee07a6c..190c9078fab 100644 --- a/dlls/strmbase/pin.c +++ b/dlls/strmbase/pin.c @@ -362,35 +362,6 @@ static inline struct strmbase_source *impl_source_from_IPin( IPin *iface ) return CONTAINING_RECORD(iface, struct strmbase_source, pin.IPin_iface); }
-HRESULT WINAPI BaseOutputPinImpl_QueryInterface(IPin * iface, REFIID riid, LPVOID * ppv) -{ - struct strmbase_source *This = impl_source_from_IPin(iface); - - TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppv); - - *ppv = NULL; - - if (IsEqualIID(riid, &IID_IUnknown)) - *ppv = iface; - else if (IsEqualIID(riid, &IID_IPin)) - *ppv = iface; - else if (IsEqualIID(riid, &IID_IMediaSeeking) || - IsEqualIID(riid, &IID_IQualityControl)) - { - return IBaseFilter_QueryInterface(&This->pin.filter->IBaseFilter_iface, riid, ppv); - } - - if (*ppv) - { - IUnknown_AddRef((IUnknown *)(*ppv)); - return S_OK; - } - - FIXME("No interface for %s!\n", debugstr_guid(riid)); - - return E_NOINTERFACE; -} - HRESULT WINAPI BaseOutputPinImpl_Connect(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt) { HRESULT hr; @@ -758,36 +729,6 @@ static inline BaseInputPin *impl_BaseInputPin_from_IPin( IPin *iface ) return CONTAINING_RECORD(iface, BaseInputPin, pin.IPin_iface); }
-HRESULT WINAPI BaseInputPinImpl_QueryInterface(IPin * iface, REFIID riid, LPVOID * ppv) -{ - BaseInputPin *This = impl_BaseInputPin_from_IPin(iface); - - TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); - - *ppv = NULL; - - if (IsEqualIID(riid, &IID_IUnknown)) - *ppv = iface; - else if (IsEqualIID(riid, &IID_IPin)) - *ppv = iface; - else if (IsEqualIID(riid, &IID_IMemInputPin)) - *ppv = &This->IMemInputPin_iface; - else if (IsEqualIID(riid, &IID_IMediaSeeking)) - { - return IBaseFilter_QueryInterface(&This->pin.filter->IBaseFilter_iface, &IID_IMediaSeeking, ppv); - } - - if (*ppv) - { - IUnknown_AddRef((IUnknown *)(*ppv)); - return S_OK; - } - - FIXME("No interface for %s!\n", debugstr_guid(riid)); - - return E_NOINTERFACE; -} - HRESULT WINAPI BaseInputPinImpl_Connect(IPin *iface, IPin *pin, const AM_MEDIA_TYPE *pmt) { ERR("(%p)->(%p, %p) outgoing connection on an input pin!\n", iface, pin, pmt); diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index 5ee13c8892e..85c5486f6b4 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -113,7 +113,6 @@ HRESULT WINAPI BasePinImpl_QueryInternalConnections(IPin * iface, IPin ** apPin, HRESULT WINAPI BasePinImpl_NewSegment(IPin * iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
/* Base Output Pin */ -HRESULT WINAPI BaseOutputPinImpl_QueryInterface(IPin * iface, REFIID riid, LPVOID * ppv); HRESULT WINAPI BaseOutputPinImpl_Connect(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt); HRESULT WINAPI BaseOutputPinImpl_ReceiveConnection(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt); HRESULT WINAPI BaseOutputPinImpl_Disconnect(IPin * iface); @@ -135,7 +134,6 @@ void strmbase_source_init(struct strmbase_source *pin, const IPinVtbl *vtbl, str const WCHAR *name, const struct strmbase_source_ops *func_table);
/* Base Input Pin */ -HRESULT WINAPI BaseInputPinImpl_QueryInterface(IPin * iface, REFIID riid, LPVOID * ppv); HRESULT WINAPI BaseInputPinImpl_Connect(IPin * iface, IPin * pConnector, const AM_MEDIA_TYPE * pmt); HRESULT WINAPI BaseInputPinImpl_ReceiveConnection(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt); HRESULT WINAPI BaseInputPinImpl_QueryAccept(IPin * iface, const AM_MEDIA_TYPE * pmt);