[PATCH 7/9] mf/tests: Add some IMFTransform output sample timestamp tests.

Rémi Bernon rbernon at codeweavers.com
Wed Apr 6 07:31:52 CDT 2022


Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
 dlls/mf/tests/mf.c | 48 ++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 46 insertions(+), 2 deletions(-)

diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c
index 8724a36e118..70b240755fd 100644
--- a/dlls/mf/tests/mf.c
+++ b/dlls/mf/tests/mf.c
@@ -6080,10 +6080,11 @@ static void test_wma_decoder(void)
     MFT_OUTPUT_DATA_BUFFER outputs[2];
     MFT_INPUT_STREAM_INFO input_info;
     MFT_OUTPUT_DATA_BUFFER output;
+    DWORD status, flags, length;
     WCHAR output_path[MAX_PATH];
     IMFMediaType *media_type;
     IMFTransform *transform;
-    DWORD status, length;
+    LONGLONG time, duration;
     HANDLE output_file;
     IMFSample *sample;
     HRSRC resource;
@@ -6341,10 +6342,26 @@ static void test_wma_decoder(void)
         ok(status == 0, "got status %#lx\n", status);
         hr = IMFSample_GetTotalLength(sample, &length);
         ok(hr == S_OK, "GetTotalLength returned %#lx\n", hr);
+        flags = 0xdeadbeef;
+        hr = IMFSample_GetSampleFlags(sample, &flags);
+        ok(hr == S_OK, "GetSampleFlags returned %#lx\n", hr);
+        ok(flags == 0, "got flags %#lx\n", flags);
+        time = 0xdeadbeef;
+        hr = IMFSample_GetSampleTime(sample, &time);
+        todo_wine
+        ok(hr == S_OK, "GetSampleTime returned %#lx\n", hr);
+        todo_wine
+        ok(time == i * 928798, "got time %I64d\n", time);
+        duration = 0xdeadbeef;
+        hr = IMFSample_GetSampleDuration(sample, &duration);
+        todo_wine
+        ok(hr == S_OK, "GetSampleDuration returned %#lx\n", hr);
         if (output.dwStatus == MFT_OUTPUT_DATA_BUFFER_INCOMPLETE ||
                 broken(output.dwStatus == (MFT_OUTPUT_DATA_BUFFER_INCOMPLETE|7)))
         {
             ok(length == wmadec_block_size, "got length %lu\n", length);
+            todo_wine
+            ok(duration == 928798, "got duration %I64d\n", duration);
             check_sample_pcm16(sample, wmadec_data, output_file, TRUE);
             wmadec_data += wmadec_block_size;
             wmadec_data_len -= wmadec_block_size;
@@ -6354,6 +6371,8 @@ static void test_wma_decoder(void)
             /* FFmpeg doesn't seem to decode WMA buffers in the same way as native */
             todo_wine
             ok(length == wmadec_block_size / 2, "got length %lu\n", length);
+            todo_wine
+            ok(duration == 464399, "got duration %I64d\n", duration);
 
             if (length == wmadec_block_size / 2)
                 check_sample_pcm16(sample, wmadec_data, output_file, FALSE);
@@ -6715,11 +6734,12 @@ static void test_h264_decoder(void)
     MFT_INPUT_STREAM_INFO input_info;
     MFT_OUTPUT_DATA_BUFFER output;
     IMFMediaBuffer *media_buffer;
+    DWORD status, length, count;
     WCHAR output_path[MAX_PATH];
     IMFAttributes *attributes;
     IMFMediaType *media_type;
+    LONGLONG time, duration;
     IMFTransform *transform;
-    DWORD status, length;
     BOOL is_win7 = FALSE;
     ULONG i, ret, flags;
     HANDLE output_file;
@@ -7057,6 +7077,30 @@ static void test_h264_decoder(void)
     ok(status == 0, "got status %#lx\n", status);
     if (hr == S_OK)
     {
+        count = 0xdeadbeef;
+        hr = IMFSample_GetBufferCount(output.pSample, &count);
+        ok(hr == S_OK, "GetBufferCount returned %#lx\n", hr);
+        ok(count == 1, "got count %#lx\n", count);
+
+        flags = 0xdeadbeef;
+        hr = IMFSample_GetSampleFlags(output.pSample, &flags);
+        ok(hr == S_OK, "GetSampleFlags returned %#lx\n", hr);
+        ok(flags == 0, "got flags %#lx\n", flags);
+        time = 0xdeadbeef;
+        hr = IMFSample_GetSampleTime(output.pSample, &time);
+        todo_wine
+        ok(hr == S_OK, "GetSampleTime returned %#lx\n", hr);
+        todo_wine
+        ok(time == 0, "got time %I64d\n", time);
+        duration = 0xdeadbeef;
+
+        /* doesn't matter what frame rate we've selected, duration is defined by the stream */
+        hr = IMFSample_GetSampleDuration(output.pSample, &duration);
+        todo_wine
+        ok(hr == S_OK, "GetSampleDuration returned %#lx\n", hr);
+        todo_wine
+        ok(duration == 333667, "got duration %I64d\n", duration);
+
         /* Win8 and before pad the data with garbage instead of original
          * buffer data, make sure it's consistent.  */
         hr = IMFSample_ConvertToContiguousBuffer(output.pSample, &media_buffer);
-- 
2.35.1




More information about the wine-devel mailing list