Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51931 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52391 Signed-off-by: Rémi Bernon rbernon@codeweavers.com ---
v3: Add broken test results for Windows 7.
dlls/mf/tests/mf.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index 8b3e0dd65b2..5b2f5e60d4b 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -5726,6 +5726,7 @@ static void test_wma_decoder(void)
MFT_REGISTER_TYPE_INFO input_type = {MFMediaType_Audio, MFAudioFormat_WMAudioV8}; MFT_REGISTER_TYPE_INFO output_type = {MFMediaType_Audio, MFAudioFormat_Float}; + MFT_INPUT_STREAM_INFO input_info; IMFMediaType *media_type; IMFTransform *transform; GUID class_id; @@ -5745,6 +5746,9 @@ static void test_wma_decoder(void)
/* check default media types */
+ hr = IMFTransform_GetInputStreamInfo(transform, 0, &input_info); + todo_wine + ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "GetInputStreamInfo returned %#x\n", hr); hr = IMFTransform_GetOutputAvailableType(transform, 0, 0, &media_type); todo_wine ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "GetOutputAvailableType returned %#x\n", hr); @@ -5802,6 +5806,10 @@ static void test_wma_decoder(void) ret = IMFMediaType_Release(media_type); ok(ret == 0, "Release returned %u\n", ret);
+ hr = IMFTransform_GetInputStreamInfo(transform, 0, &input_info); + todo_wine + ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "GetInputStreamInfo returned %#x\n", hr); + /* check new output media types */
i = -1; @@ -5844,6 +5852,21 @@ static void test_wma_decoder(void) ret = IMFMediaType_Release(media_type); ok(ret == 0, "Release returned %u\n", ret);
+ memset(&input_info, 0xcd, sizeof(input_info)); + hr = IMFTransform_GetInputStreamInfo(transform, 0, &input_info); + todo_wine + ok(hr == S_OK, "GetInputStreamInfo returned %#x\n", hr); + todo_wine + ok(input_info.hnsMaxLatency == 0, "got hnsMaxLatency %s\n", wine_dbgstr_longlong(input_info.hnsMaxLatency)); + todo_wine + ok(input_info.dwFlags == 0, "got dwFlags %#x\n", input_info.dwFlags); + todo_wine + ok(input_info.cbSize == wma_block_size, "got cbSize %u\n", input_info.cbSize); + todo_wine + ok(input_info.cbMaxLookahead == 0, "got cbMaxLookahead %#x\n", input_info.cbMaxLookahead); + todo_wine + ok(input_info.cbAlignment == 1, "got cbAlignment %#x\n", input_info.cbAlignment); + ret = IMFTransform_Release(transform); ok(ret == 0, "Release returned %u\n", ret);
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51931 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52391 Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/mf/tests/mf.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+)
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index 5b2f5e60d4b..a9467a7fdb6 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -5726,6 +5726,7 @@ static void test_wma_decoder(void)
MFT_REGISTER_TYPE_INFO input_type = {MFMediaType_Audio, MFAudioFormat_WMAudioV8}; MFT_REGISTER_TYPE_INFO output_type = {MFMediaType_Audio, MFAudioFormat_Float}; + MFT_OUTPUT_STREAM_INFO output_info; MFT_INPUT_STREAM_INFO input_info; IMFMediaType *media_type; IMFTransform *transform; @@ -5749,6 +5750,9 @@ static void test_wma_decoder(void) hr = IMFTransform_GetInputStreamInfo(transform, 0, &input_info); todo_wine ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "GetInputStreamInfo returned %#x\n", hr); + hr = IMFTransform_GetOutputStreamInfo(transform, 0, &output_info); + todo_wine + ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "GetOutputStreamInfo returned %#x\n", hr); hr = IMFTransform_GetOutputAvailableType(transform, 0, 0, &media_type); todo_wine ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "GetOutputAvailableType returned %#x\n", hr); @@ -5809,6 +5813,9 @@ static void test_wma_decoder(void) hr = IMFTransform_GetInputStreamInfo(transform, 0, &input_info); todo_wine ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "GetInputStreamInfo returned %#x\n", hr); + hr = IMFTransform_GetOutputStreamInfo(transform, 0, &output_info); + todo_wine + ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "GetOutputStreamInfo returned %#x\n", hr);
/* check new output media types */
@@ -5867,6 +5874,50 @@ static void test_wma_decoder(void) todo_wine ok(input_info.cbAlignment == 1, "got cbAlignment %#x\n", input_info.cbAlignment);
+ memset(&output_info, 0xcd, sizeof(output_info)); + hr = IMFTransform_GetOutputStreamInfo(transform, 0, &output_info); + todo_wine + ok(hr == S_OK, "GetOutputStreamInfo returned %#x\n", hr); + todo_wine + ok(output_info.dwFlags == 0, "got dwFlags %#x\n", output_info.dwFlags); + todo_wine + ok(output_info.cbSize == 0, "got cbSize %#x\n", output_info.cbSize); + todo_wine + ok(output_info.cbAlignment == 1, "got cbAlignment %#x\n", output_info.cbAlignment); + + /* MF_MT_AUDIO_AVG_BYTES_PER_SECOND isn't required by SetInputType, but is needed for the transform to work */ + + hr = MFCreateMediaType(&media_type); + ok(hr == S_OK, "MFCreateMediaType returned %#x\n", hr); + init_media_type(media_type, input_type_desc, -1); + hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_AVG_BYTES_PER_SECOND, 4003); + ok(hr == S_OK, "SetUINT32 returned %#x\n", hr); + hr = IMFTransform_SetInputType(transform, 0, media_type, 0); + todo_wine + ok(hr == S_OK, "SetInputType returned %#x.\n", hr); + + hr = IMFTransform_GetOutputStreamInfo(transform, 0, &output_info); + todo_wine + ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "GetOutputStreamInfo returned %#x\n", hr); + + init_media_type(media_type, output_type_desc, -1); + hr = IMFTransform_SetOutputType(transform, 0, media_type, 0); + todo_wine + ok(hr == S_OK, "SetInputType returned %#x.\n", hr); + ret = IMFMediaType_Release(media_type); + ok(ret == 0, "Release returned %u\n", ret); + + memset(&output_info, 0xcd, sizeof(output_info)); + hr = IMFTransform_GetOutputStreamInfo(transform, 0, &output_info); + todo_wine + ok(hr == S_OK, "GetOutputStreamInfo returned %#x\n", hr); + todo_wine + ok(output_info.dwFlags == 0, "got dwFlags %#x\n", output_info.dwFlags); + todo_wine + ok(output_info.cbSize == sizeof(wma_decoded_data), "got cbSize %#x\n", output_info.cbSize); + todo_wine + ok(output_info.cbAlignment == 1, "got cbAlignment %#x\n", output_info.cbAlignment); + ret = IMFTransform_Release(transform); ok(ret == 0, "Release returned %u\n", ret);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=106067
Your paranoid android.
=== w8adm (32 bit report) ===
mf: mf.c:4292: Test failed: Unexpected hr 0x800401f0.
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51931 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52391 Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/mf/tests/mf.c | 132 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+)
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index a9467a7fdb6..24389882e4d 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -5491,9 +5491,103 @@ static IMFSample *create_sample(const BYTE *data, ULONG size) return sample; }
+#define check_sample(a, b, c) check_sample_(__LINE__, a, b, c) +static void check_sample_(int line, IMFSample *sample, const void *expect_buf, ULONG expect_len) +{ + IMFMediaBuffer *media_buffer; + DWORD length; + BYTE *buffer; + HRESULT hr; + ULONG ret; + + hr = IMFSample_ConvertToContiguousBuffer(sample, &media_buffer); + ok_(__FILE__, line)(hr == S_OK, "ConvertToContiguousBuffer returned %#x\n", hr); + hr = IMFMediaBuffer_Lock(media_buffer, &buffer, NULL, &length); + ok_(__FILE__, line)(hr == S_OK, "Lock returned %#x\n", hr); + ok_(__FILE__, line)(expect_len == length, "got length %u\n", length); + if (length && length == expect_len) + { + ok_(__FILE__, line)(!memcmp(expect_buf, buffer, expect_len), + "unexpected buffer data\n"); + } + hr = IMFMediaBuffer_Unlock(media_buffer); + ok_(__FILE__, line)(hr == S_OK, "Unlock returned %#x\n", hr); + ret = IMFMediaBuffer_Release(media_buffer); + ok_(__FILE__, line)(ret == 1, "Release returned %u\n", ret); +} + static const BYTE wma_codec_data[10] = {0, 0x44, 0, 0, 0x17, 0, 0, 0, 0, 0}; static const BYTE wma_decoded_data[0x4000] = {0}; static const ULONG wma_block_size = 1487; +static const BYTE wma_encoded_data[][1487] = +{ + {0x09,0x00,0x00,0x77,0xe9,0x48,0x0c,0x84,0x44,0x88,0x4a,0x40,0x64,0x22,0x24,0x43, + 0xd6,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x18,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x28,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x38,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x48,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x58,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x44,0x88,0x4a,0x40,0x64,0x22,0x24,0x43, + 0xd6,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x68,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x78,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x88,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x98,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0xa8,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x44,0x88,0x4a,0x40,0x64,0x22,0x24,0x43, + 0xd6,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0xb8,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0xc8,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0xd8,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0xe8,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0xf8,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x44,0x88,0x4a,0x40,0x64,0x22,0x24,0x43, + 0xd6,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x08,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x18,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x28,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x38,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x48,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x44,0x88,0x4a,0x40,0x64,0x22,0x24,0x43, + 0xd6,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x58,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x68,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x78,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x88,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x98,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x44,0x88,0x4a,0x40,0x64,0x22,0x24,0x43, + 0xd6,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0xa8,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0xb8,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0xc8,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0xd8,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0xe8,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x44,0x88,0x4a,0x40,0x64,0x22,0x24,0x43, + 0xd6,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0xf8,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {0x03,0x00,0x00,0x42,0x10,0x84,0x21,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, +};
static void test_wma_encoder(void) { @@ -5551,10 +5645,12 @@ static void test_wma_encoder(void) MFT_REGISTER_TYPE_INFO input_type = {MFMediaType_Audio, MFAudioFormat_Float}; MFT_OUTPUT_STREAM_INFO output_info; MFT_INPUT_STREAM_INFO input_info; + MFT_OUTPUT_DATA_BUFFER output; IMFMediaType *media_type; IMFTransform *transform; IMFSample *sample; GUID class_id; + DWORD status; ULONG i, ret; HRESULT hr;
@@ -5611,6 +5707,42 @@ static void test_wma_encoder(void) hr = IMFTransform_ProcessInput(transform, 0, sample, 0); ok(hr == MF_E_NOTACCEPTING, "ProcessInput returned %#x\n", hr);
+ status = 0xdeadbeef; + sample = create_sample(NULL, output_info.cbSize); + memset(&output, 0, sizeof(output)); + output.pSample = sample; + + i = 0; + while (SUCCEEDED(hr = IMFTransform_ProcessOutput(transform, 0, 1, &output, &status))) + { + winetest_push_context("%u", i); + ok(hr == S_OK, "ProcessOutput returned %#x\n", hr); + ok(output.pSample == sample, "got pSample %p\n", output.pSample); + ok(output.dwStatus == MFT_OUTPUT_DATA_BUFFER_INCOMPLETE || + broken(output.dwStatus == (MFT_OUTPUT_DATA_BUFFER_INCOMPLETE|5)) /* win7 */, + "got dwStatus %#x\n", output.dwStatus); + ok(status == 0, "got status %#x\n", status); + check_sample(sample, wma_encoded_data + i, wma_block_size); + winetest_pop_context(); + i++; + } + + ret = IMFSample_Release(sample); + ok(ret == 0, "Release returned %u\n", ret); + + status = 0xdeadbeef; + sample = create_sample(NULL, output_info.cbSize); + memset(&output, 0, sizeof(output)); + output.pSample = sample; + hr = IMFTransform_ProcessOutput(transform, 0, 1, &output, &status); + ok(hr == MF_E_TRANSFORM_NEED_MORE_INPUT, "ProcessOutput returned %#x\n", hr); + ok(output.pSample == sample, "got pSample %p\n", output.pSample); + ok(output.dwStatus == 0, "got dwStatus %#x\n", output.dwStatus); + ok(status == 0, "got status %#x\n", status); + check_sample(sample, NULL, 0); + ret = IMFSample_Release(sample); + ok(ret == 0, "Release returned %u\n", ret); + ret = IMFTransform_Release(transform); ok(ret == 0, "Release returned %u\n", ret);
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51931 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52391 Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/mf/tests/mf.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index 24389882e4d..7f6e63850e7 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -5862,6 +5862,7 @@ static void test_wma_decoder(void) MFT_INPUT_STREAM_INFO input_info; IMFMediaType *media_type; IMFTransform *transform; + IMFSample *sample; GUID class_id; ULONG i, ret; HRESULT hr; @@ -6050,6 +6051,29 @@ static void test_wma_decoder(void) todo_wine ok(output_info.cbAlignment == 1, "got cbAlignment %#x\n", output_info.cbAlignment);
+ sample = create_sample(wma_encoded_data[0], wma_block_size / 2); + hr = IMFTransform_ProcessInput(transform, 0, sample, 0); + todo_wine + ok(hr == S_OK, "ProcessInput returned %#x\n", hr); + ret = IMFSample_Release(sample); + ok(ret == 0, "Release returned %u\n", ret); + sample = create_sample(wma_encoded_data[0] + wma_block_size, wma_block_size - wma_block_size / 2); + hr = IMFTransform_ProcessInput(transform, 0, sample, 0); + todo_wine + ok(hr == S_OK, "ProcessInput returned %#x\n", hr); + ret = IMFSample_Release(sample); + ok(ret == 0, "Release returned %u\n", ret); + sample = create_sample(wma_encoded_data[0], wma_block_size); + hr = IMFTransform_ProcessInput(transform, 0, sample, 0); + todo_wine + ok(hr == S_OK, "ProcessInput returned %#x\n", hr); + hr = IMFTransform_ProcessInput(transform, 0, sample, 0); + todo_wine + ok(hr == MF_E_NOTACCEPTING, "ProcessInput returned %#x\n", hr); + ret = IMFSample_Release(sample); + todo_wine + ok(ret == 1, "Release returned %u\n", ret); + ret = IMFTransform_Release(transform); ok(ret == 0, "Release returned %u\n", ret);
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51931 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52391 Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/mf/tests/mf.c | 136 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+)
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index 7f6e63850e7..e65050d998a 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -5860,10 +5860,12 @@ static void test_wma_decoder(void) MFT_REGISTER_TYPE_INFO output_type = {MFMediaType_Audio, MFAudioFormat_Float}; MFT_OUTPUT_STREAM_INFO output_info; MFT_INPUT_STREAM_INFO input_info; + MFT_OUTPUT_DATA_BUFFER output; IMFMediaType *media_type; IMFTransform *transform; IMFSample *sample; GUID class_id; + DWORD status; ULONG i, ret; HRESULT hr;
@@ -6074,8 +6076,142 @@ static void test_wma_decoder(void) todo_wine ok(ret == 1, "Release returned %u\n", ret);
+ /* As output_info.dwFlags doesn't have MFT_OUTPUT_STREAM_CAN_PROVIDE_SAMPLES + * IMFTransform_ProcessOutput needs a sample or returns MF_E_TRANSFORM_NEED_MORE_INPUT */ + + status = 0xdeadbeef; + memset(&output, 0, sizeof(output)); + hr = IMFTransform_ProcessOutput(transform, 0, 1, &output, &status); + todo_wine + ok(hr == MF_E_TRANSFORM_NEED_MORE_INPUT, "ProcessOutput returned %#x\n", hr); + ok(output.dwStreamID == 0, "got dwStreamID %u\n", output.dwStreamID); + ok(!output.pSample, "got pSample %p\n", output.pSample); + todo_wine + ok(output.dwStatus == MFT_OUTPUT_DATA_BUFFER_NO_SAMPLE || + broken(output.dwStatus == (MFT_OUTPUT_DATA_BUFFER_INCOMPLETE|MFT_OUTPUT_DATA_BUFFER_NO_SAMPLE)) /* Win7 */, + "got dwStatus %#x\n", output.dwStatus); + ok(!output.pEvents, "got pEvents %p\n", output.pEvents); + todo_wine + ok(status == 0, "got status %#x\n", status); + + sample = create_sample(wma_encoded_data[0], wma_block_size); + hr = IMFTransform_ProcessInput(transform, 0, sample, 0); + todo_wine + ok(hr == MF_E_NOTACCEPTING, "ProcessInput returned %#x\n", hr); + ret = IMFSample_Release(sample); + ok(ret == 0, "Release returned %u\n", ret); + + status = 0xdeadbeef; + memset(&output, 0, sizeof(output)); + hr = IMFTransform_ProcessOutput(transform, 0, 1, &output, &status); + todo_wine + ok(hr == MF_E_TRANSFORM_NEED_MORE_INPUT, "ProcessOutput returned %#x\n", hr); + ok(!output.pSample, "got pSample %p\n", output.pSample); + todo_wine + ok(output.dwStatus == MFT_OUTPUT_DATA_BUFFER_NO_SAMPLE || + broken(output.dwStatus == (MFT_OUTPUT_DATA_BUFFER_INCOMPLETE|MFT_OUTPUT_DATA_BUFFER_NO_SAMPLE)) /* Win7 */, + "got dwStatus %#x\n", output.dwStatus); + todo_wine + ok(status == 0, "got status %#x\n", status); + + status = 0xdeadbeef; + output_info.cbSize = sizeof(wma_decoded_data); + sample = create_sample(NULL, output_info.cbSize); + memset(&output, 0, sizeof(output)); + output.pSample = sample; + hr = IMFTransform_ProcessOutput(transform, 0, 1, &output, &status); + while (hr == MF_E_TRANSFORM_NEED_MORE_INPUT) + { + ok(hr == MF_E_TRANSFORM_NEED_MORE_INPUT, "ProcessOutput returned %#x\n", hr); + ok(output.pSample == sample, "got pSample %p\n", output.pSample); + ok(output.dwStatus == 0, "got dwStatus %#x\n", output.dwStatus); + ok(status == 0, "got status %#x\n", status); + check_sample(sample, NULL, 0); + ret = IMFSample_Release(sample); + ok(ret == 0, "Release returned %u\n", ret); + + sample = create_sample(wma_encoded_data[0], wma_block_size); + hr = IMFTransform_ProcessInput(transform, 0, sample, 0); + ok(hr == S_OK, "ProcessInput returned %#x\n", hr); + ret = IMFSample_Release(sample); + ok(ret == 1, "Release returned %u\n", ret); + + status = 0xdeadbeef; + sample = create_sample(NULL, output_info.cbSize); + memset(&output, 0, sizeof(output)); + output.pSample = sample; + hr = IMFTransform_ProcessOutput(transform, 0, 1, &output, &status); + } + + todo_wine + ok(hr == S_OK, "ProcessOutput returned %#x\n", hr); + ok(output.pSample == sample, "got pSample %p\n", output.pSample); + + i = 0; + while (hr == S_OK) + { + ok(output.pSample == sample, "got pSample %p\n", output.pSample); + ok(output.dwStatus == MFT_OUTPUT_DATA_BUFFER_INCOMPLETE || output.dwStatus == 0 || + broken(output.dwStatus == (MFT_OUTPUT_DATA_BUFFER_INCOMPLETE|7) || output.dwStatus == 7) /* Win7 */, + "got dwStatus %#x\n", output.dwStatus); + ok(status == 0, "got status %#x\n", status); + if (output.dwStatus == MFT_OUTPUT_DATA_BUFFER_INCOMPLETE || + broken(output.dwStatus == (MFT_OUTPUT_DATA_BUFFER_INCOMPLETE|7))) + { + check_sample(sample, wma_decoded_data, sizeof(wma_decoded_data)); + i += sizeof(wma_decoded_data); + } + else + { + check_sample(sample, wma_decoded_data, sizeof(wma_decoded_data) / 2); + i += sizeof(wma_decoded_data) / 2; + } + ret = IMFSample_Release(sample); + ok(ret == 0, "Release returned %u\n", ret); + + status = 0xdeadbeef; + sample = create_sample(NULL, output_info.cbSize); + memset(&output, 0, sizeof(output)); + output.pSample = sample; + hr = IMFTransform_ProcessOutput(transform, 0, 1, &output, &status); + } + ok(i == 0xe000, "ProcessOutput produced %#x bytes\n", i); + + todo_wine + ok(hr == MF_E_TRANSFORM_NEED_MORE_INPUT, "ProcessOutput returned %#x\n", hr); + ok(output.pSample == sample, "got pSample %p\n", output.pSample); + ok(output.dwStatus == 0, "got dwStatus %#x\n", output.dwStatus); + todo_wine + ok(status == 0, "got status %#x\n", status); + ret = IMFSample_Release(sample); + ok(ret == 0, "Release returned %u\n", ret); + + status = 0xdeadbeef; + sample = create_sample(NULL, output_info.cbSize); + memset(&output, 0, sizeof(output)); + output.pSample = sample; + hr = IMFTransform_ProcessOutput(transform, 0, 1, &output, &status); + todo_wine + ok(hr == MF_E_TRANSFORM_NEED_MORE_INPUT, "ProcessOutput returned %#x\n", hr); + ok(output.pSample == sample, "got pSample %p\n", output.pSample); + ok(output.dwStatus == 0 || + broken(output.dwStatus == (MFT_OUTPUT_DATA_BUFFER_INCOMPLETE|7)) /* Win7 */, + "got dwStatus %#x\n", output.dwStatus); + todo_wine + ok(status == 0, "got status %#x\n", status); + check_sample(sample, NULL, 0); + ret = IMFSample_Release(sample); + ok(ret == 0, "Release returned %u\n", ret); + + sample = create_sample(wma_encoded_data[0], wma_block_size); + hr = IMFTransform_ProcessInput(transform, 0, sample, 0); + todo_wine + ok(hr == S_OK, "ProcessInput returned %#x\n", hr); + ret = IMFTransform_Release(transform); ok(ret == 0, "Release returned %u\n", ret); + ret = IMFSample_Release(sample); + ok(ret == 0, "Release returned %u\n", ret);
failed: CoUninitialize();
Eh, now that I rewrote the output loop for Win7 I forgot to add a todo_wine for when the decoder transform is registered, let's ignore PATCH 5 for now.