eglimage: add Y210 DMABuf import support

This fixed the error below:

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

0:00:00.039881627 571365 0x56245eba6920 ERROR             gleglimage
gsteglimage.c:549:_drm_rgba_fourcc_from_info: Unsupported format for
DMABuf

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1389>
This commit is contained in:
Haihao Xiang 2021-07-02 15:37:19 +08:00
parent 92efecd1fe
commit 18215dcd3b

View file

@ -464,10 +464,12 @@ _drm_rgba_fourcc_from_info (const GstVideoInfo * info, int plane,
const gint rgba_fourcc = DRM_FORMAT_ABGR8888;
const gint rgb_fourcc = DRM_FORMAT_BGR888;
const gint rg_fourcc = DRM_FORMAT_GR88;
const gint rg16_fourcc = DRM_FORMAT_GR1616;
#else
const gint rgba_fourcc = DRM_FORMAT_RGBA8888;
const gint rgb_fourcc = DRM_FORMAT_RGB888;
const gint rg_fourcc = DRM_FORMAT_RG88;
const gint rg16_fourcc = DRM_FORMAT_RG1616;
#endif
GST_DEBUG ("Getting DRM fourcc for %s plane %i",
@ -549,6 +551,10 @@ _drm_rgba_fourcc_from_info (const GstVideoInfo * info, int plane,
*out_format = plane == 1 ? GST_GL_RED : GST_GL_RG;
return plane == 1 ? rg_fourcc : DRM_FORMAT_R8;
case GST_VIDEO_FORMAT_Y210:
*out_format = GST_GL_RG16;
return rg16_fourcc;
default:
GST_ERROR ("Unsupported format for DMABuf.");
return -1;