Nikolay Sivov : evr/presenter: Keep video window handle.

Alexandre Julliard julliard at winehq.org
Fri Oct 2 14:54:09 CDT 2020


Module: wine
Branch: master
Commit: 77e04e221a609cb4b45625ccbc743d322a14189e
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=77e04e221a609cb4b45625ccbc743d322a14189e

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Fri Oct  2 14:01:11 2020 +0300

evr/presenter: Keep video window handle.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/evr/presenter.c | 19 +++++++++++++++----
 dlls/evr/tests/evr.c |  7 ++-----
 2 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/dlls/evr/presenter.c b/dlls/evr/presenter.c
index 8b5a7dd46a..a8e9a50792 100644
--- a/dlls/evr/presenter.c
+++ b/dlls/evr/presenter.c
@@ -58,6 +58,7 @@ struct video_presenter
 
     IDirect3DDeviceManager9 *device_manager;
     UINT reset_token;
+    HWND video_window;
     unsigned int state;
     CRITICAL_SECTION cs;
 };
@@ -497,16 +498,26 @@ static HRESULT WINAPI video_presenter_control_GetAspectRatioMode(IMFVideoDisplay
 
 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)
 {
-    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)
diff --git a/dlls/evr/tests/evr.c b/dlls/evr/tests/evr.c
index 9665e2683d..d77703b6c1 100644
--- a/dlls/evr/tests/evr.c
+++ b/dlls/evr/tests/evr.c
@@ -1056,20 +1056,17 @@ static void test_default_presenter(void)
 
     hwnd2 = hwnd;
     hr = IMFVideoDisplayControl_GetVideoWindow(display_control, &hwnd2);
-todo_wine {
     ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
     ok(hwnd2 == NULL, "Unexpected window %p.\n", hwnd2);
-}
+
     hr = IMFVideoDisplayControl_SetVideoWindow(display_control, hwnd);
-todo_wine
     ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
 
     hwnd2 = NULL;
     hr = IMFVideoDisplayControl_GetVideoWindow(display_control, &hwnd2);
-todo_wine {
     ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
     ok(hwnd2 == hwnd, "Unexpected window %p.\n", hwnd2);
-}
+
     hr = IDirect3DDeviceManager9_CloseDeviceHandle(dm, handle);
     ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
 




More information about the wine-cvs mailing list