From 5542942c8e1d7aee45121601fcdb1d7acfecf587 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Thu, 1 Oct 2020 15:59:30 +0300 Subject: [PATCH] evr/mixer: Store input type attributes. Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- dlls/evr/mixer.c | 11 ++++++++++- dlls/evr/tests/evr.c | 31 +++++++++++-------------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/dlls/evr/mixer.c b/dlls/evr/mixer.c index e19520fa7ed..9227e6a1777 100644 --- a/dlls/evr/mixer.c +++ b/dlls/evr/mixer.c @@ -686,7 +686,16 @@ static HRESULT WINAPI video_mixer_transform_SetInputType(IMFTransform *iface, DW &count, &guids))) { if (SUCCEEDED(hr = video_mixer_collect_output_types(mixer, &video_desc, service, count, guids))) - FIXME("Set input type.\n"); + { + GUID subtype = { 0 }; + + if (FAILED(hr = IMFMediaType_GetGUID(media_type, &MF_MT_SUBTYPE, &subtype))) + WARN("Failed to get subtype %#x.\n", hr); + + if (SUCCEEDED(hr = MFCreateVideoMediaTypeFromSubtype(&subtype, &mixer->inputs[0].media_type))) + hr = IMFMediaType_CopyAllItems(media_type, (IMFAttributes *)mixer->inputs[0].media_type); + + } CoTaskMemFree(guids); } } diff --git a/dlls/evr/tests/evr.c b/dlls/evr/tests/evr.c index bf33051d6e1..e6f6251be60 100644 --- a/dlls/evr/tests/evr.c +++ b/dlls/evr/tests/evr.c @@ -896,17 +896,15 @@ static void test_default_mixer_type_negotiation(void) ok(hr == S_OK, "Unexpected hr %#x.\n", hr); hr = IMFTransform_GetInputCurrentType(transform, 0, &media_type); -todo_wine ok(hr == S_OK, "Unexpected hr %#x.\n", hr); -if (hr == S_OK) -{ ok(media_type != (IMFMediaType *)video_type, "Unexpected media type instance.\n"); + hr = IMFTransform_GetInputCurrentType(transform, 0, &media_type2); ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(media_type == media_type2, "Unexpected media type instance.\n"); IMFMediaType_Release(media_type); IMFMediaType_Release(media_type2); -} + hr = IMFTransform_QueryInterface(transform, &IID_IMFVideoProcessor, (void **)&processor); ok(hr == S_OK, "Unexpected hr %#x.\n", hr); @@ -919,31 +917,24 @@ todo_wine ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#x.\n", hr); hr = IMFTransform_GetInputCurrentType(transform, 0, &media_type); -todo_wine ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - if (SUCCEEDED(hr)) - { - ok(media_type != (IMFMediaType *)video_type, "Unexpected pointer.\n"); - hr = IMFMediaType_QueryInterface(media_type, &IID_IMFVideoMediaType, (void **)&unk); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - IUnknown_Release(unk); - IMFMediaType_Release(media_type); - } + ok(media_type != (IMFMediaType *)video_type, "Unexpected pointer.\n"); + hr = IMFMediaType_QueryInterface(media_type, &IID_IMFVideoMediaType, (void **)&unk); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + IUnknown_Release(unk); + IMFMediaType_Release(media_type); hr = IMFVideoProcessor_GetAvailableVideoProcessorModes(processor, &count, &guids); todo_wine ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#x.\n", hr); hr = IMFTransform_GetOutputAvailableType(transform, 0, 0, &media_type); -todo_wine ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - if (SUCCEEDED(hr)) - { - hr = IMFTransform_SetOutputType(transform, 0, media_type, 0); - ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - IMFMediaType_Release(media_type); - } + hr = IMFTransform_SetOutputType(transform, 0, media_type, 0); +todo_wine + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + IMFMediaType_Release(media_type); hr = IMFVideoProcessor_GetVideoProcessorMode(processor, &guid); todo_wine