quartz/vmr9: Destroy the window when set to windowless or renderless mode.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
feature/deterministic
Zebediah Figura 2020-05-12 12:06:57 -05:00 committed by Alexandre Julliard
parent 3c0b0cc834
commit fa32c8e36d
2 changed files with 17 additions and 27 deletions

View File

@ -1734,8 +1734,8 @@ static void test_overlay(void)
hwnd = (HWND)0xdeadbeef;
hr = IOverlay_GetWindowHandle(overlay, &hwnd);
todo_wine ok(hr == VFW_E_WRONG_STATE, "Got hr %#x.\n", hr);
todo_wine ok(hwnd == (HWND)0xdeadbeef, "Got invalid window %p.\n", hwnd);
ok(hr == VFW_E_WRONG_STATE, "Got hr %#x.\n", hr);
ok(hwnd == (HWND)0xdeadbeef, "Got window %p.\n", hwnd);
IOverlay_Release(overlay);
IPin_Release(pin);
@ -1750,8 +1750,8 @@ static void test_overlay(void)
hwnd = (HWND)0xdeadbeef;
hr = IOverlay_GetWindowHandle(overlay, &hwnd);
todo_wine ok(hr == VFW_E_WRONG_STATE, "Got hr %#x.\n", hr);
todo_wine ok(hwnd == (HWND)0xdeadbeef, "Got invalid window %p.\n", hwnd);
ok(hr == VFW_E_WRONG_STATE, "Got hr %#x.\n", hr);
ok(hwnd == (HWND)0xdeadbeef, "Got window %p.\n", hwnd);
IOverlay_Release(overlay);
IPin_Release(pin);
@ -3854,7 +3854,7 @@ static void test_windowless_size(void)
SetRect(&expect, 4, 6, 16, 12);
ok(EqualRect(&src, &expect), "Got source rect %s.\n", wine_dbgstr_rect(&src));
SetRect(&expect, 40, 60, 120, 160);
todo_wine ok(EqualRect(&dst, &expect), "Got dest rect %s.\n", wine_dbgstr_rect(&dst));
ok(EqualRect(&dst, &expect), "Got dest rect %s.\n", wine_dbgstr_rect(&dst));
GetWindowRect(window, &src);
SetRect(&expect, 0, 0, 640, 480);

View File

@ -458,13 +458,12 @@ static HRESULT allocate_surfaces(struct quartz_vmr *filter, const AM_MEDIA_TYPE
static void vmr_start_stream(struct strmbase_renderer *iface)
{
struct quartz_vmr *This = impl_from_IBaseFilter(&iface->filter.IBaseFilter_iface);
struct quartz_vmr *filter = impl_from_IBaseFilter(&iface->filter.IBaseFilter_iface);
TRACE("(%p)\n", This);
IVMRImagePresenter9_StartPresenting(This->presenter, This->cookie);
ShowWindow(This->window.hwnd, SW_SHOW);
SetEvent(This->run_event);
IVMRImagePresenter9_StartPresenting(filter->presenter, filter->cookie);
if (filter->window.hwnd)
ShowWindow(filter->window.hwnd, SW_SHOW);
SetEvent(filter->run_event);
}
static void vmr_stop_stream(struct strmbase_renderer *iface)
@ -1354,6 +1353,9 @@ static HRESULT WINAPI VMR9FilterConfig_SetRenderingMode(IVMRFilterConfig9 *iface
return E_INVALIDARG;
}
if (mode != VMR9Mode_Windowed)
video_window_cleanup(&This->window);
This->mode = mode;
LeaveCriticalSection(&This->renderer.filter.csFilter);
return hr;
@ -1459,13 +1461,7 @@ static HRESULT WINAPI VMR7WindowlessControl_SetVideoPosition(IVMRWindowlessContr
if (source)
This->window.src = *source;
if (dest)
{
This->window.dst = *dest;
FIXME("Output rectangle: %s.\n", wine_dbgstr_rect(dest));
SetWindowPos(This->window.hwnd, NULL,
dest->left, dest->top, dest->right - dest->left, dest->bottom-dest->top,
SWP_NOACTIVATE | SWP_NOCOPYBITS | SWP_NOOWNERZORDER | SWP_NOREDRAW);
}
LeaveCriticalSection(&This->renderer.filter.csFilter);
@ -1662,13 +1658,7 @@ static HRESULT WINAPI VMR9WindowlessControl_SetVideoPosition(IVMRWindowlessContr
if (source)
This->window.src = *source;
if (dest)
{
This->window.dst = *dest;
FIXME("Output rectangle: %s.\n", wine_dbgstr_rect(dest));
SetWindowPos(This->window.hwnd, NULL,
dest->left, dest->top, dest->right - dest->left, dest->bottom - dest->top,
SWP_NOACTIVATE | SWP_NOCOPYBITS | SWP_NOOWNERZORDER | SWP_NOREDRAW);
}
LeaveCriticalSection(&This->renderer.filter.csFilter);
@ -1740,7 +1730,7 @@ static HRESULT WINAPI VMR9WindowlessControl_RepaintVideo(IVMRWindowlessControl9
FIXME("(%p/%p)->(...) semi-stub\n", iface, This);
EnterCriticalSection(&This->renderer.filter.csFilter);
if (hwnd != This->clipping_window && hwnd != This->window.hwnd)
if (hwnd != This->clipping_window)
{
ERR("Not handling changing windows yet!!!\n");
LeaveCriticalSection(&This->renderer.filter.csFilter);
@ -2214,6 +2204,9 @@ static HRESULT WINAPI overlay_GetWindowHandle(IOverlay *iface, HWND *window)
TRACE("filter %p, window %p.\n", filter, window);
if (!filter->window.hwnd)
return VFW_E_WRONG_STATE;
*window = filter->window.hwnd;
return S_OK;
}
@ -2424,12 +2417,9 @@ static HRESULT WINAPI VMR9_ImagePresenter_PresentImage(IVMRImagePresenter9 *ifac
{
struct default_presenter *This = impl_from_IVMRImagePresenter9(iface);
HRESULT hr;
RECT output;
BOOL render = FALSE;
TRACE("(%p/%p/%p)->(...) stub\n", iface, This, This->pVMR9);
GetWindowRect(This->pVMR9->window.hwnd, &output);
TRACE("Output rectangle: %s\n", wine_dbgstr_rect(&output));
/* This might happen if we don't have active focus (eg on a different virtual desktop) */
if (!This->d3d9_dev)