From 7fcef3818e77d3eea1155f104253bf38c1dbd1a3 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Thu, 20 Jul 2023 20:58:15 +1000 Subject: [PATCH] glcolorconvert: expose the swizzle glsl functions Part-of: --- girs/GstGL-1.0.gir | 14 ++++++++++++++ .../gst-libs/gst/gl/gstglcolorconvert.c | 15 +++++++++++++++ .../gst-libs/gst/gl/gstglcolorconvert.h | 3 +++ 3 files changed, 32 insertions(+) diff --git a/girs/GstGL-1.0.gir b/girs/GstGL-1.0.gir index fa6f98f8a7..e18fe8953d 100644 --- a/girs/GstGL-1.0.gir +++ b/girs/GstGL-1.0.gir @@ -1543,6 +1543,20 @@ The glcolorconvertelement provides a GStreamer element that uses + + + + a shader string that can be used to swizzle vec +components in a GLSL shader. + + + + + a #GstGLContext + + + + Provides an implementation of #GstBaseTransformClass.transform_caps() diff --git a/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglcolorconvert.c b/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglcolorconvert.c index 12970b76bc..4dc46266be 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglcolorconvert.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglcolorconvert.c @@ -3258,6 +3258,21 @@ _do_convert_draw (GstGLContext * context, GstGLColorConvert * convert) return ret; } +/** + * gst_gl_color_convert_swizzle_shader_string: + * @context: a #GstGLContext + * + * Returns: (transfer full): a shader string that can be used to swizzle vec + * components in a GLSL shader. + * + * Since: 1.24 + */ +gchar * +gst_gl_color_convert_swizzle_shader_string (GstGLContext * context) +{ + return g_strdup (glsl_func_swizzle); +} + /** * gst_gl_color_convert_yuv_to_rgb_shader_string: * @context: a #GstGLContext diff --git a/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglcolorconvert.h b/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglcolorconvert.h index ca2eb8a6c9..47df0f200e 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglcolorconvert.h +++ b/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglcolorconvert.h @@ -151,6 +151,9 @@ gboolean gst_gl_color_convert_decide_allocation (GstGLColorConvert * conver GST_GL_API GstBuffer * gst_gl_color_convert_perform (GstGLColorConvert * convert, GstBuffer * inbuf); +GST_GL_API +gchar * gst_gl_color_convert_swizzle_shader_string (GstGLContext * context); + GST_GL_API gchar * gst_gl_color_convert_yuv_to_rgb_shader_string (GstGLContext * context);