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

Submitted by Mark Thompson on Sept. 3, 2018, midnight

Details

Message ID a1ca3e4b-f6fe-db84-554b-a7de77f7281c@jkqxz.net
State New
Headers show

Commit Message

Mark Thompson Sept. 3, 2018, midnight
---
Needed to import YUV420P frames exported from Vulkan.

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

Patch hide | download patch | download mbox

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