Commit 77e04e22 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

evr/presenter: Keep video window handle.

parent 69e777c8
...@@ -58,6 +58,7 @@ struct video_presenter ...@@ -58,6 +58,7 @@ struct video_presenter
IDirect3DDeviceManager9 *device_manager; IDirect3DDeviceManager9 *device_manager;
UINT reset_token; UINT reset_token;
HWND video_window;
unsigned int state; unsigned int state;
CRITICAL_SECTION cs; CRITICAL_SECTION cs;
}; };
...@@ -497,16 +498,26 @@ static HRESULT WINAPI video_presenter_control_GetAspectRatioMode(IMFVideoDisplay ...@@ -497,16 +498,26 @@ static HRESULT WINAPI video_presenter_control_GetAspectRatioMode(IMFVideoDisplay
static HRESULT WINAPI video_presenter_control_SetVideoWindow(IMFVideoDisplayControl *iface, HWND window) static HRESULT WINAPI video_presenter_control_SetVideoWindow(IMFVideoDisplayControl *iface, HWND window)
{ {
FIXME("%p, %p.\n", iface, window); struct video_presenter *presenter = impl_from_IMFVideoDisplayControl(iface);
return E_NOTIMPL; TRACE("%p, %p.\n", iface, window);
EnterCriticalSection(&presenter->cs);
presenter->video_window = window;
LeaveCriticalSection(&presenter->cs);
return S_OK;
} }
static HRESULT WINAPI video_presenter_control_GetVideoWindow(IMFVideoDisplayControl *iface, HWND *window) static HRESULT WINAPI video_presenter_control_GetVideoWindow(IMFVideoDisplayControl *iface, HWND *window)
{ {
FIXME("%p, %p.\n", iface, window); struct video_presenter *presenter = impl_from_IMFVideoDisplayControl(iface);
return E_NOTIMPL; TRACE("%p, %p.\n", iface, window);
*window = presenter->video_window;
return S_OK;
} }
static HRESULT WINAPI video_presenter_control_RepaintVideo(IMFVideoDisplayControl *iface) static HRESULT WINAPI video_presenter_control_RepaintVideo(IMFVideoDisplayControl *iface)
......
...@@ -1056,20 +1056,17 @@ static void test_default_presenter(void) ...@@ -1056,20 +1056,17 @@ static void test_default_presenter(void)
hwnd2 = hwnd; hwnd2 = hwnd;
hr = IMFVideoDisplayControl_GetVideoWindow(display_control, &hwnd2); hr = IMFVideoDisplayControl_GetVideoWindow(display_control, &hwnd2);
todo_wine {
ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(hwnd2 == NULL, "Unexpected window %p.\n", hwnd2); ok(hwnd2 == NULL, "Unexpected window %p.\n", hwnd2);
}
hr = IMFVideoDisplayControl_SetVideoWindow(display_control, hwnd); hr = IMFVideoDisplayControl_SetVideoWindow(display_control, hwnd);
todo_wine
ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hwnd2 = NULL; hwnd2 = NULL;
hr = IMFVideoDisplayControl_GetVideoWindow(display_control, &hwnd2); hr = IMFVideoDisplayControl_GetVideoWindow(display_control, &hwnd2);
todo_wine {
ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(hwnd2 == hwnd, "Unexpected window %p.\n", hwnd2); ok(hwnd2 == hwnd, "Unexpected window %p.\n", hwnd2);
}
hr = IDirect3DDeviceManager9_CloseDeviceHandle(dm, handle); hr = IDirect3DDeviceManager9_CloseDeviceHandle(dm, handle);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment