mf/evr: Return current clock for MR_VIDEO_RENDER_SERVICE requests.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2021-04-16 16:54:56 +03:00 committed by Alexandre Julliard
parent 55110df7eb
commit 0e43ee2746
2 changed files with 40 additions and 3 deletions

View File

@ -2068,6 +2068,13 @@ static HRESULT WINAPI video_renderer_service_lookup_LookupService(IMFTopologySer
*objects = &renderer->IMediaEventSink_iface;
IUnknown_AddRef((IUnknown *)*objects);
}
else if (IsEqualIID(riid, &IID_IMFClock))
{
*objects = renderer->clock;
if (*objects)
IUnknown_AddRef((IUnknown *)*objects);
hr = *objects ? S_OK : E_NOINTERFACE;
}
else
{
FIXME("Unsupported interface %s for render service.\n", debugstr_guid(riid));

View File

@ -4212,9 +4212,11 @@ static void test_evr(void)
IMFStreamSink *stream_sink, *stream_sink2;
IMFVideoDisplayControl *display_control;
IMFMediaType *media_type, *media_type2;
IMFPresentationTimeSource *time_source;
IMFVideoSampleAllocator *allocator;
IMFMediaTypeHandler *type_handler;
IMFVideoRenderer *video_renderer;
IMFPresentationClock *clock;
IMFMediaSink *sink, *sink2;
IMFAttributes *attributes;
DWORD flags, count, value;
@ -4228,8 +4230,8 @@ static void test_evr(void)
HRESULT hr;
GUID guid;
hr = CoInitialize(NULL);
ok(hr == S_OK, "Failed to initialize, hr %#x.\n", hr);
hr = MFStartup(MF_VERSION, MFSTARTUP_FULL);
ok(hr == S_OK, "Startup failure, hr %#x.\n", hr);
hr = MFCreateVideoRenderer(&IID_IMFVideoRenderer, (void **)&video_renderer);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
@ -4481,7 +4483,35 @@ todo_wine
IMFActivate_Release(activate);
CoUninitialize();
/* Set clock. */
window = create_window();
hr = MFCreateVideoRendererActivate(window, &activate);
ok(hr == S_OK, "Failed to create activate object, hr %#x.\n", hr);
hr = IMFActivate_ActivateObject(activate, &IID_IMFMediaSink, (void **)&sink);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = MFCreateSystemTimeSource(&time_source);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = MFCreatePresentationClock(&clock);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = IMFPresentationClock_SetTimeSource(clock, time_source);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
IMFPresentationTimeSource_Release(time_source);
hr = IMFMediaSink_SetPresentationClock(sink, clock);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
IMFPresentationClock_Release(clock);
IMFActivate_Release(activate);
DestroyWindow(window);
hr = MFShutdown();
ok(hr == S_OK, "Shutdown failure, hr %#x.\n", hr);
}
static void test_MFCreateSimpleTypeHandler(void)