## glimagesink glimagesink — A videosink based on OpenGL |

## Synopsis

    struct              GstGLImageSink;

## Object Hierarchy

      GObject
       +----GstObject
             +----GstElement
                   +----GstBaseSink
                         +----GstVideoSink
                               +----GstGLImageSink

## Implemented Interfaces

GstGLImageSink implements GstImplementsInterface and GstXOverlay.

## Properties

      "client-draw-callback"     gpointer              : Write
      "client-reshape-callback"  gpointer              : Write
      "display"                  gchar*                : Read / Write
      "force-aspect-ratio"       gboolean              : Read / Write
      "client-data"              gpointer              : Write
      "pixel-aspect-ratio"       gchar*                : Read / Write

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

### 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 -v videotestsrc ! "video/x-raw-rgb" ! 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 -v videotestsrc ! "video/x-raw-yuv, format=(fourcc)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 -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-gl/tests/examples/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 | Julien Isorce <julien.isorce@gmail.com>
class | Sink/Video

### Element Pads

name | sink
direction | sink
presence | always
details | video/x-raw-gl, width=(int)[ 1, 8000 ], height=(int)[ 1, 6000 ], pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)[ 0/1, 100/1 ]
| video/x-raw-rgb, bpp=(int)24, depth=(int)24, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
| video/x-raw-rgb, bpp=(int)24, depth=(int)24, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
| video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
| video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
| video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
| video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
| video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, alpha_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
| video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, alpha_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
| video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, alpha_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
| video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, alpha_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
| video/x-raw-yuv, format=(fourcc){ I420, YV12, YUY2, UYVY, AYUV }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]

## Details

### struct GstGLImageSink

    struct GstGLImageSink;

## Property Details

### The `"client-draw-callback"` property

      "client-draw-callback"     gpointer              : Write

Define a custom draw callback in a client code.

### The `"client-reshape-callback"` property

      "client-reshape-callback"  gpointer              : Write

Define a custom reshape callback in a client code.

### The `"display"` property

      "display"                  gchar*                : Read / Write

Display name.

Default value: NULL

### The `"force-aspect-ratio"` property

      "force-aspect-ratio"       gboolean              : Read / Write

When enabled, scaling will respect original aspect ratio.

Default value: FALSE

### The `"client-data"` property

      "client-data"              gpointer              : Write

Pass data to the draw and reshape callbacks.

### The `"pixel-aspect-ratio"` property

      "pixel-aspect-ratio"       gchar*                : Read / Write

The pixel aspect ratio of the device.

Default value: "1/1"