Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/evr/presenter.c | 52 ++++++++++++++++++++++++++++++++++++++++++++
dlls/evr/tests/evr.c | 18 ++++++++-------
2 files changed, 62 insertions(+), 8 deletions(-)
diff --git a/dlls/evr/presenter.c b/dlls/evr/presenter.c
index 8d633124db2..4614fa5eed2 100644
--- a/dlls/evr/presenter.c
+++ b/dlls/evr/presenter.c
@@ -79,6 +79,7 @@ struct video_presenter
IMFVideoPositionMapper IMFVideoPositionMapper_iface;
IQualProp IQualProp_iface;
IMFQualityAdvise IMFQualityAdvise_iface;
+ IMFQualityAdviseLimits IMFQualityAdviseLimits_iface;
IDirect3DDeviceManager9 IDirect3DDeviceManager9_iface;
IMFVideoSampleAllocatorNotify allocator_cb;
IUnknown IUnknown_inner;
@@ -166,6 +167,11 @@ static struct video_presenter *impl_from_IMFQualityAdvise(IMFQualityAdvise *ifac
return CONTAINING_RECORD(iface, struct video_presenter, IMFQualityAdvise_iface);
}
+static struct video_presenter *impl_from_IMFQualityAdviseLimits(IMFQualityAdviseLimits *iface)
+{
+ return CONTAINING_RECORD(iface, struct video_presenter, IMFQualityAdviseLimits_iface);
+}
+
static struct video_presenter *impl_from_IDirect3DDeviceManager9(IDirect3DDeviceManager9 *iface)
{
return CONTAINING_RECORD(iface, struct video_presenter, IDirect3DDeviceManager9_iface);
@@ -775,6 +781,10 @@ static HRESULT WINAPI video_presenter_inner_QueryInterface(IUnknown *iface, REFI
{
*obj = &presenter->IMFQualityAdvise_iface;
}
+ else if (IsEqualIID(riid, &IID_IMFQualityAdviseLimits))
+ {
+ *obj = &presenter->IMFQualityAdviseLimits_iface;
+ }
else if (IsEqualIID(riid, &IID_IDirect3DDeviceManager9))
{
*obj = &presenter->IDirect3DDeviceManager9_iface;
@@ -1870,6 +1880,47 @@ static const IDirect3DDeviceManager9Vtbl video_presenter_device_manager_vtbl =
video_presenter_device_manager_GetVideoService,
};
+static HRESULT WINAPI video_presenter_qa_limits_QueryInterface(IMFQualityAdviseLimits *iface, REFIID riid, void **obj)
+{
+ struct video_presenter *presenter = impl_from_IMFQualityAdviseLimits(iface);
+ return IMFVideoPresenter_QueryInterface(&presenter->IMFVideoPresenter_iface, riid, obj);
+}
+
+static ULONG WINAPI video_presenter_qa_limits_AddRef(IMFQualityAdviseLimits *iface)
+{
+ struct video_presenter *presenter = impl_from_IMFQualityAdviseLimits(iface);
+ return IMFVideoPresenter_AddRef(&presenter->IMFVideoPresenter_iface);
+}
+
+static ULONG WINAPI video_presenter_qa_limits_Release(IMFQualityAdviseLimits *iface)
+{
+ struct video_presenter *presenter = impl_from_IMFQualityAdviseLimits(iface);
+ return IMFVideoPresenter_Release(&presenter->IMFVideoPresenter_iface);
+}
+
+static HRESULT WINAPI video_presenter_qa_limits_GetMaximumDropMode(IMFQualityAdviseLimits *iface, MF_QUALITY_DROP_MODE *mode)
+{
+ FIXME("%p, %p.\n", iface, mode);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI video_presenter_qa_limits_GetMinimumQualityLevel(IMFQualityAdviseLimits *iface, MF_QUALITY_LEVEL *level)
+{
+ FIXME("%p, %p.\n", iface, level);
+
+ return E_NOTIMPL;
+}
+
+static const IMFQualityAdviseLimitsVtbl video_presenter_qa_limits_vtbl =
+{
+ video_presenter_qa_limits_QueryInterface,
+ video_presenter_qa_limits_AddRef,
+ video_presenter_qa_limits_Release,
+ video_presenter_qa_limits_GetMaximumDropMode,
+ video_presenter_qa_limits_GetMinimumQualityLevel,
+};
+
HRESULT WINAPI MFCreateVideoPresenter(IUnknown *owner, REFIID riid_device, REFIID riid, void **obj)
{
TRACE("%p, %s, %s, %p.\n", owner, debugstr_guid(riid_device), debugstr_guid(riid), obj);
@@ -1940,6 +1991,7 @@ HRESULT evr_presenter_create(IUnknown *outer, void **out)
object->IMFVideoPositionMapper_iface.lpVtbl = &video_presenter_position_mapper_vtbl;
object->IQualProp_iface.lpVtbl = &video_presenter_qualprop_vtbl;
object->IMFQualityAdvise_iface.lpVtbl = &video_presenter_quality_advise_vtbl;
+ object->IMFQualityAdviseLimits_iface.lpVtbl = &video_presenter_qa_limits_vtbl;
object->allocator_cb.lpVtbl = &video_presenter_allocator_cb_vtbl;
object->IUnknown_inner.lpVtbl = &video_presenter_inner_vtbl;
object->IDirect3DDeviceManager9_iface.lpVtbl = &video_presenter_device_manager_vtbl;
diff --git a/dlls/evr/tests/evr.c b/dlls/evr/tests/evr.c
index 94bf327dd92..fb4a2130f37 100644
--- a/dlls/evr/tests/evr.c
+++ b/dlls/evr/tests/evr.c
@@ -1154,7 +1154,7 @@ static void test_default_presenter(void)
check_interface(presenter, &IID_IMFVideoDeviceID, TRUE);
check_interface(presenter, &IID_IMFQualityAdvise, TRUE);
check_interface(presenter, &IID_IDirect3DDeviceManager9, TRUE);
- todo_wine check_interface(presenter, &IID_IMFQualityAdviseLimits, TRUE);
+ check_interface(presenter, &IID_IMFQualityAdviseLimits, TRUE);
check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFVideoPositionMapper, TRUE);
check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFVideoDisplayControl, TRUE);
check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFVideoPresenter, TRUE);
@@ -1165,7 +1165,7 @@ static void test_default_presenter(void)
check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFGetService, TRUE);
check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFVideoDeviceID, TRUE);
check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFQualityAdvise, TRUE);
- todo_wine check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFQualityAdviseLimits, TRUE);
+ check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFQualityAdviseLimits, TRUE);
check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFTransform, FALSE);
check_service_interface(presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IDirect3DDeviceManager9, TRUE);
check_service_interface(presenter, &MR_VIDEO_ACCELERATION_SERVICE, &IID_IDirect3DDeviceManager9, TRUE);
@@ -2018,30 +2018,32 @@ static void test_presenter_quality_control(void)
ok(hr == S_OK, "Failed to create default presenter, hr %#x.\n", hr);
hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IMFQualityAdviseLimits, (void **)&qa_limits);
-todo_wine
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IMFQualityAdvise, (void **)&advise);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
-if (qa_limits)
-{
hr = IMFQualityAdviseLimits_GetMaximumDropMode(qa_limits, NULL);
+todo_wine
ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
hr = IMFQualityAdviseLimits_GetMaximumDropMode(qa_limits, &mode);
+todo_wine
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- ok(mode == MF_DROP_MODE_NONE, "Unexpected mode %d.\n", mode);
+ if (SUCCEEDED(hr))
+ ok(mode == MF_DROP_MODE_NONE, "Unexpected mode %d.\n", mode);
hr = IMFQualityAdviseLimits_GetMinimumQualityLevel(qa_limits, NULL);
+todo_wine
ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
hr = IMFQualityAdviseLimits_GetMinimumQualityLevel(qa_limits, &level);
+todo_wine
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
- ok(level == MF_QUALITY_NORMAL, "Unexpected level %d.\n", level);
+ if (SUCCEEDED(hr))
+ ok(level == MF_QUALITY_NORMAL, "Unexpected level %d.\n", level);
IMFQualityAdviseLimits_Release(qa_limits);
-}
todo_wine {
mode = 1;
--
2.30.2