quartz/tests: Test (dis)connecting while not stopped.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
9c2cf13170
commit
6463f65adc
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue