Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/evr/mixer.c | 76 ++++++++++++++++++++++++++++++++++++++++++++ dlls/evr/tests/evr.c | 4 +++ 2 files changed, 80 insertions(+)
diff --git a/dlls/evr/mixer.c b/dlls/evr/mixer.c index 9227e6a1777..4ada26d074f 100644 --- a/dlls/evr/mixer.c +++ b/dlls/evr/mixer.c @@ -61,6 +61,7 @@ struct video_mixer IMFVideoPositionMapper IMFVideoPositionMapper_iface; IMFVideoProcessor IMFVideoProcessor_iface; IMFAttributes IMFAttributes_iface; + IMFQualityAdvise IMFQualityAdvise_iface; IUnknown IUnknown_inner; IUnknown *outer_unk; LONG refcount; @@ -129,6 +130,11 @@ static struct video_mixer *impl_from_IMFAttributes(IMFAttributes *iface) return CONTAINING_RECORD(iface, struct video_mixer, IMFAttributes_iface); }
+static struct video_mixer *impl_from_IMFQualityAdvise(IMFQualityAdvise *iface) +{ + return CONTAINING_RECORD(iface, struct video_mixer, IMFQualityAdvise_iface); +} + static int video_mixer_compare_input_id(const void *a, const void *b) { const unsigned int *key = a; @@ -217,6 +223,10 @@ static HRESULT WINAPI video_mixer_inner_QueryInterface(IUnknown *iface, REFIID r { *obj = &mixer->IMFAttributes_iface; } + else if (IsEqualIID(riid, &IID_IMFQualityAdvise)) + { + *obj = &mixer->IMFQualityAdvise_iface; + } else { WARN("Unsupported interface %s.\n", debugstr_guid(riid)); @@ -1685,6 +1695,71 @@ static const IMFAttributesVtbl video_mixer_attributes_vtbl = video_mixer_attributes_CopyAllItems };
+static HRESULT WINAPI video_mixer_quality_advise_QueryInterface(IMFQualityAdvise *iface, REFIID riid, void **out) +{ + struct video_mixer *mixer = impl_from_IMFQualityAdvise(iface); + return IMFTransform_QueryInterface(&mixer->IMFTransform_iface, riid, out); +} + +static ULONG WINAPI video_mixer_quality_advise_AddRef(IMFQualityAdvise *iface) +{ + struct video_mixer *mixer = impl_from_IMFQualityAdvise(iface); + return IMFTransform_AddRef(&mixer->IMFTransform_iface); +} + +static ULONG WINAPI video_mixer_quality_Release(IMFQualityAdvise *iface) +{ + struct video_mixer *mixer = impl_from_IMFQualityAdvise(iface); + return IMFTransform_Release(&mixer->IMFTransform_iface); +} + +static HRESULT WINAPI video_mixer_quality_advise_SetDropMode(IMFQualityAdvise *iface, MF_QUALITY_DROP_MODE mode) +{ + FIXME("%p, %u.\n", iface, mode); + + return E_NOTIMPL; +} + +static HRESULT WINAPI video_mixer_quality_advise_SetQualityLevel(IMFQualityAdvise *iface, MF_QUALITY_LEVEL level) +{ + FIXME("%p, %u.\n", iface, level); + + return E_NOTIMPL; +} + +static HRESULT WINAPI video_mixer_quality_advise_GetDropMode(IMFQualityAdvise *iface, MF_QUALITY_DROP_MODE *mode) +{ + FIXME("%p, %p.\n", iface, mode); + + return E_NOTIMPL; +} + +static HRESULT WINAPI video_mixer_quality_advise_GetQualityLevel(IMFQualityAdvise *iface, MF_QUALITY_LEVEL *level) +{ + FIXME("%p, %p.\n", iface, level); + + return E_NOTIMPL; +} + +static HRESULT WINAPI video_mixer_quality_advise_DropTime(IMFQualityAdvise *iface, LONGLONG interval) +{ + FIXME("%p, %s.\n", iface, wine_dbgstr_longlong(interval)); + + return E_NOTIMPL; +} + +static const IMFQualityAdviseVtbl video_mixer_quality_advise_vtbl = +{ + video_mixer_quality_advise_QueryInterface, + video_mixer_quality_advise_AddRef, + video_mixer_quality_Release, + video_mixer_quality_advise_SetDropMode, + video_mixer_quality_advise_SetQualityLevel, + video_mixer_quality_advise_GetDropMode, + video_mixer_quality_advise_GetQualityLevel, + video_mixer_quality_advise_DropTime, +}; + HRESULT WINAPI MFCreateVideoMixer(IUnknown *owner, REFIID riid_device, REFIID riid, void **obj) { TRACE("%p, %s, %s, %p.\n", owner, debugstr_guid(riid_device), debugstr_guid(riid), obj); @@ -1715,6 +1790,7 @@ HRESULT evr_mixer_create(IUnknown *outer, void **out) object->IMFVideoPositionMapper_iface.lpVtbl = &video_mixer_position_mapper_vtbl; object->IMFVideoProcessor_iface.lpVtbl = &video_mixer_processor_vtbl; object->IMFAttributes_iface.lpVtbl = &video_mixer_attributes_vtbl; + object->IMFQualityAdvise_iface.lpVtbl = &video_mixer_quality_advise_vtbl; object->IUnknown_inner.lpVtbl = &video_mixer_inner_vtbl; object->outer_unk = outer ? outer : &object->IUnknown_inner; object->refcount = 1; diff --git a/dlls/evr/tests/evr.c b/dlls/evr/tests/evr.c index e6f6251be60..7fa28e75229 100644 --- a/dlls/evr/tests/evr.c +++ b/dlls/evr/tests/evr.c @@ -438,6 +438,10 @@ static void test_default_mixer(void) hr = MFCreateVideoMixer(NULL, &IID_IDirect3DDevice9, &IID_IMFTransform, (void **)&transform); ok(hr == S_OK, "Failed to create default mixer, hr %#x.\n", hr);
+ hr = IMFTransform_QueryInterface(transform, &IID_IMFQualityAdvise, (void **)&unk); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + IUnknown_Release(unk); + hr = IMFTransform_QueryInterface(transform, &IID_IMFTopologyServiceLookupClient, (void **)&unk); ok(hr == S_OK, "Unexpected hr %#x.\n", hr); IUnknown_Release(unk);