Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qedit/tests/nullrenderer.c | 2 +- dlls/quartz/tests/dsoundrender.c | 2 +- dlls/quartz/tests/videorenderer.c | 2 +- dlls/quartz/tests/vmr7.c | 6 ++-- dlls/quartz/tests/vmr9.c | 6 ++-- dlls/strmbase/pin.c | 4 +-- dlls/strmbase/renderer.c | 16 ++++++++- dlls/strmbase/transform.c | 55 ++++++++++++++++++------------- 8 files changed, 58 insertions(+), 35 deletions(-)
diff --git a/dlls/qedit/tests/nullrenderer.c b/dlls/qedit/tests/nullrenderer.c index 45a0af16184..ab4cf54fa58 100644 --- a/dlls/qedit/tests/nullrenderer.c +++ b/dlls/qedit/tests/nullrenderer.c @@ -88,7 +88,7 @@ static void test_interfaces(void)
check_interface(pin, &IID_IKsPropertySet, FALSE); check_interface(pin, &IID_IMediaPosition, FALSE); - todo_wine check_interface(pin, &IID_IMediaSeeking, FALSE); + check_interface(pin, &IID_IMediaSeeking, FALSE);
IPin_Release(pin); ref = IBaseFilter_Release(filter); diff --git a/dlls/quartz/tests/dsoundrender.c b/dlls/quartz/tests/dsoundrender.c index ecf4a46facd..8b7a1a52364 100644 --- a/dlls/quartz/tests/dsoundrender.c +++ b/dlls/quartz/tests/dsoundrender.c @@ -161,7 +161,7 @@ static void test_interfaces(void)
check_interface(pin, &IID_IAsyncReader, FALSE); check_interface(pin, &IID_IMediaPosition, FALSE); - todo_wine check_interface(pin, &IID_IMediaSeeking, FALSE); + check_interface(pin, &IID_IMediaSeeking, FALSE);
IPin_Release(pin); IBaseFilter_Release(filter); diff --git a/dlls/quartz/tests/videorenderer.c b/dlls/quartz/tests/videorenderer.c index 9e5c8eb281f..985154f238b 100644 --- a/dlls/quartz/tests/videorenderer.c +++ b/dlls/quartz/tests/videorenderer.c @@ -93,7 +93,7 @@ static void test_interfaces(void)
check_interface(pin, &IID_IAsyncReader, FALSE); check_interface(pin, &IID_IMediaPosition, FALSE); - todo_wine check_interface(pin, &IID_IMediaSeeking, FALSE); + check_interface(pin, &IID_IMediaSeeking, FALSE);
IPin_Release(pin); IBaseFilter_Release(filter); diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c index 81b42243b88..f9ca8930f30 100644 --- a/dlls/quartz/tests/vmr7.c +++ b/dlls/quartz/tests/vmr7.c @@ -239,7 +239,7 @@ static void test_interfaces(void)
check_interface(pin, &IID_IKsPropertySet, FALSE); check_interface(pin, &IID_IMediaPosition, FALSE); - todo_wine check_interface(pin, &IID_IMediaSeeking, FALSE); + check_interface(pin, &IID_IMediaSeeking, FALSE);
IPin_Release(pin);
@@ -269,7 +269,7 @@ static void test_interfaces(void)
check_interface(pin, &IID_IKsPropertySet, FALSE); check_interface(pin, &IID_IMediaPosition, FALSE); - todo_wine check_interface(pin, &IID_IMediaSeeking, FALSE); + check_interface(pin, &IID_IMediaSeeking, FALSE);
IPin_Release(pin);
@@ -298,7 +298,7 @@ static void test_interfaces(void)
check_interface(pin, &IID_IKsPropertySet, FALSE); check_interface(pin, &IID_IMediaPosition, FALSE); - todo_wine check_interface(pin, &IID_IMediaSeeking, FALSE); + check_interface(pin, &IID_IMediaSeeking, FALSE);
IPin_Release(pin);
diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index 8d07522ab06..f4a3017d3f7 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -232,7 +232,7 @@ static void test_interfaces(void)
check_interface(pin, &IID_IKsPropertySet, FALSE); check_interface(pin, &IID_IMediaPosition, FALSE); - todo_wine check_interface(pin, &IID_IMediaSeeking, FALSE); + check_interface(pin, &IID_IMediaSeeking, FALSE);
IPin_Release(pin);
@@ -262,7 +262,7 @@ static void test_interfaces(void)
check_interface(pin, &IID_IKsPropertySet, FALSE); check_interface(pin, &IID_IMediaPosition, FALSE); - todo_wine check_interface(pin, &IID_IMediaSeeking, FALSE); + check_interface(pin, &IID_IMediaSeeking, FALSE);
IPin_Release(pin);
@@ -291,7 +291,7 @@ static void test_interfaces(void)
check_interface(pin, &IID_IKsPropertySet, FALSE); check_interface(pin, &IID_IMediaPosition, FALSE); - todo_wine check_interface(pin, &IID_IMediaSeeking, FALSE); + check_interface(pin, &IID_IMediaSeeking, FALSE);
IPin_Release(pin);
diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c index d85d767bf52..1dbfee07a6c 100644 --- a/dlls/strmbase/pin.c +++ b/dlls/strmbase/pin.c @@ -157,7 +157,7 @@ HRESULT strmbase_pin_get_media_type(struct strmbase_pin *iface, unsigned int ind return VFW_S_NO_MORE_ITEMS; }
-HRESULT WINAPI BasePinImpl_QueryInterface(IPin *iface) +HRESULT WINAPI BasePinImpl_QueryInterface(IPin *iface, REFIID iid, void **out) { struct strmbase_pin *pin = impl_from_IPin(iface); HRESULT hr; @@ -167,7 +167,7 @@ HRESULT WINAPI BasePinImpl_QueryInterface(IPin *iface) *out = NULL;
if (pin->pFuncsTable->pin_query_interface - && SUCCEEDED(hr = pin->pFuncsTable->pin_query_interface(filter, iid, out))) + && SUCCEEDED(hr = pin->pFuncsTable->pin_query_interface(pin, iid, out))) return hr;
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IPin)) diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c index c8a6249227c..5634ab1905b 100644 --- a/dlls/strmbase/renderer.c +++ b/dlls/strmbase/renderer.c @@ -147,7 +147,7 @@ static HRESULT WINAPI BaseRenderer_InputPin_EndFlush(IPin * iface)
static const IPinVtbl BaseRenderer_InputPin_Vtbl = { - BaseInputPinImpl_QueryInterface, + BasePinImpl_QueryInterface, BasePinImpl_AddRef, BasePinImpl_Release, BaseInputPinImpl_Connect, @@ -217,6 +217,19 @@ static HRESULT sink_query_accept(struct strmbase_pin *pin, const AM_MEDIA_TYPE * return filter->pFuncsTable->pfnCheckMediaType(filter, mt); }
+static HRESULT sink_query_interface(struct strmbase_pin *iface, REFIID iid, void **out) +{ + BaseRenderer *filter = impl_from_IPin(&iface->IPin_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 BaseRenderer_Receive(BaseInputPin *pin, IMediaSample *sample) { BaseRenderer *filter = impl_from_IPin(&pin->pin.IPin_iface); @@ -226,6 +239,7 @@ static HRESULT WINAPI BaseRenderer_Receive(BaseInputPin *pin, IMediaSample *samp static const BaseInputPinFuncTable input_BaseInputFuncTable = { .base.pin_query_accept = sink_query_accept, + .base.pin_query_interface = sink_query_interface, .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 fa041b66bd2..04acf63c9a5 100644 --- a/dlls/strmbase/transform.c +++ b/dlls/strmbase/transform.c @@ -161,17 +161,47 @@ static const struct strmbase_filter_ops filter_ops = .filter_destroy = transform_destroy, };
+static HRESULT sink_query_interface(struct strmbase_pin *iface, REFIID iid, void **out) +{ + TransformFilter *filter = impl_from_sink_IPin(&iface->IPin_iface); + + if (IsEqualGUID(iid, &IID_IMemInputPin)) + *out = &filter->sink.IMemInputPin_iface; + else + return E_NOINTERFACE; + + IUnknown_AddRef((IUnknown *)*out); + return S_OK; +} + static const BaseInputPinFuncTable tf_input_BaseInputFuncTable = { .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 = TransformFilter_Input_Receive, };
+static HRESULT source_query_interface(struct strmbase_pin *iface, REFIID iid, void **out) +{ + TransformFilter *filter = impl_from_source_IPin(&iface->IPin_iface); + + if (IsEqualGUID(iid, &IID_IQualityControl)) + *out = &filter->qcimpl->IQualityControl_iface; + else if (IsEqualGUID(iid, &IID_IMediaSeeking)) + return IUnknown_QueryInterface(filter->seekthru_unk, iid, out); + else + return E_NOINTERFACE; + + IUnknown_AddRef((IUnknown *)*out); + return S_OK; +} + 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 = TransformFilter_Output_DecideBufferSize, .pfnDecideAllocator = BaseOutputPinImpl_DecideAllocator, @@ -439,7 +469,7 @@ static HRESULT WINAPI TransformFilter_InputPin_NewSegment(IPin * iface, REFERENC
static const IPinVtbl TransformFilter_InputPin_Vtbl = { - BaseInputPinImpl_QueryInterface, + BasePinImpl_QueryInterface, BasePinImpl_AddRef, BasePinImpl_Release, BaseInputPinImpl_Connect, @@ -459,30 +489,9 @@ static const IPinVtbl TransformFilter_InputPin_Vtbl = TransformFilter_InputPin_NewSegment };
-static HRESULT WINAPI transform_source_QueryInterface(IPin *iface, REFIID iid, void **out) -{ - TransformFilter *filter = impl_from_source_IPin(iface); - - if (IsEqualGUID(iid, &IID_IUnknown) || IsEqualGUID(iid, &IID_IPin)) - *out = iface; - else if (IsEqualGUID(iid, &IID_IQualityControl)) - *out = &filter->qcimpl->IQualityControl_iface; - else if (IsEqualGUID(iid, &IID_IMediaSeeking)) - return IUnknown_QueryInterface(filter->seekthru_unk, iid, out); - else - { - WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); - *out = NULL; - return E_NOINTERFACE; - } - - IUnknown_AddRef((IUnknown *)*out); - return S_OK; -} - static const IPinVtbl TransformFilter_OutputPin_Vtbl = { - transform_source_QueryInterface, + BasePinImpl_QueryInterface, BasePinImpl_AddRef, BasePinImpl_Release, BaseOutputPinImpl_Connect,