## xvimagesink

xvimagesink

## Properties

gboolean | autopaint-colorkey | Read / Write
gint | brightness | Read / Write
gint | colorkey | Read / Write
gint | contrast | Read / Write
gchar * | device | Read / Write
gchar * | device-name | Read
gchar * | display | Read / Write
gboolean | double-buffer | Read / Write
gboolean | draw-borders | Read / Write
gboolean | force-aspect-ratio | Read / Write
gboolean | handle-events | Read / Write
gboolean | handle-expose | Read / Write
gint | hue | Read / Write
gchar * | pixel-aspect-ratio | Read / Write
gint | saturation | Read / Write
gboolean | synchronous | Read / Write
guint64 | window-height | Read
guint64 | window-width | Read
GstValueArray | render-rectangle | Write

## Types and Values

struct | GstXvImageSink

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GstObject
                ╰── GstElement
                    ╰── GstBaseSink
                        ╰── GstVideoSink
                            ╰── GstXvImageSink

## Implemented Interfaces

GstXvImageSink implements GstNavigation, GstVideoOverlay and GstColorBalance.

## Description

XvImageSink renders video frames to a drawable (XWindow) on a local display using the XVideo extension. Rendering to a remote display is theoretically possible but i doubt that the XVideo extension is actually available when connecting to a remote display. This element can receive a Window ID from the application through the GstVideoOverlay 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

The XVideo extension, when it's available, 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

XvImageSink creates a thread to handle events coming from the drawable. There are several kind of events that can be grouped in 2 big categories: input events and window state related events. Input events will be translated to navigation events and pushed upstream for other elements to react on them. This includes events such as pointer moves, key press/release, clicks etc... Other events are used to handle the drawable 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.

#### Pixel aspect ratio

When changing state to GST_STATE_READY, XvImageSink will open a connection to the display specified in the “display” property or the default display if nothing specified. Once this connection is open it will inspect the display configuration including the physical display geometry and then calculate the pixel aspect ratio. When receiving video frames with a different pixel aspect ratio, XvImageSink will use hardware scaling to display the video frames correctly on display's pixel aspect ratio. Sometimes the calculated pixel aspect ratio can be wrong, it is then possible to enforce a specific pixel aspect ratio using the “pixel-aspect-ratio” property.

#### Examples

    1

    gst-launch-1.0 -v videotestsrc ! xvimagesink

A pipeline to test hardware scaling. When the test video signal appears you can resize the window and see that video frames are scaled through hardware (no extra CPU cost). By default the image will never be distorted when scaled, instead black borders will be added if needed.

    1

    gst-launch-1.0 -v videotestsrc ! xvimagesink force-aspect-ratio=false

Same pipeline with “force-aspect-ratio” property set to false. You can observe that no borders are drawn around the scaled image now and it will be distorted to fill the entire frame instead of respecting the aspect ratio.

    1

    gst-launch-1.0 -v videotestsrc ! navigationtest ! xvimagesink

A pipeline to test navigation events. While moving the mouse pointer over the test signal you will see a black box following the mouse pointer. If you press the mouse button somewhere on the video and release it somewhere else a green box will appear where you pressed the button and a red one where you released it. (The navigationtest element is part of gst-plugins-good.) You can observe here that even if the images are scaled through hardware the pointer coordinates are converted back to the original video frame geometry so that the box can be drawn to the correct position. This also handles borders correctly, limiting coordinates to the image area

    1

    gst-launch-1.0 -v videotestsrc ! video/x-raw, pixel-aspect-ratio=4/3 ! xvimagesink

This is faking a 4/3 pixel aspect ratio caps on video frames produced by videotestsrc, in most cases the pixel aspect ratio of the display will be 1/1. This means that XvImageSink will have to do the scaling to convert incoming frames to a size that will match the display pixel aspect ratio (from 320x240 to 320x180 in this case).

    1

    gst-launch-1.0 -v videotestsrc ! xvimagesink hue=100 saturation=-100 brightness=100

Demonstrates how to use the colorbalance interface.

## Synopsis

### Element Information

plugin | xvimagesink
author | Julien Moutte <julien@moutte.net>
class | Sink/Video

### Element Pads

name | sink
direction | sink
presence | always
details | video/x-raw, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]

## Functions

## Types and Values

### struct GstXvImageSink

    struct GstXvImageSink;

The GstXvImageSink data structure.

#### Members

## Property Details

### The `“autopaint-colorkey”` property

      “autopaint-colorkey”       gboolean

Whether to autofill overlay with colorkey

Owner: GstXvImageSink

Flags: Read / Write

Default value: TRUE

### The `“brightness”` property

      “brightness”               gint

The brightness of the video.

Owner: GstXvImageSink

Flags: Read / Write

Allowed values: [-1000,1000]

Default value: 0

### The `“colorkey”` property

      “colorkey”                 gint

Color to use for the overlay mask.

Owner: GstXvImageSink

Flags: Read / Write

Default value: 0

### The `“contrast”` property

      “contrast”                 gint

The contrast of the video.

Owner: GstXvImageSink

Flags: Read / Write

Allowed values: [-1000,1000]

Default value: 0

### The `“device”` property

      “device”                   gchar *

The number of the video adaptor.

Owner: GstXvImageSink

Flags: Read / Write

Default value: "0"

### The `“device-name”` property

      “device-name”              gchar *

The name of the video adaptor.

Owner: GstXvImageSink

Flags: Read

Default value: NULL

### The `“display”` property

      “display”                  gchar *

X Display name.

Owner: GstXvImageSink

Flags: Read / Write

Default value: NULL

### The `“double-buffer”` property

      “double-buffer”            gboolean

Whether to double-buffer the output.

Owner: GstXvImageSink

Flags: Read / Write

Default value: TRUE

### The `“draw-borders”` property

      “draw-borders”             gboolean

Draw black borders when using GstXvImageSink:force-aspect-ratio to fill unused parts of the video area.

Owner: GstXvImageSink

Flags: Read / Write

Default value: TRUE

### The `“force-aspect-ratio”` property

      “force-aspect-ratio”       gboolean

When enabled, scaling will respect original aspect ratio.

Owner: GstXvImageSink

Flags: Read / Write

Default value: TRUE

### The `“handle-events”` property

      “handle-events”            gboolean

When enabled, XEvents will be selected and handled.

Owner: GstXvImageSink

Flags: Read / Write

Default value: TRUE

### The `“handle-expose”` property

      “handle-expose”            gboolean

When enabled, the current frame will always be drawn in response to X Expose.

Owner: GstXvImageSink

Flags: Read / Write

Default value: TRUE

### The `“hue”` property

      “hue”                      gint

The hue of the video.

Owner: GstXvImageSink

Flags: Read / Write

Allowed values: [-1000,1000]

Default value: 0

### The `“pixel-aspect-ratio”` property

      “pixel-aspect-ratio”       gchar *

The pixel aspect ratio of the device.

Owner: GstXvImageSink

Flags: Read / Write

Default value: "1/1"

### The `“saturation”` property

      “saturation”               gint

The saturation of the video.

Owner: GstXvImageSink

Flags: Read / Write

Allowed values: [-1000,1000]

Default value: 0

### The `“synchronous”` property

      “synchronous”              gboolean

When enabled, runs the X display in synchronous mode. (unrelated to A/V sync, used only for debugging).

Owner: GstXvImageSink

Flags: Read / Write

Default value: FALSE

### The `“window-height”` property

      “window-height”            guint64

Actual height of the video window.

Owner: GstXvImageSink

Flags: Read

Default value: 0

### The `“window-width”` property

      “window-width”             guint64

Actual width of the video window.

Owner: GstXvImageSink

Flags: Read

Default value: 0

### The `“render-rectangle”` property

      “render-rectangle”         GstValueArray

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

Owner: GstXvImageSink

Flags: Write