[vlc-devel] [PATCH] direct3d11: fix decoder padding not working with Qualcomm chipsets

Jean-Baptiste Kempf jb at videolan.org
Wed Jul 26 04:24:14 CEST 2017


Hello,

Don't we already get IDXGIAdapter_GetDesc somewhere else in this module?
Couldn't we factor this?

On Mon, 24 Jul 2017, at 13:04, Steve Lhomme wrote:
> ---
>  modules/video_output/win32/direct3d11.c | 27 ++++++++++++++++++++++++++-
>  1 file changed, 26 insertions(+), 1 deletion(-)
> 
> diff --git a/modules/video_output/win32/direct3d11.c
> b/modules/video_output/win32/direct3d11.c
> index 44f127aca1..3e9bbc0c3e 100644
> --- a/modules/video_output/win32/direct3d11.c
> +++ b/modules/video_output/win32/direct3d11.c
> @@ -757,6 +757,31 @@ error:
>      return VLC_EGENERIC;
>  }
>  
> +static bool CanUseDecoderPadding(vout_display_t *vd)
> +{
> +#ifndef HAVE_ID3D11VIDEODECODER
> +    (void) vd;
> +    return true;
> +#else
> +    vout_display_sys_t *sys = vd->sys;
> +    TCHAR szData[256];
> +    DWORD len = 256;
> +    IDXGIAdapter *pAdapter = D3D11DeviceAdapter(sys->d3ddevice);
> +    if (!pAdapter)
> +        return false;
> +
> +    DXGI_ADAPTER_DESC adapterDesc;
> +    HRESULT hr = IDXGIAdapter_GetDesc(pAdapter, &adapterDesc);
> +    IDXGIAdapter_Release(pAdapter);
> +    if (FAILED(hr))
> +        return false;
> +
> +    /* Qualcomm hardware has issues with textures and pixels that should
> not be
> +    * part of the decoded area */
> +    return adapterDesc.VendorId != 0x4D4F4351;
> +#endif
> +}
> +
>  static picture_pool_t *Pool(vout_display_t *vd, unsigned pool_size)
>  {
>      /* compensate for extra hardware decoding pulling extra pictures
>      from our pool */
> @@ -777,7 +802,7 @@ static picture_pool_t *Pool(vout_display_t *vd,
> unsigned pool_size)
>          pool_size = 1;
>  
>      video_format_t surface_fmt = vd->fmt;
> -    if (is_d3d11_opaque(surface_fmt.i_chroma))
> +    if (is_d3d11_opaque(surface_fmt.i_chroma) &&
> CanUseDecoderPadding(vd))
>      {
>          /* worst case scenario we need 128 alignment for HEVC */
>          surface_fmt.i_width  = (surface_fmt.i_width  + 0x7F) & ~0x7F;
> -- 
> 2.12.1
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


-- 
Jean-Baptiste Kempf -  President
+33 672 704 734


More information about the vlc-devel mailing list