From a45e4cbf9fc0410b30e8d441dbbac07305212f40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 9 Feb 2022 11:18:03 +0100 Subject: [PATCH] mf/tests: Add some WMA decoder ProcessInput tests. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- dlls/mf/tests/mf.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index 229e2e30134..09bc4ef1c1e 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -5815,8 +5815,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; + const BYTE *wma_encoded_data; + ULONG wma_encoded_data_len; IMFMediaType *media_type; IMFTransform *transform; + IMFSample *sample; + HRSRC resource; GUID class_id; ULONG i, ret; HRESULT hr; @@ -5972,6 +5976,36 @@ static void test_wma_decoder(void) ok(output_info.cbSize == sizeof(wma_decoded_data), "got cbSize %#x\n", output_info.cbSize); ok(output_info.cbAlignment == 1, "got cbAlignment %#x\n", output_info.cbAlignment); + /* resource is generated using test_wma_encoder output file */ + resource = FindResourceW(NULL, L"wmadata.bin", (const WCHAR *)RT_RCDATA); + ok(resource != 0, "FindResourceW failed, error %u\n", GetLastError()); + wma_encoded_data = LockResource(LoadResource(GetModuleHandleW(NULL), resource)); + wma_encoded_data_len = SizeofResource(GetModuleHandleW(NULL), resource); + ok(wma_encoded_data_len % wma_block_size == 0, "got wma encoded length %u\n", wma_encoded_data_len); + + sample = create_sample(wma_encoded_data, 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 + 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, 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);