amstream: Accept only MEDIASUBTYPE_RGB8 in check_media_type().

Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Gijs Vermeulen 2020-06-30 19:57:17 -05:00 committed by Alexandre Julliard
parent fddae90d9b
commit a7c515fe01
2 changed files with 7 additions and 19 deletions

View File

@ -632,23 +632,12 @@ static HRESULT WINAPI ddraw_sink_Connect(IPin *iface, IPin *peer, const AM_MEDIA
return E_UNEXPECTED;
}
static BOOL check_media_type(const AM_MEDIA_TYPE *media_type)
static BOOL check_media_type(const AM_MEDIA_TYPE *mt)
{
if (IsEqualGUID(&media_type->majortype, &MEDIATYPE_Video)
&& IsEqualGUID(&media_type->formattype, &FORMAT_VideoInfo))
{
if (IsEqualGUID(&media_type->subtype, &MEDIASUBTYPE_RGB1) ||
IsEqualGUID(&media_type->subtype, &MEDIASUBTYPE_RGB4) ||
IsEqualGUID(&media_type->subtype, &MEDIASUBTYPE_RGB8) ||
IsEqualGUID(&media_type->subtype, &MEDIASUBTYPE_RGB565) ||
IsEqualGUID(&media_type->subtype, &MEDIASUBTYPE_RGB555) ||
IsEqualGUID(&media_type->subtype, &MEDIASUBTYPE_RGB24) ||
IsEqualGUID(&media_type->subtype, &MEDIASUBTYPE_RGB32))
{
TRACE("Video sub-type %s matches\n", debugstr_guid(&media_type->subtype));
return TRUE;
}
}
if (IsEqualGUID(&mt->majortype, &MEDIATYPE_Video)
&& IsEqualGUID(&mt->subtype, &MEDIASUBTYPE_RGB8)
&& IsEqualGUID(&mt->formattype, &FORMAT_VideoInfo))
return TRUE;
return FALSE;
}

View File

@ -1970,9 +1970,8 @@ static void test_media_types(void)
{
pmt->subtype = *rejected_subtypes[i];
hr = IPin_QueryAccept(pin, pmt);
todo_wine_if (i < 6)
ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x for subtype %s.\n",
hr, wine_dbgstr_guid(rejected_subtypes[i]));
ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x for subtype %s.\n",
hr, wine_dbgstr_guid(rejected_subtypes[i]));
}
CoTaskMemFree(pmt);