Addendum to 2a6037e263ff3fae8ca82d90b0b141bea1cd473d.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/strmbase/pin.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c index c08f04730e7..d7788cda493 100644 --- a/dlls/strmbase/pin.c +++ b/dlls/strmbase/pin.c @@ -887,6 +887,13 @@ static HRESULT WINAPI sink_Disconnect(IPin *iface)
EnterCriticalSection(&pin->pin.filter->csFilter);
+ if (pin->pin.filter->state != State_Stopped) + { + LeaveCriticalSection(&pin->pin.filter->csFilter); + WARN("Filter is not stopped; returning VFW_E_NOT_STOPPED.\n"); + return VFW_E_NOT_STOPPED; + } + if (pin->pin.peer) { if (pin->pFuncsTable->sink_disconnect)
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/avidec.c | 34 +++++++++++++++++++++++++++++++ dlls/quartz/tests/avisplit.c | 28 +++++++++++++++++++++++++ dlls/quartz/tests/dsoundrender.c | 14 +++++++++++++ dlls/quartz/tests/filesource.c | 17 ++++++++++++++++ dlls/quartz/tests/mpegsplit.c | 28 +++++++++++++++++++++++++ dlls/quartz/tests/videorenderer.c | 14 +++++++++++++ dlls/quartz/tests/vmr7.c | 10 +++++++++ dlls/quartz/tests/vmr9.c | 10 +++++++++ 8 files changed, 155 insertions(+)
diff --git a/dlls/quartz/tests/avidec.c b/dlls/quartz/tests/avidec.c index 9505bfb591d..ddfe22ed797 100644 --- a/dlls/quartz/tests/avidec.c +++ b/dlls/quartz/tests/avidec.c @@ -104,8 +104,13 @@ static LRESULT CALLBACK vfw_driver_proc(DWORD_PTR id, HDRVR driver, UINT msg, }
case ICM_DECOMPRESS_GET_PALETTE: + case ICM_DECOMPRESS_SET_PALETTE: return ICERR_UNSUPPORTED;
+ case ICM_DECOMPRESS_BEGIN: + case ICM_DECOMPRESS_END: + return ICERR_OK; + case ICM_GETINFO: { ICINFO *info = (ICINFO *)lparam1; @@ -950,6 +955,13 @@ static void test_connect_pin(void) hr = IPin_ConnectionMediaType(sink, &mt); ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#x.\n", hr);
+ hr = IMediaControl_Pause(control); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, &testsource.source.pin.IPin_iface, sink, &req_mt); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + req_mt.subtype = MEDIASUBTYPE_RGB24; hr = IFilterGraph2_ConnectDirect(graph, &testsource.source.pin.IPin_iface, sink, &req_mt); ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr); @@ -969,6 +981,13 @@ static void test_connect_pin(void) ok(compare_media_types(&testsource.source.pin.mt, &req_mt), "Media types didn't match.\n"); FreeMediaType(&mt);
+ hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, sink); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + sink_bih = req_format.bmiHeader;
hr = IPin_EnumMediaTypes(source, &enummt); @@ -1061,6 +1080,14 @@ static void test_connect_pin(void) /* Exact connection. */
CopyMediaType(&req_mt, &source_mt); + + hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, &req_mt); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, &req_mt); ok(hr == S_OK, "Got hr %#x.\n", hr);
@@ -1075,6 +1102,13 @@ static void test_connect_pin(void) ok(compare_media_types(&testsink.sink.pin.mt, &req_mt), "Media types didn't match.\n"); FreeMediaType(&mt);
+ hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, source); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, source); ok(hr == S_OK, "Got hr %#x.\n", hr); hr = IFilterGraph2_Disconnect(graph, source); diff --git a/dlls/quartz/tests/avisplit.c b/dlls/quartz/tests/avisplit.c index 644807dc32f..c5af19b5aff 100644 --- a/dlls/quartz/tests/avisplit.c +++ b/dlls/quartz/tests/avisplit.c @@ -1110,6 +1110,13 @@ static void test_connect_pin(void) hr = IPin_ConnectionMediaType(sink, &mt); ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#x.\n", hr);
+ hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, &testsource.source.pin.IPin_iface, sink, &req_mt); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + req_mt.majortype = MEDIATYPE_Video; hr = IFilterGraph2_ConnectDirect(graph, &testsource.source.pin.IPin_iface, sink, &req_mt); ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr); @@ -1133,6 +1140,13 @@ static void test_connect_pin(void) ok(compare_media_types(&mt, &req_mt), "Media types didn't match.\n"); ok(compare_media_types(&testsource.source.pin.mt, &req_mt), "Media types didn't match.\n");
+ hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, sink); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + /* Test source connection. */
IBaseFilter_FindPin(filter, L"Stream 00", &source); @@ -1152,6 +1166,13 @@ static void test_connect_pin(void) IEnumMediaTypes_Release(enummt); CopyMediaType(&req_mt, source_mt);
+ hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, &req_mt); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, &req_mt); ok(hr == S_OK, "Got hr %#x.\n", hr);
@@ -1167,6 +1188,13 @@ static void test_connect_pin(void) ok(compare_media_types(&mt, &req_mt), "Media types didn't match.\n"); ok(compare_media_types(&testsink.sink.pin.mt, &req_mt), "Media types didn't match.\n");
+ hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, source); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, source); ok(hr == S_OK, "Got hr %#x.\n", hr); hr = IFilterGraph2_Disconnect(graph, source); diff --git a/dlls/quartz/tests/dsoundrender.c b/dlls/quartz/tests/dsoundrender.c index 9aa9a796c9f..5142ca2da6d 100644 --- a/dlls/quartz/tests/dsoundrender.c +++ b/dlls/quartz/tests/dsoundrender.c @@ -880,6 +880,13 @@ static void test_connect_pin(void) hr = IPin_ConnectionMediaType(pin, &mt); ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#x.\n", hr);
+ hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt); ok(hr == S_OK, "Got hr %#x.\n", hr);
@@ -892,6 +899,13 @@ static void test_connect_pin(void) ok(hr == S_OK, "Got hr %#x.\n", hr); ok(compare_media_types(&mt, &req_mt), "Media types didn't match.\n");
+ hr = IMediaControl_Pause(control); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, pin); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + IPin_QueryInterface(pin, &IID_IMemInputPin, (void **)&input);
test_allocator(input); diff --git a/dlls/quartz/tests/filesource.c b/dlls/quartz/tests/filesource.c index b50b06dc10f..4162e248937 100644 --- a/dlls/quartz/tests/filesource.c +++ b/dlls/quartz/tests/filesource.c @@ -1296,6 +1296,7 @@ static void test_connect_pin(void) AM_MEDIA_TYPE mt, *source_mt; struct testsink testsink; IEnumMediaTypes *enummt; + IMediaControl *control; IFilterGraph2 *graph; IPin *source, *peer; BYTE my_format = 1; @@ -1308,6 +1309,7 @@ static void test_connect_pin(void) &IID_IFilterGraph2, (void **)&graph); IFilterGraph2_AddFilter(graph, &testsink.filter.IBaseFilter_iface, L"sink"); IFilterGraph2_AddFilter(graph, filter, L"file source"); + IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control); load_file(filter, filename); IBaseFilter_FindPin(filter, L"Output", &source);
@@ -1325,6 +1327,13 @@ static void test_connect_pin(void)
/* Test exact connection. */
+ hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.pin.pin.IPin_iface, &req_mt); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.pin.pin.IPin_iface, &req_mt); ok(hr == S_OK, "Got hr %#x.\n", hr);
@@ -1338,6 +1347,13 @@ static void test_connect_pin(void) ok(compare_media_types(&mt, &req_mt), "Media types didn't match.\n"); ok(compare_media_types(&testsink.pin.pin.mt, &req_mt), "Media types didn't match.\n");
+ hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, source); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, source); ok(hr == S_OK, "Got hr %#x.\n", hr); hr = IFilterGraph2_Disconnect(graph, source); @@ -1449,6 +1465,7 @@ static void test_connect_pin(void)
CoTaskMemFree(source_mt); IPin_Release(source); + IMediaControl_Release(control); ref = IFilterGraph2_Release(graph); ok(!ref, "Got outstanding refcount %d.\n", ref); ref = IBaseFilter_Release(filter); diff --git a/dlls/quartz/tests/mpegsplit.c b/dlls/quartz/tests/mpegsplit.c index f8a0ac56356..26e2d06314c 100644 --- a/dlls/quartz/tests/mpegsplit.c +++ b/dlls/quartz/tests/mpegsplit.c @@ -1348,6 +1348,13 @@ static void test_connect_pin(void) hr = IPin_ConnectionMediaType(sink, &mt); ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#x.\n", hr);
+ hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, &testsource.source.pin.IPin_iface, sink, &req_mt); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + req_mt.majortype = MEDIATYPE_Video; hr = IFilterGraph2_ConnectDirect(graph, &testsource.source.pin.IPin_iface, sink, &req_mt); ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr); @@ -1371,6 +1378,13 @@ static void test_connect_pin(void) ok(compare_media_types(&mt, &req_mt), "Media types didn't match.\n"); ok(compare_media_types(&testsource.source.pin.mt, &req_mt), "Media types didn't match.\n");
+ hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, sink); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + /* Test source connection. */
IBaseFilter_FindPin(filter, L"Audio", &source); @@ -1390,6 +1404,13 @@ static void test_connect_pin(void) IEnumMediaTypes_Release(enummt); CopyMediaType(&req_mt, source_mt);
+ hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, &req_mt); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, &req_mt); ok(hr == S_OK, "Got hr %#x.\n", hr);
@@ -1403,6 +1424,13 @@ static void test_connect_pin(void) ok(compare_media_types(&mt, &req_mt), "Media types didn't match.\n"); ok(compare_media_types(&testsink.sink.pin.mt, &req_mt), "Media types didn't match.\n");
+ hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, source); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, source); ok(hr == S_OK, "Got hr %#x.\n", hr); hr = IFilterGraph2_Disconnect(graph, source); diff --git a/dlls/quartz/tests/videorenderer.c b/dlls/quartz/tests/videorenderer.c index f84d553f2aa..ffe370acf43 100644 --- a/dlls/quartz/tests/videorenderer.c +++ b/dlls/quartz/tests/videorenderer.c @@ -1378,6 +1378,13 @@ static void test_connect_pin(void) hr = IPin_ConnectionMediaType(pin, &mt); ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#x.\n", hr);
+ hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt); ok(hr == S_OK, "Got hr %#x.\n", hr);
@@ -1390,6 +1397,13 @@ static void test_connect_pin(void) ok(hr == S_OK, "Got hr %#x.\n", hr); ok(compare_media_types(&mt, &req_mt), "Media types didn't match.\n");
+ hr = IMediaControl_Pause(control); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, pin); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + IPin_QueryInterface(pin, &IID_IMemInputPin, (void **)&input);
test_allocator(input); diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c index 0a72cbb9b74..d7daa6deed5 100644 --- a/dlls/quartz/tests/vmr7.c +++ b/dlls/quartz/tests/vmr7.c @@ -1425,6 +1425,13 @@ static void test_connect_pin(void) hr = IPin_ConnectionMediaType(pin, &mt); ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#x.\n", hr);
+ hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt); ok(hr == S_OK, "Got hr %#x.\n", hr);
@@ -1437,6 +1444,9 @@ static void test_connect_pin(void) ok(hr == S_OK, "Got hr %#x.\n", hr); ok(compare_media_types(&mt, &req_mt), "Media types didn't match.\n");
+ /* Disconnecting while not stopped is broken: it returns S_OK, but + * subsequent attempts to connect return VFW_E_ALREADY_CONNECTED. */ + IPin_QueryInterface(pin, &IID_IMemInputPin, (void **)&input);
test_allocator(input); diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index 7b470c6e534..f88c43b07b5 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -1635,6 +1635,13 @@ static void test_connect_pin(void) hr = IPin_ConnectionMediaType(pin, &mt); ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#x.\n", hr);
+ hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt); ok(hr == S_OK, "Got hr %#x.\n", hr);
@@ -1647,6 +1654,9 @@ static void test_connect_pin(void) ok(hr == S_OK, "Got hr %#x.\n", hr); ok(compare_media_types(&mt, &req_mt), "Media types didn't match.\n");
+ /* Disconnecting while not stopped is broken: it returns S_OK, but + * subsequent attempts to connect return VFW_E_ALREADY_CONNECTED. */ + test_allocator(input);
hr = IMemInputPin_GetAllocator(input, &allocator);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=82204
Your paranoid android.
=== w10pro64 (32 bit report) ===
quartz: videorenderer.c:1087: Test failed: Got hr 0x80004005.
=== w10pro64 (64 bit report) ===
quartz: videorenderer.c:1087: Test failed: Got hr 0x80004005.
=== w10pro64_ar (64 bit report) ===
quartz: videorenderer.c:1077: Test failed: Thread should block in Receive(). videorenderer.c:1087: Test failed: Got hr 0x80004005.
=== w10pro64_he (64 bit report) ===
quartz: videorenderer.c:1073: Test failed: Wait failed. videorenderer.c:1074: Test failed: Got hr 0x103. videorenderer.c:1077: Test failed: Thread should block in Receive(). videorenderer.c:1087: Test failed: Got hr 0x80004005.
=== w10pro64_ja (64 bit report) ===
quartz: videorenderer.c:1087: Test failed: Got hr 0x80004005.
=== w10pro64 (32 bit report) ===
quartz: vmr7.c:2112: Test failed: Got unexpected status 0. vmr7.c:2115: Test failed: Wait timed out. vmr7.c:2123: Test failed: Got unexpected status 0x400040.
=== w10pro64_ar (64 bit report) ===
quartz: vmr7.c:2112: Test failed: Got unexpected status 0. vmr7.c:2115: Test failed: Wait timed out. vmr7.c:2123: Test failed: Got unexpected status 0x400040.
=== w10pro64 (32 bit report) ===
quartz: vmr9.c:1446: Test failed: Got hr 0x1. vmr9.c:1456: Test failed: Got hr 0x80040227.
=== w10pro64_he (64 bit report) ===
quartz: vmr9.c:1446: Test failed: Got hr 0x1.
=== w10pro64_ja (64 bit report) ===
quartz: vmr9.c:1436: Test failed: Thread should block in Receive().
=== w10pro64_zh_CN (64 bit report) ===
quartz: vmr9.c:1446: Test failed: Got hr 0x1.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qasf/tests/dmowrapper.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+)
diff --git a/dlls/qasf/tests/dmowrapper.c b/dlls/qasf/tests/dmowrapper.c index f76c0c3d9d5..bd87a3494b2 100644 --- a/dlls/qasf/tests/dmowrapper.c +++ b/dlls/qasf/tests/dmowrapper.c @@ -1445,6 +1445,8 @@ static void test_filter_state(IMediaControl *control) OAFilterState state; HRESULT hr;
+ got_Flush = 0; + hr = IMediaControl_GetState(control, 0, &state); ok(hr == S_OK, "Got hr %#x.\n", hr); ok(state == State_Stopped, "Got state %u.\n", state); @@ -1782,6 +1784,13 @@ static void test_connect_pin(void) hr = IFilterGraph2_ConnectDirect(graph, &testsource.source.pin.IPin_iface, sink, &req_mt); ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr);
+ hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, &testsource.source.pin.IPin_iface, sink, &req_mt); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(!testdmo_input_mt_set, "Input type should not be set.\n");
req_mt.lSampleSize = 123; @@ -1800,6 +1809,13 @@ static void test_connect_pin(void) ok(testdmo_input_mt_set, "Input type should be set.\n"); ok(compare_media_types(&testdmo_input_mt, &req_mt), "Media types didn't match.\n");
+ hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, sink); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + test_sink_allocator(meminput);
/* Test source connection. */ @@ -1816,6 +1832,14 @@ static void test_connect_pin(void) /* Exact connection. */
req_mt = mt2; + + hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, &req_mt); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, &req_mt); ok(hr == S_OK, "Got hr %#x.\n", hr);
@@ -1831,6 +1855,13 @@ static void test_connect_pin(void) ok(testdmo_output_mt_set, "Output type should be set.\n"); ok(compare_media_types(&testdmo_output_mt, &req_mt), "Media types didn't match.\n");
+ hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, source); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + test_filter_state(control); test_sample_processing(control, meminput);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qcap/tests/filewriter.c | 14 ++++++++++++ dlls/qcap/tests/smartteefilter.c | 37 +++++++++++++++++++++++++++++--- 2 files changed, 48 insertions(+), 3 deletions(-)
diff --git a/dlls/qcap/tests/filewriter.c b/dlls/qcap/tests/filewriter.c index e3bdcb76560..d6dbc3faded 100644 --- a/dlls/qcap/tests/filewriter.c +++ b/dlls/qcap/tests/filewriter.c @@ -768,6 +768,13 @@ static void test_connect_pin(void) hr = IPin_ConnectionMediaType(pin, &mt); ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#x.\n", hr);
+ hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt); ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr); req_mt.majortype = MEDIATYPE_Stream; @@ -783,6 +790,13 @@ static void test_connect_pin(void) ok(hr == S_OK, "Got hr %#x.\n", hr); ok(!memcmp(&mt, &req_mt, sizeof(AM_MEDIA_TYPE)), "Media types didn't match.\n");
+ hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, pin); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + todo_wine ok(hr == VFW_E_NO_ALLOCATOR, "Got hr %#x.\n", hr); + CoCreateInstance(&CLSID_MemoryAllocator, NULL, CLSCTX_INPROC_SERVER, &IID_IMemAllocator, (void **)&allocator);
diff --git a/dlls/qcap/tests/smartteefilter.c b/dlls/qcap/tests/smartteefilter.c index 1364beef161..1019fd3c1ba 100644 --- a/dlls/qcap/tests/smartteefilter.c +++ b/dlls/qcap/tests/smartteefilter.c @@ -2519,7 +2519,7 @@ static void test_source_media_types(AM_MEDIA_TYPE req_mt, const AM_MEDIA_TYPE *s }
static void test_source_connection(AM_MEDIA_TYPE req_mt, IFilterGraph2 *graph, - struct testfilter *testsink, IPin *source) + IMediaControl *control, struct testfilter *testsink, IPin *source) { const AM_MEDIA_TYPE sink_mt = req_mt; AM_MEDIA_TYPE mt; @@ -2536,6 +2536,13 @@ static void test_source_connection(AM_MEDIA_TYPE req_mt, IFilterGraph2 *graph,
/* Exact connection. */
+ hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, source, &testsink->sink.pin.IPin_iface, &req_mt); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, source, &testsink->sink.pin.IPin_iface, &req_mt); ok(hr == S_OK, "Got hr %#x.\n", hr);
@@ -2549,6 +2556,13 @@ static void test_source_connection(AM_MEDIA_TYPE req_mt, IFilterGraph2 *graph, ok(compare_media_types(&mt, &req_mt), "Media types didn't match.\n"); ok(compare_media_types(&testsink->sink.pin.mt, &req_mt), "Media types didn't match.\n");
+ hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, source); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, source); ok(hr == S_OK, "Got hr %#x.\n", hr); hr = IFilterGraph2_Disconnect(graph, source); @@ -2662,6 +2676,7 @@ static void test_connect_pin(void) IPin *sink, *capture, *preview, *peer; AM_MEDIA_TYPE mt, *mts[3]; IEnumMediaTypes *enummt; + IMediaControl *control; IFilterGraph2 *graph; HRESULT hr; ULONG ref; @@ -2673,6 +2688,7 @@ static void test_connect_pin(void) IFilterGraph2_AddFilter(graph, &testsource.filter.IBaseFilter_iface, L"source"); IFilterGraph2_AddFilter(graph, &testsink.filter.IBaseFilter_iface, L"sink"); IFilterGraph2_AddFilter(graph, filter, L"sample grabber"); + IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control); IBaseFilter_FindPin(filter, L"Input", &sink); IBaseFilter_FindPin(filter, L"Capture", &capture); IBaseFilter_FindPin(filter, L"Preview", &preview); @@ -2709,6 +2725,13 @@ static void test_connect_pin(void) hr = IPin_ConnectionMediaType(sink, &mt); ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#x.\n", hr);
+ hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, &testsource.source.pin.IPin_iface, sink, &req_mt); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, &testsource.source.pin.IPin_iface, sink, &req_mt); ok(hr == S_OK, "Got hr %#x.\n", hr);
@@ -2729,8 +2752,15 @@ static void test_connect_pin(void)
test_source_media_types(req_mt, &testsource.source_mt, capture); test_source_media_types(req_mt, &testsource.source_mt, preview); - test_source_connection(req_mt, graph, &testsink, capture); - test_source_connection(req_mt, graph, &testsink, preview); + test_source_connection(req_mt, graph, control, &testsink, capture); + test_source_connection(req_mt, graph, control, &testsink, preview); + + hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, sink); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IFilterGraph2_Disconnect(graph, sink); ok(hr == S_OK, "Got hr %#x.\n", hr); @@ -2750,6 +2780,7 @@ static void test_connect_pin(void) IPin_Release(sink); IPin_Release(capture); IPin_Release(preview); + IMediaControl_Release(control); ref = IFilterGraph2_Release(graph); ok(!ref, "Got outstanding refcount %d.\n", ref); ref = IBaseFilter_Release(filter);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qedit/tests/nullrenderer.c | 17 +++++++++++++++++ dlls/qedit/tests/samplegrabber.c | 31 +++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+)
diff --git a/dlls/qedit/tests/nullrenderer.c b/dlls/qedit/tests/nullrenderer.c index 754228d770b..1800f4dad4c 100644 --- a/dlls/qedit/tests/nullrenderer.c +++ b/dlls/qedit/tests/nullrenderer.c @@ -803,6 +803,7 @@ static void test_connect_pin(void) IBaseFilter *filter = create_null_renderer(); struct testfilter source; IMemAllocator *allocator; + IMediaControl *control; IFilterGraph2 *graph; IMemInputPin *input; AM_MEDIA_TYPE mt; @@ -816,6 +817,7 @@ static void test_connect_pin(void) &IID_IFilterGraph2, (void **)&graph); IFilterGraph2_AddFilter(graph, &source.filter.IBaseFilter_iface, L"source"); IFilterGraph2_AddFilter(graph, filter, L"sink"); + IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control);
IBaseFilter_FindPin(filter, L"In", &pin);
@@ -827,6 +829,13 @@ static void test_connect_pin(void) hr = IPin_ConnectionMediaType(pin, &mt); ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#x.\n", hr);
+ hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt); ok(hr == S_OK, "Got hr %#x.\n", hr);
@@ -839,6 +848,13 @@ static void test_connect_pin(void) ok(hr == S_OK, "Got hr %#x.\n", hr); ok(!memcmp(&mt, &req_mt, sizeof(AM_MEDIA_TYPE)), "Media types didn't match.\n");
+ hr = IMediaControl_Pause(control); + ok(hr == S_FALSE, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, pin); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + IPin_QueryInterface(pin, &IID_IMemInputPin, (void **)&input);
test_allocator(input); @@ -875,6 +891,7 @@ static void test_connect_pin(void)
IMemInputPin_Release(input); IPin_Release(pin); + IMediaControl_Release(control); ref = IFilterGraph2_Release(graph); ok(!ref, "Got outstanding refcount %d.\n", ref); ref = IBaseFilter_Release(filter); diff --git a/dlls/qedit/tests/samplegrabber.c b/dlls/qedit/tests/samplegrabber.c index 8e68e3efae1..3a1d1a16ce6 100644 --- a/dlls/qedit/tests/samplegrabber.c +++ b/dlls/qedit/tests/samplegrabber.c @@ -769,6 +769,7 @@ static void test_connect_pin(void) IPin *sink, *source, *peer; IEnumMediaTypes *enummt; ISampleGrabber *grabber; + IMediaControl *control; AM_MEDIA_TYPE mt, *pmt; IFilterGraph2 *graph; HRESULT hr; @@ -781,6 +782,7 @@ static void test_connect_pin(void) IFilterGraph2_AddFilter(graph, &testsource.filter.IBaseFilter_iface, L"source"); IFilterGraph2_AddFilter(graph, &testsink.filter.IBaseFilter_iface, L"sink"); IFilterGraph2_AddFilter(graph, filter, L"sample grabber"); + IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control); IBaseFilter_FindPin(filter, L"In", &sink); IBaseFilter_FindPin(filter, L"Out", &source); IBaseFilter_QueryInterface(filter, &IID_ISampleGrabber, (void **)&grabber); @@ -802,6 +804,13 @@ static void test_connect_pin(void) hr = IPin_ConnectionMediaType(sink, &mt); ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#x.\n", hr);
+ hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, &testsource.source.pin.IPin_iface, sink, &req_mt); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, &testsource.source.pin.IPin_iface, sink, &req_mt); ok(hr == S_OK, "Got hr %#x.\n", hr);
@@ -814,6 +823,13 @@ static void test_connect_pin(void) ok(hr == S_OK, "Got hr %#x.\n", hr); ok(compare_media_types(&mt, &req_mt), "Media types didn't match.\n");
+ hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, sink); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = ISampleGrabber_GetConnectedMediaType(grabber, NULL); ok(hr == E_POINTER, "Got hr %#x.\n", hr);
@@ -874,6 +890,13 @@ static void test_connect_pin(void)
/* Exact connection. */
+ hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, &req_mt); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + req_mt.bTemporalCompression = FALSE; hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, &req_mt); ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr); @@ -893,6 +916,13 @@ static void test_connect_pin(void) ok(compare_media_types(&testsink.sink.pin.mt, &req_mt), "Media types didn't match.\n"); ok(compare_media_types(&testsource.source.pin.mt, &testsink.sink.pin.mt), "Media types didn't match.\n");
+ hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, source); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#x.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IFilterGraph2_Disconnect(graph, source); ok(hr == S_OK, "Got hr %#x.\n", hr); hr = IFilterGraph2_Disconnect(graph, source); @@ -1025,6 +1055,7 @@ static void test_connect_pin(void)
IPin_Release(sink); IPin_Release(source); + IMediaControl_Release(control); ref = IFilterGraph2_Release(graph); ok(!ref, "Got outstanding refcount %d.\n", ref); ISampleGrabber_Release(grabber);