Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/dxva2/main.c | 12 +++++++++--- dlls/dxva2/tests/dxva2.c | 11 +++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/dlls/dxva2/main.c b/dlls/dxva2/main.c index 8952de17b1e..4eefffd6052 100644 --- a/dlls/dxva2/main.c +++ b/dlls/dxva2/main.c @@ -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; diff --git a/dlls/dxva2/tests/dxva2.c b/dlls/dxva2/tests/dxva2.c index 1de1712d163..f785b2ce147 100644 --- a/dlls/dxva2/tests/dxva2.c +++ b/dlls/dxva2/tests/dxva2.c @@ -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[] = { @@ -353,6 +354,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); @@ -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);
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/dxva2/main.c | 5 +++++ dlls/dxva2/tests/dxva2.c | 1 - 2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/dlls/dxva2/main.c b/dlls/dxva2/main.c index 4eefffd6052..f91b033055c 100644 --- a/dlls/dxva2/main.c +++ b/dlls/dxva2/main.c @@ -390,6 +390,11 @@ static HRESULT WINAPI device_manager_processor_service_GetVideoProcessorDeviceGu { FIXME("%p, %p, %p, %p semi-stub.\n", iface, video_desc, count, guids);
+ *count = 0; + + if (!dxva_is_supported_stream_format(video_desc)) + return E_FAIL; + if (!(*guids = CoTaskMemAlloc(sizeof(**guids)))) return E_OUTOFMEMORY;
diff --git a/dlls/dxva2/tests/dxva2.c b/dlls/dxva2/tests/dxva2.c index f785b2ce147..80749b81f12 100644 --- a/dlls/dxva2/tests/dxva2.c +++ b/dlls/dxva2/tests/dxva2.c @@ -380,7 +380,6 @@ static void test_device_manager(void) 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); }
On Mon, 7 Jun 2021, Nikolay Sivov wrote:
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
dlls/dxva2/main.c | 12 +++++++++--- dlls/dxva2/tests/dxva2.c | 11 +++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-)
This patch is causing failures on the cw-rx460 and cw-gtx560 machines: https://test.winehq.org/data/patterns.html#dxva2:dxva2
Do you know what could be wrong?
On 6/8/21 5:34 PM, Francois Gouget wrote:
On Mon, 7 Jun 2021, Nikolay Sivov wrote:
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
dlls/dxva2/main.c | 12 +++++++++--- dlls/dxva2/tests/dxva2.c | 11 +++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-)
This patch is causing failures on the cw-rx460 and cw-gtx560 machines: https://test.winehq.org/data/patterns.html#dxva2:dxva2
Do you know what could be wrong?
Yes, it fails when hw devices are available. I sent a patch to remove that failing test, it's not important.