evr/mixer: Implement GetAvailableVideoProcessorModes().

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2022-04-11 11:23:12 +03:00 committed by Alexandre Julliard
parent 91d6e8b4ab
commit 0289b9c23a
2 changed files with 28 additions and 10 deletions

View File

@ -1930,9 +1930,27 @@ static ULONG WINAPI video_mixer_processor_Release(IMFVideoProcessor *iface)
static HRESULT WINAPI video_mixer_processor_GetAvailableVideoProcessorModes(IMFVideoProcessor *iface, UINT *count,
GUID **modes)
{
FIXME("%p, %p, %p.\n", iface, count, modes);
struct video_mixer *mixer = impl_from_IMFVideoProcessor(iface);
IDirectXVideoProcessorService *service;
DXVA2_VideoDesc video_desc;
HRESULT hr;
return E_NOTIMPL;
TRACE("%p, %p, %p.\n", iface, count, modes);
EnterCriticalSection(&mixer->cs);
if (!mixer->inputs[0].media_type || !mixer->output.media_type)
hr = MF_E_TRANSFORM_TYPE_NOT_SET;
else if (SUCCEEDED(hr = video_mixer_get_processor_service(mixer, &service)))
{
video_mixer_init_dxva_videodesc(mixer->inputs[0].media_type, &video_desc);
hr = IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids(service, &video_desc, count, modes);
IDirectXVideoProcessorService_Release(service);
}
LeaveCriticalSection(&mixer->cs);
return hr;
}
static HRESULT WINAPI video_mixer_processor_GetVideoProcessorCaps(IMFVideoProcessor *iface, GUID *mode,

View File

@ -654,7 +654,6 @@ static void test_default_mixer(void)
ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoProcessor_GetAvailableVideoProcessorModes(processor, &count, &guids);
todo_wine
ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#lx.\n", hr);
IMFVideoProcessor_Release(processor);
@ -1071,6 +1070,9 @@ static void test_default_mixer_type_negotiation(void)
hr = MFCreateVideoMixer(NULL, &IID_IDirect3DDevice9, &IID_IMFTransform, (void **)&transform);
ok(hr == S_OK, "Failed to create default mixer, hr %#lx.\n", hr);
hr = IMFTransform_QueryInterface(transform, &IID_IMFVideoProcessor, (void **)&processor);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_GetInputAvailableType(transform, 0, 0, &media_type);
ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr);
@ -1095,6 +1097,9 @@ static void test_default_mixer_type_negotiation(void)
hr = IMFTransform_SetInputType(transform, 0, media_type, MFT_SET_TYPE_TEST_ONLY);
ok(hr == MF_E_NOT_INITIALIZED, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoProcessor_GetAvailableVideoProcessorModes(processor, &count, &guids);
ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#lx.\n", hr);
/* Now try with device manager. */
window = create_window();
@ -1282,9 +1287,6 @@ static void test_default_mixer_type_negotiation(void)
IMFMediaType_Release(media_type2);
IMFMediaType_Release(media_type);
hr = IMFTransform_QueryInterface(transform, &IID_IMFVideoProcessor, (void **)&processor);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoProcessor_GetVideoProcessorMode(processor, &guid);
todo_wine
ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#lx.\n", hr);
@ -1302,7 +1304,6 @@ static void test_default_mixer_type_negotiation(void)
IMFMediaType_Release(media_type);
hr = IMFVideoProcessor_GetAvailableVideoProcessorModes(processor, &count, &guids);
todo_wine
ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#lx.\n", hr);
hr = IMFTransform_GetOutputAvailableType(transform, 0, 0, &media_type);
@ -1319,10 +1320,9 @@ static void test_default_mixer_type_negotiation(void)
ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
hr = IMFVideoProcessor_GetAvailableVideoProcessorModes(processor, &count, &guids);
todo_wine
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (SUCCEEDED(hr))
CoTaskMemFree(guids);
ok(count > 0 && !!guids, "Unexpected modes data.\n");
CoTaskMemFree(guids);
hr = IMFTransform_GetOutputCurrentType(transform, 0, &media_type2);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);