[PATCH v3 1/4] mf/tests: Check the number of input samples to get a H264 stream change.
Rémi Bernon
rbernon at codeweavers.com
Wed Mar 9 02:53:03 CST 2022
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 at codeweavers.com>
---
v3: Rebase and fix uninitialized output_info.cbSize usage in PATCH 4.
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 2e126a1dbcf..ead2d56dc70 100644
--- a/dlls/mf/tests/mf.c
+++ b/dlls/mf/tests/mf.c
@@ -6619,6 +6619,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;
@@ -6636,6 +6637,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);
@@ -6830,6 +6839,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)
{
@@ -6848,19 +6858,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);
--
2.35.1
More information about the wine-devel
mailing list