Signed-off-by: Nikolay Sivov nsivov@codeweavers.com ---
That's what it returns for software device on Windows, regardless of input format, while rejecting some.
dlls/dxva2/main.c | 18 +++++++++++++++++- dlls/dxva2/tests/Makefile.in | 2 +- dlls/dxva2/tests/dxva2.c | 23 ++++++++++++++++++++++- 3 files changed, 40 insertions(+), 3 deletions(-)
diff --git a/dlls/dxva2/main.c b/dlls/dxva2/main.c index 22a35c4fbb3..6ebc4f00186 100644 --- a/dlls/dxva2/main.c +++ b/dlls/dxva2/main.c @@ -195,7 +195,23 @@ static HRESULT WINAPI device_manager_processor_service_GetVideoProcessorRenderTa IDirectXVideoProcessorService *iface, REFGUID deviceguid, const DXVA2_VideoDesc *video_desc, UINT *count, D3DFORMAT **formats) { - FIXME("%p, %s, %p, %p, %p.\n", iface, debugstr_guid(deviceguid), video_desc, count, formats); + TRACE("%p, %s, %p, %p, %p.\n", iface, debugstr_guid(deviceguid), video_desc, count, formats); + + if (IsEqualGUID(deviceguid, &DXVA2_VideoProcSoftwareDevice)) + { + /* FIXME: filter some input formats */ + + if (!(*formats = CoTaskMemAlloc(2 * sizeof(**formats)))) + return E_OUTOFMEMORY; + + *count = 2; + (*formats)[0] = D3DFMT_X8R8G8B8; + (*formats)[1] = D3DFMT_A8R8G8B8; + + return S_OK; + } + else + FIXME("Unsupported device %s.\n", debugstr_guid(deviceguid));
return E_NOTIMPL; } diff --git a/dlls/dxva2/tests/Makefile.in b/dlls/dxva2/tests/Makefile.in index c86c5ab42fc..ccd03940a24 100644 --- a/dlls/dxva2/tests/Makefile.in +++ b/dlls/dxva2/tests/Makefile.in @@ -1,5 +1,5 @@ TESTDLL = dxva2.dll -IMPORTS = dxva2 user32 d3d9 +IMPORTS = dxva2 user32 d3d9 ole32
C_SRCS = \ dxva2.c diff --git a/dlls/dxva2/tests/dxva2.c b/dlls/dxva2/tests/dxva2.c index 58b0231420d..f5b28ed3f8d 100644 --- a/dlls/dxva2/tests/dxva2.c +++ b/dlls/dxva2/tests/dxva2.c @@ -82,13 +82,16 @@ static void test_device_manager(void) IDirectXVideoProcessorService *processor_service; IDirectXVideoAccelerationService *accel_service; IDirect3DDevice9 *device, *device2, *device3; + IDirectXVideoProcessorService *proc_service; IDirect3DDeviceManager9 *manager; IDirect3DSurface9 *surfaces[2]; + DXVA2_VideoDesc video_desc; int refcount, refcount2; HANDLE handle, handle1; + D3DFORMAT *formats; + UINT token, count; IDirect3D9 *d3d; HWND window; - UINT token; HRESULT hr; RECT rect;
@@ -297,6 +300,24 @@ static void test_device_manager(void)
IDirectXVideoAccelerationService_Release(accel_service);
+ /* RT formats. */ + hr = DXVA2CreateVideoService(device, &IID_IDirectXVideoProcessorService, (void **)&proc_service); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + + memset(&video_desc, 0, sizeof(video_desc)); + video_desc.SampleWidth = 64; + video_desc.SampleHeight = 64; + video_desc.Format = D3DFMT_A8R8G8B8; + + count = 0; + hr = IDirectXVideoProcessorService_GetVideoProcessorRenderTargets(proc_service, &DXVA2_VideoProcSoftwareDevice, + &video_desc, &count, &formats); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(count, "Unexpected format count %u.\n", count); + CoTaskMemFree(formats); + + IDirectXVideoProcessorService_Release(proc_service); + hr = IDirect3DDeviceManager9_OpenDeviceHandle(manager, &handle); ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/evr/mixer.c | 6 +++++- dlls/evr/tests/evr.c | 1 - 2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/evr/mixer.c b/dlls/evr/mixer.c index 710e20815ab..e19520fa7ed 100644 --- a/dlls/evr/mixer.c +++ b/dlls/evr/mixer.c @@ -604,6 +604,7 @@ static HRESULT video_mixer_collect_output_types(struct video_mixer *mixer, const if (!(ptr = heap_realloc(rt_formats, (count + format_count) * sizeof(*rt_formats)))) { hr = E_OUTOFMEMORY; + count = 0; CoTaskMemFree(formats); break; } @@ -641,12 +642,15 @@ static HRESULT video_mixer_collect_output_types(struct video_mixer *mixer, const mixer->output.type_count = count; } else + { hr = E_OUTOFMEMORY; + count = 0; + } }
heap_free(rt_formats);
- return hr; + return count ? S_OK : hr; }
static HRESULT WINAPI video_mixer_transform_SetInputType(IMFTransform *iface, DWORD id, IMFMediaType *media_type, DWORD flags) diff --git a/dlls/evr/tests/evr.c b/dlls/evr/tests/evr.c index 3e2675497a1..bf33051d6e1 100644 --- a/dlls/evr/tests/evr.c +++ b/dlls/evr/tests/evr.c @@ -893,7 +893,6 @@ static void test_default_mixer_type_negotiation(void) ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = IMFTransform_SetInputType(transform, 0, (IMFMediaType *)video_type, 0); -todo_wine ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = IMFTransform_GetInputCurrentType(transform, 0, &media_type);