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

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


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Nov  7 09:17:19 2017 +0100| [ed8b58eb656f4f68ee2527ffd491094cae5d20d9] | committer: Thomas Guillem

hw: vaapi: add 10 bits support

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

 modules/hw/vaapi/vlc_vaapi.c |  8 ++++++--
 modules/hw/vaapi/vlc_vaapi.h | 11 ++++++++++-
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/modules/hw/vaapi/vlc_vaapi.c b/modules/hw/vaapi/vlc_vaapi.c
index e777a879a4..baae6f510f 100644
--- a/modules/hw/vaapi/vlc_vaapi.c
+++ b/modules/hw/vaapi/vlc_vaapi.c
@@ -64,6 +64,10 @@ vlc_chroma_to_vaapi(int i_vlc_chroma, unsigned *va_rt_format, int *va_fourcc)
             *va_rt_format = VA_RT_FORMAT_YUV420;
             *va_fourcc = VA_FOURCC_NV12;
             break;
+        case VLC_CODEC_VAAPI_420_10BPP:
+            *va_rt_format = VA_RT_FORMAT_YUV420_10BPP;
+            *va_fourcc = VA_FOURCC_P010;
+            break;
         default:
             vlc_assert_unreachable();
     }
@@ -414,9 +418,9 @@ vlc_vaapi_CreateConfigChecked(vlc_object_t *o, VADisplay dpy,
     }
 
     /* Not sure what to do if not, I don't have a way to test */
-    if ((attrib.value & VA_RT_FORMAT_YUV420) == 0)
+    if ((attrib.value & (VA_RT_FORMAT_YUV420|VA_RT_FORMAT_YUV420_10BPP)) == 0)
     {
-        msg_Err(o, "config doesn't support VA_RT_FORMAT_YUV420");
+        msg_Err(o, "config doesn't support VA_RT_FORMAT_YUV420*");
         return VA_INVALID_ID;
     }
 
diff --git a/modules/hw/vaapi/vlc_vaapi.h b/modules/hw/vaapi/vlc_vaapi.h
index ce37b95cb8..e8ecd1edb1 100644
--- a/modules/hw/vaapi/vlc_vaapi.h
+++ b/modules/hw/vaapi/vlc_vaapi.h
@@ -27,6 +27,14 @@
 
 #include <va/va.h>
 
+#ifndef VA_RT_FORMAT_YUV420_10BPP
+# define VA_RT_FORMAT_YUV420_10BPP 0x00000100
+#endif
+
+#ifndef VA_FOURCC_P010
+#define VA_FOURCC_P010 0x30313050
+#endif
+
 #include <vlc_common.h>
 #include <vlc_fourcc.h>
 #include <vlc_picture_pool.h>
@@ -208,7 +216,8 @@ vlc_vaapi_PicGetDisplay(picture_t *pic);
 static inline bool
 vlc_vaapi_IsChromaOpaque(int i_vlc_chroma)
 {
-    return i_vlc_chroma == VLC_CODEC_VAAPI_420;
+    return i_vlc_chroma == VLC_CODEC_VAAPI_420
+        || i_vlc_chroma == VLC_CODEC_VAAPI_420_10BPP;
 }
 
 #endif /* VLC_VAAPI_H */



More information about the vlc-commits mailing list