[vlc-commits] hw:d3d11: get a better texture format when the source doesn't have a picsys

Steve Lhomme git at videolan.org
Mon May 28 13:25:31 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Jan 31 17:10:35 2018 +0100| [10c2b24205d3b61f648a8361b1fddf366a3e995b] | committer: Steve Lhomme

hw:d3d11: get a better texture format when the source doesn't have a picsys

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=10c2b24205d3b61f648a8361b1fddf366a3e995b
---

 modules/hw/d3d11/d3d11_instance.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/modules/hw/d3d11/d3d11_instance.c b/modules/hw/d3d11/d3d11_instance.c
index e9aa7ce314..11585b3f4e 100644
--- a/modules/hw/d3d11/d3d11_instance.c
+++ b/modules/hw/d3d11/d3d11_instance.c
@@ -80,10 +80,16 @@ void D3D11_FilterHoldInstance(filter_t *filter, d3d11_device_t *out, D3D11_TEXTU
             instances++;
 
         memset(dstDesc, 0, sizeof(*dstDesc));
-        if (filter->fmt_in.video.i_chroma == VLC_CODEC_D3D11_OPAQUE_10B)
-            dstDesc->Format = DXGI_FORMAT_P010;
-        else
-            dstDesc->Format = DXGI_FORMAT_NV12;
+        dstDesc->Format = DxgiFourccFormat( filter->fmt_in.video.i_chroma );
+        if (dstDesc->Format == DXGI_FORMAT_UNKNOWN)
+            switch (filter->fmt_in.video.i_chroma)
+            {
+            case VLC_CODEC_D3D11_OPAQUE:      dstDesc->Format = DXGI_FORMAT_NV12; break;
+            case VLC_CODEC_D3D11_OPAQUE_10B:  dstDesc->Format = DXGI_FORMAT_P010; break;
+            case VLC_CODEC_D3D11_OPAQUE_BGRA: dstDesc->Format = DXGI_FORMAT_B8G8R8A8_UNORM; break;
+            case VLC_CODEC_D3D11_OPAQUE_RGBA: dstDesc->Format = DXGI_FORMAT_R8G8B8A8_UNORM; break;
+            default: break;
+            }
         dstDesc->Width  = filter->fmt_out.video.i_width;
         dstDesc->Height = filter->fmt_out.video.i_height;
     }



More information about the vlc-commits mailing list