mf/tests: Add some WMA decoder ProcessInput tests.

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>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2022-02-09 11:18:03 +01:00 committed by Alexandre Julliard
parent c426c72b5c
commit a45e4cbf9f
1 changed files with 34 additions and 0 deletions

View File

@ -5815,8 +5815,12 @@ static void test_wma_decoder(void)
MFT_REGISTER_TYPE_INFO output_type = {MFMediaType_Audio, MFAudioFormat_Float}; MFT_REGISTER_TYPE_INFO output_type = {MFMediaType_Audio, MFAudioFormat_Float};
MFT_OUTPUT_STREAM_INFO output_info; MFT_OUTPUT_STREAM_INFO output_info;
MFT_INPUT_STREAM_INFO input_info; MFT_INPUT_STREAM_INFO input_info;
const BYTE *wma_encoded_data;
ULONG wma_encoded_data_len;
IMFMediaType *media_type; IMFMediaType *media_type;
IMFTransform *transform; IMFTransform *transform;
IMFSample *sample;
HRSRC resource;
GUID class_id; GUID class_id;
ULONG i, ret; ULONG i, ret;
HRESULT hr; 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.cbSize == sizeof(wma_decoded_data), "got cbSize %#x\n", output_info.cbSize);
ok(output_info.cbAlignment == 1, "got cbAlignment %#x\n", output_info.cbAlignment); 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); ret = IMFTransform_Release(transform);
ok(ret == 0, "Release returned %u\n", ret); ok(ret == 0, "Release returned %u\n", ret);