Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/evr/evr.spec | 2 +- dlls/evr/main.c | 28 ++++++++++++++++++++++++++++ dlls/evr/tests/evr.c | 13 +++++++++++++ include/evr.idl | 3 ++- 4 files changed, 44 insertions(+), 2 deletions(-)
diff --git a/dlls/evr/evr.spec b/dlls/evr/evr.spec index e46cb04f644..73cbf05b461 100644 --- a/dlls/evr/evr.spec +++ b/dlls/evr/evr.spec @@ -14,7 +14,7 @@ @ stub MFCreateVideoMediaTypeFromVideoInfoHeader2 @ stub MFCreateVideoMediaTypeFromVideoInfoHeader @ stdcall MFCreateVideoMixer(ptr ptr ptr ptr) -@ stub MFCreateVideoMixerAndPresenter +@ stdcall MFCreateVideoMixerAndPresenter(ptr ptr ptr ptr ptr ptr) @ stub MFCreateVideoOTA @ stub MFCreateVideoPresenter2 @ stdcall MFCreateVideoPresenter(ptr ptr ptr ptr) diff --git a/dlls/evr/main.c b/dlls/evr/main.c index 2c6db8430ba..301330a51e2 100644 --- a/dlls/evr/main.c +++ b/dlls/evr/main.c @@ -196,3 +196,31 @@ HRESULT WINAPI DllUnregisterServer(void) { return __wine_unregister_resources(instance_evr); } + +HRESULT WINAPI MFCreateVideoMixerAndPresenter(IUnknown *mixer_outer, IUnknown *presenter_outer, + REFIID riid_mixer, void **mixer, REFIID riid_presenter, void **presenter) +{ + HRESULT hr; + + TRACE("%p, %p, %s, %p, %s, %p.\n", mixer_outer, presenter_outer, debugstr_guid(riid_mixer), mixer, + debugstr_guid(riid_presenter), presenter); + + if (!mixer || !presenter) + return E_POINTER; + + *mixer = *presenter = NULL; + + if (SUCCEEDED(hr = CoCreateInstance(&CLSID_MFVideoMixer9, mixer_outer, CLSCTX_INPROC_SERVER, riid_mixer, mixer))) + hr = CoCreateInstance(&CLSID_MFVideoPresenter9, presenter_outer, CLSCTX_INPROC_SERVER, riid_presenter, presenter); + + if (FAILED(hr)) + { + if (*mixer) + IUnknown_Release((IUnknown *)*mixer); + if (*presenter) + IUnknown_Release((IUnknown *)*presenter); + *mixer = *presenter = NULL; + } + + return hr; +} diff --git a/dlls/evr/tests/evr.c b/dlls/evr/tests/evr.c index 1046e70312d..b9f86eb2529 100644 --- a/dlls/evr/tests/evr.c +++ b/dlls/evr/tests/evr.c @@ -950,6 +950,18 @@ static void test_default_presenter(void) IMFVideoPresenter_Release(presenter); }
+static void test_MFCreateVideoMixerAndPresenter(void) +{ + IUnknown *mixer, *presenter; + HRESULT hr; + + hr = MFCreateVideoMixerAndPresenter(NULL, NULL, &IID_IUnknown, (void **)&mixer, &IID_IUnknown, (void **)&presenter); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + + IUnknown_Release(mixer); + IUnknown_Release(presenter); +} + START_TEST(evr) { CoInitialize(NULL); @@ -965,6 +977,7 @@ START_TEST(evr) test_default_mixer_type_negotiation(); test_surface_sample(); test_default_presenter(); + test_MFCreateVideoMixerAndPresenter();
CoUninitialize(); } diff --git a/include/evr.idl b/include/evr.idl index 384a051944c..8628e111a31 100644 --- a/include/evr.idl +++ b/include/evr.idl @@ -299,7 +299,8 @@ cpp_quote("DEFINE_GUID(MR_VIDEO_MIXER_SERVICE, 0x073cd2fc, 0x6cf4, 0x40b7, 0x88, cpp_quote("DEFINE_GUID(MR_VIDEO_ACCELERATION_SERVICE, 0xefef5175, 0x5c7d, 0x4ce2, 0xbb, 0xbd, 0x34, 0xff, 0x8b, 0xca, 0x65, 0x54);") cpp_quote("DEFINE_GUID(MR_BUFFER_SERVICE, 0xa562248c, 0x9ac6, 0x4ffc, 0x9f, 0xba, 0x3a, 0xf8, 0xf8, 0xad, 0x1a, 0x4d);") cpp_quote("DEFINE_GUID(VIDEO_ZOOM_RECT, 0x7aaa1638, 0x1b7f, 0x4c93, 0xbd, 0x89, 0x5b, 0x9c, 0x9f, 0xb6, 0xfc, 0xf0);") - cpp_quote("HRESULT WINAPI MFCreateVideoMixer(IUnknown *owner, REFIID riid_device, REFIID riid, void **obj);") +cpp_quote("HRESULT WINAPI MFCreateVideoMixerAndPresenter(IUnknown *mixer_outer, IUnknown *presenter_outer, ") +cpp_quote(" REFIID riid_mixer, void **mixer, REFIID riid_presenter, void **presenter);") cpp_quote("HRESULT WINAPI MFCreateVideoPresenter(IUnknown *owner, REFIID riid_device, REFIID riid, void **obj);") cpp_quote("HRESULT WINAPI MFCreateVideoSampleFromSurface(IUnknown *surface, IMFSample **sample);")