Commit 6a7428a0 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

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=52183Signed-off-by: 's avatarRémi Bernon <rbernon@codeweavers.com> Signed-off-by: 's avatarNikolay Sivov <nsivov@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 824a7eed
...@@ -6636,6 +6636,7 @@ static void test_h264_decoder(void) ...@@ -6636,6 +6636,7 @@ static void test_h264_decoder(void)
MFT_OUTPUT_DATA_BUFFER output; MFT_OUTPUT_DATA_BUFFER output;
const BYTE *h264_encoded_data; const BYTE *h264_encoded_data;
ULONG h264_encoded_data_len; ULONG h264_encoded_data_len;
IMFAttributes *attributes;
IMFMediaType *media_type; IMFMediaType *media_type;
IMFTransform *transform; IMFTransform *transform;
ULONG i, ret, flags; ULONG i, ret, flags;
...@@ -6653,6 +6654,14 @@ static void test_h264_decoder(void) ...@@ -6653,6 +6654,14 @@ static void test_h264_decoder(void)
&transform, &class_id)) &transform, &class_id))
goto failed; 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 */ /* no output type is available before an input type is set */
hr = IMFTransform_GetOutputAvailableType(transform, 0, 0, &media_type); hr = IMFTransform_GetOutputAvailableType(transform, 0, 0, &media_type);
...@@ -6847,6 +6856,7 @@ static void test_h264_decoder(void) ...@@ -6847,6 +6856,7 @@ static void test_h264_decoder(void)
ok(!output.pEvents, "got pEvents %p\n", output.pEvents); ok(!output.pEvents, "got pEvents %p\n", output.pEvents);
ok(status == 0, "got status %#lx\n", status); ok(status == 0, "got status %#lx\n", status);
i = 0;
sample = next_h264_sample(&h264_encoded_data, &h264_encoded_data_len); sample = next_h264_sample(&h264_encoded_data, &h264_encoded_data_len);
while (1) while (1)
{ {
...@@ -6865,19 +6875,30 @@ static void test_h264_decoder(void) ...@@ -6865,19 +6875,30 @@ static void test_h264_decoder(void)
ret = IMFSample_Release(output.pSample); ret = IMFSample_Release(output.pSample);
ok(ret == 0, "Release returned %lu\n", ret); ok(ret == 0, "Release returned %lu\n", ret);
while (h264_encoded_data_len > 4) hr = IMFTransform_ProcessInput(transform, 0, sample, 0);
{ todo_wine
hr = IMFTransform_ProcessInput(transform, 0, sample, 0); ok(hr == S_OK, "ProcessInput returned %#lx\n", hr);
if (FAILED(hr)) break; ret = IMFSample_Release(sample);
ok(hr == S_OK, "ProcessInput returned %#lx\n", hr); ok(ret <= 1, "Release returned %lu\n", ret);
ret = IMFSample_Release(sample); sample = next_h264_sample(&h264_encoded_data, &h264_encoded_data_len);
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 == MF_E_NOTACCEPTING, "ProcessInput returned %#lx\n", hr); ok(hr == S_OK, "ProcessInput returned %#lx\n", hr);
EXPECT_REF(sample, 1); 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 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(hr == MF_E_TRANSFORM_STREAM_CHANGE, "ProcessOutput returned %#lx\n", hr);
ok(output.dwStreamID == 0, "got dwStreamID %lu\n", output.dwStreamID); ok(output.dwStreamID == 0, "got dwStreamID %lu\n", output.dwStreamID);
ok(!!output.pSample, "got pSample %p\n", output.pSample); ok(!!output.pSample, "got pSample %p\n", output.pSample);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment