Module: wine Branch: master Commit: 6a7428a0fae887cecf2e97b9cab9de9cf7811446 URL: https://source.winehq.org/git/wine.git/?a=commit;h=6a7428a0fae887cecf2e97b9c...
Author: Rémi Bernon rbernon@codeweavers.com Date: Wed Mar 9 09:53:03 2022 +0100
mf/tests: Check the number of input samples to get a H264 stream change.
We check that we can at least push two input samples at a time, which matches what Call of Duty Black Ops 3 is doing, as it is not checking ProcessInput result most of the time.
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
---
dlls/mf/tests/mf.c | 43 ++++++++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 11 deletions(-)
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index d23dcdce064..d9ceb066c60 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -6636,6 +6636,7 @@ static void test_h264_decoder(void) MFT_OUTPUT_DATA_BUFFER output; const BYTE *h264_encoded_data; ULONG h264_encoded_data_len; + IMFAttributes *attributes; IMFMediaType *media_type; IMFTransform *transform; ULONG i, ret, flags; @@ -6653,6 +6654,14 @@ static void test_h264_decoder(void) &transform, &class_id)) goto failed;
+ hr = IMFTransform_GetAttributes(transform, &attributes); + todo_wine + ok(hr == S_OK, "GetAttributes returned %#lx\n", hr); + if (hr != S_OK) MFCreateAttributes(&attributes, 0); + hr = IMFAttributes_SetUINT32(attributes, &MF_LOW_LATENCY, 1); + ok(hr == S_OK, "SetUINT32 returned %#lx\n", hr); + IMFAttributes_Release(attributes); + /* no output type is available before an input type is set */
hr = IMFTransform_GetOutputAvailableType(transform, 0, 0, &media_type); @@ -6847,6 +6856,7 @@ static void test_h264_decoder(void) ok(!output.pEvents, "got pEvents %p\n", output.pEvents); ok(status == 0, "got status %#lx\n", status);
+ i = 0; sample = next_h264_sample(&h264_encoded_data, &h264_encoded_data_len); while (1) { @@ -6865,19 +6875,30 @@ static void test_h264_decoder(void) ret = IMFSample_Release(output.pSample); ok(ret == 0, "Release returned %lu\n", ret);
- while (h264_encoded_data_len > 4) - { - hr = IMFTransform_ProcessInput(transform, 0, sample, 0); - if (FAILED(hr)) break; - ok(hr == S_OK, "ProcessInput returned %#lx\n", hr); - ret = IMFSample_Release(sample); - ok(ret <= 1, "Release returned %lu\n", ret); - sample = next_h264_sample(&h264_encoded_data, &h264_encoded_data_len); - } - ok(hr == MF_E_NOTACCEPTING, "ProcessInput returned %#lx\n", hr); - EXPECT_REF(sample, 1); + hr = IMFTransform_ProcessInput(transform, 0, sample, 0); + todo_wine + ok(hr == S_OK, "ProcessInput returned %#lx\n", hr); + ret = IMFSample_Release(sample); + ok(ret <= 1, "Release returned %lu\n", ret); + sample = next_h264_sample(&h264_encoded_data, &h264_encoded_data_len); + + hr = IMFTransform_ProcessInput(transform, 0, sample, 0); + todo_wine + ok(hr == S_OK, "ProcessInput returned %#lx\n", hr); + ret = IMFSample_Release(sample); + ok(ret <= 1, "Release returned %lu\n", ret); + sample = next_h264_sample(&h264_encoded_data, &h264_encoded_data_len); + i++; + + hr = IMFTransform_ProcessMessage(transform, MFT_MESSAGE_COMMAND_DRAIN, 0); + todo_wine + ok(hr == S_OK, "ProcessMessage returned %#lx\n", hr); } todo_wine + ok(i == 2, "got %lu iterations\n", i); + todo_wine + ok(h264_encoded_data_len == 44959, "got h264_encoded_data_len %lu\n", h264_encoded_data_len); + todo_wine ok(hr == MF_E_TRANSFORM_STREAM_CHANGE, "ProcessOutput returned %#lx\n", hr); ok(output.dwStreamID == 0, "got dwStreamID %lu\n", output.dwStreamID); ok(!!output.pSample, "got pSample %p\n", output.pSample);