Commit a54597fd authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

quartz/vmr9: Forbid setting the video clipping window while connected.

parent f1de733a
...@@ -3234,7 +3234,7 @@ static void test_clipping_window(void) ...@@ -3234,7 +3234,7 @@ static void test_clipping_window(void)
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IVMRWindowlessControl9_SetVideoClippingWindow(windowless_control, window); hr = IVMRWindowlessControl9_SetVideoClippingWindow(windowless_control, window);
todo_wine ok(hr == VFW_E_WRONG_STATE, "Got hr %#x.\n", hr); ok(hr == VFW_E_WRONG_STATE, "Got hr %#x.\n", hr);
hr = IFilterGraph2_Disconnect(graph, &source.source.pin.IPin_iface); hr = IFilterGraph2_Disconnect(graph, &source.source.pin.IPin_iface);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
......
...@@ -1846,23 +1846,30 @@ static HRESULT WINAPI VMR9WindowlessControl_SetAspectRatioMode(IVMRWindowlessCon ...@@ -1846,23 +1846,30 @@ static HRESULT WINAPI VMR9WindowlessControl_SetAspectRatioMode(IVMRWindowlessCon
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI VMR9WindowlessControl_SetVideoClippingWindow(IVMRWindowlessControl9 *iface, HWND hwnd) static HRESULT WINAPI VMR9WindowlessControl_SetVideoClippingWindow(IVMRWindowlessControl9 *iface, HWND window)
{ {
struct quartz_vmr *This = impl_from_IVMRWindowlessControl9(iface); struct quartz_vmr *filter = impl_from_IVMRWindowlessControl9(iface);
TRACE("(%p/%p)->(%p)\n", iface, This, hwnd); TRACE("filter %p, window %p.\n", filter, window);
if (!IsWindow(hwnd)) if (!IsWindow(window))
{ {
WARN("Invalid window %p, returning E_INVALIDARG.\n", hwnd); WARN("Invalid window %p, returning E_INVALIDARG.\n", window);
return E_INVALIDARG; return E_INVALIDARG;
} }
EnterCriticalSection(&This->renderer.filter.csFilter); EnterCriticalSection(&filter->renderer.filter.csFilter);
This->hWndClippingWindow = hwnd;
if (This->renderer.sink.pin.peer) if (filter->renderer.sink.pin.peer)
VMR9_maybe_init(This, FALSE, &This->renderer.sink.pin.mt); {
LeaveCriticalSection(&This->renderer.filter.csFilter); LeaveCriticalSection(&filter->renderer.filter.csFilter);
WARN("Attempt to set the clipping window while connected; returning VFW_E_WRONG_STATE.\n");
return VFW_E_WRONG_STATE;
}
filter->hWndClippingWindow = window;
LeaveCriticalSection(&filter->renderer.filter.csFilter);
return S_OK; return S_OK;
} }
......
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