GstGLFilter

GstGLFilter

Functions

Types and Values

Object Hierarchy

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

Description

Functions

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

the function to transform input into output . called with data

 

data

the data associated with func

 

Returns

the return value of func


gst_gl_filter_render_to_target_with_shader ()

void
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.

 

gst_gl_filter_filter_texture ()

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

Perform automatic upload if needed, call filter_texture vfunc and then an automatic download if needed.

Parameters

filter

a GstGLFilter

 

inbuf

an input buffer

 

outbuf

an output buffer

 

Returns

whether the transformation succeeded

Types and Values

GstGLFilter

typedef struct _GstGLFilter GstGLFilter;

GstGLFilter is a base class that provides the logic of getting the GL context from downstream and automatic upload/download for non-GstGLMemory GstBuffers.

Members


GstGLFilterClass

typedef struct {
  GstGLBaseFilterClass parent_class;

  gboolean (*set_caps)          (GstGLFilter* filter, GstCaps* incaps, GstCaps* outcaps);
  gboolean (*filter)            (GstGLFilter *filter, GstBuffer *inbuf, GstBuffer *outbuf);
  gboolean (*filter_texture)    (GstGLFilter *filter, GstGLMemory *in_tex, GstGLMemory *out_tex);
  gboolean (*init_fbo)          (GstGLFilter *filter);

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

  /* useful to init and cleanup custom gl resources */
  void (*display_init_cb)       (GstGLFilter *filter);
  void (*display_reset_cb)      (GstGLFilter *filter);

  gpointer                      _padding[GST_PADDING];
} GstGLFilterClass;

Members

set_caps ()

mirror from GstBaseTransform

 

filter ()

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

 

filter_texture ()

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

 

init_fbo ()

perform initialization when the Framebuffer object is created

 

transform_internal_caps ()

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

 

display_init_cb ()

execute arbitrary gl code on start

 

display_reset_cb ()

execute arbitrary gl code at stop

 

gpointer _padding[GST_PADDING];