Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/videorenderer.c | 26 ++++++++++++++++++++++++++ dlls/quartz/videorenderer.c | 8 ++++++-- 2 files changed, 32 insertions(+), 2 deletions(-)
diff --git a/dlls/quartz/tests/videorenderer.c b/dlls/quartz/tests/videorenderer.c index 1343f85e5e6..3bee2a500c8 100644 --- a/dlls/quartz/tests/videorenderer.c +++ b/dlls/quartz/tests/videorenderer.c @@ -1321,6 +1321,31 @@ static void test_unconnected_filter_state(void) ok(!ref, "Got outstanding refcount %d.\n", ref); }
+static void test_overlay(void) +{ + IBaseFilter *filter = create_video_renderer(); + IOverlay *overlay; + HRESULT hr; + ULONG ref; + IPin *pin; + HWND hwnd; + + IBaseFilter_FindPin(filter, sink_id, &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); + 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(videorenderer) { CoInitialize(NULL); @@ -1334,6 +1359,7 @@ START_TEST(videorenderer) test_enum_media_types(); test_unconnected_filter_state(); test_connect_pin(); + test_overlay();
CoUninitialize(); } diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c index e2d80642d2e..429b59bfe33 100644 --- a/dlls/quartz/videorenderer.c +++ b/dlls/quartz/videorenderer.c @@ -854,8 +854,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; + VideoRendererImpl *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)