evr/presenter: Invalidate media type on destination rectangle change.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Andrew Eikum 2021-10-26 19:58:31 +03:00 committed by Alexandre Julliard
parent a1c057c9a7
commit 7980d049e8
2 changed files with 17 additions and 10 deletions

View File

@ -1295,8 +1295,14 @@ static HRESULT WINAPI video_presenter_control_SetVideoPosition(IMFVideoDisplayCo
video_presenter_set_mixer_rect(presenter);
}
}
if (dst_rect)
if (dst_rect && !EqualRect(dst_rect, &presenter->dst_rect))
{
presenter->dst_rect = *dst_rect;
hr = video_presenter_invalidate_media_type(presenter);
/* Mixer's input type hasn't been configured yet, this is not an error. */
if (hr == MF_E_TRANSFORM_TYPE_NOT_SET) hr = S_OK;
/* FIXME: trigger repaint */
}
}
LeaveCriticalSection(&presenter->cs);

View File

@ -2190,9 +2190,6 @@ static void test_presenter_media_type(void)
hr = IMFTransform_ProcessMessage(mixer, MFT_MESSAGE_SET_D3D_MANAGER, (ULONG_PTR)manager);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = IMFTransform_SetInputType(mixer, 0, input_type, 0);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = IMFVideoPresenter_QueryInterface(presenter, &IID_IMFTopologyServiceLookupClient, (void **)&lookup_client);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
@ -2204,12 +2201,20 @@ static void test_presenter_media_type(void)
hr = IMFVideoDisplayControl_SetVideoWindow(display_control, window);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
/* Set destination rectangle before mixer types are configured. */
SetRect(&dst, 0, 0, 101, 51);
hr = IMFVideoDisplayControl_SetVideoPosition(display_control, NULL, &dst);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = IMFTransform_SetInputType(mixer, 0, input_type, 0);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = IMFVideoPresenter_ProcessMessage(presenter, MFVP_MESSAGE_INVALIDATEMEDIATYPE, 0);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
get_output_aperture(mixer, &frame_size, &aperture);
ok(frame_size.cx == 100 && frame_size.cy == 50, "Unexpected frame size %u x %u.\n", frame_size.cx, frame_size.cy);
ok(aperture.Area.cx == 100 && aperture.Area.cy == 50, "Unexpected size %u x %u.\n", aperture.Area.cx, aperture.Area.cy);
ok(frame_size.cx == 101 && frame_size.cy == 51, "Unexpected frame size %u x %u.\n", frame_size.cx, frame_size.cy);
ok(aperture.Area.cx == 101 && aperture.Area.cy == 51, "Unexpected size %u x %u.\n", aperture.Area.cx, aperture.Area.cy);
ok(!aperture.OffsetX.value && !aperture.OffsetX.fract && !aperture.OffsetY.value && !aperture.OffsetY.fract,
"Unexpected offset %u x %u.\n", aperture.OffsetX.value, aperture.OffsetY.value);
@ -2218,10 +2223,8 @@ static void test_presenter_media_type(void)
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
get_output_aperture(mixer, &frame_size, &aperture);
todo_wine {
ok(frame_size.cx == 199 && frame_size.cy == 298, "Unexpected frame size %u x %u.\n", frame_size.cx, frame_size.cy);
ok(aperture.Area.cx == 199 && aperture.Area.cy == 298, "Unexpected size %u x %u.\n", aperture.Area.cx, aperture.Area.cy);
}
ok(!aperture.OffsetX.value && !aperture.OffsetX.fract && !aperture.OffsetY.value && !aperture.OffsetY.fract,
"Unexpected offset %u x %u.\n", aperture.OffsetX.value, aperture.OffsetY.value);
@ -2229,10 +2232,8 @@ todo_wine {
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
get_output_aperture(mixer, &frame_size, &aperture);
todo_wine {
ok(frame_size.cx == 199 && frame_size.cy == 298, "Unexpected frame size %u x %u.\n", frame_size.cx, frame_size.cy);
ok(aperture.Area.cx == 199 && aperture.Area.cy == 298, "Unexpected size %u x %u.\n", aperture.Area.cx, aperture.Area.cy);
}
ok(!aperture.OffsetX.value && !aperture.OffsetX.fract && !aperture.OffsetY.value && !aperture.OffsetY.fract,
"Unexpected offset %u x %u.\n", aperture.OffsetX.value, aperture.OffsetY.value);