Zebediah Figura : quartz/tests: Add some tests for flushing on the video renderer.
Alexandre Julliard
julliard at winehq.org
Mon Sep 30 16:19:06 CDT 2019
Module: wine
Branch: master
Commit: 0867dd77b63b91086f046d52b4d5e6758a8e963a
URL: https://source.winehq.org/git/wine.git/?a=commit;h=0867dd77b63b91086f046d52b4d5e6758a8e963a
Author: Zebediah Figura <z.figura12 at gmail.com>
Date: Sun Sep 29 19:03:28 2019 -0500
quartz/tests: Add some tests for flushing on the video renderer.
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/quartz/tests/videorenderer.c | 63 +++++++++++++++++++++++++++++++++++++++
1 file changed, 63 insertions(+)
diff --git a/dlls/quartz/tests/videorenderer.c b/dlls/quartz/tests/videorenderer.c
index 4e948a9120..a3ca8038bc 100644
--- a/dlls/quartz/tests/videorenderer.c
+++ b/dlls/quartz/tests/videorenderer.c
@@ -850,6 +850,68 @@ static void test_filter_state(IMemInputPin *input, IFilterGraph2 *graph)
IMediaControl_Release(control);
}
+static void test_flushing(IPin *pin, IMemInputPin *input, IFilterGraph2 *graph)
+{
+ IMediaControl *control;
+ OAFilterState state;
+ HANDLE thread;
+ HRESULT hr;
+
+ IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control);
+
+ hr = IMediaControl_Pause(control);
+ ok(hr == S_FALSE, "Got hr %#x.\n", hr);
+
+ thread = send_frame(input);
+ todo_wine ok(WaitForSingleObject(thread, 100) == WAIT_TIMEOUT, "Thread should block in Receive().\n");
+
+ hr = IMediaControl_GetState(control, 0, &state);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IPin_BeginFlush(pin);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = join_thread(thread);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ thread = send_frame(input);
+ hr = join_thread(thread);
+ todo_wine ok(hr == E_FAIL, "Got hr %#x.\n", hr);
+
+ hr = IPin_EndFlush(pin);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ /* We dropped the sample we were holding, so now we need a new one... */
+
+ hr = IMediaControl_GetState(control, 0, &state);
+ todo_wine ok(hr == VFW_S_STATE_INTERMEDIATE, "Got hr %#x.\n", hr);
+
+ thread = send_frame(input);
+ todo_wine ok(WaitForSingleObject(thread, 100) == WAIT_TIMEOUT, "Thread should block in Receive().\n");
+
+ hr = IMediaControl_Run(control);
+ todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
+ hr = join_thread(thread);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IPin_BeginFlush(pin);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = join_thread(send_frame(input));
+ todo_wine ok(hr == E_FAIL, "Got hr %#x.\n", hr);
+
+ hr = IPin_EndFlush(pin);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = join_thread(send_frame(input));
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ hr = IMediaControl_Stop(control);
+ ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+ IMediaControl_Release(control);
+}
+
static void test_connect_pin(void)
{
VIDEOINFOHEADER vih =
@@ -954,6 +1016,7 @@ static void test_connect_pin(void)
ok(hr == S_OK, "Got hr %#x.\n", hr);
test_filter_state(input, graph);
+ test_flushing(pin, input, graph);
hr = IFilterGraph2_Disconnect(graph, pin);
ok(hr == S_OK, "Got hr %#x.\n", hr);
More information about the wine-cvs
mailing list