# 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-base/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

## Implemented interfaces

    GstChildProxy
    GstVideoOverlay
    GstNavigation
    GstColorBalance

## Factory details

Authors: – Matthew Waters

Classification: – `Sink/Video`

Rank – secondary

Plugin – opengl

Package – GStreamer Base Plug-ins

## Pad Templates

### `sink`

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

    video/x-raw(memory:DMABuf, meta:GstVideoOverlayComposition):
             format: DMA_DRM
              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, GBRA, GBR, RGBP, BGRP, RGB, BGR, RGB16, BGR16, AYUV, VUYA, A444, A422, Y410, I420, YV12, NV12, NV21, NV16, NV61, NV24, YUY2, UYVY, Y210, Y41B, Y42B, Y444, GRAY8, GRAY16_LE, GRAY16_BE, ARGB64, A420, AV12, NV12_16L32S, NV12_4L4, RBGA, v210, RGBA64_LE, BGR10A2_LE, RGB10A2_LE, BGR10x2_LE, RGB10x2_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_10LE, Y444_12LE, Y444_16LE }
              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, GBRA, GBR, RGBP, BGRP, RGB, BGR, RGB16, BGR16, AYUV, VUYA, A444, A422, Y410, I420, YV12, NV12, NV21, NV16, NV61, NV24, YUY2, UYVY, Y210, Y41B, Y42B, Y444, GRAY8, GRAY16_LE, GRAY16_BE, ARGB64, A420, AV12, NV12_16L32S, NV12_4L4, RBGA, v210, RGBA64_LE, BGR10A2_LE, RGB10A2_LE, BGR10x2_LE, RGB10x2_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_10LE, Y444_12LE, Y444_16LE }
              width: [ 1, 2147483647 ]
             height: [ 1, 2147483647 ]
          framerate: [ 0/1, 2147483647/1 ]

    video/x-raw(memory:GLMemory, meta:GstVideoOverlayComposition):
             format: { RGBA, BGRA, RGBx, BGRx, ARGB, ABGR, xRGB, xBGR, GBRA, GBR, RGBP, BGRP, RGB, BGR, RGB16, BGR16, AYUV, VUYA, A444, A422, Y410, I420, YV12, NV12, NV21, NV16, NV61, NV24, YUY2, UYVY, Y210, Y41B, Y42B, Y444, GRAY8, GRAY16_LE, GRAY16_BE, ARGB64, A420, AV12, NV12_16L32S, NV12_4L4, RBGA, v210, RGBA64_LE, BGR10A2_LE, RGB10A2_LE, BGR10x2_LE, RGB10x2_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_10LE, Y444_12LE, Y444_16LE }
              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:DMABuf):
             format: DMA_DRM
              width: [ 1, 2147483647 ]
             height: [ 1, 2147483647 ]
          framerate: [ 0/1, 2147483647/1 ]
    video/x-raw:
             format: { RGBA, BGRA, RGBx, BGRx, ARGB, ABGR, xRGB, xBGR, GBRA, GBR, RGBP, BGRP, RGB, BGR, RGB16, BGR16, AYUV, VUYA, A444, A422, Y410, I420, YV12, NV12, NV21, NV16, NV61, NV24, YUY2, UYVY, Y210, Y41B, Y42B, Y444, GRAY8, GRAY16_LE, GRAY16_BE, ARGB64, A420, AV12, NV12_16L32S, NV12_4L4, RBGA, v210, RGBA64_LE, BGR10A2_LE, RGB10A2_LE, BGR10x2_LE, RGB10x2_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_10LE, Y444_12LE, Y444_16LE }
              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, GBRA, GBR, RGBP, BGRP, RGB, BGR, RGB16, BGR16, AYUV, VUYA, A444, A422, Y410, I420, YV12, NV12, NV21, NV16, NV61, NV24, YUY2, UYVY, Y210, Y41B, Y42B, Y444, GRAY8, GRAY16_LE, GRAY16_BE, ARGB64, A420, AV12, NV12_16L32S, NV12_4L4, RBGA, v210, RGBA64_LE, BGR10A2_LE, RGB10A2_LE, BGR10x2_LE, RGB10x2_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_10LE, Y444_12LE, Y444_16LE }
              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 ]

Presence – always

Direction – sink

Object type – GstPad

## 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

## Properties

### context

    “context” GstGLContext *

Get OpenGL context

Flags : Read

### 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

### ignore-alpha

    “ignore-alpha” gboolean

When enabled, alpha will be ignored and converted to black

Flags : Read / Write

Default value : true

### 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

### 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)

### show-preroll-frame

    “show-preroll-frame” gboolean

Whether to render video frames during preroll

Flags : Read / Write / Construct

Default value : true

The results of the search are