eglimage: Add AV12 DMABuf import support
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Thu, 10 Jun 2021 16:41:31 +0000 (12:41 -0400)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Thu, 10 Jun 2021 16:41:31 +0000 (12:41 -0400)
The per plane format mapping for AV12 was missing, which would force
raw upload.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1199>

gst-libs/gst/gl/egl/gsteglimage.c

index 7355d52..30bab22 100644 (file)
@@ -545,6 +545,10 @@ _drm_rgba_fourcc_from_info (const GstVideoInfo * info, int plane,
       *out_format = plane == 0 ? GST_GL_R16 : GST_GL_RG16;
       return plane == 0 ? DRM_FORMAT_R16 : DRM_FORMAT_RG1616;
 
+    case GST_VIDEO_FORMAT_AV12:
+      *out_format = plane == 1 ? GST_GL_RED : GST_GL_RG;
+      return plane == 1 ? rg_fourcc : DRM_FORMAT_R8;
+
     default:
       GST_ERROR ("Unsupported format for DMABuf.");
       return -1;