Commit 90f8a1b8 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

quartz/vmr9: Set the destination rect to the whole client area when connecting.

parent 8725564f
...@@ -2593,6 +2593,7 @@ static void test_basic_video(void) ...@@ -2593,6 +2593,7 @@ static void test_basic_video(void)
UINT count; UINT count;
ULONG ref; ULONG ref;
IPin *pin; IPin *pin;
RECT rect;
IBaseFilter_QueryInterface(filter, &IID_IBasicVideo, (void **)&video); IBaseFilter_QueryInterface(filter, &IID_IBasicVideo, (void **)&video);
IBaseFilter_FindPin(filter, L"VMR Input0", &pin); IBaseFilter_FindPin(filter, L"VMR Input0", &pin);
...@@ -2727,6 +2728,35 @@ static void test_basic_video(void) ...@@ -2727,6 +2728,35 @@ static void test_basic_video(void)
test_basic_video_source(video); test_basic_video_source(video);
test_basic_video_destination(video); test_basic_video_destination(video);
hr = IFilterGraph2_Disconnect(graph, &source.source.pin.IPin_iface);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IFilterGraph2_Disconnect(graph, pin);
ok(hr == S_OK, "Got hr %#x.\n", hr);
vih.bmiHeader.biWidth = 16;
vih.bmiHeader.biHeight = 16;
hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IMemInputPin_GetAllocator(input, &allocator);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
if (hr == S_OK)
{
hr = IMemAllocator_SetProperties(allocator, &req_props, &ret_props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(!memcmp(&ret_props, &req_props, sizeof(req_props)), "Properties did not match.\n");
hr = IMemAllocator_Commit(allocator);
ok(hr == S_OK, "Got hr %#x.\n", hr);
IMemAllocator_Release(allocator);
}
check_source_position(video, 0, 0, 16, 16);
SetRect(&rect, 0, 0, 0, 0);
AdjustWindowRectEx(&rect, WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_OVERLAPPEDWINDOW, FALSE, 0);
check_destination_position(video, 0, 0, max(16, GetSystemMetrics(SM_CXMIN) - (rect.right - rect.left)),
max(16, GetSystemMetrics(SM_CYMIN) - (rect.bottom - rect.top)));
out: out:
ref = IFilterGraph2_Release(graph); ref = IFilterGraph2_Release(graph);
ok(!ref, "Got outstanding refcount %d.\n", ref); ok(!ref, "Got outstanding refcount %d.\n", ref);
......
...@@ -3591,6 +3591,7 @@ static void test_basic_video(void) ...@@ -3591,6 +3591,7 @@ static void test_basic_video(void)
UINT count; UINT count;
ULONG ref; ULONG ref;
IPin *pin; IPin *pin;
RECT rect;
IBaseFilter_QueryInterface(filter, &IID_IBasicVideo, (void **)&video); IBaseFilter_QueryInterface(filter, &IID_IBasicVideo, (void **)&video);
IBaseFilter_FindPin(filter, L"VMR Input0", &pin); IBaseFilter_FindPin(filter, L"VMR Input0", &pin);
...@@ -3725,6 +3726,35 @@ static void test_basic_video(void) ...@@ -3725,6 +3726,35 @@ static void test_basic_video(void)
test_basic_video_source(video); test_basic_video_source(video);
test_basic_video_destination(video); test_basic_video_destination(video);
hr = IFilterGraph2_Disconnect(graph, &source.source.pin.IPin_iface);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IFilterGraph2_Disconnect(graph, pin);
ok(hr == S_OK, "Got hr %#x.\n", hr);
vih.bmiHeader.biWidth = 16;
vih.bmiHeader.biHeight = 16;
hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IMemInputPin_GetAllocator(input, &allocator);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
if (hr == S_OK)
{
hr = IMemAllocator_SetProperties(allocator, &req_props, &ret_props);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(!memcmp(&ret_props, &req_props, sizeof(req_props)), "Properties did not match.\n");
hr = IMemAllocator_Commit(allocator);
ok(hr == S_OK, "Got hr %#x.\n", hr);
IMemAllocator_Release(allocator);
}
check_source_position(video, 0, 0, 16, 16);
SetRect(&rect, 0, 0, 0, 0);
AdjustWindowRectEx(&rect, WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_OVERLAPPEDWINDOW, FALSE, 0);
check_destination_position(video, 0, 0, max(16, GetSystemMetrics(SM_CXMIN) - (rect.right - rect.left)),
max(16, GetSystemMetrics(SM_CYMIN) - (rect.bottom - rect.top)));
out: out:
ref = IFilterGraph2_Release(graph); ref = IFilterGraph2_Release(graph);
ok(!ref, "Got outstanding refcount %d.\n", ref); ok(!ref, "Got outstanding refcount %d.\n", ref);
...@@ -3831,7 +3861,7 @@ static void test_windowless_size(void) ...@@ -3831,7 +3861,7 @@ static void test_windowless_size(void)
hr = IVMRWindowlessControl9_GetVideoPosition(windowless_control, NULL, &dst); hr = IVMRWindowlessControl9_GetVideoPosition(windowless_control, NULL, &dst);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
SetRect(&expect, 0, 0, 0, 0); SetRect(&expect, 0, 0, 0, 0);
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));
SetRect(&src, 4, 6, 16, 12); SetRect(&src, 4, 6, 16, 12);
hr = IVMRWindowlessControl9_SetVideoPosition(windowless_control, &src, NULL); hr = IVMRWindowlessControl9_SetVideoPosition(windowless_control, &src, NULL);
...@@ -3844,7 +3874,7 @@ static void test_windowless_size(void) ...@@ -3844,7 +3874,7 @@ static void test_windowless_size(void)
SetRect(&expect, 4, 6, 16, 12); SetRect(&expect, 4, 6, 16, 12);
ok(EqualRect(&src, &expect), "Got source rect %s.\n", wine_dbgstr_rect(&src)); ok(EqualRect(&src, &expect), "Got source rect %s.\n", wine_dbgstr_rect(&src));
SetRect(&expect, 0, 0, 0, 0); SetRect(&expect, 0, 0, 0, 0);
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));
SetRect(&dst, 40, 60, 120, 160); SetRect(&dst, 40, 60, 120, 160);
hr = IVMRWindowlessControl9_SetVideoPosition(windowless_control, NULL, &dst); hr = IVMRWindowlessControl9_SetVideoPosition(windowless_control, NULL, &dst);
......
...@@ -519,12 +519,13 @@ static HRESULT vmr_connect(struct strmbase_renderer *iface, const AM_MEDIA_TYPE ...@@ -519,12 +519,13 @@ static HRESULT vmr_connect(struct strmbase_renderer *iface, const AM_MEDIA_TYPE
filter->VideoWidth = bitmap_header->biWidth; filter->VideoWidth = bitmap_header->biWidth;
filter->VideoHeight = bitmap_header->biHeight; filter->VideoHeight = bitmap_header->biHeight;
SetRect(&rect, 0, 0, filter->VideoWidth, filter->VideoHeight); SetRect(&rect, 0, 0, filter->VideoWidth, filter->VideoHeight);
filter->window.src = filter->window.dst = rect; filter->window.src = rect;
AdjustWindowRectEx(&rect, GetWindowLongW(window, GWL_STYLE), FALSE, AdjustWindowRectEx(&rect, GetWindowLongW(window, GWL_STYLE), FALSE,
GetWindowLongW(window, GWL_EXSTYLE)); GetWindowLongW(window, GWL_EXSTYLE));
SetWindowPos(window, NULL, 0, 0, rect.right - rect.left, rect.bottom - rect.top, SetWindowPos(window, NULL, 0, 0, rect.right - rect.left, rect.bottom - rect.top,
SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
GetClientRect(window, &filter->window.dst);
if (filter->mode if (filter->mode
|| SUCCEEDED(hr = IVMRFilterConfig9_SetRenderingMode(&filter->IVMRFilterConfig9_iface, VMR9Mode_Windowed))) || SUCCEEDED(hr = IVMRFilterConfig9_SetRenderingMode(&filter->IVMRFilterConfig9_iface, VMR9Mode_Windowed)))
......
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