glcolorconvert: expose the swizzle glsl functions

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5109>
This commit is contained in:
Matthew Waters 2023-07-20 20:58:15 +10:00 committed by GStreamer Marge Bot
parent bff5d6d725
commit 7fcef3818e
3 changed files with 32 additions and 0 deletions

View file

@ -1543,6 +1543,20 @@ The glcolorconvertelement provides a GStreamer element that uses
</parameter>
</parameters>
</function>
<function name="swizzle_shader_string" c:identifier="gst_gl_color_convert_swizzle_shader_string" version="1.24">
<source-position filename="../subprojects/gst-plugins-base/gst-libs/gst/gl/gstglcolorconvert.h"/>
<return-value transfer-ownership="full">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-base/gst-libs/gst/gl/gstglcolorconvert.c">a shader string that can be used to swizzle vec
components in a GLSL shader.</doc>
<type name="utf8" c:type="gchar*"/>
</return-value>
<parameters>
<parameter name="context" transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-base/gst-libs/gst/gl/gstglcolorconvert.c">a #GstGLContext</doc>
<type name="GLContext" c:type="GstGLContext*"/>
</parameter>
</parameters>
</function>
<function name="transform_caps" c:identifier="gst_gl_color_convert_transform_caps" version="1.6">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-base/gst-libs/gst/gl/gstglcolorconvert.c">Provides an implementation of #GstBaseTransformClass.transform_caps()</doc>
<source-position filename="../subprojects/gst-plugins-base/gst-libs/gst/gl/gstglcolorconvert.h"/>

View file

@ -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

View file

@ -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);