## glimagesink glimagesink |

## Description

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

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

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

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

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

## Synopsis

### Element Information

plugin | opengl
author | Matthew Waters <matthew@centricular.com>
class | Sink/Video

### Element Pads

name | sink
direction | sink
presence | always
details | video/x-raw(memory:GLMemory, meta:GstVideoOverlayComposition), format=(string){ RGBA, BGRA, RGBx, BGRx, ARGB, ABGR, xRGB, xBGR, RGB, BGR, RGB16, BGR16, AYUV, I420, YV12, NV12, NV21, YUY2, UYVY, Y41B, Y42B, Y444, GRAY8, GRAY16_LE, GRAY16_BE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
| video/x-raw(memory:SystemMemory, meta:GstVideoOverlayComposition), format=(string){ RGBA, BGRA, RGBx, BGRx, ARGB, ABGR, xRGB, xBGR, RGB, BGR, RGB16, BGR16, AYUV, I420, YV12, NV12, NV21, YUY2, UYVY, Y41B, Y42B, Y444, GRAY8, GRAY16_LE, GRAY16_BE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
| video/x-raw(meta:GstVideoGLTextureUploadMeta, meta:GstVideoOverlayComposition), format=(string)RGBA, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
| video/x-raw(memory:GLMemory), format=(string){ RGBA, BGRA, RGBx, BGRx, ARGB, ABGR, xRGB, xBGR, RGB, BGR, RGB16, BGR16, AYUV, I420, YV12, NV12, NV21, YUY2, UYVY, Y41B, Y42B, Y444, GRAY8, GRAY16_LE, GRAY16_BE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
| video/x-raw, format=(string){ RGBA, BGRA, RGBx, BGRx, ARGB, ABGR, xRGB, xBGR, RGB, BGR, RGB16, BGR16, AYUV, I420, YV12, NV12, NV21, YUY2, UYVY, Y41B, Y42B, Y444, GRAY8, GRAY16_LE, GRAY16_BE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
| video/x-raw(meta:GstVideoGLTextureUploadMeta), format=(string)RGBA, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]

## Functions

## Types and Values