• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3<head>
4<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5<title>ximagesink: GStreamer Base Plugins 1.0 Plugins Reference Manual</title>
6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7<link rel="home" href="index.html" title="GStreamer Base Plugins 1.0 Plugins Reference Manual">
8<link rel="up" href="ch01.html" title="gst-plugins-base Elements">
9<link rel="prev" href="gst-plugins-base-plugins-vorbistag.html" title="vorbistag">
10<link rel="next" href="gst-plugins-base-plugins-xvimagesink.html" title="xvimagesink">
11<meta name="generator" content="GTK-Doc V1.28 (XML mode)">
12<link rel="stylesheet" href="style.css" type="text/css">
13</head>
14<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
16<td width="100%" align="left" class="shortcuts">
17<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span18                  <a href="#gst-plugins-base-plugins-ximagesink.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span19                  <a href="#gst-plugins-base-plugins-ximagesink.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_interfaces">  <span class="dim">|</span20                  <a href="#gst-plugins-base-plugins-ximagesink.implemented-interfaces" class="shortcut">Implemented Interfaces</a></span><span id="nav_properties">  <span class="dim">|</span21                  <a href="#gst-plugins-base-plugins-ximagesink.properties" class="shortcut">Properties</a></span>
22</td>
23<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
24<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
25<td><a accesskey="p" href="gst-plugins-base-plugins-vorbistag.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
26<td><a accesskey="n" href="gst-plugins-base-plugins-xvimagesink.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
27</tr></table>
28<div class="refentry">
29<a name="gst-plugins-base-plugins-ximagesink"></a><div class="titlepage"></div>
30<div class="refnamediv"><table width="100%"><tr>
31<td valign="top">
32<h2><span class="refentrytitle"><a name="gst-plugins-base-plugins-ximagesink.top_of_page"></a>ximagesink</span></h2>
33<p>ximagesink</p>
34</td>
35<td class="gallery_image" valign="top" align="right"></td>
36</tr></table></div>
37<div class="refsect1">
38<a name="gst-plugins-base-plugins-ximagesink.properties"></a><h2>Properties</h2>
39<div class="informaltable"><table class="informaltable" border="0">
40<colgroup>
41<col width="150px" class="properties_type">
42<col width="300px" class="properties_name">
43<col width="200px" class="properties_flags">
44</colgroup>
45<tbody>
46<tr>
47<td class="property_type">
48<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *</td>
49<td class="property_name"><a class="link" href="gst-plugins-base-plugins-ximagesink.html#GstXImageSink--display" title="The “display” property">display</a></td>
50<td class="property_flags">Read / Write</td>
51</tr>
52<tr>
53<td class="property_type"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td>
54<td class="property_name"><a class="link" href="gst-plugins-base-plugins-ximagesink.html#GstXImageSink--force-aspect-ratio" title="The “force-aspect-ratio” property">force-aspect-ratio</a></td>
55<td class="property_flags">Read / Write</td>
56</tr>
57<tr>
58<td class="property_type"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td>
59<td class="property_name"><a class="link" href="gst-plugins-base-plugins-ximagesink.html#GstXImageSink--handle-events" title="The “handle-events” property">handle-events</a></td>
60<td class="property_flags">Read / Write</td>
61</tr>
62<tr>
63<td class="property_type"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td>
64<td class="property_name"><a class="link" href="gst-plugins-base-plugins-ximagesink.html#GstXImageSink--handle-expose" title="The “handle-expose” property">handle-expose</a></td>
65<td class="property_flags">Read / Write</td>
66</tr>
67<tr>
68<td class="property_type">
69<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *</td>
70<td class="property_name"><a class="link" href="gst-plugins-base-plugins-ximagesink.html#GstXImageSink--pixel-aspect-ratio" title="The “pixel-aspect-ratio” property">pixel-aspect-ratio</a></td>
71<td class="property_flags">Read / Write</td>
72</tr>
73<tr>
74<td class="property_type"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td>
75<td class="property_name"><a class="link" href="gst-plugins-base-plugins-ximagesink.html#GstXImageSink--synchronous" title="The “synchronous” property">synchronous</a></td>
76<td class="property_flags">Read / Write</td>
77</tr>
78<tr>
79<td class="property_type"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a></td>
80<td class="property_name"><a class="link" href="gst-plugins-base-plugins-ximagesink.html#GstXImageSink--window-height" title="The “window-height” property">window-height</a></td>
81<td class="property_flags">Read</td>
82</tr>
83<tr>
84<td class="property_type"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a></td>
85<td class="property_name"><a class="link" href="gst-plugins-base-plugins-ximagesink.html#GstXImageSink--window-width" title="The “window-width” property">window-width</a></td>
86<td class="property_flags">Read</td>
87</tr>
88</tbody>
89</table></div>
90</div>
91<a name="GstXImageSink"></a><div class="refsect1">
92<a name="gst-plugins-base-plugins-ximagesink.other"></a><h2>Types and Values</h2>
93<div class="informaltable"><table class="informaltable" width="100%" border="0">
94<colgroup>
95<col width="150px" class="name">
96<col class="description">
97</colgroup>
98<tbody><tr>
99<td class="datatype_keyword">struct</td>
100<td class="function_name"><a class="link" href="gst-plugins-base-plugins-ximagesink.html#GstXImageSink-struct" title="struct GstXImageSink">GstXImageSink</a></td>
101</tr></tbody>
102</table></div>
103</div>
104<div class="refsect1">
105<a name="gst-plugins-base-plugins-ximagesink.object-hierarchy"></a><h2>Object Hierarchy</h2>
106<pre class="screen">    <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject-struct">GObject</a>
107    <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GInitiallyUnowned">GInitiallyUnowned</a>
108        <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstObject.html#GstObject-struct">GstObject</a>
109            <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstElement.html#GstElement-struct">GstElement</a>
110                <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gstreamer-libs-1.0/GstBaseSink.html#GstBaseSink-struct">GstBaseSink</a>
111                    <span class="lineart">╰──</span> <a href="../html/GstVideoSink.html#GstVideoSink-struct">GstVideoSink</a>
112                        <span class="lineart">╰──</span> GstXImageSink
113</pre>
114</div>
115<div class="refsect1">
116<a name="gst-plugins-base-plugins-ximagesink.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
117<p>
118GstXImageSink implements
119 <a href="../html/GstNavigation.html#GstNavigation-struct">GstNavigation</a> and  <a href="../html/GstVideoOverlay.html#GstVideoOverlay-struct">GstVideoOverlay</a>.</p>
120</div>
121<div class="refsect1">
122<a name="gst-plugins-base-plugins-ximagesink.description"></a><h2>Description</h2>
123<p>XImageSink renders video frames to a drawable (XWindow) on a local or remote
124display. This element can receive a Window ID from the application through
125the <a href="../html/GstVideoOverlay.html#GstVideoOverlay-struct"><span class="type">GstVideoOverlay</span></a> interface and will then render video frames in this
126drawable. If no Window ID was provided by the application, the element will
127create its own internal window and render into it.</p>
128<div class="refsect3">
129<a name="id-1.2.116.8.3"></a><h4>Scaling</h4>
130<p>As standard XImage rendering to a drawable is not scaled, XImageSink will use
131reverse caps negotiation to try to get scaled video frames for the drawable.
132This is accomplished by asking the peer pad if it accepts some different caps
133which in most cases implies that there is a scaling element in the pipeline,
134or that an element generating the video frames can generate them with a
135different geometry. This mechanism is handled during buffer allocations, for
136each allocation request the video sink will check the drawable geometry, look
137at the <a class="link" href="gst-plugins-base-plugins-ximagesink.html#GstXImageSink--force-aspect-ratio" title="The “force-aspect-ratio” property"><span class="type">“force-aspect-ratio”</span></a> property, calculate the geometry of
138desired video frames and then check that the peer pad accept those new caps.
139If it does it will then allocate a buffer in video memory with this new
140geometry and return it with the new caps.</p>
141</div>
142<div class="refsect3">
143<a name="id-1.2.116.8.4"></a><h4>Events</h4>
144<p>XImageSink creates a thread to handle events coming from the drawable. There
145are several kind of events that can be grouped in 2 big categories: input
146events and window state related events. Input events will be translated to
147navigation events and pushed upstream for other elements to react on them.
148This includes events such as pointer moves, key press/release, clicks etc...
149Other events are used to handle the drawable appearance even when the data
150is not flowing (GST_STATE_PAUSED). That means that even when the element is
151paused, it will receive expose events from the drawable and draw the latest
152frame with correct borders/aspect-ratio.</p>
153</div>
154<div class="refsect3">
155<a name="id-1.2.116.8.5"></a><h4>Pixel aspect ratio</h4>
156<p>When changing state to GST_STATE_READY, XImageSink will open a connection to
157the display specified in the <a class="link" href="gst-plugins-base-plugins-ximagesink.html#GstXImageSink--display" title="The “display” property"><span class="type">“display”</span></a> property or the default
158display if nothing specified. Once this connection is open it will inspect
159the display configuration including the physical display geometry and
160then calculate the pixel aspect ratio. When caps negotiation will occur, the
161video sink will set the calculated pixel aspect ratio on the caps to make
162sure that incoming video frames will have the correct pixel aspect ratio for
163this display. Sometimes the calculated pixel aspect ratio can be wrong, it is
164then possible to enforce a specific pixel aspect ratio using the
165<a class="link" href="gst-plugins-base-plugins-ximagesink.html#GstXImageSink--pixel-aspect-ratio" title="The “pixel-aspect-ratio” property"><span class="type">“pixel-aspect-ratio”</span></a> property.</p>
166</div>
167<div class="refsect3">
168<a name="id-1.2.116.8.6"></a><h4>Examples</h4>
169<div class="informalexample">
170  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
171    <tbody>
172      <tr>
173        <td class="listing_lines" align="right"><pre>1</pre></td>
174        <td class="listing_code"><pre class="programlisting">gst<span class="gtkdoc opt">-</span>launch<span class="gtkdoc opt">-</span><span class="number">1.0</span> <span class="gtkdoc opt">-</span>v videotestsrc <span class="gtkdoc opt">!</span> queue <span class="gtkdoc opt">!</span> ximagesink</pre></td>
175      </tr>
176    </tbody>
177  </table>
178</div>
179
180<p>
181 A pipeline to test reverse negotiation. When the test video signal appears
182you can resize the window and see that scaled buffers of the desired size are
183going to arrive with a short delay. This illustrates how buffers of desired
184size are allocated along the way. If you take away the queue, scaling will
185happen almost immediately.</p>
186<div class="informalexample">
187  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
188    <tbody>
189      <tr>
190        <td class="listing_lines" align="right"><pre>1</pre></td>
191        <td class="listing_code"><pre class="programlisting">gst<span class="gtkdoc opt">-</span>launch<span class="gtkdoc opt">-</span><span class="number">1.0</span> <span class="gtkdoc opt">-</span>v videotestsrc <span class="gtkdoc opt">!</span> navigationtest <span class="gtkdoc opt">!</span> videoconvert <span class="gtkdoc opt">!</span> ximagesink</pre></td>
192      </tr>
193    </tbody>
194  </table>
195</div>
196
197<p>
198 A pipeline to test navigation events.
199While moving the mouse pointer over the test signal you will see a black box
200following the mouse pointer. If you press the mouse button somewhere on the
201video and release it somewhere else a green box will appear where you pressed
202the button and a red one where you released it. (The navigationtest element
203is part of gst-plugins-good.)</p>
204<div class="informalexample">
205  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
206    <tbody>
207      <tr>
208        <td class="listing_lines" align="right"><pre>1</pre></td>
209        <td class="listing_code"><pre class="programlisting">gst<span class="gtkdoc opt">-</span>launch<span class="gtkdoc opt">-</span><span class="number">1.0</span> <span class="gtkdoc opt">-</span>v videotestsrc <span class="gtkdoc opt">!</span> video<span class="gtkdoc opt">/</span>x<span class="gtkdoc opt">-</span>raw<span class="gtkdoc opt">,</span> pixel<span class="gtkdoc opt">-</span>aspect<span class="gtkdoc opt">-</span>ratio<span class="gtkdoc opt">=(</span>fraction<span class="gtkdoc opt">)</span><span class="number">4</span><span class="gtkdoc opt">/</span><span class="number">3</span> <span class="gtkdoc opt">!</span> videoscale <span class="gtkdoc opt">!</span> ximagesink</pre></td>
210      </tr>
211    </tbody>
212  </table>
213</div>
214
215<p>
216 This is faking a 4/3 pixel aspect ratio caps on video frames produced by
217videotestsrc, in most cases the pixel aspect ratio of the display will be
2181/1. This means that videoscale will have to do the scaling to convert
219incoming frames to a size that will match the display pixel aspect ratio
220(from 320x240 to 320x180 in this case). Note that you might have to escape
221some characters for your shell like '(fraction)'.</p>
222</div>
223<div class="refsynopsisdiv">
224<h2>Synopsis</h2>
225<div class="refsect2">
226<a name="id-1.2.116.8.7.1"></a><h3>Element Information</h3>
227<div class="variablelist"><table border="0" class="variablelist">
228<colgroup>
229<col align="left" valign="top">
230<col>
231</colgroup>
232<tbody>
233<tr>
234<td><p><span class="term">plugin</span></p></td>
235<td>
236            <a class="link" href="gst-plugins-base-plugins-plugin-ximagesink.html#plugin-ximagesink">ximagesink</a>
237          </td>
238</tr>
239<tr>
240<td><p><span class="term">author</span></p></td>
241<td>Julien Moutte &lt;julien@moutte.net&gt;</td>
242</tr>
243<tr>
244<td><p><span class="term">class</span></p></td>
245<td>Sink/Video</td>
246</tr>
247</tbody>
248</table></div>
249</div>
250<hr>
251<div class="refsect2">
252<a name="id-1.2.116.8.7.2"></a><h3>Element Pads</h3>
253<div class="variablelist"><table border="0" class="variablelist">
254<colgroup>
255<col align="left" valign="top">
256<col>
257</colgroup>
258<tbody>
259<tr>
260<td><p><span class="term">name</span></p></td>
261<td>sink</td>
262</tr>
263<tr>
264<td><p><span class="term">direction</span></p></td>
265<td>sink</td>
266</tr>
267<tr>
268<td><p><span class="term">presence</span></p></td>
269<td>always</td>
270</tr>
271<tr>
272<td><p><span class="term">details</span></p></td>
273<td>video/x-raw, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]</td>
274</tr>
275</tbody>
276</table></div>
277</div>
278</div>
279</div>
280<div class="refsect1">
281<a name="gst-plugins-base-plugins-ximagesink.functions_details"></a><h2>Functions</h2>
282<p></p>
283</div>
284<div class="refsect1">
285<a name="gst-plugins-base-plugins-ximagesink.other_details"></a><h2>Types and Values</h2>
286<div class="refsect2">
287<a name="GstXImageSink-struct"></a><h3>struct GstXImageSink</h3>
288<pre class="programlisting">struct GstXImageSink;</pre>
289<p>The <a class="link" href="gst-plugins-base-plugins-ximagesink.html#GstXImageSink"><span class="type">GstXImageSink</span></a> data structure.</p>
290<div class="refsect3">
291<a name="GstXImageSink.members"></a><h4>Members</h4>
292<div class="informaltable"><table class="informaltable" width="100%" border="0">
293<colgroup>
294<col width="300px" class="struct_members_name">
295<col class="struct_members_description">
296<col width="200px" class="struct_members_annotations">
297</colgroup>
298<tbody></tbody>
299</table></div>
300</div>
301</div>
302</div>
303<div class="refsect1">
304<a name="gst-plugins-base-plugins-ximagesink.property-details"></a><h2>Property Details</h2>
305<div class="refsect2">
306<a name="GstXImageSink--display"></a><h3>The <code class="literal">“display”</code> property</h3>
307<pre class="programlisting">  “display”                  <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *</pre>
308<p>X Display name.</p>
309<p>Flags: Read / Write</p>
310<p>Default value: NULL</p>
311</div>
312<hr>
313<div class="refsect2">
314<a name="GstXImageSink--force-aspect-ratio"></a><h3>The <code class="literal">“force-aspect-ratio”</code> property</h3>
315<pre class="programlisting">  “force-aspect-ratio”       <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></pre>
316<p>When enabled, reverse caps negotiation (scaling) will respect original aspect ratio.</p>
317<p>Flags: Read / Write</p>
318<p>Default value: TRUE</p>
319</div>
320<hr>
321<div class="refsect2">
322<a name="GstXImageSink--handle-events"></a><h3>The <code class="literal">“handle-events”</code> property</h3>
323<pre class="programlisting">  “handle-events”            <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></pre>
324<p>When enabled, XEvents will be selected and handled.</p>
325<p>Flags: Read / Write</p>
326<p>Default value: TRUE</p>
327</div>
328<hr>
329<div class="refsect2">
330<a name="GstXImageSink--handle-expose"></a><h3>The <code class="literal">“handle-expose”</code> property</h3>
331<pre class="programlisting">  “handle-expose”            <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></pre>
332<p>When enabled, the current frame will always be drawn in response to X Expose events.</p>
333<p>Flags: Read / Write</p>
334<p>Default value: TRUE</p>
335</div>
336<hr>
337<div class="refsect2">
338<a name="GstXImageSink--pixel-aspect-ratio"></a><h3>The <code class="literal">“pixel-aspect-ratio”</code> property</h3>
339<pre class="programlisting">  “pixel-aspect-ratio”       <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *</pre>
340<p>The pixel aspect ratio of the device.</p>
341<p>Flags: Read / Write</p>
342<p>Default value: "1/1"</p>
343</div>
344<hr>
345<div class="refsect2">
346<a name="GstXImageSink--synchronous"></a><h3>The <code class="literal">“synchronous”</code> property</h3>
347<pre class="programlisting">  “synchronous”              <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></pre>
348<p>When enabled, runs the X display in synchronous mode. (unrelated to A/V sync, used only for debugging).</p>
349<p>Flags: Read / Write</p>
350<p>Default value: FALSE</p>
351</div>
352<hr>
353<div class="refsect2">
354<a name="GstXImageSink--window-height"></a><h3>The <code class="literal">“window-height”</code> property</h3>
355<pre class="programlisting">  “window-height”            <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a></pre>
356<p>Actual height of the video window.</p>
357<p>Flags: Read</p>
358<p>Default value: 0</p>
359</div>
360<hr>
361<div class="refsect2">
362<a name="GstXImageSink--window-width"></a><h3>The <code class="literal">“window-width”</code> property</h3>
363<pre class="programlisting">  “window-width”             <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a></pre>
364<p>Actual width of the video window.</p>
365<p>Flags: Read</p>
366<p>Default value: 0</p>
367</div>
368</div>
369</div>
370<div class="footer">
371<hr>Generated by GTK-Doc V1.28</div>
372</body>
373</html>