<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <title>xvimagesink</title> <meta name="generator" content="DocBook XSL Stylesheets V1.72.0"> <link rel="start" href="index.html" title="GStreamer Base Plugins 0.10 Plugins Reference Manual"> <link rel="up" href="ch01.html" title="gst-plugins-base Elements"> <link rel="prev" href="gst-plugins-base-plugins-ximagesink.html" title="ximagesink"> <link rel="next" href="ch02.html" title="gst-plugins-base Plugins"> <meta name="generator" content="GTK-Doc V1.8 (XML mode)"> <link rel="stylesheet" href="style.css" type="text/css"> <link rel="chapter" href="ch01.html" title="gst-plugins-base Elements"> <link rel="chapter" href="ch02.html" title="gst-plugins-base Plugins"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"> <tr valign="middle"> <td><a accesskey="p" href="gst-plugins-base-plugins-ximagesink.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td> <td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td> <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td> <th width="100%" align="center">GStreamer Base Plugins 0.10 Plugins Reference Manual</th> <td><a accesskey="n" href="ch02.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td> </tr> <tr><td colspan="5" class="shortcuts"><nobr><a href="#id2623088" class="shortcut">Top</a>  |  <a href="#id2624210" class="shortcut">Description</a>  |  <a href="#id2592655" class="shortcut">Object Hierarchy</a>  |  <a href="#id2577748" class="shortcut">Implemented Interfaces</a>  |  <a href="#id2623040" class="shortcut">Properties</a></nobr></td></tr> </table> <div class="refentry" lang="en"> <a name="gst-plugins-base-plugins-xvimagesink"></a><div class="titlepage"></div> <div class="refnamediv"><table width="100%"><tr> <td valign="top"> <h2> <a name="id2623088"></a><span class="refentrytitle">xvimagesink</span> </h2> <p>xvimagesink — A Xv based videosink</p> </td> <td valign="top" align="right"></td> </tr></table></div> <div class="refsynopsisdiv"> <h2>Synopsis</h2> <a name="GstXvImageSink"></a><pre class="synopsis"> <a href="gst-plugins-base-plugins-xvimagesink.html#GstXvImageSink-struct">GstXvImageSink</a>; </pre> </div> <div class="refsect1" lang="en"> <a name="id2592655"></a><h2>Object Hierarchy</h2> <pre class="synopsis"> GObject +----GstObject +----GstElement +----GstBaseSink +----<a href="/usr/share/gtk-doc/html/gst-plugins-base-libs/gst-plugins-base-libs-gstvideosink.html#GstVideoSink" >GstVideoSink</a> +----GstXvImageSink </pre> </div> <div class="refsect1" lang="en"> <a name="id2577748"></a><h2>Implemented Interfaces</h2> <p> GstXvImageSink implements GstImplementsInterface, <a href="/usr/share/gtk-doc/html/gst-plugins-base-libs/gst-plugins-base-libs-gstpropertyprobe.html#GstPropertyProbe" >GstPropertyProbe</a>, <a href="/usr/share/gtk-doc/html/gst-plugins-base-libs/gst-plugins-base-libs-gstxoverlay.html#GstXOverlay" >GstXOverlay</a>, <a href="/usr/share/gtk-doc/html/gst-plugins-base-libs/gst-plugins-base-libs-gstcolorbalance.html#GstColorBalance" >GstColorBalance</a> and <a href="/usr/share/gtk-doc/html/gst-plugins-base-libs/gst-plugins-base-libs-gstnavigation.html#GstNavigation" >GstNavigation</a>.</p> </div> <div class="refsect1" lang="en"> <a name="id2623040"></a><h2>Properties</h2> <pre class="synopsis"> "<a href="gst-plugins-base-plugins-xvimagesink.html#GstXvImageSink--brightness">brightness</a>" gint : Read / Write "<a href="gst-plugins-base-plugins-xvimagesink.html#GstXvImageSink--contrast">contrast</a>" gint : Read / Write "<a href="gst-plugins-base-plugins-xvimagesink.html#GstXvImageSink--display">display</a>" gchar* : Read / Write "<a href="gst-plugins-base-plugins-xvimagesink.html#GstXvImageSink--hue">hue</a>" gint : Read / Write "<a href="gst-plugins-base-plugins-xvimagesink.html#GstXvImageSink--pixel-aspect-ratio">pixel-aspect-ratio</a>" gchar* : Read / Write "<a href="gst-plugins-base-plugins-xvimagesink.html#GstXvImageSink--saturation">saturation</a>" gint : Read / Write "<a href="gst-plugins-base-plugins-xvimagesink.html#GstXvImageSink--synchronous">synchronous</a>" gboolean : Read / Write "<a href="gst-plugins-base-plugins-xvimagesink.html#GstXvImageSink--force-aspect-ratio">force-aspect-ratio</a>" gboolean : Read / Write "<a href="gst-plugins-base-plugins-xvimagesink.html#GstXvImageSink--device">device</a>" gchar* : Read / Write "<a href="gst-plugins-base-plugins-xvimagesink.html#GstXvImageSink--device-name">device-name</a>" gchar* : Read "<a href="gst-plugins-base-plugins-xvimagesink.html#GstXvImageSink--handle-events">handle-events</a>" gboolean : Read / Write "<a href="gst-plugins-base-plugins-xvimagesink.html#GstXvImageSink--double-buffer">double-buffer</a>" gboolean : Read / Write "<a href="gst-plugins-base-plugins-xvimagesink.html#GstXvImageSink--handle-expose">handle-expose</a>" gboolean : Read / Write </pre> </div> <div class="refsect1" lang="en"> <a name="id2624210"></a><h2>Description</h2> <p> </p> <div class="refsect2" lang="en"> <a name="id2624223"></a><p> 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. </p> <h3>Scaling</h3> <p> 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 <a href="gst-plugins-base-plugins-xvimagesink.html#GstXvImageSink--force-aspect-ratio">force-aspect-ratio</a> property it is possible to enforce scaling with a constant aspect ratio, which means drawing black borders around the video frame. </p> <h3>Events</h3> <p> 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. </p> <h3>Pixel aspect ratio</h3> <p> When changing state to GST_STATE_READY, XvImageSink will open a connection to the display specified in the <a href="gst-plugins-base-plugins-xvimagesink.html#GstXvImageSink--display">display</a> 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 <a href="gst-plugins-base-plugins-xvimagesink.html#GstXvImageSink--pixel-aspect-ratio">pixel-aspect-ratio</a> property. </p> <h3>Examples</h3> <p> Here is a simple pipeline to test hardware scaling : </p> <pre class="programlisting"> gst-launch -v videotestsrc ! xvimagesink </pre> <p> When the test video signal appears you can resize the window and see that video frames are scaled through hardware (no extra CPU cost). You can try again setting the force-aspect-ratio property to true and observe the borders drawn around the scaled image respecting aspect ratio. </p> <pre class="programlisting"> gst-launch -v videotestsrc ! xvimagesink force-aspect-ratio=true </pre> <p> </p> <p> Here is a simple pipeline to test navigation events : </p> <pre class="programlisting"> gst-launch -v videotestsrc ! navigationtest ! xvimagesink </pre> <p> 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 </p> <p> Here is a simple pipeline to test pixel aspect ratio : </p> <pre class="programlisting"> gst-launch -v videotestsrc ! video/x-raw-yuv, pixel-aspect-ratio=(fraction)4/3 ! xvimagesink </pre> <p> 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). Note that you might have to escape some characters for your shell like '\(fraction\)'. </p> <p> Here is a test pipeline to test the colorbalance interface : </p> <pre class="programlisting"> gst-launch -v videotestsrc ! xvimagesink hue=100 saturation=-100 brightness=100 </pre> <p> </p> </div> <div class="refsect2" lang="en"> <a name="id2622328"></a><h3>Element Information</h3> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><span class="term">plugin</span></td> <td> <a href="gst-plugins-base-plugins-plugin-xvimagesink.html#plugin-xvimagesink">xvimagesink</a> </td> </tr> <tr> <td><span class="term">author</span></td> <td>Julien Moutte <julien@moutte.net></td> </tr> <tr> <td><span class="term">class</span></td> <td>Sink/Video</td> </tr> </tbody> </table></div> <h3>Element Pads</h3> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><span class="term">name</span></td> <td>sink</td> </tr> <tr> <td><span class="term">direction</span></td> <td>sink</td> </tr> <tr> <td><span class="term">presence</span></td> <td>always</td> </tr> <tr> <td><span class="term">details</span></td> <td>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 ]</td> </tr> </tbody> </table></div> </div> <p> </p> </div> <div class="refsect1" lang="en"> <a name="id2622468"></a><h2>Details</h2> <div class="refsect2" lang="en"> <a name="id2622479"></a><h3> <a name="GstXvImageSink-struct"></a>GstXvImageSink</h3> <a class="indexterm" name="id2622490"></a><pre class="programlisting">typedef struct _GstXvImageSink GstXvImageSink;</pre> <p> The <a href="gst-plugins-base-plugins-xvimagesink.html#GstXvImageSink"><span class="type">GstXvImageSink</span></a> data structure.</p> <p> </p> </div> </div> <div class="refsect1" lang="en"> <a name="id2622519"></a><h2>Property Details</h2> <div class="refsect2" lang="en"> <a name="id2622530"></a><h3> <a name="GstXvImageSink--brightness"></a>The "<code class="literal">brightness</code>" property</h3> <a class="indexterm" name="id2620963"></a><pre class="programlisting"> "brightness" gint : Read / Write</pre> <p>The brightness of the video.</p> <p>Allowed values: [-1000,1000]</p> <p>Default value: 0</p> </div> <hr> <div class="refsect2" lang="en"> <a name="id2620994"></a><h3> <a name="GstXvImageSink--contrast"></a>The "<code class="literal">contrast</code>" property</h3> <a class="indexterm" name="id2621007"></a><pre class="programlisting"> "contrast" gint : Read / Write</pre> <p>The contrast of the video.</p> <p>Allowed values: [-1000,1000]</p> <p>Default value: 0</p> </div> <hr> <div class="refsect2" lang="en"> <a name="id2621037"></a><h3> <a name="GstXvImageSink--display"></a>The "<code class="literal">display</code>" property</h3> <a class="indexterm" name="id2621051"></a><pre class="programlisting"> "display" gchar* : Read / Write</pre> <p>X Display name.</p> <p>Default value: NULL</p> </div> <hr> <div class="refsect2" lang="en"> <a name="id2621077"></a><h3> <a name="GstXvImageSink--hue"></a>The "<code class="literal">hue</code>" property</h3> <a class="indexterm" name="id2621092"></a><pre class="programlisting"> "hue" gint : Read / Write</pre> <p>The hue of the video.</p> <p>Allowed values: [-1000,1000]</p> <p>Default value: 0</p> </div> <hr> <div class="refsect2" lang="en"> <a name="id2621122"></a><h3> <a name="GstXvImageSink--pixel-aspect-ratio"></a>The "<code class="literal">pixel-aspect-ratio</code>" property</h3> <a class="indexterm" name="id2621138"></a><pre class="programlisting"> "pixel-aspect-ratio" gchar* : Read / Write</pre> <p>The pixel aspect ratio of the device.</p> <p>Default value: "1/1"</p> </div> <hr> <div class="refsect2" lang="en"> <a name="id2621164"></a><h3> <a name="GstXvImageSink--saturation"></a>The "<code class="literal">saturation</code>" property</h3> <a class="indexterm" name="id2621177"></a><pre class="programlisting"> "saturation" gint : Read / Write</pre> <p>The saturation of the video.</p> <p>Allowed values: [-1000,1000]</p> <p>Default value: 0</p> </div> <hr> <div class="refsect2" lang="en"> <a name="id2621208"></a><h3> <a name="GstXvImageSink--synchronous"></a>The "<code class="literal">synchronous</code>" property</h3> <a class="indexterm" name="id2621222"></a><pre class="programlisting"> "synchronous" gboolean : Read / Write</pre> <p>When enabled, runs the X display in synchronous mode. (used only for debugging).</p> <p>Default value: FALSE</p> </div> <hr> <div class="refsect2" lang="en"> <a name="id2621249"></a><h3> <a name="GstXvImageSink--force-aspect-ratio"></a>The "<code class="literal">force-aspect-ratio</code>" property</h3> <a class="indexterm" name="id2621265"></a><pre class="programlisting"> "force-aspect-ratio" gboolean : Read / Write</pre> <p>When enabled, scaling will respect original aspect ratio.</p> <p>Default value: FALSE</p> </div> <hr> <div class="refsect2" lang="en"> <a name="id2621291"></a><h3> <a name="GstXvImageSink--device"></a>The "<code class="literal">device</code>" property</h3> <a class="indexterm" name="id2621305"></a><pre class="programlisting"> "device" gchar* : Read / Write</pre> <p>The number of the video adaptor.</p> <p>Default value: "0"</p> </div> <hr> <div class="refsect2" lang="en"> <a name="id2621331"></a><h3> <a name="GstXvImageSink--device-name"></a>The "<code class="literal">device-name</code>" property</h3> <a class="indexterm" name="id2621345"></a><pre class="programlisting"> "device-name" gchar* : Read</pre> <p>The name of the video adaptor.</p> <p>Default value: NULL</p> </div> <hr> <div class="refsect2" lang="en"> <a name="id2621371"></a><h3> <a name="GstXvImageSink--handle-events"></a>The "<code class="literal">handle-events</code>" property</h3> <a class="indexterm" name="id2621387"></a><pre class="programlisting"> "handle-events" gboolean : Read / Write</pre> <p>When enabled, XEvents will be selected and handled.</p> <p>Default value: TRUE</p> </div> <hr> <div class="refsect2" lang="en"> <a name="id2625163"></a><h3> <a name="GstXvImageSink--double-buffer"></a>The "<code class="literal">double-buffer</code>" property</h3> <a class="indexterm" name="id2625177"></a><pre class="programlisting"> "double-buffer" gboolean : Read / Write</pre> <p>Whether to double-buffer the output.</p> <p>Default value: TRUE</p> </div> <hr> <div class="refsect2" lang="en"> <a name="id2625201"></a><h3> <a name="GstXvImageSink--handle-expose"></a>The "<code class="literal">handle-expose</code>" property</h3> <a class="indexterm" name="id2625216"></a><pre class="programlisting"> "handle-expose" gboolean : Read / Write</pre> <p>When enabled, the current frame will always be drawn in response to X Expose events.</p> <p>Default value: TRUE</p> </div> </div> </div> </body> </html>