GStreamer Base Plugins 0.10 Plugins Reference Manual | ||||
---|---|---|---|---|
GObject +----GstObject +----GstElement +----GstBaseSink +----GstVideoSink +----GstXImageSink
GstXImageSink implements GstImplementsInterface, GstXOverlay and GstNavigation.
"display" gchar* : Read / Write "pixel-aspect-ratio" gchar* : Read / Write "synchronous" gboolean : Read / Write "force-aspect-ratio" gboolean : Read / Write "handle-events" gboolean : Read / Write "handle-expose" gboolean : Read / Write
XImageSink renders video frames to a drawable (XWindow) on a local or 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.
As standard XImage rendering to a drawable is not scaled, XImageSink will use reverse caps negotiation to try to get scaled video frames for the drawable. This is accomplished by asking the peer pad if it accepts some different caps which in most cases implies that there is a scaling element in the pipeline, or that an element generating the video frames can generate them with a different geometry. This mechanism is handled during buffer allocations, for each allocation request the video sink will check the drawable geometry, look at the "force-aspect-ratio" property, calculate the geometry of desired video frames and then check that the peer pad accept those new caps. If it does it will then allocate a buffer in video memory with this new geometry and return it with the new caps.
XImageSink 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, XImageSink 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 caps negotiation will occur, the video sink will set the calculated pixel aspect ratio on the caps to make sure that incoming video frames will have the correct pixel aspect ratio for this display. 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 ! queue ! ximagesink
gst-launch -v videotestsrc ! navigationtest ! ffmpegcolorspace ! ximagesink
gst-launch -v videotestsrc ! video/x-raw-rgb, pixel-aspect-ratio=(fraction)4/3 ! videoscale ! ximagesink
"pixel-aspect-ratio"
property"pixel-aspect-ratio" gchar* : Read / Write
The pixel aspect ratio of the device.
Default value: "1/1"
"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, reverse caps negotiation (scaling) will respect original aspect ratio.
Default value: FALSE
"handle-events"
property"handle-events" gboolean : Read / Write
When enabled, XEvents will be selected and handled.
Default value: TRUE