eglimage: add Y212_LE / Y212_BE DMABuf import support
authorHaihao Xiang <haihao.xiang@intel.com>
Fri, 2 Jul 2021 12:31:22 +0000 (20:31 +0800)
committerHaihao Xiang <haihao.xiang@intel.com>
Wed, 5 Oct 2022 04:21:03 +0000 (04:21 +0000)
This fixed the error below:

GST_GL_PLATFORM=egl gst-launch-1.0 videotestsrc ! msdkvpp \
! "video/x-raw(memory:DMABuf),format=Y212_LE" ! glimagesink

0:00:00.148086281 575148 0x562a6d36d920 ERROR             gleglimage
gsteglimage.c:555:_drm_rgba_fourcc_from_info: Unsupported format for
DMABuf.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1389>

subprojects/gst-plugins-base/gst-libs/gst/gl/egl/gsteglimage.c

index f83e629..58f44d8 100644 (file)
@@ -555,6 +555,14 @@ _drm_rgba_fourcc_from_info (const GstVideoInfo * info, int plane,
       *out_format = GST_GL_RG16;
       return rg16_fourcc;
 
+    case GST_VIDEO_FORMAT_Y212_LE:
+      *out_format = GST_GL_RG16;
+      return DRM_FORMAT_GR1616;
+
+    case GST_VIDEO_FORMAT_Y212_BE:
+      *out_format = GST_GL_RG16;
+      return DRM_FORMAT_RG1616;
+
     default:
       GST_ERROR ("Unsupported format for DMABuf.");
       return -1;