[PATCH 5/6] mf/tests: Add some IMFTransform output sample timestamp tests.

Rémi Bernon rbernon at codeweavers.com
Mon Apr 4 16:48:08 CDT 2022


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

diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c
index a93ae1510f2..d300b2a4d82 100644
--- a/dlls/mf/tests/mf.c
+++ b/dlls/mf/tests/mf.c
@@ -6093,10 +6093,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;
@@ -6354,10 +6355,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;
@@ -6367,6 +6384,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);
@@ -6693,11 +6712,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;
     ULONG i, ret, flags;
     HANDLE output_file;
     IMFSample *sample;
@@ -7002,6 +7022,28 @@ 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;
+        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