evr/presenter: Return default flags for GetRenderingPrefs().

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2020-10-06 14:48:57 +03:00 committed by Alexandre Julliard
parent f79ca651ae
commit 9b1bd73188
2 changed files with 22 additions and 2 deletions

View File

@ -61,6 +61,7 @@ struct video_presenter
HWND video_window; HWND video_window;
MFVideoNormalizedRect src_rect; MFVideoNormalizedRect src_rect;
RECT dst_rect; RECT dst_rect;
DWORD rendering_prefs;
unsigned int state; unsigned int state;
CRITICAL_SECTION cs; CRITICAL_SECTION cs;
}; };
@ -658,9 +659,18 @@ static HRESULT WINAPI video_presenter_control_SetRenderingPrefs(IMFVideoDisplayC
static HRESULT WINAPI video_presenter_control_GetRenderingPrefs(IMFVideoDisplayControl *iface, DWORD *flags) static HRESULT WINAPI video_presenter_control_GetRenderingPrefs(IMFVideoDisplayControl *iface, DWORD *flags)
{ {
FIXME("%p, %p.\n", iface, flags); struct video_presenter *presenter = impl_from_IMFVideoDisplayControl(iface);
return E_NOTIMPL; TRACE("%p, %p.\n", iface, flags);
if (!flags)
return E_POINTER;
EnterCriticalSection(&presenter->cs);
*flags = presenter->rendering_prefs;
LeaveCriticalSection(&presenter->cs);
return S_OK;
} }
static HRESULT WINAPI video_presenter_control_SetFullscreen(IMFVideoDisplayControl *iface, BOOL fullscreen) static HRESULT WINAPI video_presenter_control_SetFullscreen(IMFVideoDisplayControl *iface, BOOL fullscreen)

View File

@ -979,6 +979,7 @@ static void test_default_presenter(void)
HWND hwnd, hwnd2; HWND hwnd, hwnd2;
HANDLE handle; HANDLE handle;
IUnknown *unk; IUnknown *unk;
DWORD flags;
float rate; float rate;
HRESULT hr; HRESULT hr;
GUID iid; GUID iid;
@ -1016,6 +1017,15 @@ static void test_default_presenter(void)
hr = IMFGetService_GetService(gs, &MR_VIDEO_RENDER_SERVICE, &IID_IMFVideoDisplayControl, (void **)&display_control); hr = IMFGetService_GetService(gs, &MR_VIDEO_RENDER_SERVICE, &IID_IMFVideoDisplayControl, (void **)&display_control);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = IMFVideoDisplayControl_GetRenderingPrefs(display_control, NULL);
ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
flags = 123;
hr = IMFVideoDisplayControl_GetRenderingPrefs(display_control, &flags);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(!flags, "Unexpected rendering flags %#x.\n", flags);
IMFVideoDisplayControl_Release(display_control); IMFVideoDisplayControl_Release(display_control);
hr = IMFGetService_GetService(gs, &MR_VIDEO_ACCELERATION_SERVICE, &IID_IDirect3DDeviceManager9, (void **)&dm); hr = IMFGetService_GetService(gs, &MR_VIDEO_ACCELERATION_SERVICE, &IID_IDirect3DDeviceManager9, (void **)&dm);