Commit 84bede2b authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

strmbase: Don't treat GUID_NULL in enumerated types as a wildcard.

parent 7c35fccb
......@@ -978,32 +978,17 @@ static void test_connect_pin(void)
req_mt.majortype = MEDIATYPE_Video;
hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, &req_mt);
todo_wine ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr);
if (hr == S_OK)
{
IFilterGraph2_Disconnect(graph, source);
IFilterGraph2_Disconnect(graph, &testsink.sink.pin.IPin_iface);
}
ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr);
req_mt.majortype = GUID_NULL;
req_mt.subtype = MEDIASUBTYPE_RGB8;
hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, &req_mt);
todo_wine ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr);
if (hr == S_OK)
{
IFilterGraph2_Disconnect(graph, source);
IFilterGraph2_Disconnect(graph, &testsink.sink.pin.IPin_iface);
}
ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr);
req_mt.subtype = GUID_NULL;
req_mt.formattype = FORMAT_None;
hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, &req_mt);
todo_wine ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr);
if (hr == S_OK)
{
IFilterGraph2_Disconnect(graph, source);
IFilterGraph2_Disconnect(graph, &testsink.sink.pin.IPin_iface);
}
ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr);
req_mt.formattype = GUID_NULL;
testsink.sink_mt = &req_mt;
......
......@@ -1405,12 +1405,7 @@ static void test_connect_pin(void)
req_mt.formattype = FORMAT_None;
req_mt.majortype = GUID_NULL;
hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.pin.pin.IPin_iface, &req_mt);
todo_wine ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr);
if (hr == S_OK)
{
IFilterGraph2_Disconnect(graph, source);
IFilterGraph2_Disconnect(graph, &testsink.pin.pin.IPin_iface);
}
ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr);
req_mt.formattype = GUID_NULL;
hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.pin.pin.IPin_iface, &req_mt);
......@@ -1421,12 +1416,7 @@ static void test_connect_pin(void)
req_mt.subtype = MEDIASUBTYPE_RGB8;
hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.pin.pin.IPin_iface, &req_mt);
todo_wine ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr);
if (hr == S_OK)
{
IFilterGraph2_Disconnect(graph, source);
IFilterGraph2_Disconnect(graph, &testsink.pin.pin.IPin_iface);
}
ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr);
req_mt.subtype = GUID_NULL;
hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.pin.pin.IPin_iface, &req_mt);
......@@ -1438,12 +1428,7 @@ static void test_connect_pin(void)
req_mt.majortype = MEDIATYPE_Stream;
req_mt.subtype = MEDIASUBTYPE_RGB8;
hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.pin.pin.IPin_iface, &req_mt);
todo_wine ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr);
if (hr == S_OK)
{
IFilterGraph2_Disconnect(graph, source);
IFilterGraph2_Disconnect(graph, &testsink.pin.pin.IPin_iface);
}
ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr);
req_mt.subtype = GUID_NULL;
hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.pin.pin.IPin_iface, &req_mt);
......
......@@ -422,24 +422,21 @@ static inline struct strmbase_source *impl_source_from_IPin( IPin *iface )
return CONTAINING_RECORD(iface, struct strmbase_source, pin.IPin_iface);
}
static BOOL compare_media_types(const AM_MEDIA_TYPE *a, const AM_MEDIA_TYPE *b)
static BOOL compare_media_types(const AM_MEDIA_TYPE *req_mt, const AM_MEDIA_TYPE *pin_mt)
{
if (!a)
if (!req_mt)
return TRUE;
if (!IsEqualGUID(&a->majortype, &b->majortype)
&& !IsEqualGUID(&a->majortype, &GUID_NULL)
&& !IsEqualGUID(&b->majortype, &GUID_NULL))
if (!IsEqualGUID(&req_mt->majortype, &pin_mt->majortype)
&& !IsEqualGUID(&req_mt->majortype, &GUID_NULL))
return FALSE;
if (!IsEqualGUID(&a->subtype, &b->subtype)
&& !IsEqualGUID(&a->subtype, &GUID_NULL)
&& !IsEqualGUID(&b->subtype, &GUID_NULL))
if (!IsEqualGUID(&req_mt->subtype, &pin_mt->subtype)
&& !IsEqualGUID(&req_mt->subtype, &GUID_NULL))
return FALSE;
if (!IsEqualGUID(&a->formattype, &b->formattype)
&& !IsEqualGUID(&a->formattype, &GUID_NULL)
&& !IsEqualGUID(&b->formattype, &GUID_NULL))
if (!IsEqualGUID(&req_mt->formattype, &pin_mt->formattype)
&& !IsEqualGUID(&req_mt->formattype, &GUID_NULL))
return FALSE;
return TRUE;
......
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