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>
feature/deterministic
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;
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;

View File

@ -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);

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);
}
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;