evr/presenter: Add IMFQualityAdvise stub.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2020-11-13 15:31:33 +03:00 committed by Alexandre Julliard
parent 02d982de38
commit b6c01ee2f8
2 changed files with 100 additions and 42 deletions

View File

@ -67,6 +67,7 @@ struct video_presenter
IMFGetService IMFGetService_iface;
IMFVideoPositionMapper IMFVideoPositionMapper_iface;
IQualProp IQualProp_iface;
IMFQualityAdvise IMFQualityAdvise_iface;
IMFVideoSampleAllocatorNotify allocator_cb;
IUnknown IUnknown_inner;
IUnknown *outer_unk;
@ -146,6 +147,11 @@ static struct video_presenter *impl_from_IQualProp(IQualProp *iface)
return CONTAINING_RECORD(iface, struct video_presenter, IQualProp_iface);
}
static struct video_presenter *impl_from_IMFQualityAdvise(IMFQualityAdvise *iface)
{
return CONTAINING_RECORD(iface, struct video_presenter, IMFQualityAdvise_iface);
}
static void video_presenter_notify_renderer(struct video_presenter *presenter,
LONG event, LONG_PTR param1, LONG_PTR param2)
{
@ -470,6 +476,10 @@ static HRESULT WINAPI video_presenter_inner_QueryInterface(IUnknown *iface, REFI
{
*obj = &presenter->IQualProp_iface;
}
else if (IsEqualIID(riid, &IID_IMFQualityAdvise))
{
*obj = &presenter->IMFQualityAdvise_iface;
}
else
{
WARN("Unimplemented interface %s.\n", debugstr_guid(riid));
@ -1418,6 +1428,75 @@ static const IQualPropVtbl video_presenter_qualprop_vtbl =
video_presenter_qualprop_get_DevSyncOffset,
};
static HRESULT WINAPI video_presenter_quality_advise_QueryInterface(IMFQualityAdvise *iface, REFIID riid, void **out)
{
struct video_presenter *presenter = impl_from_IMFQualityAdvise(iface);
return IMFVideoPresenter_QueryInterface(&presenter->IMFVideoPresenter_iface, riid, out);
}
static ULONG WINAPI video_presenter_quality_advise_AddRef(IMFQualityAdvise *iface)
{
struct video_presenter *presenter = impl_from_IMFQualityAdvise(iface);
return IMFVideoPresenter_AddRef(&presenter->IMFVideoPresenter_iface);
}
static ULONG WINAPI video_presenter_quality_advise_Release(IMFQualityAdvise *iface)
{
struct video_presenter *presenter = impl_from_IMFQualityAdvise(iface);
return IMFVideoPresenter_Release(&presenter->IMFVideoPresenter_iface);
}
static HRESULT WINAPI video_presenter_quality_advise_SetDropMode(IMFQualityAdvise *iface,
MF_QUALITY_DROP_MODE mode)
{
FIXME("%p, %u.\n", iface, mode);
return E_NOTIMPL;
}
static HRESULT WINAPI video_presenter_quality_advise_SetQualityLevel(IMFQualityAdvise *iface,
MF_QUALITY_LEVEL level)
{
FIXME("%p, %u.\n", iface, level);
return E_NOTIMPL;
}
static HRESULT WINAPI video_presenter_quality_advise_GetDropMode(IMFQualityAdvise *iface,
MF_QUALITY_DROP_MODE *mode)
{
FIXME("%p, %p.\n", iface, mode);
return E_NOTIMPL;
}
static HRESULT WINAPI video_presenter_quality_advise_GetQualityLevel(IMFQualityAdvise *iface,
MF_QUALITY_LEVEL *level)
{
FIXME("%p, %p.\n", iface, level);
return E_NOTIMPL;
}
static HRESULT WINAPI video_presenter_quality_advise_DropTime(IMFQualityAdvise *iface, LONGLONG interval)
{
FIXME("%p, %s.\n", iface, wine_dbgstr_longlong(interval));
return E_NOTIMPL;
}
static const IMFQualityAdviseVtbl video_presenter_quality_advise_vtbl =
{
video_presenter_quality_advise_QueryInterface,
video_presenter_quality_advise_AddRef,
video_presenter_quality_advise_Release,
video_presenter_quality_advise_SetDropMode,
video_presenter_quality_advise_SetQualityLevel,
video_presenter_quality_advise_GetDropMode,
video_presenter_quality_advise_GetQualityLevel,
video_presenter_quality_advise_DropTime,
};
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);
@ -1487,6 +1566,7 @@ HRESULT evr_presenter_create(IUnknown *outer, void **out)
object->IMFGetService_iface.lpVtbl = &video_presenter_getservice_vtbl;
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->allocator_cb.lpVtbl = &video_presenter_allocator_cb_vtbl;
object->IUnknown_inner.lpVtbl = &video_presenter_inner_vtbl;
object->outer_unk = outer ? outer : &object->IUnknown_inner;

View File

@ -461,17 +461,16 @@ 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_IMFClockStateSink, (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);
check_interface(transform, &IID_IMFQualityAdvise, TRUE);
check_interface(transform, &IID_IMFClockStateSink, TRUE);
check_interface(transform, &IID_IMFTopologyServiceLookupClient, TRUE);
check_interface(transform, &IID_IMFGetService, TRUE);
check_interface(transform, &IID_IMFAttributes, TRUE);
check_interface(transform, &IID_IMFVideoMixerBitmap, TRUE);
check_interface(transform, &IID_IMFVideoPositionMapper, TRUE);
check_interface(transform, &IID_IMFVideoProcessor, TRUE);
check_interface(transform, &IID_IMFVideoMixerControl, TRUE);
check_interface(transform, &IID_IMFVideoDeviceID, TRUE);
hr = IMFTransform_QueryInterface(transform, &IID_IMFGetService, (void **)&gs);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
@ -534,22 +533,6 @@ todo_wine
IMFGetService_Release(gs);
hr = IMFTransform_QueryInterface(transform, &IID_IMFVideoMixerBitmap, (void **)&unk);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
IUnknown_Release(unk);
hr = IMFTransform_QueryInterface(transform, &IID_IMFVideoPositionMapper, (void **)&unk);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
IUnknown_Release(unk);
hr = IMFTransform_QueryInterface(transform, &IID_IMFVideoProcessor, (void **)&unk);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
IUnknown_Release(unk);
hr = IMFTransform_QueryInterface(transform, &IID_IMFVideoMixerControl, (void **)&unk);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
IUnknown_Release(unk);
hr = IMFTransform_SetOutputBounds(transform, 100, 10);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
@ -1117,13 +1100,16 @@ static void test_default_presenter(void)
if (FAILED(hr))
return;
hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IQualProp, (void **)&unk);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
IUnknown_Release(unk);
hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IMFVideoPositionMapper, (void **)&unk);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
IUnknown_Release(unk);
check_interface(presenter, &IID_IQualProp, TRUE);
check_interface(presenter, &IID_IMFVideoPositionMapper, TRUE);
check_interface(presenter, &IID_IMFTopologyServiceLookupClient, TRUE);
check_interface(presenter, &IID_IMFVideoDisplayControl, TRUE);
check_interface(presenter, &IID_IMFRateSupport, TRUE);
check_interface(presenter, &IID_IMFGetService, TRUE);
check_interface(presenter, &IID_IMFClockStateSink, TRUE);
check_interface(presenter, &IID_IMFVideoPresenter, TRUE);
check_interface(presenter, &IID_IMFVideoDeviceID, TRUE);
check_interface(presenter, &IID_IMFQualityAdvise, TRUE);
hr = MFGetService((IUnknown *)presenter, &MR_VIDEO_RENDER_SERVICE, &IID_IMFVideoPositionMapper, (void **)&unk);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
@ -1141,14 +1127,6 @@ static void test_default_presenter(void)
IMFVideoDeviceID_Release(deviceid);
hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IMFTopologyServiceLookupClient, (void **)&unk);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
IUnknown_Release(unk);
hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IMFVideoDisplayControl, (void **)&unk);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
IUnknown_Release(unk);
hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IMFGetService, (void **)&gs);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);