Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/evr/mixer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/evr/mixer.c b/dlls/evr/mixer.c index 30b4ed31b3f..3a2b6830782 100644 --- a/dlls/evr/mixer.c +++ b/dlls/evr/mixer.c @@ -35,7 +35,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(evr);
-#define MAX_MIXER_INPUT_STREAMS 16 +#define MAX_MIXER_INPUT_SUBSTREAMS (15) +#define MAX_MIXER_INPUT_STREAMS (MAX_MIXER_INPUT_SUBSTREAMS + 1)
struct input_stream { @@ -932,7 +933,7 @@ static HRESULT WINAPI video_mixer_transform_SetOutputType(IMFTransform *iface, D rt_format = subtype.Data1;
if (SUCCEEDED(hr = IDirectXVideoProcessorService_CreateVideoProcessor(service, &mixer->output.rt_formats[i].device, - &video_desc, rt_format, MAX_MIXER_INPUT_STREAMS, &mixer->processor))) + &video_desc, rt_format, MAX_MIXER_INPUT_SUBSTREAMS, &mixer->processor))) { if (mixer->output.media_type) IMFMediaType_Release(mixer->output.media_type);
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/dxva2/main.c | 21 +++++++++++++++++-- dlls/dxva2/tests/dxva2.c | 45 ++++++++++++++++++++++++++++++++++++---- 2 files changed, 60 insertions(+), 6 deletions(-)
diff --git a/dlls/dxva2/main.c b/dlls/dxva2/main.c index 2fab82ff476..81c32692f7f 100644 --- a/dlls/dxva2/main.c +++ b/dlls/dxva2/main.c @@ -204,9 +204,26 @@ static HRESULT WINAPI video_processor_GetCreationParameters(IDirectXVideoProcess static HRESULT WINAPI video_processor_GetVideoProcessorCaps(IDirectXVideoProcessor *iface, DXVA2_VideoProcessorCaps *caps) { - FIXME("%p, %p.\n", iface, caps); + struct video_processor *processor = impl_from_IDirectXVideoProcessor(iface);
- return E_NOTIMPL; + TRACE("%p, %p.\n", iface, caps); + + if (IsEqualGUID(&processor->device, &DXVA2_VideoProcSoftwareDevice)) + { + memset(caps, 0, sizeof(*caps)); + caps->DeviceCaps = DXVA2_VPDev_SoftwareDevice; + caps->InputPool = D3DPOOL_SYSTEMMEM; + caps->VideoProcessorOperations = DXVA2_VideoProcess_PlanarAlpha | DXVA2_VideoProcess_YUV2RGB | + DXVA2_VideoProcess_StretchX | DXVA2_VideoProcess_StretchY | DXVA2_VideoProcess_SubRects | + DXVA2_VideoProcess_SubStreams | DXVA2_VideoProcess_SubStreamsExtended | DXVA2_VideoProcess_YUV2RGBExtended; + } + else + { + FIXME("Unsupported device %s.\n", debugstr_guid(&processor->device)); + return E_FAIL; + } + + return S_OK; }
static HRESULT WINAPI video_processor_GetProcAmpRange(IDirectXVideoProcessor *iface, UINT cap, DXVA2_ValueRange *range) diff --git a/dlls/dxva2/tests/dxva2.c b/dlls/dxva2/tests/dxva2.c index ab0a2769bd2..75c23dfdcda 100644 --- a/dlls/dxva2/tests/dxva2.c +++ b/dlls/dxva2/tests/dxva2.c @@ -420,17 +420,18 @@ done: static void test_video_processor(void) { IDirectXVideoProcessorService *service, *service2; - IDirect3DDevice9 *device; + IDirectXVideoProcessor *processor, *processor2; IDirect3DDeviceManager9 *manager; + DXVA2_VideoProcessorCaps caps; + DXVA2_VideoDesc video_desc; + IDirect3DDevice9 *device; HANDLE handle, handle1; + D3DFORMAT format; IDirect3D9 *d3d; HWND window; UINT token; HRESULT hr; - IDirectXVideoProcessor *processor, *processor2; - DXVA2_VideoDesc video_desc; GUID guid; - D3DFORMAT format;
window = create_window(); d3d = Direct3DCreate9(D3D_SDK_VERSION); @@ -466,10 +467,46 @@ static void test_video_processor(void) video_desc.SampleHeight = 64; video_desc.Format = D3DFMT_A8R8G8B8;
+ /* Number of substreams does not include reference stream. */ + hr = IDirectXVideoProcessorService_CreateVideoProcessor(service, &DXVA2_VideoProcSoftwareDevice, &video_desc, + D3DFMT_A8R8G8B8, 16, &processor); +todo_wine + ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + if (SUCCEEDED(hr)) IDirectXVideoProcessor_Release(processor); + + hr = IDirectXVideoProcessorService_CreateVideoProcessor(service, &DXVA2_VideoProcSoftwareDevice, &video_desc, + D3DFMT_A8R8G8B8, 15, &processor); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + IDirectXVideoProcessor_Release(processor); + + hr = IDirectXVideoProcessorService_CreateVideoProcessor(service, &DXVA2_VideoProcSoftwareDevice, &video_desc, + D3DFMT_A8R8G8B8, 0, &processor); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + IDirectXVideoProcessor_Release(processor); + hr = IDirectXVideoProcessorService_CreateVideoProcessor(service, &DXVA2_VideoProcSoftwareDevice, &video_desc, D3DFMT_A8R8G8B8, 1, &processor); ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ hr = IDirectXVideoProcessor_GetVideoProcessorCaps(processor, &caps); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(caps.DeviceCaps == DXVA2_VPDev_SoftwareDevice, "Unexpected device type %#x.\n", caps.DeviceCaps); + ok(caps.InputPool == D3DPOOL_SYSTEMMEM, "Unexpected input pool %#x.\n", caps.InputPool); + ok(!caps.NumForwardRefSamples, "Unexpected sample count.\n"); + ok(!caps.NumBackwardRefSamples, "Unexpected sample count.\n"); + ok(!caps.Reserved, "Unexpected field.\n"); + ok(caps.DeinterlaceTechnology == DXVA2_DeinterlaceTech_Unknown, "Unexpected deinterlace technology %#x.\n", + caps.DeinterlaceTechnology); + ok(!caps.ProcAmpControlCaps, "Unexpected proc amp mask %#x.\n", caps.ProcAmpControlCaps); + ok(caps.VideoProcessorOperations == (DXVA2_VideoProcess_PlanarAlpha | DXVA2_VideoProcess_YUV2RGB | + DXVA2_VideoProcess_StretchX | DXVA2_VideoProcess_StretchY | DXVA2_VideoProcess_SubRects | + DXVA2_VideoProcess_SubStreams | DXVA2_VideoProcess_SubStreamsExtended | DXVA2_VideoProcess_YUV2RGBExtended), + "Unexpected processor operations %#x.\n", caps.VideoProcessorOperations); + ok(caps.NoiseFilterTechnology == DXVA2_NoiseFilterTech_Unsupported, "Unexpected noise filter technology %#x.\n", + caps.NoiseFilterTechnology); + ok(caps.DetailFilterTechnology == DXVA2_DetailFilterTech_Unsupported, "Unexpected detail filter technology %#x.\n", + caps.DetailFilterTechnology); + hr = IDirectXVideoProcessorService_CreateVideoProcessor(service, &DXVA2_VideoProcSoftwareDevice, &video_desc, D3DFMT_A8R8G8B8, 1, &processor2); ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/dxva2/main.c | 6 ++++++ dlls/dxva2/tests/dxva2.c | 2 -- 2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/dxva2/main.c b/dlls/dxva2/main.c index 81c32692f7f..46f5a7af485 100644 --- a/dlls/dxva2/main.c +++ b/dlls/dxva2/main.c @@ -496,6 +496,12 @@ static HRESULT WINAPI device_manager_processor_service_CreateVideoProcessor(IDir
/* FIXME: validate render target format */
+ if (max_substreams >= 16) + { + WARN("Invalid substreams count %u.\n", max_substreams); + return E_INVALIDARG; + } + if (!(object = heap_alloc_zero(sizeof(*object)))) return E_OUTOFMEMORY;
diff --git a/dlls/dxva2/tests/dxva2.c b/dlls/dxva2/tests/dxva2.c index 75c23dfdcda..e3307032ad4 100644 --- a/dlls/dxva2/tests/dxva2.c +++ b/dlls/dxva2/tests/dxva2.c @@ -470,9 +470,7 @@ static void test_video_processor(void) /* Number of substreams does not include reference stream. */ hr = IDirectXVideoProcessorService_CreateVideoProcessor(service, &DXVA2_VideoProcSoftwareDevice, &video_desc, D3DFMT_A8R8G8B8, 16, &processor); -todo_wine ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); - if (SUCCEEDED(hr)) IDirectXVideoProcessor_Release(processor);
hr = IDirectXVideoProcessorService_CreateVideoProcessor(service, &DXVA2_VideoProcSoftwareDevice, &video_desc, D3DFMT_A8R8G8B8, 15, &processor);