From 0ace1301071880f844278a6fac184bda81a144c4 Mon Sep 17 00:00:00 2001 From: He Junyan Date: Mon, 11 Sep 2023 23:10:00 +0800 Subject: [PATCH] glcolorconvert: Calculate correct swizzles for Y410, Y412 formats The GST_VIDEO_FORMAT_Y410, GST_VIDEO_FORMAT_Y412_LE and GST_VIDEO_FORMAT_Y412_BE formats in fact are packed formats, which have just 1 plane. But we have special setting for them rather than using get_single_planar_format_gl_swizzle_order(). Part-of: --- subprojects/gst-plugins-base/gst-libs/gst/gl/gstglformat.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglformat.c b/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglformat.c index 7a3f2ea4fc..e03dc8cf94 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglformat.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglformat.c @@ -537,7 +537,10 @@ gst_gl_video_format_swizzle (GstVideoFormat video_format, int *swizzle) { const GstVideoFormatInfo *finfo = gst_video_format_get_info (video_format); - if (finfo->n_planes == 1) { + if (finfo->n_planes == 1 && + (finfo->flags & GST_VIDEO_FORMAT_FLAG_RGB || + video_format == GST_VIDEO_FORMAT_AYUV || + video_format == GST_VIDEO_FORMAT_VUYA)) { get_single_planar_format_gl_swizzle_order (video_format, swizzle); return TRUE; }