mf/tests: Add some H264 decoder SetOutputType tests.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45988
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47084
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49715
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52183
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2022-02-17 11:38:49 +01:00 committed by Alexandre Julliard
parent 67ed1f8835
commit f1ea8a4a50

View file

@ -6518,6 +6518,20 @@ static void test_h264_decoder(void)
ATTR_GUID(MF_MT_SUBTYPE, MFVideoFormat_H264),
{0},
};
static const struct attribute_desc output_type_desc[] =
{
ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video),
ATTR_GUID(MF_MT_SUBTYPE, MFVideoFormat_NV12),
ATTR_RATIO(MF_MT_FRAME_SIZE, 1920, 1080),
{0},
};
static const struct attribute_desc output_type_desc_win7[] =
{
ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Video),
ATTR_GUID(MF_MT_SUBTYPE, MFVideoFormat_NV12),
ATTR_RATIO(MF_MT_FRAME_SIZE, 1920, 1088),
{0},
};
MFT_REGISTER_TYPE_INFO input_type = {MFMediaType_Video, MFVideoFormat_H264};
MFT_REGISTER_TYPE_INFO output_type = {MFMediaType_Video, MFVideoFormat_NV12};
@ -6541,6 +6555,17 @@ static void test_h264_decoder(void)
todo_wine
ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "GetOutputAvailableType returned %#x\n", hr);
/* setting output media type first doesn't work */
hr = MFCreateMediaType(&media_type);
ok(hr == S_OK, "MFCreateMediaType returned %#x\n", hr);
init_media_type(media_type, default_outputs[0], -1);
hr = IMFTransform_SetOutputType(transform, 0, media_type, 0);
todo_wine
ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "SetOutputType returned %#x.\n", hr);
ret = IMFMediaType_Release(media_type);
ok(ret == 0, "Release returned %u\n", ret);
/* check available input types */
i = -1;
@ -6598,6 +6623,37 @@ static void test_h264_decoder(void)
todo_wine
ok(i == 5, "%u output media types\n", i);
/* check required output media type attributes */
hr = MFCreateMediaType(&media_type);
ok(hr == S_OK, "MFCreateMediaType returned %#x\n", hr);
hr = IMFTransform_SetOutputType(transform, 0, media_type, 0);
todo_wine
ok(hr == E_INVALIDARG, "SetOutputType returned %#x.\n", hr);
init_media_type(media_type, output_type_desc, 1);
hr = IMFTransform_SetOutputType(transform, 0, media_type, 0);
todo_wine
ok(hr == MF_E_INVALIDMEDIATYPE, "SetOutputType returned %#x.\n", hr);
init_media_type(media_type, output_type_desc, 2);
for (i = 2; i < ARRAY_SIZE(output_type_desc) - 1; ++i)
{
hr = IMFTransform_SetOutputType(transform, 0, media_type, 0);
todo_wine
ok(hr == MF_E_ATTRIBUTENOTFOUND, "SetOutputType returned %#x.\n", hr);
init_media_type(media_type, output_type_desc, i + 1);
}
hr = IMFTransform_SetOutputType(transform, 0, media_type, 0);
if (broken(hr == MF_E_INVALIDMEDIATYPE))
{
init_media_type(media_type, output_type_desc_win7, ARRAY_SIZE(output_type_desc_win7) - 1);
hr = IMFTransform_SetOutputType(transform, 0, media_type, 0);
}
todo_wine
ok(hr == S_OK, "SetOutputType returned %#x.\n", hr);
ret = IMFMediaType_Release(media_type);
todo_wine
ok(ret == 1, "Release returned %u\n", ret);
ret = IMFTransform_Release(transform);
ok(ret == 0, "Release returned %u\n", ret);