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

winegstreamer: Implement ResamplerMediaObject transform.

parent b6a7a021
......@@ -7570,10 +7570,8 @@ static void test_audio_convert(void)
/* check default media types */
hr = IMFTransform_GetInputStreamInfo(transform, 0, &input_info);
todo_wine
ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "GetInputStreamInfo returned %#lx\n", hr);
hr = IMFTransform_GetOutputStreamInfo(transform, 0, &output_info);
todo_wine
ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "GetOutputStreamInfo returned %#lx\n", hr);
i = -1;
......@@ -7586,9 +7584,7 @@ static void test_audio_convert(void)
ok(ret == 0, "Release returned %lu\n", ret);
winetest_pop_context();
}
todo_wine
ok(hr == MF_E_NO_MORE_TYPES, "GetOutputAvailableType returned %#lx\n", hr);
todo_wine
ok(i == 4, "%lu output media types\n", i);
i = -1;
......@@ -7603,9 +7599,7 @@ static void test_audio_convert(void)
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 == 2, "%lu input media types\n", i);
/* setting output media type first doesn't work */
......@@ -7614,7 +7608,6 @@ static void test_audio_convert(void)
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);
todo_wine
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);
......@@ -7624,31 +7617,25 @@ static void test_audio_convert(void)
hr = MFCreateMediaType(&media_type);
ok(hr == S_OK, "MFCreateMediaType returned %#lx\n", hr);
hr = IMFTransform_SetInputType(transform, 0, media_type, 0);
todo_wine
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);
todo_wine
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);
todo_wine
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);
todo_wine
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);
todo_wine
ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "GetInputStreamInfo returned %#lx\n", hr);
hr = IMFTransform_GetOutputStreamInfo(transform, 0, &output_info);
todo_wine
ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "GetOutputStreamInfo returned %#lx\n", hr);
/* check new output media types */
......@@ -7663,9 +7650,7 @@ static void test_audio_convert(void)
ok(ret == 0, "Release returned %lu\n", ret);
winetest_pop_context();
}
todo_wine
ok(hr == MF_E_NO_MORE_TYPES, "GetOutputAvailableType returned %#lx\n", hr);
todo_wine
ok(i == 4, "%lu output media types\n", i);
/* check required output media type attributes */
......@@ -7673,50 +7658,36 @@ static void test_audio_convert(void)
hr = MFCreateMediaType(&media_type);
ok(hr == S_OK, "MFCreateMediaType returned %#lx\n", hr);
hr = IMFTransform_SetOutputType(transform, 0, media_type, 0);
todo_wine
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);
todo_wine
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);
todo_wine
ok(hr == MF_E_INVALIDMEDIATYPE, "SetOutputType returned %#lx.\n", hr);
init_media_type(media_type, output_type_desc, i + 1);
}
hr = IMFTransform_SetOutputType(transform, 0, media_type, 0);
todo_wine
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);
todo_wine
ok(hr == S_OK, "GetInputStreamInfo returned %#lx\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 %#lx\n", input_info.dwFlags);
todo_wine
ok(input_info.cbSize == 8, "got cbSize %lu\n", input_info.cbSize);
todo_wine
ok(input_info.cbMaxLookahead == 0, "got cbMaxLookahead %#lx\n", input_info.cbMaxLookahead);
todo_wine
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);
todo_wine
ok(hr == S_OK, "GetOutputStreamInfo returned %#lx\n", hr);
todo_wine
ok(output_info.dwFlags == 0, "got dwFlags %#lx\n", output_info.dwFlags);
todo_wine
ok(output_info.cbSize == 4, "got cbSize %#lx\n", output_info.cbSize);
todo_wine
ok(output_info.cbAlignment == 1, "got cbAlignment %#lx\n", output_info.cbAlignment);
resource = FindResourceW(NULL, L"audiodata.bin", (const WCHAR *)RT_RCDATA);
......@@ -7731,13 +7702,10 @@ static void test_audio_convert(void)
hr = IMFSample_SetSampleDuration(sample, 10000000);
ok(hr == S_OK, "SetSampleDuration returned %#lx\n", hr);
hr = IMFTransform_ProcessInput(transform, 0, sample, 0);
todo_wine
ok(hr == S_OK, "ProcessInput returned %#lx\n", hr);
hr = IMFTransform_ProcessMessage(transform, MFT_MESSAGE_COMMAND_DRAIN, 0);
todo_wine
ok(hr == S_OK, "ProcessMessage returned %#lx\n", hr);
hr = IMFTransform_ProcessInput(transform, 0, sample, 0);
todo_wine
ok(hr == MF_E_NOTACCEPTING, "ProcessInput returned %#lx\n", hr);
IMFSample_Release(sample);
......@@ -7793,12 +7761,9 @@ static void test_audio_convert(void)
}
hr = IMFSample_GetSampleTime(sample, &time);
todo_wine
ok(hr == S_OK, "GetSampleTime returned %#lx\n", hr);
todo_wine_if(i != 0)
ok(time == i * 928798, "got time %I64d\n", time);
hr = IMFSample_GetSampleDuration(sample, &duration);
todo_wine
ok(hr == S_OK, "GetSampleDuration returned %#lx\n", hr);
todo_wine
ok(duration == 897506, "got duration %I64d\n", duration);
......@@ -7806,7 +7771,6 @@ static void test_audio_convert(void)
ok(hr == S_OK, "GetTotalLength returned %#lx\n", hr);
todo_wine
ok(length == 15832, "got length %lu\n", length);
todo_wine
ok(audioconv_data_len == 16084, "got remaining length %lu\n", audioconv_data_len);
check_sample_pcm16(sample, audioconv_data, output_file, FALSE);
audioconv_data_len -= length;
......@@ -7821,7 +7785,6 @@ static void test_audio_convert(void)
todo_wine
ok(output.dwStatus == MFT_OUTPUT_DATA_BUFFER_INCOMPLETE || broken(output.dwStatus == 0) /* win7 */,
"got dwStatus %#lx\n", output.dwStatus);
todo_wine
ok(status == 0, "got status %#lx\n", status);
if (hr == S_OK)
......@@ -7853,11 +7816,9 @@ static void test_audio_convert(void)
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 %#lx\n", hr);
ok(output.pSample == sample, "got pSample %p\n", output.pSample);
ok(output.dwStatus == 0, "got dwStatus %#lx\n", output.dwStatus);
todo_wine
ok(status == 0, "got status %#lx\n", status);
hr = IMFSample_GetTotalLength(sample, &length);
ok(hr == S_OK, "GetTotalLength returned %#lx\n", hr);
......
......@@ -406,6 +406,7 @@ NTSTATUS wg_transform_create(void *args)
break;
case WG_MAJOR_TYPE_AUDIO:
break;
case WG_MAJOR_TYPE_VIDEO:
case WG_MAJOR_TYPE_UNKNOWN:
GST_FIXME("Format %u not implemented!", input_format.major_type);
......
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