glimagesink

glimagesink renders video frames to a drawable on a local or remote display using OpenGL. This element can receive a Window ID from the application through the VideoOverlay interface and will then render video frames in this drawable. If no Window ID was provided by the application, the element will create its own internal window and render into it.

See the GstGLDisplay documentation for a list of environment variables that can override window/platform detection.

Scaling

Depends on the driver, OpenGL handles hardware accelerated scaling of video frames. This means that the element will just accept incoming video frames no matter their geometry and will then put them to the drawable scaling them on the fly. Using the force-aspect-ratio property it is possible to enforce scaling with a constant aspect ratio, which means drawing black borders around the video frame.

Events

Through the gl thread, glimagesink handle some events coming from the drawable to manage its appearance even when the data is not flowing (GST_STATE_PAUSED). That means that even when the element is paused, it will receive expose events from the drawable and draw the latest frame with correct borders/aspect-ratio.

Examples

 gst-launch-1.0 -v videotestsrc ! video/x-raw ! glimagesink

A pipeline to test hardware scaling. No special opengl extension is used in this pipeline, that's why it should work with OpenGL >= 1.1. That's the case if you are using the MESA3D driver v1.3.

 gst-launch-1.0 -v videotestsrc ! video/x-raw,format=I420 ! glimagesink

A pipeline to test hardware scaling and hardware colorspace conversion. When your driver supports GLSL (OpenGL Shading Language needs OpenGL >= 2.1), the 4 following format YUY2, UYVY, I420, YV12 and AYUV are converted to RGB32 through some fragment shaders and using one framebuffer (FBO extension OpenGL >= 1.4). If your driver does not support GLSL but supports MESA_YCbCr extension then the you can use YUY2 and UYVY. In this case the colorspace conversion is automatically made when loading the texture and therefore no framebuffer is used.

 gst-launch-1.0 -v gltestsrc ! glimagesink

A pipeline 100% OpenGL. No special opengl extension is used in this pipeline, that's why it should work with OpenGL >= 1.1. That's the case if you are using the MESA3D driver v1.3.

 gst-plugins-bas/tests/examples/gl/generic/cube

The graphic FPS scene can be greater than the input video FPS. The graphic scene can be written from a client code through the two glfilterapp properties.

Hierarchy

GObject
    ╰──GInitiallyUnowned
        ╰──GstObject
            ╰──GstElement
                ╰──GstBin
                    ╰──GstGLSinkBin
                        ╰──glimagesink

Factory details

Authors: – Matthew Waters

Classification:Sink/Video

Rank – secondary

Plugin – gstopengl

Package – GStreamer Base Plug-ins

Pad Templates

sink

video/x-raw(memory:GLMemory, meta:GstVideoOverlayComposition):
         format: { RGBA, BGRA, RGBx, BGRx, ARGB, ABGR, xRGB, xBGR, RGB, BGR, RGB16, BGR16, AYUV, VUYA, Y410, I420, YV12, NV12, NV21, NV16, NV61, YUY2, UYVY, Y210, Y41B, Y42B, Y444, GRAY8, GRAY16_LE, GRAY16_BE, ARGB64, BGR10A2_LE, RGB10A2_LE, P010_10LE, P012_LE, P016_LE, Y212_LE, Y412_LE }
          width: [ 1, 2147483647 ]
         height: [ 1, 2147483647 ]
      framerate: [ 0/1, 2147483647/1 ]

video/x-raw(memory:DMABuf, meta:GstVideoOverlayComposition):
         format: { RGBA, BGRA, RGBx, BGRx, ARGB, ABGR, xRGB, xBGR, RGB, BGR, RGB16, BGR16, AYUV, VUYA, Y410, I420, YV12, NV12, NV21, NV16, NV61, YUY2, UYVY, Y210, Y41B, Y42B, Y444, GRAY8, GRAY16_LE, GRAY16_BE, ARGB64, BGR10A2_LE, RGB10A2_LE, P010_10LE, P012_LE, P016_LE, Y212_LE, Y412_LE }
          width: [ 1, 2147483647 ]
         height: [ 1, 2147483647 ]
      framerate: [ 0/1, 2147483647/1 ]

video/x-raw(memory:SystemMemory, meta:GstVideoOverlayComposition):
         format: { RGBA, BGRA, RGBx, BGRx, ARGB, ABGR, xRGB, xBGR, RGB, BGR, RGB16, BGR16, AYUV, VUYA, Y410, I420, YV12, NV12, NV21, NV16, NV61, YUY2, UYVY, Y210, Y41B, Y42B, Y444, GRAY8, GRAY16_LE, GRAY16_BE, ARGB64, BGR10A2_LE, RGB10A2_LE, P010_10LE, P012_LE, P016_LE, Y212_LE, Y412_LE }
          width: [ 1, 2147483647 ]
         height: [ 1, 2147483647 ]
      framerate: [ 0/1, 2147483647/1 ]

video/x-raw(meta:GstVideoGLTextureUploadMeta, meta:GstVideoOverlayComposition):
         format: RGBA
          width: [ 1, 2147483647 ]
         height: [ 1, 2147483647 ]
      framerate: [ 0/1, 2147483647/1 ]

video/x-raw(memory:GLMemory):
         format: { RGBA, BGRA, RGBx, BGRx, ARGB, ABGR, xRGB, xBGR, RGB, BGR, RGB16, BGR16, AYUV, VUYA, Y410, I420, YV12, NV12, NV21, NV16, NV61, YUY2, UYVY, Y210, Y41B, Y42B, Y444, GRAY8, GRAY16_LE, GRAY16_BE, ARGB64, BGR10A2_LE, RGB10A2_LE, P010_10LE, P012_LE, P016_LE, Y212_LE, Y412_LE }
          width: [ 1, 2147483647 ]
         height: [ 1, 2147483647 ]
      framerate: [ 0/1, 2147483647/1 ]

video/x-raw(memory:DMABuf):
         format: { RGBA, BGRA, RGBx, BGRx, ARGB, ABGR, xRGB, xBGR, RGB, BGR, RGB16, BGR16, AYUV, VUYA, Y410, I420, YV12, NV12, NV21, NV16, NV61, YUY2, UYVY, Y210, Y41B, Y42B, Y444, GRAY8, GRAY16_LE, GRAY16_BE, ARGB64, BGR10A2_LE, RGB10A2_LE, P010_10LE, P012_LE, P016_LE, Y212_LE, Y412_LE }
          width: [ 1, 2147483647 ]
         height: [ 1, 2147483647 ]
      framerate: [ 0/1, 2147483647/1 ]
video/x-raw:
         format: { RGBA, BGRA, RGBx, BGRx, ARGB, ABGR, xRGB, xBGR, RGB, BGR, RGB16, BGR16, AYUV, VUYA, Y410, I420, YV12, NV12, NV21, NV16, NV61, YUY2, UYVY, Y210, Y41B, Y42B, Y444, GRAY8, GRAY16_LE, GRAY16_BE, ARGB64, BGR10A2_LE, RGB10A2_LE, P010_10LE, P012_LE, P016_LE, Y212_LE, Y412_LE }
          width: [ 1, 2147483647 ]
         height: [ 1, 2147483647 ]
      framerate: [ 0/1, 2147483647/1 ]

video/x-raw(meta:GstVideoGLTextureUploadMeta):
         format: RGBA
          width: [ 1, 2147483647 ]
         height: [ 1, 2147483647 ]
      framerate: [ 0/1, 2147483647/1 ]

Presencealways

Directionsink

Object typeGstPad


Signals

client-draw

gboolean
client_draw_callback (GstElement * param_0,
                      GstGLContext * arg0,
                      GstSample * arg1,
                      gpointer udata)
def client_draw_callback (param_0, arg0, arg1, udata):
    #python callback for the 'client-draw' signal
function client_draw_callback(param_0: GstElement * param_0, arg0: GstGLContext * arg0, arg1: GstSample * arg1, udata: gpointer udata): {
    // javascript callback for the 'client-draw' signal
}

Parameters:

param_0
No description available
arg0
No description available
arg1
No description available
udata
No description available
Returns ( gboolean ) –
No description available

Flags: Run Last


client-reshape

gboolean
client_reshape_callback (GstElement * param_0,
                         GstGLContext * arg0,
                         guint arg1,
                         guint arg2,
                         gpointer udata)
def client_reshape_callback (param_0, arg0, arg1, arg2, udata):
    #python callback for the 'client-reshape' signal
function client_reshape_callback(param_0: GstElement * param_0, arg0: GstGLContext * arg0, arg1: guint arg1, arg2: guint arg2, udata: gpointer udata): {
    // javascript callback for the 'client-reshape' signal
}

Parameters:

param_0
No description available
arg0
No description available
arg1
No description available
arg2
No description available
udata
No description available
Returns ( gboolean ) –
No description available

Flags: Run Last


create-element

GstElement *
create_element_callback (GstElement * param_0,
                         gpointer udata)
def create_element_callback (param_0, udata):
    #python callback for the 'create-element' signal
function create_element_callback(param_0: GstElement * param_0, udata: gpointer udata): {
    // javascript callback for the 'create-element' signal
}

Parameters:

param_0
No description available
udata
No description available
Returns ( GstElement * ) –
No description available

Flags: Run Last


Properties

async

“async” gboolean

Go asynchronously to PAUSED

Flags : Read / Write

Default value : true


async-handling

“async-handling” gboolean

The bin will handle Asynchronous state changes

Flags : Read / Write

Default value : false


blocksize

“blocksize” guint

Size in bytes to pull per buffer (0 = default)

Flags : Read / Write

Default value : 4096


brightness

“brightness” gdouble

brightness

Flags : Read / Write

Default value : 0


context

“context” GstGLContext *

Get OpenGL context

Flags : Read


contrast

“contrast” gdouble

contrast

Flags : Read / Write

Default value : 1


enable-last-sample

“enable-last-sample” gboolean

Enable the last-sample property

Flags : Read / Write

Default value : true


force-aspect-ratio

“force-aspect-ratio” gboolean

When enabled, scaling will respect original aspect ratio

Flags : Read / Write

Default value : true


handle-events

“handle-events” gboolean

When enabled, XEvents will be selected and handled

Flags : Read / Write

Default value : true


hue

“hue” gdouble

hue

Flags : Read / Write

Default value : 0


ignore-alpha

“ignore-alpha” gboolean

When enabled, alpha will be ignored and converted to black

Flags : Read / Write

Default value : true


last-sample

“last-sample” GstSample *

The last sample received in the sink

Flags : Read


max-bitrate

“max-bitrate” guint64

The maximum bits per second to render (0 = disabled)

Flags : Read / Write

Default value : 0


max-lateness

“max-lateness” gint64

Maximum number of nanoseconds that a buffer can be late before it is dropped (-1 unlimited)

Flags : Read / Write

Default value : 5000000


message-forward

“message-forward” gboolean

Forwards all children messages

Flags : Read / Write

Default value : false


output-multiview-downmix-mode

“output-multiview-downmix-mode” GstGLStereoDownmix *

Output anaglyph type to generate when downmixing to mono

Flags : Read / Write

Default value : green-magenta-dubois (0)


output-multiview-flags

“output-multiview-flags” GstVideoMultiviewFlags *

Output multiview layout modifier flags

Flags : Read / Write

Default value : none


output-multiview-mode

“output-multiview-mode” GstVideoMultiviewMode *

Choose output mode for multiview/3D video

Flags : Read / Write

Default value : mono (0)


pixel-aspect-ratio

“pixel-aspect-ratio” GstFraction *

The pixel aspect ratio of the device

Flags : Read / Write

Default value : 0/1


qos

“qos” gboolean

Generate Quality-of-Service events upstream

Flags : Read / Write

Default value : true


render-delay

“render-delay” guint64

Additional render delay of the sink in nanoseconds

Flags : Read / Write

Default value : 0


render-rectangle

“render-rectangle” GstValueArray *

The render rectangle ('<x, y, width, height>')

Flags : Read / Write


rotate-method

“rotate-method” GstGLRotateMethod *

rotate method

Flags : Read / Write

Default value : none (0)


saturation

“saturation” gdouble

saturation

Flags : Read / Write

Default value : 1


show-preroll-frame

“show-preroll-frame” gboolean

Whether to render video frames during preroll

Flags : Read / Write / Construct

Default value : true


sink

“sink” GstElement *

The GL sink chain to use

Flags : Read / Write


sync

“sync” gboolean

Sync on the clock

Flags : Read / Write

Default value : true


throttle-time

“throttle-time” guint64

The time to keep between rendered buffers (0 = disabled)

Flags : Read / Write

Default value : 0


ts-offset

“ts-offset” gint64

Timestamp offset in nanoseconds

Flags : Read / Write

Default value : 0


The results of the search are