Commit 5b7a3aaf authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

mf/tests: Add some MP3 decoder transform tests.

There's some differences in the decoded data between Windows versions, the results have been taken from a Windows 10 VM.
parent 27c3069f
......@@ -9246,6 +9246,440 @@ failed:
CoUninitialize();
}
static void test_mp3_decoder(void)
{
const GUID transform_inputs[] =
{
MFAudioFormat_MP3,
};
const GUID transform_outputs[] =
{
MFAudioFormat_PCM,
};
const GUID dmo_inputs[] =
{
MFAudioFormat_MP3,
};
const GUID dmo_outputs[] =
{
MEDIASUBTYPE_PCM,
};
static const media_type_desc expect_available_inputs[] =
{
{
ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Audio),
ATTR_GUID(MF_MT_SUBTYPE, MFAudioFormat_MP3),
ATTR_UINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, 1),
},
};
static const media_type_desc expect_available_outputs[] =
{
{
ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Audio),
ATTR_GUID(MF_MT_SUBTYPE, MFAudioFormat_Float),
ATTR_UINT32(MF_MT_AUDIO_BITS_PER_SAMPLE, 32),
ATTR_UINT32(MF_MT_AUDIO_NUM_CHANNELS, 2),
ATTR_UINT32(MF_MT_AUDIO_SAMPLES_PER_SECOND, 22050),
ATTR_UINT32(MF_MT_AUDIO_AVG_BYTES_PER_SECOND, 176400),
ATTR_UINT32(MF_MT_AUDIO_BLOCK_ALIGNMENT, 8),
ATTR_UINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, 1),
},
{
ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Audio),
ATTR_GUID(MF_MT_SUBTYPE, MFAudioFormat_PCM),
ATTR_UINT32(MF_MT_AUDIO_BITS_PER_SAMPLE, 16),
ATTR_UINT32(MF_MT_AUDIO_NUM_CHANNELS, 2),
ATTR_UINT32(MF_MT_AUDIO_SAMPLES_PER_SECOND, 22050),
ATTR_UINT32(MF_MT_AUDIO_AVG_BYTES_PER_SECOND, 88200),
ATTR_UINT32(MF_MT_AUDIO_BLOCK_ALIGNMENT, 4),
ATTR_UINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, 1),
},
{
ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Audio),
ATTR_GUID(MF_MT_SUBTYPE, MFAudioFormat_PCM),
ATTR_UINT32(MF_MT_AUDIO_BITS_PER_SAMPLE, 8),
ATTR_UINT32(MF_MT_AUDIO_NUM_CHANNELS, 2),
ATTR_UINT32(MF_MT_AUDIO_SAMPLES_PER_SECOND, 22050),
ATTR_UINT32(MF_MT_AUDIO_AVG_BYTES_PER_SECOND, 44100),
ATTR_UINT32(MF_MT_AUDIO_BLOCK_ALIGNMENT, 2),
ATTR_UINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, 1),
},
{
ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Audio),
ATTR_GUID(MF_MT_SUBTYPE, MFAudioFormat_Float),
ATTR_UINT32(MF_MT_AUDIO_BITS_PER_SAMPLE, 32),
ATTR_UINT32(MF_MT_AUDIO_NUM_CHANNELS, 1),
ATTR_UINT32(MF_MT_AUDIO_SAMPLES_PER_SECOND, 22050),
ATTR_UINT32(MF_MT_AUDIO_AVG_BYTES_PER_SECOND, 88200),
ATTR_UINT32(MF_MT_AUDIO_BLOCK_ALIGNMENT, 4),
ATTR_UINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, 1),
},
{
ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Audio),
ATTR_GUID(MF_MT_SUBTYPE, MFAudioFormat_PCM),
ATTR_UINT32(MF_MT_AUDIO_BITS_PER_SAMPLE, 16),
ATTR_UINT32(MF_MT_AUDIO_NUM_CHANNELS, 1),
ATTR_UINT32(MF_MT_AUDIO_SAMPLES_PER_SECOND, 22050),
ATTR_UINT32(MF_MT_AUDIO_AVG_BYTES_PER_SECOND, 44100),
ATTR_UINT32(MF_MT_AUDIO_BLOCK_ALIGNMENT, 2),
ATTR_UINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, 1),
},
{
ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Audio),
ATTR_GUID(MF_MT_SUBTYPE, MFAudioFormat_PCM),
ATTR_UINT32(MF_MT_AUDIO_BITS_PER_SAMPLE, 8),
ATTR_UINT32(MF_MT_AUDIO_NUM_CHANNELS, 1),
ATTR_UINT32(MF_MT_AUDIO_SAMPLES_PER_SECOND, 22050),
ATTR_UINT32(MF_MT_AUDIO_AVG_BYTES_PER_SECOND, 22050),
ATTR_UINT32(MF_MT_AUDIO_BLOCK_ALIGNMENT, 1),
ATTR_UINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, 1),
},
};
const struct attribute_desc input_type_desc[] =
{
ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Audio),
ATTR_GUID(MF_MT_SUBTYPE, MFAudioFormat_MP3),
ATTR_UINT32(MF_MT_AUDIO_SAMPLES_PER_SECOND, 22050),
ATTR_UINT32(MF_MT_AUDIO_NUM_CHANNELS, 2),
{0},
};
static const struct attribute_desc output_type_desc[] =
{
ATTR_GUID(MF_MT_MAJOR_TYPE, MFMediaType_Audio),
ATTR_GUID(MF_MT_SUBTYPE, MFAudioFormat_PCM),
ATTR_UINT32(MF_MT_AUDIO_AVG_BYTES_PER_SECOND, 88200),
ATTR_UINT32(MF_MT_AUDIO_BITS_PER_SAMPLE, 16),
ATTR_UINT32(MF_MT_AUDIO_NUM_CHANNELS, 2),
ATTR_UINT32(MF_MT_AUDIO_SAMPLES_PER_SECOND, 22050),
ATTR_UINT32(MF_MT_AUDIO_BLOCK_ALIGNMENT, 4),
{0},
};
MFT_REGISTER_TYPE_INFO output_type = {MFMediaType_Audio, MFAudioFormat_PCM};
MFT_REGISTER_TYPE_INFO input_type = {MFMediaType_Audio, MFAudioFormat_MP3};
static const ULONG mp3dec_block_size = 0x1200;
ULONG mp3dec_data_len, mp3enc_data_len;
const BYTE *mp3dec_data, *mp3enc_data;
MFT_OUTPUT_STREAM_INFO output_info;
MFT_INPUT_STREAM_INFO input_info;
MFT_OUTPUT_DATA_BUFFER output;
WCHAR output_path[MAX_PATH];
IMFMediaType *media_type;
IMFTransform *transform;
LONGLONG time, duration;
DWORD status, length;
HANDLE output_file;
IMFSample *sample;
HRSRC resource;
GUID class_id;
ULONG i, ret;
HRESULT hr;
hr = CoInitialize(NULL);
ok(hr == S_OK, "Failed to initialize, hr %#lx.\n", hr);
if (!create_transform(MFT_CATEGORY_AUDIO_DECODER, &input_type, &output_type, L"MP3 Decoder MFT", &MFMediaType_Audio,
transform_inputs, ARRAY_SIZE(transform_inputs), transform_outputs, ARRAY_SIZE(transform_outputs),
&transform, &CLSID_CMP3DecMediaObject, &class_id))
goto failed;
check_dmo(&class_id, L"MP3 Decoder DMO", &MEDIATYPE_Audio, dmo_inputs, ARRAY_SIZE(dmo_inputs),
dmo_outputs, ARRAY_SIZE(dmo_outputs));
check_interface(transform, &IID_IMFTransform, TRUE);
check_interface(transform, &IID_IMediaObject, TRUE);
todo_wine
check_interface(transform, &IID_IPropertyStore, TRUE);
check_interface(transform, &IID_IPropertyBag, FALSE);
/* check default media types */
hr = IMFTransform_GetInputStreamInfo(transform, 0, &input_info);
ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "GetInputStreamInfo returned %#lx\n", hr);
hr = IMFTransform_GetOutputStreamInfo(transform, 0, &output_info);
ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "GetOutputStreamInfo returned %#lx\n", hr);
hr = IMFTransform_GetOutputAvailableType(transform, 0, 0, &media_type);
ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "GetOutputAvailableType returned %#lx\n", hr);
i = -1;
while (SUCCEEDED(hr = IMFTransform_GetInputAvailableType(transform, 0, ++i, &media_type)))
{
winetest_push_context("in %lu", i);
ok(hr == S_OK, "GetInputAvailableType returned %#lx\n", hr);
check_media_type(media_type, expect_available_inputs[i], -1);
hr = IMFTransform_SetInputType(transform, 0, media_type, 0);
ok(hr == MF_E_INVALIDMEDIATYPE, "SetInputType returned %#lx.\n", hr);
ret = IMFMediaType_Release(media_type);
ok(ret == 0, "Release returned %lu\n", ret);
winetest_pop_context();
}
todo_wine
ok(hr == MF_E_NO_MORE_TYPES, "GetInputAvailableType returned %#lx\n", hr);
todo_wine
ok(i == ARRAY_SIZE(expect_available_inputs), "%lu input media types\n", i);
/* setting output media type first doesn't work */
hr = MFCreateMediaType(&media_type);
ok(hr == S_OK, "MFCreateMediaType returned %#lx\n", hr);
init_media_type(media_type, output_type_desc, -1);
hr = IMFTransform_SetOutputType(transform, 0, media_type, 0);
ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "SetOutputType returned %#lx.\n", hr);
ret = IMFMediaType_Release(media_type);
ok(ret == 0, "Release returned %lu\n", ret);
/* check required input media type attributes */
hr = MFCreateMediaType(&media_type);
ok(hr == S_OK, "MFCreateMediaType returned %#lx\n", hr);
hr = IMFTransform_SetInputType(transform, 0, media_type, 0);
ok(hr == MF_E_ATTRIBUTENOTFOUND, "SetInputType returned %#lx.\n", hr);
init_media_type(media_type, input_type_desc, 1);
hr = IMFTransform_SetInputType(transform, 0, media_type, 0);
ok(hr == MF_E_ATTRIBUTENOTFOUND, "SetInputType returned %#lx.\n", hr);
init_media_type(media_type, input_type_desc, 2);
for (i = 2; i < ARRAY_SIZE(input_type_desc) - 1; ++i)
{
hr = IMFTransform_SetInputType(transform, 0, media_type, 0);
ok(hr == MF_E_INVALIDMEDIATYPE, "SetInputType returned %#lx.\n", hr);
init_media_type(media_type, input_type_desc, i + 1);
}
hr = IMFTransform_SetInputType(transform, 0, media_type, 0);
ok(hr == S_OK, "SetInputType returned %#lx.\n", hr);
ret = IMFMediaType_Release(media_type);
ok(ret == 0, "Release returned %lu\n", ret);
hr = IMFTransform_GetInputStreamInfo(transform, 0, &input_info);
ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "GetInputStreamInfo returned %#lx\n", hr);
hr = IMFTransform_GetOutputStreamInfo(transform, 0, &output_info);
ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "GetOutputStreamInfo returned %#lx\n", hr);
/* check new output media types */
i = -1;
while (SUCCEEDED(hr = IMFTransform_GetOutputAvailableType(transform, 0, ++i, &media_type)))
{
winetest_push_context("out %lu", i);
ok(hr == S_OK, "GetOutputAvailableType returned %#lx\n", hr);
check_media_type(media_type, expect_available_outputs[i], -1);
ret = IMFMediaType_Release(media_type);
ok(ret == 0, "Release returned %lu\n", ret);
winetest_pop_context();
}
ok(hr == MF_E_NO_MORE_TYPES, "GetOutputAvailableType returned %#lx\n", hr);
ok(i == ARRAY_SIZE(expect_available_outputs), "%lu output media types\n", i);
/* check required output media type attributes */
hr = MFCreateMediaType(&media_type);
ok(hr == S_OK, "MFCreateMediaType returned %#lx\n", hr);
hr = IMFTransform_SetOutputType(transform, 0, media_type, 0);
ok(hr == MF_E_ATTRIBUTENOTFOUND, "SetOutputType returned %#lx.\n", hr);
init_media_type(media_type, output_type_desc, 1);
hr = IMFTransform_SetOutputType(transform, 0, media_type, 0);
ok(hr == MF_E_ATTRIBUTENOTFOUND, "SetOutputType returned %#lx.\n", hr);
init_media_type(media_type, output_type_desc, 2);
for (i = 2; i < ARRAY_SIZE(output_type_desc) - 1; ++i)
{
hr = IMFTransform_SetOutputType(transform, 0, media_type, 0);
ok(hr == E_INVALIDARG, "SetOutputType returned %#lx.\n", hr);
init_media_type(media_type, output_type_desc, i + 1);
}
hr = IMFTransform_SetOutputType(transform, 0, media_type, 0);
ok(hr == S_OK, "SetOutputType returned %#lx.\n", hr);
ret = IMFMediaType_Release(media_type);
ok(ret == 0, "Release returned %lu\n", ret);
memset(&input_info, 0xcd, sizeof(input_info));
hr = IMFTransform_GetInputStreamInfo(transform, 0, &input_info);
ok(hr == S_OK, "GetInputStreamInfo returned %#lx\n", hr);
ok(input_info.hnsMaxLatency == 0, "got hnsMaxLatency %s\n", wine_dbgstr_longlong(input_info.hnsMaxLatency));
ok(input_info.dwFlags == 0, "got dwFlags %#lx\n", input_info.dwFlags);
ok(input_info.cbSize == 0, "got cbSize %lu\n", input_info.cbSize);
ok(input_info.cbMaxLookahead == 0, "got cbMaxLookahead %#lx\n", input_info.cbMaxLookahead);
ok(input_info.cbAlignment == 1, "got cbAlignment %#lx\n", input_info.cbAlignment);
memset(&output_info, 0xcd, sizeof(output_info));
hr = IMFTransform_GetOutputStreamInfo(transform, 0, &output_info);
ok(hr == S_OK, "GetOutputStreamInfo returned %#lx\n", hr);
ok(output_info.dwFlags == 0, "got dwFlags %#lx\n", output_info.dwFlags);
todo_wine
ok(output_info.cbSize == mp3dec_block_size, "got cbSize %#lx\n", output_info.cbSize);
ok(output_info.cbAlignment == 1, "got cbAlignment %#lx\n", output_info.cbAlignment);
resource = FindResourceW(NULL, L"mp3encdata.bin", (const WCHAR *)RT_RCDATA);
ok(resource != 0, "FindResourceW failed, error %lu\n", GetLastError());
mp3enc_data = LockResource(LoadResource(GetModuleHandleW(NULL), resource));
mp3enc_data_len = SizeofResource(GetModuleHandleW(NULL), resource);
ok(mp3enc_data_len == 6295, "got length %lu\n", mp3enc_data_len);
sample = create_sample(mp3enc_data, mp3enc_data_len);
hr = IMFTransform_ProcessInput(transform, 0, sample, 0);
ok(hr == S_OK, "ProcessInput returned %#lx\n", hr);
ret = IMFSample_Release(sample);
ok(ret == 1, "Release returned %lu\n", ret);
sample = create_sample(mp3enc_data, mp3enc_data_len);
hr = IMFTransform_ProcessInput(transform, 0, sample, 0);
ok(hr == MF_E_NOTACCEPTING, "ProcessInput returned %#lx\n", hr);
ret = IMFSample_Release(sample);
ok(ret == 0, "Release returned %lu\n", ret);
status = 0xdeadbeef;
sample = create_sample(NULL, mp3dec_block_size);
memset(&output, 0, sizeof(output));
output.pSample = sample;
resource = FindResourceW(NULL, L"mp3decdata.bin", (const WCHAR *)RT_RCDATA);
ok(resource != 0, "FindResourceW failed, error %lu\n", GetLastError());
mp3dec_data = LockResource(LoadResource(GetModuleHandleW(NULL), resource));
mp3dec_data_len = SizeofResource(GetModuleHandleW(NULL), resource);
ok(mp3dec_data_len == 94656, "got length %lu\n", mp3dec_data_len);
/* and generate a new one as well in a temporary directory */
GetTempPathW(ARRAY_SIZE(output_path), output_path);
lstrcatW(output_path, L"mp3decdata.bin");
output_file = CreateFileW(output_path, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0);
ok(output_file != INVALID_HANDLE_VALUE, "CreateFileW failed, error %lu\n", GetLastError());
hr = IMFTransform_ProcessMessage(transform, MFT_MESSAGE_COMMAND_DRAIN, 0);
ok(hr == S_OK, "ProcessMessage returned %#lx\n", hr);
hr = IMFTransform_ProcessOutput(transform, 0, 1, &output, &status);
ok(hr == S_OK, "ProcessOutput returned %#lx\n", hr);
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 %#lx\n", output.dwStatus);
ok(status == 0, "got status %#lx\n", status);
hr = IMFSample_GetSampleTime(sample, &time);
ok(hr == S_OK, "GetSampleTime returned %#lx\n", hr);
ok(time == 0, "got time %I64d\n", time);
hr = IMFSample_GetSampleDuration(sample, &duration);
ok(hr == S_OK, "GetSampleDuration returned %#lx\n", hr);
ok(duration == 282993 || broken(duration == 522449) /* win8 */ || broken(duration == 261224) /* win7 */,
"got duration %I64d\n", duration);
hr = IMFSample_GetTotalLength(sample, &length);
ok(hr == S_OK, "GetTotalLength returned %#lx\n", hr);
ok(length == 0x9c0 || broken(length == mp3dec_block_size) /* win8 */ || broken(length == 0x900) /* win7 */,
"got length %lu\n", length);
ok(mp3dec_data_len > length, "got remaining length %lu\n", mp3dec_data_len);
if (length == 0x9c0) check_sample_pcm16(sample, mp3dec_data, output_file, FALSE);
mp3dec_data_len -= 0x9c0;
mp3dec_data += 0x9c0;
i = duration;
while (SUCCEEDED(hr = IMFTransform_ProcessOutput(transform, 0, 1, &output, &status)))
{
winetest_push_context("%lu", i);
ok(hr == S_OK, "ProcessOutput returned %#lx\n", hr);
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 %#lx\n", output.dwStatus);
ok(status == 0, "got status %#lx\n", status);
if (!(output.dwStatus & MFT_OUTPUT_DATA_BUFFER_INCOMPLETE))
{
winetest_pop_context();
break;
}
hr = IMFSample_GetSampleTime(sample, &time);
ok(hr == S_OK, "GetSampleTime returned %#lx\n", hr);
ok(time == i, "got time %I64d\n", time);
hr = IMFSample_GetSampleDuration(sample, &duration);
ok(hr == S_OK, "GetSampleDuration returned %#lx\n", hr);
ok(duration == 522449 || broken(261225 - duration <= 1) /* win7 */,
"got duration %I64d\n", duration);
hr = IMFSample_GetTotalLength(sample, &length);
ok(hr == S_OK, "GetTotalLength returned %#lx\n", hr);
ok(length == mp3dec_block_size || broken(length == 0x900) /* win7 */,
"got length %lu\n", length);
ok(mp3dec_data_len > length || broken(mp3dec_data_len == 2304 || mp3dec_data_len == 0) /* win7 */,
"got remaining length %lu\n", mp3dec_data_len);
if (length == mp3dec_block_size) check_sample_pcm16(sample, mp3dec_data, output_file, FALSE);
mp3dec_data += min(mp3dec_data_len, length);
mp3dec_data_len -= min(mp3dec_data_len, length);
winetest_pop_context();
i += duration;
}
hr = IMFSample_GetSampleTime(sample, &time);
ok(hr == S_OK, "GetSampleTime returned %#lx\n", hr);
ok(time == i || broken(time == i - duration) /* win7 */, "got time %I64d\n", time);
hr = IMFSample_GetSampleDuration(sample, &duration);
ok(hr == S_OK, "GetSampleDuration returned %#lx\n", hr);
todo_wine
ok(duration == 522449 || broken(261225 - duration <= 1) /* win7 */, "got duration %I64d\n", duration);
hr = IMFSample_GetTotalLength(sample, &length);
ok(hr == S_OK, "GetTotalLength returned %#lx\n", hr);
todo_wine
ok(length == mp3dec_block_size || broken(length == 0) /* win7 */, "got length %lu\n", length);
ok(mp3dec_data_len == mp3dec_block_size || broken(mp3dec_data_len == 0) /* win7 */, "got remaining length %lu\n", mp3dec_data_len);
check_sample_pcm16(sample, mp3dec_data, output_file, FALSE);
mp3dec_data_len -= length;
mp3dec_data += length;
memset(&output, 0, sizeof(output));
output.pSample = sample;
hr = IMFTransform_ProcessOutput(transform, 0, 1, &output, &status);
todo_wine
ok(hr == S_OK || broken(hr == MF_E_TRANSFORM_NEED_MORE_INPUT) /* win7 */, "ProcessOutput returned %#lx\n", hr);
ok(output.pSample == sample, "got pSample %p\n", output.pSample);
todo_wine
ok(output.dwStatus == MFT_OUTPUT_DATA_BUFFER_INCOMPLETE || broken(output.dwStatus == 0) /* win7 */,
"got dwStatus %#lx\n", output.dwStatus);
ok(status == 0, "got status %#lx\n", status);
if (hr == S_OK)
{
hr = IMFSample_GetSampleTime(sample, &time);
ok(hr == S_OK, "GetSampleTime returned %#lx\n", hr);
todo_wine
ok(time == 10185486, "got time %I64d\n", time);
hr = IMFSample_GetSampleDuration(sample, &duration);
ok(hr == S_OK, "GetSampleDuration returned %#lx\n", hr);
todo_wine
ok(duration == 14286, "got duration %I64d\n", duration);
hr = IMFSample_GetTotalLength(sample, &length);
ok(hr == S_OK, "GetTotalLength returned %#lx\n", hr);
todo_wine
ok(length == mp3dec_data_len, "got length %lu\n", length);
if (length == mp3dec_data_len)
check_sample_pcm16(sample, mp3dec_data, output_file, FALSE);
}
trace("created %s\n", debugstr_w(output_path));
CloseHandle(output_file);
ret = IMFSample_Release(sample);
ok(ret == 0, "Release returned %lu\n", ret);
status = 0xdeadbeef;
sample = create_sample(NULL, mp3dec_block_size);
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 %#lx\n", hr);
ok(output.pSample == sample, "got pSample %p\n", output.pSample);
ok(output.dwStatus == 0, "got dwStatus %#lx\n", output.dwStatus);
ok(status == 0, "got status %#lx\n", status);
hr = IMFSample_GetTotalLength(sample, &length);
ok(hr == S_OK, "GetTotalLength returned %#lx\n", hr);
ok(length == 0, "got length %lu\n", length);
ret = IMFSample_Release(sample);
ok(ret == 0, "Release returned %lu\n", ret);
ret = IMFTransform_Release(transform);
ok(ret == 0, "Release returned %lu\n", ret);
failed:
CoUninitialize();
}
START_TEST(mf)
{
......@@ -9285,4 +9719,5 @@ START_TEST(mf)
test_h264_decoder();
test_audio_convert();
test_color_convert();
test_mp3_decoder();
}
......@@ -33,6 +33,19 @@ wmaencdata.bin RCDATA wmaencdata.bin
wmadecdata.bin RCDATA wmadecdata.bin
/* Generated with:
* gst-launch-1.0 filesrc location=dlls/mf/tests/audiodata.bin ! \
* audio/x-raw,format=F32LE,rate=22050,channels=2,layout=interleaved ! \
* audioconvert ! lamemp3enc ! \
* audio/mpeg,mpegversion=1,layer=3,rate=22050,channels=2 ! \
* filesink location=dlls/mf/tests/mp3encdata.bin
*/
/* @makedep: mp3encdata.bin */
mp3encdata.bin RCDATA mp3encdata.bin
/* @makedep: mp3decdata.bin */
mp3decdata.bin RCDATA mp3decdata.bin
/* Generated with:
* gst-launch-1.0 videotestsrc num-buffers=60 pattern=smpte100 ! \
* video/x-raw,format=I420,width=84,height=82,framerate=30000/1001 ! \
* videoflip method=clockwise ! videoconvert ! \
......
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