[FFmpeg-devel] [PATCH 1/2] hwcontext_vaapi: Add DRM format mappings for YUV420P (libva I420)

Mark Thompson sw at jkqxz.net
Mon Sep 3 03:00:13 EEST 2018


---
Needed to import YUV420P frames exported from Vulkan.

 libavutil/hwcontext_vaapi.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c
index a2387d4fc4..cc3739f6ec 100644
--- a/libavutil/hwcontext_vaapi.c
+++ b/libavutil/hwcontext_vaapi.c
@@ -935,6 +935,12 @@ static const struct {
     DRM_MAP(NV12, 2, DRM_FORMAT_R8,  DRM_FORMAT_RG88),
 #endif
     DRM_MAP(NV12, 1, DRM_FORMAT_NV12),
+#ifdef VA_FOURCC_I420
+#ifdef DRM_FORMAT_R8
+    DRM_MAP(I420, 3, DRM_FORMAT_R8, DRM_FORMAT_R8, DRM_FORMAT_R8),
+#endif
+    DRM_MAP(I420, 1, DRM_FORMAT_YUV420),
+#endif
 #if defined(VA_FOURCC_P010) && defined(DRM_FORMAT_R16)
     DRM_MAP(P010, 2, DRM_FORMAT_R16, DRM_FORMAT_RG1616),
 #endif
-- 
2.18.0


More information about the ffmpeg-devel mailing list