Rémi Bernon : mf/tests: Add more topology loader converter and enumeration tests.

Alexandre Julliard julliard at winehq.org
Tue Aug 16 16:00:59 CDT 2022


Module: wine
Branch: master
Commit: 245ac9b46e960ee1189a426a88acc574c588a3a4
URL:    https://gitlab.winehq.org/wine/wine/-/commit/245ac9b46e960ee1189a426a88acc574c588a3a4

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Thu Aug 11 09:38:40 2022 +0200

mf/tests: Add more topology loader converter and enumeration tests.

---

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

diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c
index f6024f95768..5d95b092002 100644
--- a/dlls/mf/tests/mf.c
+++ b/dlls/mf/tests/mf.c
@@ -2210,6 +2210,16 @@ static void test_topology_loader(void)
         ATTR_UINT32(MF_MT_AUDIO_BLOCK_ALIGNMENT, 1),
         ATTR_UINT32(MF_MT_AUDIO_BITS_PER_SAMPLE, 8),
     };
+    static const media_type_desc audio_float_48000 =
+    {
+        ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Audio),
+        ATTR_GUID(MF_MT_SUBTYPE, MFAudioFormat_Float),
+        ATTR_UINT32(MF_MT_AUDIO_NUM_CHANNELS, 2),
+        ATTR_UINT32(MF_MT_AUDIO_SAMPLES_PER_SECOND, 48000),
+        ATTR_UINT32(MF_MT_AUDIO_AVG_BYTES_PER_SECOND, 8 * 48000),
+        ATTR_UINT32(MF_MT_AUDIO_BLOCK_ALIGNMENT, 8),
+        ATTR_UINT32(MF_MT_AUDIO_BITS_PER_SAMPLE, 32),
+    };
     static const media_type_desc audio_mp3_44100 =
     {
         ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Audio),
@@ -2332,6 +2342,13 @@ static void test_topology_loader(void)
             .expected_result = S_OK,
             .flags = LOADER_EXPECTED_CONVERTER,
         },
+        {
+            /* PCM -> PCM, different enumerated bps, same current type, sink allow converter, force enumerate */
+            .input_type = &audio_pcm_44100, .output_type = &audio_pcm_48000, .sink_method = MF_CONNECT_ALLOW_CONVERTER, .source_method = -1,
+            .current_input = &audio_pcm_48000,
+            .expected_result = S_OK,
+            .flags = LOADER_EXPECTED_CONVERTER | LOADER_SET_ENUMERATE_SOURCE_TYPES | LOADER_TODO,
+        },
         {
             /* PCM -> PCM, different enumerated bps, no current type, sink allow decoder */
             .input_type = &audio_pcm_44100, .output_type = &audio_pcm_48000, .sink_method = MF_CONNECT_ALLOW_DECODER, .source_method = MF_CONNECT_DIRECT,
@@ -2377,6 +2394,13 @@ static void test_topology_loader(void)
             .expected_result = S_OK,
             .flags = LOADER_EXPECTED_DECODER | LOADER_TODO,
         },
+        {
+            /* MP3 -> PCM, need both decoder and converter */
+            .input_type = &audio_mp3_44100, .output_type = &audio_float_48000, .sink_method = MF_CONNECT_ALLOW_DECODER, .source_method = -1,
+            .current_input = &audio_mp3_44100,
+            .expected_result = S_OK,
+            .flags = LOADER_EXPECTED_DECODER | LOADER_EXPECTED_CONVERTER | LOADER_TODO,
+        },
 
         {
             /* I420 -> RGB32, Color Convert media type */




More information about the wine-cvs mailing list