GStreamer Base Plugins 0.10 Plugins Reference Manual | ||||
---|---|---|---|---|
GObject +----GstObject +----GstElement +----GstBaseSink +----GstVideoSink +----GstXvImageSink
GstXvImageSink implements GstImplementsInterface, GstPropertyProbe, GstXOverlay, GstColorBalance and GstNavigation.
"brightness" gint : Read / Write "contrast" gint : Read / Write "display" gchar* : Read / Write "hue" gint : Read / Write "pixel-aspect-ratio" gchar* : Read / Write "saturation" gint : Read / Write "synchronous" gboolean : Read / Write "force-aspect-ratio" gboolean : Read / Write "device" gchar* : Read / Write "device-name" gchar* : Read "handle-events" gboolean : Read / Write "double-buffer" gboolean : Read / Write "handle-expose" gboolean : Read / Write "autopaint-colorkey" gboolean : Read / Write "colorkey" gint : Read / Write "draw-borders" gboolean : Read / Write
XvImageSink renders video frames to a drawable (XWindow) on a local display using the XVideo extension. Rendering to a remote display is theorically 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 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.
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.
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.
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.
gst-launch -v videotestsrc ! xvimagesink
gst-launch -v videotestsrc ! xvimagesink force-aspect-ratio=true
gst-launch -v videotestsrc ! navigationtest ! xvimagesink
gst-launch -v videotestsrc ! video/x-raw-yuv, pixel-aspect-ratio=(fraction)4/3 ! xvimagesink
gst-launch -v videotestsrc ! xvimagesink hue=100 saturation=-100 brightness=100
name | sink |
direction | sink |
presence | always |
details | video/x-raw-rgb, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ] |
video/x-raw-yuv, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ] |
"brightness"
property"brightness" gint : Read / Write
The brightness of the video.
Allowed values: [-1000,1000]
Default value: 0
"contrast"
property"contrast" gint : Read / Write
The contrast of the video.
Allowed values: [-1000,1000]
Default value: 0
"hue"
property"hue" gint : Read / Write
The hue of the video.
Allowed values: [-1000,1000]
Default value: 0
"pixel-aspect-ratio"
property"pixel-aspect-ratio" gchar* : Read / Write
The pixel aspect ratio of the device.
Default value: "1/1"
"saturation"
property"saturation" gint : Read / Write
The saturation of the video.
Allowed values: [-1000,1000]
Default value: 0
"synchronous"
property"synchronous" gboolean : Read / Write
When enabled, runs the X display in synchronous mode. (used only for debugging).
Default value: FALSE
"force-aspect-ratio"
property"force-aspect-ratio" gboolean : Read / Write
When enabled, scaling will respect original aspect ratio.
Default value: FALSE
"device"
property"device" gchar* : Read / Write
The number of the video adaptor.
Default value: "0"
"device-name"
property"device-name" gchar* : Read
The name of the video adaptor.
Default value: NULL
"handle-events"
property"handle-events" gboolean : Read / Write
When enabled, XEvents will be selected and handled.
Default value: TRUE
"double-buffer"
property"double-buffer" gboolean : Read / Write
Whether to double-buffer the output.
Default value: TRUE
Since 0.10.14
"handle-expose"
property"handle-expose" gboolean : Read / Write
When enabled, the current frame will always be drawn in response to X Expose.
Default value: TRUE
Since 0.10.14
"autopaint-colorkey"
property"autopaint-colorkey" gboolean : Read / Write
Whether to autofill overlay with colorkey
Default value: TRUE
Since 0.10.21
"colorkey"
property"colorkey" gint : Read / Write
Color to use for the overlay mask.
Default value: 0
Since 0.10.21