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

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2020-02-16 23:31:51 -06:00 committed by Alexandre Julliard
parent 7c35fccbcc
commit 84bede2b0d
3 changed files with 14 additions and 47 deletions

View File

@ -978,32 +978,17 @@ static void test_connect_pin(void)
req_mt.majortype = MEDIATYPE_Video; req_mt.majortype = MEDIATYPE_Video;
hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, &req_mt); 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); 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);
}
req_mt.majortype = GUID_NULL; req_mt.majortype = GUID_NULL;
req_mt.subtype = MEDIASUBTYPE_RGB8; req_mt.subtype = MEDIASUBTYPE_RGB8;
hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, &req_mt); 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); 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);
}
req_mt.subtype = GUID_NULL; req_mt.subtype = GUID_NULL;
req_mt.formattype = FORMAT_None; req_mt.formattype = FORMAT_None;
hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, &req_mt); 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); 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);
}
req_mt.formattype = GUID_NULL; req_mt.formattype = GUID_NULL;
testsink.sink_mt = &req_mt; testsink.sink_mt = &req_mt;

View File

@ -1405,12 +1405,7 @@ static void test_connect_pin(void)
req_mt.formattype = FORMAT_None; req_mt.formattype = FORMAT_None;
req_mt.majortype = GUID_NULL; req_mt.majortype = GUID_NULL;
hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.pin.pin.IPin_iface, &req_mt); 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); 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);
}
req_mt.formattype = GUID_NULL; req_mt.formattype = GUID_NULL;
hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.pin.pin.IPin_iface, &req_mt); 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; req_mt.subtype = MEDIASUBTYPE_RGB8;
hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.pin.pin.IPin_iface, &req_mt); 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); 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);
}
req_mt.subtype = GUID_NULL; req_mt.subtype = GUID_NULL;
hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.pin.pin.IPin_iface, &req_mt); 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.majortype = MEDIATYPE_Stream;
req_mt.subtype = MEDIASUBTYPE_RGB8; req_mt.subtype = MEDIASUBTYPE_RGB8;
hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.pin.pin.IPin_iface, &req_mt); 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); 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);
}
req_mt.subtype = GUID_NULL; req_mt.subtype = GUID_NULL;
hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.pin.pin.IPin_iface, &req_mt); hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.pin.pin.IPin_iface, &req_mt);

View File

@ -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); 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; return TRUE;
if (!IsEqualGUID(&a->majortype, &b->majortype) if (!IsEqualGUID(&req_mt->majortype, &pin_mt->majortype)
&& !IsEqualGUID(&a->majortype, &GUID_NULL) && !IsEqualGUID(&req_mt->majortype, &GUID_NULL))
&& !IsEqualGUID(&b->majortype, &GUID_NULL))
return FALSE; return FALSE;
if (!IsEqualGUID(&a->subtype, &b->subtype) if (!IsEqualGUID(&req_mt->subtype, &pin_mt->subtype)
&& !IsEqualGUID(&a->subtype, &GUID_NULL) && !IsEqualGUID(&req_mt->subtype, &GUID_NULL))
&& !IsEqualGUID(&b->subtype, &GUID_NULL))
return FALSE; return FALSE;
if (!IsEqualGUID(&a->formattype, &b->formattype) if (!IsEqualGUID(&req_mt->formattype, &pin_mt->formattype)
&& !IsEqualGUID(&a->formattype, &GUID_NULL) && !IsEqualGUID(&req_mt->formattype, &GUID_NULL))
&& !IsEqualGUID(&b->formattype, &GUID_NULL))
return FALSE; return FALSE;
return TRUE; return TRUE;