# GstGLFilter

GstGLFilter helps to implement simple OpenGL filter elements taking a single input and producing a single output with a GstGLFramebuffer

## GstGLFilter

    GObject
        ╰──GInitiallyUnowned
            ╰──GstObject
                ╰──GstElement
                    ╰──GstBaseTransform
                        ╰──GstGLBaseFilter
                            ╰──GstGLFilter

### Members

`parent` (GstGLBaseFilter) –
No description available
`in_info` (GstVideoInfo) –

the video info for input buffers

`out_info` (GstVideoInfo) –

the video info for output buffers

`in_texture_target` (GstGLTextureTarget) –

The texture target of the input buffers (usually 2D)

`out_texture_target` (GstGLTextureTarget) –

The texture target of the output buffers (usually 2D)

`out_caps` (GstCaps *) –

the output GstCaps

`fbo` (GstGLFramebuffer *) –

GstGLFramebuffer object used for transformations (only for subclass usage)

### Class structure

#### GstGLFilterClass

##### Fields

`parent_class` (GstGLBaseFilterClass) –
No description available

### GstGL.GLFilterClass

##### Attributes

`parent_class` (GstGL.GLBaseFilterClass) –
No description available

### GstGL.GLFilterClass

##### Attributes

`parent_class` (GstGL.GLBaseFilterClass) –
No description available

## GstGL.GLFilter

    GObject.Object
        ╰──GObject.InitiallyUnowned
            ╰──Gst.Object
                ╰──Gst.Element
                    ╰──GstBase.BaseTransform
                        ╰──GstGL.GLBaseFilter
                            ╰──GstGL.GLFilter

### Members

`parent` (GstGL.GLBaseFilter) –
No description available
`in_info` (GstVideo.VideoInfo) –

the video info for input buffers

`out_info` (GstVideo.VideoInfo) –

the video info for output buffers

`in_texture_target` (GstGL.GLTextureTarget) –

The texture target of the input buffers (usually 2D)

`out_texture_target` (GstGL.GLTextureTarget) –

The texture target of the output buffers (usually 2D)

`out_caps` (Gst.Caps) –

the output Gst.Caps

`fbo` (GstGL.GLFramebuffer) –

GstGL.GLFramebuffer object used for transformations (only for subclass usage)

## GstGL.GLFilter

    GObject.Object
        ╰──GObject.InitiallyUnowned
            ╰──Gst.Object
                ╰──Gst.Element
                    ╰──GstBase.BaseTransform
                        ╰──GstGL.GLBaseFilter
                            ╰──GstGL.GLFilter

### Members

`parent` (GstGL.GLBaseFilter) –
No description available
`in_info` (GstVideo.VideoInfo) –

the video info for input buffers

`out_info` (GstVideo.VideoInfo) –

the video info for output buffers

`in_texture_target` (GstGL.GLTextureTarget) –

The texture target of the input buffers (usually 2D)

`out_texture_target` (GstGL.GLTextureTarget) –

The texture target of the output buffers (usually 2D)

`out_caps` (Gst.Caps) –

the output Gst.Caps

`fbo` (GstGL.GLFramebuffer) –

GstGL.GLFramebuffer object used for transformations (only for subclass usage)

### Methods

#### gst_gl_filter_draw_fullscreen_quad

    gst_gl_filter_draw_fullscreen_quad (GstGLFilter * filter)

Render a fullscreen quad using the current GL state. The only GL state this modifies is the necessary vertex/index buffers and, if necessary, a Vertex Array Object for drawing a fullscreen quad. Framebuffer state, any shaders, viewport state, etc must be setup by the caller.

Parameters:

`filter` –

a GstGLFilter

Since : 1.10

#### GstGL.GLFilter.prototype.draw_fullscreen_quad

    function GstGL.GLFilter.prototype.draw_fullscreen_quad(): {
        // javascript wrapper for 'gst_gl_filter_draw_fullscreen_quad'
    }

Render a fullscreen quad using the current GL state. The only GL state this modifies is the necessary vertex/index buffers and, if necessary, a Vertex Array Object for drawing a fullscreen quad. Framebuffer state, any shaders, viewport state, etc must be setup by the caller.

Parameters:

`filter` (GstGL.GLFilter) –

a GstGL.GLFilter

Since : 1.10

#### GstGL.GLFilter.draw_fullscreen_quad

    def GstGL.GLFilter.draw_fullscreen_quad (self):
        #python wrapper for 'gst_gl_filter_draw_fullscreen_quad'

Render a fullscreen quad using the current GL state. The only GL state this modifies is the necessary vertex/index buffers and, if necessary, a Vertex Array Object for drawing a fullscreen quad. Framebuffer state, any shaders, viewport state, etc must be setup by the caller.

Parameters:

`filter` (GstGL.GLFilter) –

a GstGL.GLFilter

Since : 1.10

#### gst_gl_filter_filter_texture

    gboolean
    gst_gl_filter_filter_texture (GstGLFilter * filter,
                                  GstBuffer * input,
                                  GstBuffer * output)

Calls filter_texture vfunc with correctly mapped GstGLMemory

Parameters:

`filter` –

a GstGLFilter

`input` –

an input buffer

`output` –

an output buffer

Returns –

whether the transformation succeeded

Since : 1.4

#### GstGL.GLFilter.prototype.filter_texture

    function GstGL.GLFilter.prototype.filter_texture(input: Gst.Buffer, output: Gst.Buffer): {
        // javascript wrapper for 'gst_gl_filter_filter_texture'
    }

Calls filter_texture vfunc with correctly mapped GstGL.GLMemory

Parameters:

`filter` (GstGL.GLFilter) –

a GstGL.GLFilter

`input` (Gst.Buffer) –

an input buffer

`output` (Gst.Buffer) –

an output buffer

Returns (Number) –

whether the transformation succeeded

Since : 1.4

#### GstGL.GLFilter.filter_texture

    def GstGL.GLFilter.filter_texture (self, input, output):
        #python wrapper for 'gst_gl_filter_filter_texture'

Calls filter_texture vfunc with correctly mapped GstGL.GLMemory

Parameters:

`filter` (GstGL.GLFilter) –

a GstGL.GLFilter

`input` (Gst.Buffer) –

an input buffer

`output` (Gst.Buffer) –

an output buffer

Returns (bool) –

whether the transformation succeeded

Since : 1.4

#### gst_gl_filter_render_to_target

    gboolean
    gst_gl_filter_render_to_target (GstGLFilter * filter,
                                    GstGLMemory * input,
                                    GstGLMemory * output,
                                    GstGLFilterRenderFunc func,
                                    gpointer data)

Transforms input into output using func on through FBO.

Parameters:

`filter` –

a GstGLFilter

`input` –

the input texture

`output` –

the output texture

`func` ( [scope call]) –

the function to transform input into output. called with data

`data` ( [allow-none]) –

the data associated with func

Returns –

the return value of func

Since : 1.10

#### GstGL.GLFilter.prototype.render_to_target

    function GstGL.GLFilter.prototype.render_to_target(input: GstGL.GLMemory, output: GstGL.GLMemory, func: GstGL.GLFilterRenderFunc, data: Object): {
        // javascript wrapper for 'gst_gl_filter_render_to_target'
    }

Transforms input into output using func on through FBO.

Parameters:

`filter` (GstGL.GLFilter) –

a GstGL.GLFilter

`input` (GstGL.GLMemory) –

the input texture

`output` (GstGL.GLMemory) –

the output texture

`func` (GstGL.GLFilterRenderFunc) –

the function to transform input into output. called with data

`data` (Object) –

the data associated with func

Returns (Number) –

the return value of func

Since : 1.10

#### GstGL.GLFilter.render_to_target

    def GstGL.GLFilter.render_to_target (self, input, output, func, *data):
        #python wrapper for 'gst_gl_filter_render_to_target'

Transforms input into output using func on through FBO.

Parameters:

`filter` (GstGL.GLFilter) –

a GstGL.GLFilter

`input` (GstGL.GLMemory) –

the input texture

`output` (GstGL.GLMemory) –

the output texture

`func` (GstGL.GLFilterRenderFunc) –

the function to transform input into output. called with data

`data` (variadic) –

the data associated with func

Returns (bool) –

the return value of func

Since : 1.10

#### gst_gl_filter_render_to_target_with_shader

    gst_gl_filter_render_to_target_with_shader (GstGLFilter * filter,
                                                GstGLMemory * input,
                                                GstGLMemory * output,
                                                GstGLShader * shader)

Transforms input into output using shader with a FBO.

See also: gst_gl_filter_render_to_target

Parameters:

`filter` –

a GstGLFilter

`input` –

the input texture

`output` –

the output texture

`shader` –

the shader to use.

Since : 1.4

#### GstGL.GLFilter.prototype.render_to_target_with_shader

    function GstGL.GLFilter.prototype.render_to_target_with_shader(input: GstGL.GLMemory, output: GstGL.GLMemory, shader: GstGL.GLShader): {
        // javascript wrapper for 'gst_gl_filter_render_to_target_with_shader'
    }

Transforms input into output using shader with a FBO.

See also: GstGL.GLFilter.prototype.render_to_target

Parameters:

`filter` (GstGL.GLFilter) –

a GstGL.GLFilter

`input` (GstGL.GLMemory) –

the input texture

`output` (GstGL.GLMemory) –

the output texture

`shader` (GstGL.GLShader) –

the shader to use.

Since : 1.4

#### GstGL.GLFilter.render_to_target_with_shader

    def GstGL.GLFilter.render_to_target_with_shader (self, input, output, shader):
        #python wrapper for 'gst_gl_filter_render_to_target_with_shader'

Transforms input into output using shader with a FBO.

See also: GstGL.GLFilter.render_to_target

Parameters:

`filter` (GstGL.GLFilter) –

a GstGL.GLFilter

`input` (GstGL.GLMemory) –

the input texture

`output` (GstGL.GLMemory) –

the output texture

`shader` (GstGL.GLShader) –

the shader to use.

Since : 1.4

### Functions

#### gst_gl_filter_add_rgba_pad_templates

    gst_gl_filter_add_rgba_pad_templates (GstGLFilterClass * klass)

Parameters:

`klass` –
No description available

#### GstGL.GLFilter.prototype.add_rgba_pad_templates

    function GstGL.GLFilter.prototype.add_rgba_pad_templates(klass: GstGL.GLFilterClass): {
        // javascript wrapper for 'gst_gl_filter_add_rgba_pad_templates'
    }

Parameters:

`klass` (GstGL.GLFilterClass) –
No description available

#### GstGL.GLFilter.add_rgba_pad_templates

    def GstGL.GLFilter.add_rgba_pad_templates (klass):
        #python wrapper for 'gst_gl_filter_add_rgba_pad_templates'

Parameters:

`klass` (GstGL.GLFilterClass) –
No description available

### Virtual Methods

#### filter

    gboolean
    filter (GstGLFilter * filter,
            GstBuffer * inbuf,
            GstBuffer * outbuf)

perform operations on the input and output buffers. In general, you should avoid using this method if at all possible. One valid use-case for using this is keeping previous buffers for future calculations. Note: If filter exists, then filter_texture is not run

Parameters:

`filter` –
No description available
`inbuf` –
No description available
`outbuf` –
No description available
Returns –
No description available

#### vfunc_filter

    function vfunc_filter(filter: GstGL.GLFilter, inbuf: Gst.Buffer, outbuf: Gst.Buffer): {
        // javascript implementation of the 'filter' virtual method
    }

perform operations on the input and output buffers. In general, you should avoid using this method if at all possible. One valid use-case for using this is keeping previous buffers for future calculations. Note: If filter exists, then filter_texture is not run

Parameters:

`filter` (GstGL.GLFilter) –
No description available
`inbuf` (Gst.Buffer) –
No description available
`outbuf` (Gst.Buffer) –
No description available
Returns (Number) –
No description available

#### do_filter

    def do_filter (filter, inbuf, outbuf):
        #python implementation of the 'filter' virtual method

perform operations on the input and output buffers. In general, you should avoid using this method if at all possible. One valid use-case for using this is keeping previous buffers for future calculations. Note: If filter exists, then filter_texture is not run

Parameters:

`filter` (GstGL.GLFilter) –
No description available
`inbuf` (Gst.Buffer) –
No description available
`outbuf` (Gst.Buffer) –
No description available
Returns (bool) –
No description available

#### filter_texture

    gboolean
    filter_texture (GstGLFilter * filter,
                    GstGLMemory * input,
                    GstGLMemory * output)

given in_tex, transform it into out_tex. Not used if filter exists

Parameters:

`filter` –
No description available
`input` –
No description available
`output` –
No description available
Returns –
No description available

#### vfunc_filter_texture

    function vfunc_filter_texture(filter: GstGL.GLFilter, input: GstGL.GLMemory, output: GstGL.GLMemory): {
        // javascript implementation of the 'filter_texture' virtual method
    }

given in_tex, transform it into out_tex. Not used if filter exists

Parameters:

`filter` (GstGL.GLFilter) –
No description available
`input` (GstGL.GLMemory) –
No description available
`output` (GstGL.GLMemory) –
No description available
Returns (Number) –
No description available

#### do_filter_texture

    def do_filter_texture (filter, input, output):
        #python implementation of the 'filter_texture' virtual method

given in_tex, transform it into out_tex. Not used if filter exists

Parameters:

`filter` (GstGL.GLFilter) –
No description available
`input` (GstGL.GLMemory) –
No description available
`output` (GstGL.GLMemory) –
No description available
Returns (bool) –
No description available

#### init_fbo

    gboolean
    init_fbo (GstGLFilter * filter)

perform initialization when the Framebuffer object is created

Parameters:

`filter` –
No description available
Returns –
No description available

#### vfunc_init_fbo

    function vfunc_init_fbo(filter: GstGL.GLFilter): {
        // javascript implementation of the 'init_fbo' virtual method
    }

perform initialization when the Framebuffer object is created

Parameters:

`filter` (GstGL.GLFilter) –
No description available
Returns (Number) –
No description available

#### do_init_fbo

    def do_init_fbo (filter):
        #python implementation of the 'init_fbo' virtual method

perform initialization when the Framebuffer object is created

Parameters:

`filter` (GstGL.GLFilter) –
No description available
Returns (bool) –
No description available

#### set_caps

    gboolean
    set_caps (GstGLFilter * filter,
              GstCaps * incaps,
              GstCaps * outcaps)

mirror from GstBaseTransform

Parameters:

`filter` –
No description available
`incaps` –
No description available
`outcaps` –
No description available
Returns –
No description available

#### vfunc_set_caps

    function vfunc_set_caps(filter: GstGL.GLFilter, incaps: Gst.Caps, outcaps: Gst.Caps): {
        // javascript implementation of the 'set_caps' virtual method
    }

mirror from GstBase.BaseTransform

Parameters:

`filter` (GstGL.GLFilter) –
No description available
`incaps` (Gst.Caps) –
No description available
`outcaps` (Gst.Caps) –
No description available
Returns (Number) –
No description available

#### do_set_caps

    def do_set_caps (filter, incaps, outcaps):
        #python implementation of the 'set_caps' virtual method

mirror from GstBase.BaseTransform

Parameters:

`filter` (GstGL.GLFilter) –
No description available
`incaps` (Gst.Caps) –
No description available
`outcaps` (Gst.Caps) –
No description available
Returns (bool) –
No description available

#### transform_internal_caps

    GstCaps *
    transform_internal_caps (GstGLFilter * filter,
                             GstPadDirection direction,
                             GstCaps * caps,
                             GstCaps * filter_caps)

Perform sub-class specific modifications of the caps to be processed between upload on input and before download for output.

Parameters:

`filter` –
No description available
`direction` –
No description available
`caps` –
No description available
`filter_caps` –
No description available
Returns –
No description available

#### vfunc_transform_internal_caps

    function vfunc_transform_internal_caps(filter: GstGL.GLFilter, direction: Gst.PadDirection, caps: Gst.Caps, filter_caps: Gst.Caps): {
        // javascript implementation of the 'transform_internal_caps' virtual method
    }

Perform sub-class specific modifications of the caps to be processed between upload on input and before download for output.

Parameters:

`filter` (GstGL.GLFilter) –
No description available
`direction` (Gst.PadDirection) –
No description available
`caps` (Gst.Caps) –
No description available
`filter_caps` (Gst.Caps) –
No description available
Returns (Gst.Caps) –
No description available

#### do_transform_internal_caps

    def do_transform_internal_caps (filter, direction, caps, filter_caps):
        #python implementation of the 'transform_internal_caps' virtual method

Perform sub-class specific modifications of the caps to be processed between upload on input and before download for output.

Parameters:

`filter` (GstGL.GLFilter) –
No description available
`direction` (Gst.PadDirection) –
No description available
`caps` (Gst.Caps) –
No description available
`filter_caps` (Gst.Caps) –
No description available
Returns (Gst.Caps) –
No description available

## Callbacks

### GstGLFilterRenderFunc

    gboolean
    (*GstGLFilterRenderFunc) (GstGLFilter * filter,
                              GstGLMemory * in_tex,
                              gpointer user_data)

Parameters:

`filter` –

the GstGLFilter

`in_tex` –

the input GstGLMemory to render

`user_data` –

user data

Returns –

whether the render succeeded

Since : 1.10

### GstGL.GLFilterRenderFunc

    function GstGL.GLFilterRenderFunc(filter: GstGL.GLFilter, in_tex: GstGL.GLMemory, user_data: Object): {
        // javascript wrapper for 'GstGLFilterRenderFunc'
    }

Parameters:

`filter` (GstGL.GLFilter) –

the GstGL.GLFilter

`in_tex` (GstGL.GLMemory) –

the input GstGL.GLMemory to render

`user_data` (Object) –

user data

Returns (Number) –

whether the render succeeded

Since : 1.10

### GstGL.GLFilterRenderFunc

    def GstGL.GLFilterRenderFunc (filter, in_tex, *user_data):
        #python wrapper for 'GstGLFilterRenderFunc'

Parameters:

`filter` (GstGL.GLFilter) –

the GstGL.GLFilter

`in_tex` (GstGL.GLMemory) –

the input GstGL.GLMemory to render

`user_data` (variadic) –

user data

Returns (bool) –

whether the render succeeded

Since : 1.10

The results of the search are