[vlc-commits] opengl: vaapi: add 10 bits support

Thomas Guillem git at videolan.org
Tue Nov 7 11:52:59 CET 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Sun Sep  3 11:09:46 2017 +0200| [04cd7e0d9675e9cc158aaabad02eb3cd34d8fb44] | committer: Thomas Guillem

opengl: vaapi: add 10 bits support

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

 modules/video_output/opengl/converter_vaapi.c | 27 ++++++++++++++++++++++++---
 1 file changed, 24 insertions(+), 3 deletions(-)

diff --git a/modules/video_output/opengl/converter_vaapi.c b/modules/video_output/opengl/converter_vaapi.c
index 0b0f794b9c..7b38f86cba 100644
--- a/modules/video_output/opengl/converter_vaapi.c
+++ b/modules/video_output/opengl/converter_vaapi.c
@@ -119,6 +119,10 @@ vaegl_init_fourcc(const opengl_tex_converter_t *tc, struct priv *priv,
             priv->drm_fourccs[0] = VLC_FOURCC('R', '8', ' ', ' ');
             priv->drm_fourccs[1] = VLC_FOURCC('G', 'R', '8', '8');
             break;
+        case VA_FOURCC_P010:
+            priv->drm_fourccs[0] = VLC_FOURCC('R', '1', '6', ' ');
+            priv->drm_fourccs[1] = VLC_FOURCC('G', 'R', '3', '2');
+            break;
 #if 0
         /* TODO: the following fourcc are not handled for now */
         case VA_FOURCC_RGBA:
@@ -355,7 +359,23 @@ tc_vaegl_init(opengl_tex_converter_t *tc, VADisplay *vadpy,
     priv->vadpy = vadpy;
     priv->fourcc = 0;
 
-    if (vaegl_init_fourcc(tc, priv, VA_FOURCC_NV12))
+    int va_fourcc;
+    int vlc_sw_chroma;
+    switch (tc->fmt.i_chroma)
+    {
+        case VLC_CODEC_VAAPI_420:
+            va_fourcc = VA_FOURCC_NV12;
+            vlc_sw_chroma = VLC_CODEC_NV12;
+            break;
+        case VLC_CODEC_VAAPI_420_10BPP:
+            va_fourcc = VA_FOURCC_P010;
+            vlc_sw_chroma = VLC_CODEC_P010;
+            break;
+        default:
+            vlc_assert_unreachable();
+    }
+
+    if (vaegl_init_fourcc(tc, priv, va_fourcc))
         goto error;
 
     priv->glEGLImageTargetTexture2DOES =
@@ -379,7 +399,7 @@ tc_vaegl_init(opengl_tex_converter_t *tc, VADisplay *vadpy,
     if (tc_va_check_interop_blacklist(tc, priv->vadpy))
         goto error;
 
-    tc->fshader = opengl_fragment_shader_init(tc, GL_TEXTURE_2D, VLC_CODEC_NV12,
+    tc->fshader = opengl_fragment_shader_init(tc, GL_TEXTURE_2D, vlc_sw_chroma,
                                               tc->fmt.space);
     if (tc->fshader == 0)
         goto error;
@@ -420,7 +440,8 @@ Open(vlc_object_t *obj)
 {
     opengl_tex_converter_t *tc = (void *) obj;
 
-    if (tc->fmt.i_chroma != VLC_CODEC_VAAPI_420 || tc->gl->ext != VLC_GL_EXT_EGL
+    if (!vlc_vaapi_IsChromaOpaque(tc->fmt.i_chroma)
+     || tc->gl->ext != VLC_GL_EXT_EGL
      || tc->gl->egl.createImageKHR == NULL
      || tc->gl->egl.destroyImageKHR == NULL)
         return VLC_EGENERIC;



More information about the vlc-commits mailing list