From 58f7c7823be66e81b1a212ab8be458185472d2bc Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Wed, 8 Jul 2020 18:10:37 +0300 Subject: [PATCH] mf/evr: Forward mixer service requests to the mixer. Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- dlls/mf/evr.c | 23 +++++++++++++++++++++-- dlls/mf/tests/mf.c | 6 ++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/dlls/mf/evr.c b/dlls/mf/evr.c index ebb3fd4c2c8..8b7de5c76bb 100644 --- a/dlls/mf/evr.c +++ b/dlls/mf/evr.c @@ -468,9 +468,28 @@ static ULONG WINAPI video_renderer_get_service_Release(IMFGetService *iface) static HRESULT WINAPI video_renderer_get_service_GetService(IMFGetService *iface, REFGUID service, REFIID riid, void **obj) { - FIXME("%p, %s, %s, %p.\n", iface, debugstr_guid(service), debugstr_guid(riid), obj); + struct video_renderer *renderer = impl_from_IMFGetService(iface); + HRESULT hr = E_NOINTERFACE; + IMFGetService *gs = NULL; - return E_NOTIMPL; + TRACE("%p, %s, %s, %p.\n", iface, debugstr_guid(service), debugstr_guid(riid), obj); + + if (IsEqualGUID(service, &MR_VIDEO_MIXER_SERVICE)) + { + hr = IMFTransform_QueryInterface(renderer->mixer, &IID_IMFGetService, (void **)&gs); + } + else + { + FIXME("Unsupported service %s.\n", debugstr_guid(service)); + } + + if (gs) + { + hr = IMFGetService_GetService(gs, service, riid, obj); + IMFGetService_Release(gs); + } + + return hr; } static const IMFGetServiceVtbl video_renderer_get_service_vtbl = diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index 3fad309bcf6..aa2c5199b95 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -3235,6 +3235,7 @@ static void test_evr(void) IMFActivate *activate; DWORD flags, count; IMFGetService *gs; + IUnknown *unk; UINT64 value; HRESULT hr; @@ -3280,6 +3281,11 @@ static void test_evr(void) hr = IMFMediaSink_QueryInterface(sink, &IID_IMFGetService, (void **)&gs); ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + + hr = IMFGetService_GetService(gs, &MR_VIDEO_MIXER_SERVICE, &IID_IMFVideoMixerControl, (void **)&unk); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + IUnknown_Release(unk); + IMFGetService_Release(gs); hr = IMFActivate_ShutdownObject(activate);