Signed-off-by: Derek Lesho dlesho@codeweavers.com --- dlls/dxva2/main.c | 63 ++++++++++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 25 deletions(-)
diff --git a/dlls/dxva2/main.c b/dlls/dxva2/main.c index 2fab82ff476..ee11b1d4f84 100644 --- a/dlls/dxva2/main.c +++ b/dlls/dxva2/main.c @@ -377,28 +377,48 @@ static HRESULT WINAPI device_manager_processor_service_RegisterVideoProcessorSof return E_NOTIMPL; }
-static BOOL dxva_is_supported_stream_format(const DXVA2_VideoDesc *video_desc) +DEFINE_GUID(WINE_DXVA2_VideoProcHardwareDevice, 0x986666c3,0x32ac,0x4788,0xab,0x2a,0xd5,0x74,0x5f,0xf9,0x52,0xd8); + +static BOOL dxva_is_supported_stream_format(const DXVA2_VideoDesc *video_desc, const GUID *guid) { - return video_desc->Format == D3DFMT_A8R8G8B8 || - video_desc->Format == D3DFMT_X8R8G8B8 || - video_desc->Format == D3DFMT_YUY2; + if (IsEqualGUID(guid, &DXVA2_VideoProcSoftwareDevice)) + { + return video_desc->Format == D3DFMT_A8R8G8B8 || + video_desc->Format == D3DFMT_X8R8G8B8 || + video_desc->Format == D3DFMT_YUY2; + } + if (IsEqualGUID(guid, &WINE_DXVA2_VideoProcHardwareDevice)) + { + return video_desc->Format == MAKEFOURCC('N','V','1','2'); + } + FIXME("Unsupported device %s.\n", debugstr_guid(guid)); + return FALSE; }
static HRESULT WINAPI device_manager_processor_service_GetVideoProcessorDeviceGuids( IDirectXVideoProcessorService *iface, const DXVA2_VideoDesc *video_desc, UINT *count, GUID **guids) { + UINT size, i = 0; + FIXME("%p, %p, %p, %p semi-stub.\n", iface, video_desc, count, guids);
*count = 0;
- if (!dxva_is_supported_stream_format(video_desc)) + size = dxva_is_supported_stream_format(video_desc, &DXVA2_VideoProcSoftwareDevice) + + dxva_is_supported_stream_format(video_desc, &WINE_DXVA2_VideoProcHardwareDevice); + + if (!size) return E_FAIL;
- if (!(*guids = CoTaskMemAlloc(sizeof(**guids)))) + if (!(*guids = CoTaskMemAlloc(sizeof(**guids) * size))) return E_OUTOFMEMORY;
- memcpy(*guids, &DXVA2_VideoProcSoftwareDevice, sizeof(**guids)); - *count = 1; + if (dxva_is_supported_stream_format(video_desc, &DXVA2_VideoProcSoftwareDevice)) + memcpy(guids[i++], &DXVA2_VideoProcSoftwareDevice, sizeof(**guids)); + if (dxva_is_supported_stream_format(video_desc, &WINE_DXVA2_VideoProcHardwareDevice)) + memcpy(guids[i++], &WINE_DXVA2_VideoProcHardwareDevice, sizeof(**guids)); + + *count = size;
return S_OK; } @@ -409,27 +429,20 @@ static HRESULT WINAPI device_manager_processor_service_GetVideoProcessorRenderTa { TRACE("%p, %s, %p, %p, %p.\n", iface, debugstr_guid(deviceguid), video_desc, count, formats);
- if (IsEqualGUID(deviceguid, &DXVA2_VideoProcSoftwareDevice)) + if (!dxva_is_supported_stream_format(video_desc, deviceguid)) { - if (!dxva_is_supported_stream_format(video_desc)) - { - WARN("Unsupported content format %#x.\n", video_desc->Format); - return E_FAIL; - } - - if (!(*formats = CoTaskMemAlloc(2 * sizeof(**formats)))) - return E_OUTOFMEMORY; + WARN("Unsupported content format %#x.\n", video_desc->Format); + return E_FAIL; + }
- *count = 2; - (*formats)[0] = D3DFMT_X8R8G8B8; - (*formats)[1] = D3DFMT_A8R8G8B8; + if (!(*formats = CoTaskMemAlloc(2 * sizeof(**formats)))) + return E_OUTOFMEMORY;
- return S_OK; - } - else - FIXME("Unsupported device %s.\n", debugstr_guid(deviceguid)); + *count = 2; + (*formats)[0] = D3DFMT_X8R8G8B8; + (*formats)[1] = D3DFMT_A8R8G8B8;
- return E_NOTIMPL; + return S_OK; }
static HRESULT WINAPI device_manager_processor_service_GetVideoProcessorSubStreamFormats(
Signed-off-by: Derek Lesho dlesho@codeweavers.com --- dlls/dxva2/main.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/dlls/dxva2/main.c b/dlls/dxva2/main.c index ee11b1d4f84..33dc32644d1 100644 --- a/dlls/dxva2/main.c +++ b/dlls/dxva2/main.c @@ -458,9 +458,26 @@ static HRESULT WINAPI device_manager_processor_service_GetVideoProcessorCaps( IDirectXVideoProcessorService *iface, REFGUID deviceguid, const DXVA2_VideoDesc *video_desc, D3DFORMAT rt_format, DXVA2_VideoProcessorCaps *caps) { - FIXME("%p, %s, %p, %u, %p.\n", iface, debugstr_guid(deviceguid), video_desc, rt_format, caps); + TRACE("%p, %s, %p, %u, %p.\n", iface, debugstr_guid(deviceguid), video_desc, rt_format, caps);
- return E_NOTIMPL; + if (!dxva_is_supported_stream_format(video_desc, deviceguid)) + return E_NOTIMPL; + + if (IsEqualGUID(deviceguid, &DXVA2_VideoProcSoftwareDevice)) + caps->DeviceCaps = DXVA2_VPDev_SoftwareDevice; + else + caps->DeviceCaps = DXVA2_VPDev_HardwareDevice; + caps->InputPool = D3DPOOL_DEFAULT; + caps->NumForwardRefSamples = 0; + caps->NumBackwardRefSamples = 0; + caps->Reserved = 0; + caps->DeinterlaceTechnology = DXVA2_DeinterlaceTech_Unknown; + caps->ProcAmpControlCaps = DXVA2_ProcAmp_None; + caps->VideoProcessorOperations = DXVA2_VideoProcess_YUV2RGB | DXVA2_VideoProcess_StretchX | DXVA2_VideoProcess_StretchY; + caps->NoiseFilterTechnology = DXVA2_NoiseFilterTech_Unsupported; + caps->DetailFilterTechnology = DXVA2_DetailFilterTech_Unsupported; + + return S_OK; }
static HRESULT WINAPI device_manager_processor_service_GetProcAmpRange(
Signed-off-by: Derek Lesho dlesho@codeweavers.com --- dlls/winegstreamer/mfplat.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c index 58200dc409a..2784a3ca130 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c @@ -563,6 +563,7 @@ static IMFMediaType *mf_media_type_from_wg_format_audio(const struct wg_format * IMFMediaType_SetUINT32(type, &MF_MT_AUDIO_SAMPLES_PER_SECOND, format->u.audio.rate); IMFMediaType_SetUINT32(type, &MF_MT_AUDIO_NUM_CHANNELS, format->u.audio.channels); IMFMediaType_SetUINT32(type, &MF_MT_AUDIO_CHANNEL_MASK, format->u.audio.channel_mask); + IMFMediaType_SetUINT32(type, &MF_MT_AUDIO_BLOCK_ALIGNMENT, format->u.audio.channels * audio_formats[i].depth / 8); IMFMediaType_SetUINT32(type, &MF_MT_ALL_SAMPLES_INDEPENDENT, TRUE);
return type;
On 11/1/21 2:59 PM, Derek Lesho wrote:
Signed-off-by: Derek Lesho dlesho@codeweavers.com
dlls/dxva2/main.c | 63 ++++++++++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 25 deletions(-)
diff --git a/dlls/dxva2/main.c b/dlls/dxva2/main.c index 2fab82ff476..ee11b1d4f84 100644 --- a/dlls/dxva2/main.c +++ b/dlls/dxva2/main.c @@ -377,28 +377,48 @@ static HRESULT WINAPI device_manager_processor_service_RegisterVideoProcessorSof return E_NOTIMPL; }
-static BOOL dxva_is_supported_stream_format(const DXVA2_VideoDesc *video_desc) +DEFINE_GUID(WINE_DXVA2_VideoProcHardwareDevice, 0x986666c3,0x32ac,0x4788,0xab,0x2a,0xd5,0x74,0x5f,0xf9,0x52,0xd8);
I'm not sure we necessarily need something that custom yet. I'm going to testif DXVA2_VideoProcProgressiveDevice has similar properties. It's documented to be available as HW-independent device.
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=101189
Your paranoid android.
=== debiant2 (build log) ===
error: corrupt patch at line 53 Task: Patch failed to apply
=== debiant2 (build log) ===
error: corrupt patch at line 53 Task: Patch failed to apply
I checked with DXVA2_VideoProcProgressiveDevice on old Nvidia hardware (Geforce 315), and according to dxva checker utility, it is reported as HW device, with NV12 as supported input, with caps containing what you have set. I think we should go with that standard device, exposing it properly.
Have you verified that surface creation works with NV12 format on wined3d?