Commit 0070a00c authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

dxva2: Accept AYUV as input format.

parent b6ca5e50
......@@ -377,6 +377,14 @@ static HRESULT WINAPI device_manager_processor_service_RegisterVideoProcessorSof
return E_NOTIMPL;
}
static BOOL dxva_is_supported_stream_format(const DXVA2_VideoDesc *video_desc)
{
return video_desc->Format == D3DFMT_A8R8G8B8 ||
video_desc->Format == D3DFMT_X8R8G8B8 ||
video_desc->Format == D3DFMT_YUY2 ||
video_desc->Format == MAKEFOURCC('A','Y','U','V');
}
static HRESULT WINAPI device_manager_processor_service_GetVideoProcessorDeviceGuids(
IDirectXVideoProcessorService *iface, const DXVA2_VideoDesc *video_desc, UINT *count, GUID **guids)
{
......@@ -399,9 +407,7 @@ static HRESULT WINAPI device_manager_processor_service_GetVideoProcessorRenderTa
if (IsEqualGUID(deviceguid, &DXVA2_VideoProcSoftwareDevice))
{
if (!(video_desc->Format == D3DFMT_A8R8G8B8 ||
video_desc->Format == D3DFMT_X8R8G8B8 ||
video_desc->Format == D3DFMT_YUY2))
if (!dxva_is_supported_stream_format(video_desc))
{
WARN("Unsupported content format %#x.\n", video_desc->Format);
return E_FAIL;
......
......@@ -111,6 +111,7 @@ static void test_device_manager(void)
D3DFMT_A8R8G8B8,
D3DFMT_X8R8G8B8,
D3DFMT_YUY2,
MAKEFOURCC('A','Y','U','V'),
};
static const D3DFORMAT rt_unsupported_formats[] =
{
......@@ -354,6 +355,12 @@ static void test_device_manager(void)
init_video_desc(&video_desc, rt_formats[i]);
count = 0;
hr = IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids(proc_service, &video_desc, &count, &guids);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(count > 0, "Unexpected device count.\n");
CoTaskMemFree(guids);
count = 0;
hr = IDirectXVideoProcessorService_GetVideoProcessorRenderTargets(proc_service, &DXVA2_VideoProcSoftwareDevice,
&video_desc, &count, &formats);
ok(hr == S_OK, "Unexpected hr %#x, format %d.\n", hr, rt_formats[i]);
......@@ -371,6 +378,10 @@ static void test_device_manager(void)
hr = IDirectXVideoProcessorService_GetVideoProcessorRenderTargets(proc_service, &DXVA2_VideoProcSoftwareDevice,
&video_desc, &count, &formats);
ok(hr == E_FAIL, "Unexpected hr %#x, format %d.\n", hr, rt_unsupported_formats[i]);
hr = IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids(proc_service, &video_desc, &count, &guids);
todo_wine
ok(hr == E_FAIL, "Unexpected hr %#x.\n", hr);
}
IDirectXVideoProcessorService_Release(proc_service);
......
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