Rémi Bernon : mf/tests: Add some H264 decoder SetOutputType tests.

Alexandre Julliard julliard at winehq.org
Mon Feb 21 16:15:11 CST 2022


Module: wine
Branch: master
Commit: f1ea8a4a503f9eff388e8baa78a5053b7cf00bd5
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=f1ea8a4a503f9eff388e8baa78a5053b7cf00bd5

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Thu Feb 17 11:38:49 2022 +0100

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 at codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mf/tests/mf.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)

diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c
index dc19efc4ae6..07f4c28052d 100644
--- a/dlls/mf/tests/mf.c
+++ b/dlls/mf/tests/mf.c
@@ -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);
 




More information about the wine-cvs mailing list