Zebediah Figura : quartz/vmr9: Implement IOverlay::GetWindowHandle().

Alexandre Julliard julliard at winehq.org
Fri Oct 4 16:34:05 CDT 2019


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

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Fri Oct  4 10:02:49 2019 -0500

quartz/vmr9: Implement IOverlay::GetWindowHandle().

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/quartz/tests/vmr7.c | 26 ++++++++++++++++++++++++++
 dlls/quartz/tests/vmr9.c | 26 ++++++++++++++++++++++++++
 dlls/quartz/vmr9.c       |  8 ++++++--
 3 files changed, 58 insertions(+), 2 deletions(-)

diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c
index 0228e0c249..0d72689078 100644
--- a/dlls/quartz/tests/vmr7.c
+++ b/dlls/quartz/tests/vmr7.c
@@ -1097,6 +1097,31 @@ static void test_connect_pin(void)
     ok(!ref, "Got outstanding refcount %d.\n", ref);
 }
 
+static void test_overlay(void)
+{
+    IBaseFilter *filter = create_vmr7(0);
+    IOverlay *overlay;
+    HRESULT hr;
+    ULONG ref;
+    IPin *pin;
+    HWND hwnd;
+
+    IBaseFilter_FindPin(filter, L"VMR Input0", &pin);
+
+    hr = IPin_QueryInterface(pin, &IID_IOverlay, (void **)&overlay);
+    ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+    hwnd = (HWND)0xdeadbeef;
+    hr = IOverlay_GetWindowHandle(overlay, &hwnd);
+    ok(hr == S_OK, "Got hr %#x.\n", hr);
+    todo_wine ok(hwnd && hwnd != (HWND)0xdeadbeef, "Got invalid window %p.\n", hwnd);
+
+    IOverlay_Release(overlay);
+    IPin_Release(pin);
+    ref = IBaseFilter_Release(filter);
+    ok(!ref, "Got outstanding refcount %d.\n", ref);
+}
+
 START_TEST(vmr7)
 {
     CoInitialize(NULL);
@@ -1111,6 +1136,7 @@ START_TEST(vmr7)
     test_enum_media_types();
     test_unconnected_filter_state();
     test_connect_pin();
+    test_overlay();
 
     CoUninitialize();
 }
diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c
index d3001727d4..928484ccb6 100644
--- a/dlls/quartz/tests/vmr9.c
+++ b/dlls/quartz/tests/vmr9.c
@@ -1096,6 +1096,31 @@ static void test_connect_pin(void)
     ok(!ref, "Got outstanding refcount %d.\n", ref);
 }
 
+static void test_overlay(void)
+{
+    IBaseFilter *filter = create_vmr9(0);
+    IOverlay *overlay;
+    HRESULT hr;
+    ULONG ref;
+    IPin *pin;
+    HWND hwnd;
+
+    IBaseFilter_FindPin(filter, L"VMR Input0", &pin);
+
+    hr = IPin_QueryInterface(pin, &IID_IOverlay, (void **)&overlay);
+    ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+    hwnd = (HWND)0xdeadbeef;
+    hr = IOverlay_GetWindowHandle(overlay, &hwnd);
+    ok(hr == S_OK, "Got hr %#x.\n", hr);
+    todo_wine ok(hwnd && hwnd != (HWND)0xdeadbeef, "Got invalid window %p.\n", hwnd);
+
+    IOverlay_Release(overlay);
+    IPin_Release(pin);
+    ref = IBaseFilter_Release(filter);
+    ok(!ref, "Got outstanding refcount %d.\n", ref);
+}
+
 START_TEST(vmr9)
 {
     IBaseFilter *filter;
@@ -1121,6 +1146,7 @@ START_TEST(vmr9)
     test_enum_media_types();
     test_unconnected_filter_state();
     test_connect_pin();
+    test_overlay();
 
     CoUninitialize();
 }
diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c
index 5a1d248dde..600e75945a 100644
--- a/dlls/quartz/vmr9.c
+++ b/dlls/quartz/vmr9.c
@@ -2183,8 +2183,12 @@ static HRESULT WINAPI overlay_SetColorKey(IOverlay *iface, COLORKEY *key)
 
 static HRESULT WINAPI overlay_GetWindowHandle(IOverlay *iface, HWND *window)
 {
-    FIXME("iface %p, window %p, stub!\n", iface, window);
-    return E_NOTIMPL;
+    struct quartz_vmr *filter = impl_from_IOverlay(iface);
+
+    TRACE("filter %p, window %p.\n", filter, window);
+
+    *window = filter->baseControlWindow.baseWindow.hWnd;
+    return S_OK;
 }
 
 static HRESULT WINAPI overlay_GetClipList(IOverlay *iface, RECT *source, RECT *dest, RGNDATA **region)




More information about the wine-cvs mailing list