• 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>gdkpixbufsink: GStreamer Good 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 Good Plugins 1.0 Plugins Reference Manual">
8<link rel="up" href="ch01.html" title="gst-plugins-good Elements">
9<link rel="prev" href="gst-plugins-good-plugins-gdkpixbufoverlay.html" title="gdkpixbufoverlay">
10<link rel="next" href="gst-plugins-good-plugins-goom2k1.html" title="goom2k1">
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-good-plugins-gdkpixbufsink.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span19                  <a href="#gst-plugins-good-plugins-gdkpixbufsink.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_properties">  <span class="dim">|</span20                  <a href="#gst-plugins-good-plugins-gdkpixbufsink.properties" class="shortcut">Properties</a></span>
21</td>
22<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
23<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
24<td><a accesskey="p" href="gst-plugins-good-plugins-gdkpixbufoverlay.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
25<td><a accesskey="n" href="gst-plugins-good-plugins-goom2k1.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
26</tr></table>
27<div class="refentry">
28<a name="gst-plugins-good-plugins-gdkpixbufsink"></a><div class="titlepage"></div>
29<div class="refnamediv"><table width="100%"><tr>
30<td valign="top">
31<h2><span class="refentrytitle"><a name="gst-plugins-good-plugins-gdkpixbufsink.top_of_page"></a>gdkpixbufsink</span></h2>
32<p>gdkpixbufsink</p>
33</td>
34<td class="gallery_image" valign="top" align="right"></td>
35</tr></table></div>
36<div class="refsect1">
37<a name="gst-plugins-good-plugins-gdkpixbufsink.properties"></a><h2>Properties</h2>
38<div class="informaltable"><table class="informaltable" border="0">
39<colgroup>
40<col width="150px" class="properties_type">
41<col width="300px" class="properties_name">
42<col width="200px" class="properties_flags">
43</colgroup>
44<tbody>
45<tr>
46<td class="property_type">
47<a href="/usr/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf-struct"><span class="type">GdkPixbuf</span></a> *</td>
48<td class="property_name"><a class="link" href="gst-plugins-good-plugins-gdkpixbufsink.html#GstGdkPixbufSink--last-pixbuf" title="The “last-pixbuf” property">last-pixbuf</a></td>
49<td class="property_flags">Read</td>
50</tr>
51<tr>
52<td class="property_type"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td>
53<td class="property_name"><a class="link" href="gst-plugins-good-plugins-gdkpixbufsink.html#GstGdkPixbufSink--post-messages" title="The “post-messages” property">post-messages</a></td>
54<td class="property_flags">Read / Write</td>
55</tr>
56</tbody>
57</table></div>
58</div>
59<a name="GstGdkPixbufSink"></a><div class="refsect1">
60<a name="gst-plugins-good-plugins-gdkpixbufsink.other"></a><h2>Types and Values</h2>
61<div class="informaltable"><table class="informaltable" width="100%" border="0">
62<colgroup>
63<col width="150px" class="name">
64<col class="description">
65</colgroup>
66<tbody><tr>
67<td class="datatype_keyword">struct</td>
68<td class="function_name"><a class="link" href="gst-plugins-good-plugins-gdkpixbufsink.html#GstGdkPixbufSink-struct" title="struct GstGdkPixbufSink">GstGdkPixbufSink</a></td>
69</tr></tbody>
70</table></div>
71</div>
72<div class="refsect1">
73<a name="gst-plugins-good-plugins-gdkpixbufsink.object-hierarchy"></a><h2>Object Hierarchy</h2>
74<pre class="screen">    <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject-struct">GObject</a>
75    <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GInitiallyUnowned">GInitiallyUnowned</a>
76        <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstObject.html#GstObject-struct">GstObject</a>
77            <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstElement.html#GstElement-struct">GstElement</a>
78                <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gstreamer-libs-1.0/GstBaseSink.html#GstBaseSink-struct">GstBaseSink</a>
79                    <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gst-plugins-base-libs-1.0/GstVideoSink.html#GstVideoSink-struct">GstVideoSink</a>
80                        <span class="lineart">╰──</span> GstGdkPixbufSink
81</pre>
82</div>
83<div class="refsect1">
84<a name="gst-plugins-good-plugins-gdkpixbufsink.description"></a><h2>Description</h2>
85<p>This sink element takes RGB or RGBA images as input and wraps them into
86<a href="/usr/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf-struct"><span class="type">GdkPixbuf</span></a> objects, for easy saving to file via the
87GdkPixbuf library API or displaying in Gtk+ applications (e.g. using
88the <a href="/usr/share/gtk-doc/html/gtk3/GtkImage.html#GtkImage-struct"><span class="type">GtkImage</span></a> widget).</p>
89<p>There are two ways to use this element and obtain the <a href="/usr/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf-struct"><span class="type">GdkPixbuf</span></a> objects
90created:</p>
91<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
92<li class="listitem">
93Watching for element messages named <code class="classname">"preroll-pixbuf"
94</code> or <code class="classname">"pixbuf"</code> on the bus, which
95will be posted whenever an image would usually be rendered. See below for
96more details on these messages and how to extract the pixbuf object
97contained in them.
98</li>
99<li class="listitem">
100Retrieving the current pixbuf via the <a class="link" href="gst-plugins-good-plugins-gdkpixbufsink.html#GstGdkPixbufSink--last-pixbuf" title="The “last-pixbuf” property"><span class="type">“last-pixbuf”</span></a> property
101when needed. This is the easiest way to get at pixbufs for snapshotting
102purposes - just wait until the pipeline is prerolled (ASYNC_DONE message
103on the bus), then read the property. If you use this method, you may want
104to disable message posting by setting the <a class="link" href="gst-plugins-good-plugins-gdkpixbufsink.html#GstGdkPixbufSink--post-messages" title="The “post-messages” property"><span class="type">“post-messages”</span></a>
105property to <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>. This avoids unnecessary memory overhead.
106</li>
107</ul></div>
108<p>The primary purpose of this element is to abstract away the <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstBuffer.html#GstBuffer-struct"><span class="type">GstBuffer</span></a> to
109<a href="/usr/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf-struct"><span class="type">GdkPixbuf</span></a> conversion. Other than that it's very similar to the fakesink
110element.</p>
111<p>This element is meant for easy no-hassle video snapshotting. It is not
112suitable for video playback or video display at high framerates. Use
113ximagesink, xvimagesink or some other suitable video sink in connection
114with the <span class="type">GstXOverlay</span> interface instead if you want to do video playback.</p>
115<div class="refsect2">
116<a name="id-1.2.67.7.7"></a><h3>Message details</h3>
117As mentioned above, this element will by default post element messages
118containing structures named <code class="classname">"preroll-pixbuf"
119</code> or <code class="classname">"pixbuf"</code> on the bus (this
120can be disabled by setting the <a class="link" href="gst-plugins-good-plugins-gdkpixbufsink.html#GstGdkPixbufSink--post-messages" title="The “post-messages” property"><span class="type">“post-messages”</span></a> property
121to <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> though). The element message structure has the following fields:
122<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
123<li class="listitem">
124<code class="classname">"pixbuf"</code>: the <a href="/usr/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf-struct"><span class="type">GdkPixbuf</span></a> object
125</li>
126<li class="listitem">
127<code class="classname">"pixel-aspect-ratio"</code>: the pixel aspect
128  ratio (PAR) of the input image (this field contains a <span class="type">GstFraction</span>); the
129  PAR is usually 1:1 for images, but is often something non-1:1 in the case
130  of video input. In this case the image may be distorted and you may need
131  to rescale it accordingly before saving it to file or displaying it. This
132  can easily be done using <a href="/usr/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-Scaling.html#gdk-pixbuf-scale"><code class="function">gdk_pixbuf_scale()</code></a> (the reason this is not done
133  automatically is that the application will often scale the image anyway
134  according to the size of the output window, in which case it is much more
135  efficient to only scale once rather than twice). You can put a videoscale
136  element and a capsfilter element with
137  <code class="literal">video/x-raw-rgb,pixel-aspect-ratio=(fraction)1/1</code> caps
138  in front of this element to make sure the pixbufs always have a 1:1 PAR.
139</li>
140</ul></div>
141</div>
142<hr>
143<div class="refsect2">
144<a name="id-1.2.67.7.8"></a><h3>Example pipeline</h3>
145<div class="informalexample">
146  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
147    <tbody>
148      <tr>
149        <td class="listing_lines" align="right"><pre>1</pre></td>
150        <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>m <span class="gtkdoc opt">-</span>v videotestsrc num<span class="gtkdoc opt">-</span>buffers<span class="gtkdoc opt">=</span><span class="number">1</span> <span class="gtkdoc opt">!</span> gdkpixbufsink</pre></td>
151      </tr>
152    </tbody>
153  </table>
154</div>
155 Process one single test image as pixbuf (note that the output you see will
156be slightly misleading. The message structure does contain a valid pixbuf
157object even if the structure string says '(NULL)').
158</div>
159<div class="refsynopsisdiv">
160<h2>Synopsis</h2>
161<div class="refsect2">
162<a name="id-1.2.67.7.9.1"></a><h3>Element Information</h3>
163<div class="variablelist"><table border="0" class="variablelist">
164<colgroup>
165<col align="left" valign="top">
166<col>
167</colgroup>
168<tbody>
169<tr>
170<td><p><span class="term">plugin</span></p></td>
171<td>
172            <a class="link" href="gst-plugins-good-plugins-plugin-gdkpixbuf.html#plugin-gdkpixbuf">gdkpixbuf</a>
173          </td>
174</tr>
175<tr>
176<td><p><span class="term">author</span></p></td>
177<td>Tim-Philipp Müller &lt;tim centricular net&gt;</td>
178</tr>
179<tr>
180<td><p><span class="term">class</span></p></td>
181<td>Sink/Video</td>
182</tr>
183</tbody>
184</table></div>
185</div>
186<hr>
187<div class="refsect2">
188<a name="id-1.2.67.7.9.2"></a><h3>Element Pads</h3>
189<div class="variablelist"><table border="0" class="variablelist">
190<colgroup>
191<col align="left" valign="top">
192<col>
193</colgroup>
194<tbody>
195<tr>
196<td><p><span class="term">name</span></p></td>
197<td>sink</td>
198</tr>
199<tr>
200<td><p><span class="term">direction</span></p></td>
201<td>sink</td>
202</tr>
203<tr>
204<td><p><span class="term">presence</span></p></td>
205<td>always</td>
206</tr>
207<tr>
208<td><p><span class="term">details</span></p></td>
209<td>video/x-raw, format=(string)RGB, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</td>
210</tr>
211<tr>
212<td><p><span class="term"></span></p></td>
213<td> video/x-raw, format=(string)RGBA, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</td>
214</tr>
215</tbody>
216</table></div>
217</div>
218</div>
219</div>
220<div class="refsect1">
221<a name="gst-plugins-good-plugins-gdkpixbufsink.functions_details"></a><h2>Functions</h2>
222<p></p>
223</div>
224<div class="refsect1">
225<a name="gst-plugins-good-plugins-gdkpixbufsink.other_details"></a><h2>Types and Values</h2>
226<div class="refsect2">
227<a name="GstGdkPixbufSink-struct"></a><h3>struct GstGdkPixbufSink</h3>
228<pre class="programlisting">struct GstGdkPixbufSink;</pre>
229<p>Opaque element structure.</p>
230</div>
231</div>
232<div class="refsect1">
233<a name="gst-plugins-good-plugins-gdkpixbufsink.property-details"></a><h2>Property Details</h2>
234<div class="refsect2">
235<a name="GstGdkPixbufSink--last-pixbuf"></a><h3>The <code class="literal">“last-pixbuf”</code> property</h3>
236<pre class="programlisting">  “last-pixbuf”              <a href="/usr/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf-struct"><span class="type">GdkPixbuf</span></a> *</pre>
237<p>Last GdkPixbuf object rendered.</p>
238<p>Flags: Read</p>
239</div>
240<hr>
241<div class="refsect2">
242<a name="GstGdkPixbufSink--post-messages"></a><h3>The <code class="literal">“post-messages”</code> property</h3>
243<pre class="programlisting">  “post-messages”            <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></pre>
244<p>Whether to post messages containing pixbufs on the bus.</p>
245<p>Flags: Read / Write</p>
246<p>Default value: TRUE</p>
247</div>
248</div>
249</div>
250<div class="footer">
251<hr>Generated by GTK-Doc V1.28</div>
252</body>
253</html>