GstGLColorConvert

GstGLColorConvert — an object that converts between color spaces/formats

Functions

Types and Values

Object Hierarchy

    GObject
    ╰── GstGLColorConvert

Description

GstGLColorConvert is an object that converts between color spaces and/or formats using OpenGL Shaders.

A GstGLColorConvert can be created with gst_gl_color_convert_new().

For handling stride scaling in the shader, see gst_gl_color_convert_set_texture_scaling().

Functions

gst_gl_color_convert_new ()

GstGLColorConvert *
gst_gl_color_convert_new (GstGLContext *context);

gst_gl_color_convert_init_format ()

gboolean
gst_gl_color_convert_init_format (GstGLColorConvert *convert,
                                  GstVideoInfo *in_info,
                                  GstVideoInfo *out_info);

Initializes convert with the information required for conversion.

Parameters

convert

a GstGLColorConvert

 

in_info

input GstVideoInfo

 

out_info

output GstVideoInfo

 

Returns

whether the initialization was successful


gst_gl_color_convert_set_texture_scaling ()

void
gst_gl_color_convert_set_texture_scaling
                               (GstGLColorConvert *convert,
                                gfloat scaling[GST_VIDEO_MAX_PLANES][2]);

Scales the input textures by the given amount. Useful for performing stride scaling in a shader on OpenGL platforms that do not support GL_PIXEL_[UN]PACK_LENGTH such as GL|ES 2.0.

Parameters

convert

a GstGLColorConvert

 

scaling

array of texture scaling coefficients stored in width, height order per texture being converted.

 

gst_gl_color_convert_perform ()

gboolean
gst_gl_color_convert_perform (GstGLColorConvert *convert,
                              GstGLMemory *in_tex[GST_VIDEO_MAX_PLANES],
                              GstGLMemory *out_tex[GST_VIDEO_MAX_PLANES]);

Converts the data contained in in_tex into out_tex using the formats specified by the GstVideoInfos passed to gst_gl_color_convert_init_format()

Parameters

convert

a GstGLColorConvert

 

in_tex

the texture ids for input formatted according to in_info

 

out_tex

the texture ids for output formatted according to out_info

 

Returns

whether the conversion was successful

Types and Values

GST_GL_COLOR_CONVERT_FORMATS

#define             GST_GL_COLOR_CONVERT_FORMATS

The currently supported formats that can be converted


GST_GL_COLOR_CONVERT_VIDEO_CAPS

#define GST_GL_COLOR_CONVERT_VIDEO_CAPS GST_VIDEO_CAPS_MAKE (GST_GL_COLOR_CONVERT_FORMATS)

The currently supported GstCaps that can be converted


GstGLColorConvert

typedef struct _GstGLColorConvert GstGLColorConvert;

Opaque GstGLColorConvert object


GstGLColorConvertClass

typedef struct {
  GObjectClass object_class;
} GstGLColorConvertClass;

The GstGLColorConvertClass struct only contains private data

See Also

GstGLUpload, GstGLDownload, GstGLMemory