mf/evr: Add IMFGetService 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-07-08 18:10:35 +03:00 committed by Alexandre Julliard
parent 115ac28399
commit f557a5ee56
2 changed files with 49 additions and 0 deletions

View File

@ -36,6 +36,7 @@ struct video_renderer
IMFVideoRenderer IMFVideoRenderer_iface;
IMFClockStateSink IMFClockStateSink_iface;
IMFMediaEventGenerator IMFMediaEventGenerator_iface;
IMFGetService IMFGetService_iface;
LONG refcount;
IMFMediaEventQueue *event_queue;
@ -70,6 +71,11 @@ static struct video_renderer *impl_from_IMFClockStateSink(IMFClockStateSink *ifa
return CONTAINING_RECORD(iface, struct video_renderer, IMFClockStateSink_iface);
}
static struct video_renderer *impl_from_IMFGetService(IMFGetService *iface)
{
return CONTAINING_RECORD(iface, struct video_renderer, IMFGetService_iface);
}
static HRESULT WINAPI video_renderer_sink_QueryInterface(IMFMediaSink *iface, REFIID riid, void **obj)
{
struct video_renderer *renderer = impl_from_IMFMediaSink(iface);
@ -97,6 +103,10 @@ static HRESULT WINAPI video_renderer_sink_QueryInterface(IMFMediaSink *iface, RE
{
*obj = &renderer->IMFClockStateSink_iface;
}
else if (IsEqualIID(riid, &IID_IMFGetService))
{
*obj = &renderer->IMFGetService_iface;
}
else
{
WARN("Unsupported interface %s.\n", debugstr_guid(riid));
@ -438,6 +448,39 @@ static const IMFClockStateSinkVtbl video_renderer_clock_sink_vtbl =
video_renderer_clock_sink_OnClockSetRate,
};
static HRESULT WINAPI video_renderer_get_service_QueryInterface(IMFGetService *iface, REFIID riid, void **obj)
{
struct video_renderer *renderer = impl_from_IMFGetService(iface);
return IMFMediaSink_QueryInterface(&renderer->IMFMediaSink_iface, riid, obj);
}
static ULONG WINAPI video_renderer_get_service_AddRef(IMFGetService *iface)
{
struct video_renderer *renderer = impl_from_IMFGetService(iface);
return IMFMediaSink_AddRef(&renderer->IMFMediaSink_iface);
}
static ULONG WINAPI video_renderer_get_service_Release(IMFGetService *iface)
{
struct video_renderer *renderer = impl_from_IMFGetService(iface);
return IMFMediaSink_Release(&renderer->IMFMediaSink_iface);
}
static HRESULT WINAPI video_renderer_get_service_GetService(IMFGetService *iface, REFGUID service, REFIID riid, void **obj)
{
FIXME("%p, %s, %s, %p.\n", iface, debugstr_guid(service), debugstr_guid(riid), obj);
return E_NOTIMPL;
}
static const IMFGetServiceVtbl video_renderer_get_service_vtbl =
{
video_renderer_get_service_QueryInterface,
video_renderer_get_service_AddRef,
video_renderer_get_service_Release,
video_renderer_get_service_GetService,
};
static HRESULT video_renderer_create_mixer(IMFAttributes *attributes, IMFTransform **out)
{
unsigned int flags = 0;
@ -499,6 +542,7 @@ static HRESULT evr_create_object(IMFAttributes *attributes, void *user_context,
object->IMFVideoRenderer_iface.lpVtbl = &video_renderer_vtbl;
object->IMFMediaEventGenerator_iface.lpVtbl = &video_renderer_events_vtbl;
object->IMFClockStateSink_iface.lpVtbl = &video_renderer_clock_sink_vtbl;
object->IMFGetService_iface.lpVtbl = &video_renderer_get_service_vtbl;
object->refcount = 1;
InitializeCriticalSection(&object->cs);

View File

@ -3234,6 +3234,7 @@ static void test_evr(void)
IMFMediaSink *sink, *sink2;
IMFActivate *activate;
DWORD flags, count;
IMFGetService *gs;
UINT64 value;
HRESULT hr;
@ -3277,6 +3278,10 @@ static void test_evr(void)
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
IMFClockStateSink_Release(clock_sink);
hr = IMFMediaSink_QueryInterface(sink, &IID_IMFGetService, (void **)&gs);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
IMFGetService_Release(gs);
hr = IMFActivate_ShutdownObject(activate);
ok(hr == S_OK, "Failed to shut down, hr %#x.\n", hr);