evr/presenter: Add IQualProp 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:31 +03:00 committed by Alexandre Julliard
parent 0824d408ba
commit e19938f9db
2 changed files with 88 additions and 0 deletions

View file

@ -66,6 +66,7 @@ struct video_presenter
IMFRateSupport IMFRateSupport_iface;
IMFGetService IMFGetService_iface;
IMFVideoPositionMapper IMFVideoPositionMapper_iface;
IQualProp IQualProp_iface;
IMFVideoSampleAllocatorNotify allocator_cb;
IUnknown IUnknown_inner;
IUnknown *outer_unk;
@ -137,6 +138,11 @@ static struct video_presenter *impl_from_IMFVideoSampleAllocatorNotify(IMFVideoS
return CONTAINING_RECORD(iface, struct video_presenter, allocator_cb);
}
static struct video_presenter *impl_from_IQualProp(IQualProp *iface)
{
return CONTAINING_RECORD(iface, struct video_presenter, IQualProp_iface);
}
static void video_presenter_notify_renderer(struct video_presenter *presenter,
LONG event, LONG_PTR param1, LONG_PTR param2)
{
@ -444,6 +450,10 @@ static HRESULT WINAPI video_presenter_inner_QueryInterface(IUnknown *iface, REFI
{
*obj = &presenter->IMFVideoPositionMapper_iface;
}
else if (IsEqualIID(riid, &IID_IQualProp))
{
*obj = &presenter->IQualProp_iface;
}
else
{
WARN("Unimplemented interface %s.\n", debugstr_guid(riid));
@ -1285,6 +1295,79 @@ static const IMFVideoSampleAllocatorNotifyVtbl video_presenter_allocator_cb_vtbl
video_presenter_allocator_cb_NotifyRelease,
};
static HRESULT WINAPI video_presenter_qualprop_QueryInterface(IQualProp *iface, REFIID riid, void **obj)
{
struct video_presenter *presenter = impl_from_IQualProp(iface);
return IMFVideoPresenter_QueryInterface(&presenter->IMFVideoPresenter_iface, riid, obj);
}
static ULONG WINAPI video_presenter_qualprop_AddRef(IQualProp *iface)
{
struct video_presenter *presenter = impl_from_IQualProp(iface);
return IMFVideoPresenter_AddRef(&presenter->IMFVideoPresenter_iface);
}
static ULONG WINAPI video_presenter_qualprop_Release(IQualProp *iface)
{
struct video_presenter *presenter = impl_from_IQualProp(iface);
return IMFVideoPresenter_Release(&presenter->IMFVideoPresenter_iface);
}
static HRESULT WINAPI video_presenter_qualprop_get_FramesDroppedInRenderer(IQualProp *iface, int *frames)
{
FIXME("%p, %p stub.\n", iface, frames);
return E_NOTIMPL;
}
static HRESULT WINAPI video_presenter_qualprop_get_FramesDrawn(IQualProp *iface, int *frames)
{
FIXME("%p, %p stub.\n", iface, frames);
return E_NOTIMPL;
}
static HRESULT WINAPI video_presenter_qualprop_get_AvgFrameRate(IQualProp *iface, int *avg_frame_rate)
{
FIXME("%p, %p stub.\n", iface, avg_frame_rate);
return E_NOTIMPL;
}
static HRESULT WINAPI video_presenter_qualprop_get_Jitter(IQualProp *iface, int *jitter)
{
FIXME("%p, %p stub.\n", iface, jitter);
return E_NOTIMPL;
}
static HRESULT WINAPI video_presenter_qualprop_get_AvgSyncOffset(IQualProp *iface, int *offset)
{
FIXME("%p, %p stub.\n", iface, offset);
return E_NOTIMPL;
}
static HRESULT WINAPI video_presenter_qualprop_get_DevSyncOffset(IQualProp *iface, int *devoffset)
{
FIXME("%p, %p stub.\n", iface, devoffset);
return E_NOTIMPL;
}
static const IQualPropVtbl video_presenter_qualprop_vtbl =
{
video_presenter_qualprop_QueryInterface,
video_presenter_qualprop_AddRef,
video_presenter_qualprop_Release,
video_presenter_qualprop_get_FramesDroppedInRenderer,
video_presenter_qualprop_get_FramesDrawn,
video_presenter_qualprop_get_AvgFrameRate,
video_presenter_qualprop_get_Jitter,
video_presenter_qualprop_get_AvgSyncOffset,
video_presenter_qualprop_get_DevSyncOffset,
};
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);
@ -1353,6 +1436,7 @@ HRESULT evr_presenter_create(IUnknown *outer, void **out)
object->IMFRateSupport_iface.lpVtbl = &video_presenter_rate_support_vtbl;
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->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

@ -1122,6 +1122,10 @@ 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);