# GstGLColorConvert

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, the configuration negotiated with gst_gl_color_convert_transform_caps and the conversion performed with gst_gl_color_convert_perform.

The glcolorconvertelement provides a GStreamer element that uses GstGLColorConvert to convert between video formats and color spaces.

## GstGLColorConvert

    GObject
        ╰──GInitiallyUnowned
            ╰──GstObject
                ╰──GstGLColorConvert

Opaque GstGLColorConvert object

### Class structure

#### GstGLColorConvertClass

The GstGLColorConvertClass struct only contains private data

### GstGL.GLColorConvertClass

The GstGL.GLColorConvertClass struct only contains private data

### GstGL.GLColorConvertClass

The GstGL.GLColorConvertClass struct only contains private data

## GstGL.GLColorConvert

    GObject.Object
        ╰──GObject.InitiallyUnowned
            ╰──Gst.Object
                ╰──GstGL.GLColorConvert

Opaque GstGL.GLColorConvert object

## GstGL.GLColorConvert

    GObject.Object
        ╰──GObject.InitiallyUnowned
            ╰──Gst.Object
                ╰──GstGL.GLColorConvert

Opaque GstGL.GLColorConvert object

### Constructors

#### gst_gl_color_convert_new

    GstGLColorConvert *
    gst_gl_color_convert_new (GstGLContext * context)

Parameters:

`context` –

a GstGLContext

Returns ( [transfer: full]) –

a new GstGLColorConvert object

Since : 1.4

#### GstGL.GLColorConvert.prototype.new

    function GstGL.GLColorConvert.prototype.new(context: GstGL.GLContext): {
        // javascript wrapper for 'gst_gl_color_convert_new'
    }

Parameters:

`context` (GstGL.GLContext) –

a GstGL.GLContext

Returns (GstGL.GLColorConvert) –

a new GstGL.GLColorConvert object

Since : 1.4

#### GstGL.GLColorConvert.new

    def GstGL.GLColorConvert.new (context):
        #python wrapper for 'gst_gl_color_convert_new'

Parameters:

`context` (GstGL.GLContext) –

a GstGL.GLContext

Returns (GstGL.GLColorConvert) –

a new GstGL.GLColorConvert object

Since : 1.4

### Methods

#### gst_gl_color_convert_decide_allocation

    gboolean
    gst_gl_color_convert_decide_allocation (GstGLColorConvert * convert,
                                            GstQuery * query)

Provides an implementation of decide_allocation()

Parameters:

`convert` –

a GstGLColorConvert

`query` –

a completed ALLOCATION GstQuery

Returns –

whether the allocation parameters were successfully chosen

Since : 1.8

#### GstGL.GLColorConvert.prototype.decide_allocation

    function GstGL.GLColorConvert.prototype.decide_allocation(query: Gst.Query): {
        // javascript wrapper for 'gst_gl_color_convert_decide_allocation'
    }

Provides an implementation of vfunc_decide_allocation()

Parameters:

`convert` (GstGL.GLColorConvert) –

a GstGL.GLColorConvert

`query` (Gst.Query) –

a completed ALLOCATION Gst.Query

Returns (Number) –

whether the allocation parameters were successfully chosen

Since : 1.8

#### GstGL.GLColorConvert.decide_allocation

    def GstGL.GLColorConvert.decide_allocation (self, query):
        #python wrapper for 'gst_gl_color_convert_decide_allocation'

Provides an implementation of do_decide_allocation()

Parameters:

`convert` (GstGL.GLColorConvert) –

a GstGL.GLColorConvert

`query` (Gst.Query) –

a completed ALLOCATION Gst.Query

Returns (bool) –

whether the allocation parameters were successfully chosen

Since : 1.8

#### gst_gl_color_convert_perform

    GstBuffer *
    gst_gl_color_convert_perform (GstGLColorConvert * convert,
                                  GstBuffer * inbuf)

Converts the data contained by inbuf using the formats specified by the GstCaps passed to gst_gl_color_convert_set_caps

Parameters:

`convert` –

a GstGLColorConvert

`inbuf` ( [transfer: none]) –

the GstGLMemory filled GstBuffer to convert

Returns ( [transfer: full][nullable]) –

a converted GstBuffer or NULL

Since : 1.4

#### GstGL.GLColorConvert.prototype.perform

    function GstGL.GLColorConvert.prototype.perform(inbuf: Gst.Buffer): {
        // javascript wrapper for 'gst_gl_color_convert_perform'
    }

Converts the data contained by inbuf using the formats specified by the Gst.Caps passed to GstGL.GLColorConvert.prototype.set_caps

Parameters:

`convert` (GstGL.GLColorConvert) –

a GstGL.GLColorConvert

`inbuf` (Gst.Buffer) –

the GstGL.GLMemory filled Gst.Buffer to convert

Returns (Gst.Buffer) –

a converted Gst.Buffer or null

Since : 1.4

#### GstGL.GLColorConvert.perform

    def GstGL.GLColorConvert.perform (self, inbuf):
        #python wrapper for 'gst_gl_color_convert_perform'

Converts the data contained by inbuf using the formats specified by the Gst.Caps passed to GstGL.GLColorConvert.set_caps

Parameters:

`convert` (GstGL.GLColorConvert) –

a GstGL.GLColorConvert

`inbuf` (Gst.Buffer) –

the GstGL.GLMemory filled Gst.Buffer to convert

Returns (Gst.Buffer) –

a converted Gst.Buffer or None

Since : 1.4

#### gst_gl_color_convert_set_caps

    gboolean
    gst_gl_color_convert_set_caps (GstGLColorConvert * convert,
                                   GstCaps * in_caps,
                                   GstCaps * out_caps)

Initializes convert with the information required for conversion.

Parameters:

`convert` –

a GstGLColorConvert

`in_caps` –

input GstCaps

`out_caps` –

output GstCaps

Returns –
No description available

Since : 1.6

#### GstGL.GLColorConvert.prototype.set_caps

    function GstGL.GLColorConvert.prototype.set_caps(in_caps: Gst.Caps, out_caps: Gst.Caps): {
        // javascript wrapper for 'gst_gl_color_convert_set_caps'
    }

Initializes convert with the information required for conversion.

Parameters:

`convert` (GstGL.GLColorConvert) –

a GstGL.GLColorConvert

`in_caps` (Gst.Caps) –

input Gst.Caps

`out_caps` (Gst.Caps) –

output Gst.Caps

Returns (Number) –
No description available

Since : 1.6

#### GstGL.GLColorConvert.set_caps

    def GstGL.GLColorConvert.set_caps (self, in_caps, out_caps):
        #python wrapper for 'gst_gl_color_convert_set_caps'

Initializes convert with the information required for conversion.

Parameters:

`convert` (GstGL.GLColorConvert) –

a GstGL.GLColorConvert

`in_caps` (Gst.Caps) –

input Gst.Caps

`out_caps` (Gst.Caps) –

output Gst.Caps

Returns (bool) –
No description available

Since : 1.6

### Functions

#### gst_gl_color_convert_fixate_caps

    GstCaps *
    gst_gl_color_convert_fixate_caps (GstGLContext * context,
                                      GstPadDirection direction,
                                      GstCaps * caps,
                                      GstCaps * other)

Provides an implementation of fixate_caps()

Parameters:

`context` –

a GstGLContext to use for transforming caps

`direction` –

a GstPadDirection

`caps` ( [transfer: none]) –

the GstCaps of direction

`other` ( [transfer: full]) –

the GstCaps to fixate

Returns ( [transfer: full]) –

the fixated GstCaps

Since : 1.8

#### GstGL.GLColorConvert.prototype.fixate_caps

    function GstGL.GLColorConvert.prototype.fixate_caps(context: GstGL.GLContext, direction: Gst.PadDirection, caps: Gst.Caps, other: Gst.Caps): {
        // javascript wrapper for 'gst_gl_color_convert_fixate_caps'
    }

Provides an implementation of vfunc_fixate_caps()

Parameters:

`context` (GstGL.GLContext) –

a GstGL.GLContext to use for transforming caps

`direction` (Gst.PadDirection) –

a Gst.PadDirection

`caps` (Gst.Caps) –

the Gst.Caps of direction

`other` (Gst.Caps) –

the Gst.Caps to fixate

Returns (Gst.Caps) –

the fixated Gst.Caps

Since : 1.8

#### GstGL.GLColorConvert.fixate_caps

    def GstGL.GLColorConvert.fixate_caps (context, direction, caps, other):
        #python wrapper for 'gst_gl_color_convert_fixate_caps'

Provides an implementation of do_fixate_caps()

Parameters:

`context` (GstGL.GLContext) –

a GstGL.GLContext to use for transforming caps

`direction` (Gst.PadDirection) –

a Gst.PadDirection

`caps` (Gst.Caps) –

the Gst.Caps of direction

`other` (Gst.Caps) –

the Gst.Caps to fixate

Returns (Gst.Caps) –

the fixated Gst.Caps

Since : 1.8

#### gst_gl_color_convert_swizzle_shader_string

    gchar *
    gst_gl_color_convert_swizzle_shader_string (GstGLContext * context)

Parameters:

`context` –

a GstGLContext

Returns ( [transfer: full]) –

a shader string that can be used to swizzle vec components in a GLSL shader.

Since : 1.24

#### GstGL.GLColorConvert.prototype.swizzle_shader_string

    function GstGL.GLColorConvert.prototype.swizzle_shader_string(context: GstGL.GLContext): {
        // javascript wrapper for 'gst_gl_color_convert_swizzle_shader_string'
    }

Parameters:

`context` (GstGL.GLContext) –

a GstGL.GLContext

Returns (String) –

a shader string that can be used to swizzle vec components in a GLSL shader.

Since : 1.24

#### GstGL.GLColorConvert.swizzle_shader_string

    def GstGL.GLColorConvert.swizzle_shader_string (context):
        #python wrapper for 'gst_gl_color_convert_swizzle_shader_string'

Parameters:

`context` (GstGL.GLContext) –

a GstGL.GLContext

Returns (str) –

a shader string that can be used to swizzle vec components in a GLSL shader.

Since : 1.24

#### gst_gl_color_convert_transform_caps

    GstCaps *
    gst_gl_color_convert_transform_caps (GstGLContext * context,
                                         GstPadDirection direction,
                                         GstCaps * caps,
                                         GstCaps * filter)

Provides an implementation of transform_caps()

Parameters:

`context` –

a GstGLContext to use for transforming caps

`direction` –

a GstPadDirection

`caps` ( [transfer: none]) –

the GstCaps to transform

`filter` ( [transfer: none]) –

a set of filter GstCaps

Returns ( [transfer: full]) –

the converted GstCaps

Since : 1.6

#### GstGL.GLColorConvert.prototype.transform_caps

    function GstGL.GLColorConvert.prototype.transform_caps(context: GstGL.GLContext, direction: Gst.PadDirection, caps: Gst.Caps, filter: Gst.Caps): {
        // javascript wrapper for 'gst_gl_color_convert_transform_caps'
    }

Provides an implementation of vfunc_transform_caps()

Parameters:

`context` (GstGL.GLContext) –

a GstGL.GLContext to use for transforming caps

`direction` (Gst.PadDirection) –

a Gst.PadDirection

`caps` (Gst.Caps) –

the Gst.Caps to transform

`filter` (Gst.Caps) –

a set of filter Gst.Caps

Returns (Gst.Caps) –

the converted Gst.Caps

Since : 1.6

#### GstGL.GLColorConvert.transform_caps

    def GstGL.GLColorConvert.transform_caps (context, direction, caps, filter):
        #python wrapper for 'gst_gl_color_convert_transform_caps'

Provides an implementation of do_transform_caps()

Parameters:

`context` (GstGL.GLContext) –

a GstGL.GLContext to use for transforming caps

`direction` (Gst.PadDirection) –

a Gst.PadDirection

`caps` (Gst.Caps) –

the Gst.Caps to transform

`filter` (Gst.Caps) –

a set of filter Gst.Caps

Returns (Gst.Caps) –

the converted Gst.Caps

Since : 1.6

#### gst_gl_color_convert_yuv_to_rgb_shader_string

    gchar *
    gst_gl_color_convert_yuv_to_rgb_shader_string (GstGLContext * context)

The returned glsl function has declaration:

`vec3 yuv_to_rgb (vec3 rgb, vec3 offset, vec3 ycoeff, vec3 ucoeff, vec3 vcoeff);`

The Y component is placed in the 0th index of the returned value, The U component in the 1st, and the V component in the 2nd. offset, ycoeff, ucoeff, and vcoeff are the specific coefficients and offset used for the conversion.

Parameters:

`context` –

a GstGLContext

Returns ( [transfer: full]) –

a glsl function that can be used to convert from yuv to rgb

Since : 1.24

#### GstGL.GLColorConvert.prototype.yuv_to_rgb_shader_string

    function GstGL.GLColorConvert.prototype.yuv_to_rgb_shader_string(context: GstGL.GLContext): {
        // javascript wrapper for 'gst_gl_color_convert_yuv_to_rgb_shader_string'
    }

The returned glsl function has declaration:

`vec3 yuv_to_rgb (vec3 rgb, vec3 offset, vec3 ycoeff, vec3 ucoeff, vec3 vcoeff);`

The Y component is placed in the 0th index of the returned value, The U component in the 1st, and the V component in the 2nd. offset, ycoeff, ucoeff, and vcoeff are the specific coefficients and offset used for the conversion.

Parameters:

`context` (GstGL.GLContext) –

a GstGL.GLContext

Returns (String) –

a glsl function that can be used to convert from yuv to rgb

Since : 1.24

#### GstGL.GLColorConvert.yuv_to_rgb_shader_string

    def GstGL.GLColorConvert.yuv_to_rgb_shader_string (context):
        #python wrapper for 'gst_gl_color_convert_yuv_to_rgb_shader_string'

The returned glsl function has declaration:

`vec3 yuv_to_rgb (vec3 rgb, vec3 offset, vec3 ycoeff, vec3 ucoeff, vec3 vcoeff);`

The Y component is placed in the 0th index of the returned value, The U component in the 1st, and the V component in the 2nd. offset, ycoeff, ucoeff, and vcoeff are the specific coefficients and offset used for the conversion.

Parameters:

`context` (GstGL.GLContext) –

a GstGL.GLContext

Returns (str) –

a glsl function that can be used to convert from yuv to rgb

Since : 1.24

## Function Macros

### GST_GL_COLOR_CONVERT_CAST

    #define GST_GL_COLOR_CONVERT_CAST(obj) ((GstGLColorConvert*)(obj))

## Constants

### GST_GL_COLOR_CONVERT_EXT_FORMATS

    #define GST_GL_COLOR_CONVERT_EXT_FORMATS \
        ", RGBA64_LE, BGR10A2_LE, RGB10A2_LE, P010_10LE, P012_LE, P016_LE, Y212_LE, Y412_LE" \
        ", A444_16LE, A422_16LE, A420_16LE, A444_12LE, A422_12LE, A420_12LE, A420_10LE" \
        ", A422_10LE, A444_10LE, I420_12LE, I420_10LE, I422_10LE, I422_12LE, Y444_16LE, Y444_10LE"

### GST_GL_COLOR_CONVERT_FORMATS

    #define GST_GL_COLOR_CONVERT_FORMATS "{ RGBA, RGB, RGBx, BGR, BGRx, BGRA, xRGB, " \
                                   "xBGR, ARGB, ABGR, GBRA, GBR, RGBP, BGRP, Y444, I420, YV12, Y42B, " \
                                   "Y41B, NV12, NV21, NV16, NV61, YUY2, UYVY, Y210, AYUV, " \
                                   "VUYA, Y410, A444, A422, GRAY8, GRAY16_LE, GRAY16_BE, " \
                                   "RGB16, BGR16, ARGB64, A420, AV12, NV12_16L32S, NV12_4L4, RBGA, v210" \
                                   GST_GL_COLOR_CONVERT_EXT_FORMATS "}"

The currently supported formats that can be converted

### GstGL.GL_COLOR_CONVERT_FORMATS

The currently supported formats that can be converted

### GstGL.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 \
        "video/x-raw(" GST_CAPS_FEATURE_MEMORY_GL_MEMORY "), "              \
        "format = (string) " GST_GL_COLOR_CONVERT_FORMATS ", "              \
        "width = " GST_VIDEO_SIZE_RANGE ", "                                \
        "height = " GST_VIDEO_SIZE_RANGE ", "                               \
        "framerate = " GST_VIDEO_FPS_RANGE ", "                             \
        "texture-target = (string) { 2D, rectangle, external-oes } "        \
        " ; "                                                               \
        "video/x-raw(" GST_CAPS_FEATURE_MEMORY_GL_MEMORY ","                \
        GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION "), "           \
        "format = (string) " GST_GL_COLOR_CONVERT_FORMATS ", "              \
        "width = " GST_VIDEO_SIZE_RANGE ", "                                \
        "height = " GST_VIDEO_SIZE_RANGE ", "                               \
        "framerate = " GST_VIDEO_FPS_RANGE ", "                             \
        "texture-target = (string) { 2D, rectangle, external-oes }"         \
        " ; "                                                               \
        GST_VIDEO_DMA_DRM_CAPS_MAKE                                         \
        " ; "                                                               \
        GST_VIDEO_CAPS_MAKE_WITH_FEATURES ("memory:DMABuf,"                 \
          GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION,              \
          "DMA_DRM")

The currently supported GstCaps that can be converted

### GstGL.GL_COLOR_CONVERT_VIDEO_CAPS

The currently supported Gst.Caps that can be converted

### GstGL.GL_COLOR_CONVERT_VIDEO_CAPS

The currently supported Gst.Caps that can be converted

The results of the search are