| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| <html> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <title>gdkpixbufsink: GStreamer Good Plugins 1.0 Plugins Reference Manual</title> |
| <meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> |
| <link rel="home" href="index.html" title="GStreamer Good Plugins 1.0 Plugins Reference Manual"> |
| <link rel="up" href="ch01.html" title="gst-plugins-good Elements"> |
| <link rel="prev" href="gst-plugins-good-plugins-gdkpixbufoverlay.html" title="gdkpixbufoverlay"> |
| <link rel="next" href="gst-plugins-good-plugins-goom2k1.html" title="goom2k1"> |
| <meta name="generator" content="GTK-Doc V1.25 (XML mode)"> |
| <link rel="stylesheet" href="style.css" type="text/css"> |
| </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="5"><tr valign="middle"> |
| <td width="100%" align="left" class="shortcuts"> |
| <a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span> |
| <a href="#gst-plugins-good-plugins-gdkpixbufsink.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span> |
| <a href="#gst-plugins-good-plugins-gdkpixbufsink.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_properties"> <span class="dim">|</span> |
| <a href="#gst-plugins-good-plugins-gdkpixbufsink.properties" class="shortcut">Properties</a></span> |
| </td> |
| <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td> |
| <td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td> |
| <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> |
| <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> |
| </tr></table> |
| <div class="refentry"> |
| <a name="gst-plugins-good-plugins-gdkpixbufsink"></a><div class="titlepage"></div> |
| <div class="refnamediv"><table width="100%"><tr> |
| <td valign="top"> |
| <h2><span class="refentrytitle"><a name="gst-plugins-good-plugins-gdkpixbufsink.top_of_page"></a>gdkpixbufsink</span></h2> |
| <p>gdkpixbufsink</p> |
| </td> |
| <td class="gallery_image" valign="top" align="right"></td> |
| </tr></table></div> |
| <div class="refsect1"> |
| <a name="gst-plugins-good-plugins-gdkpixbufsink.properties"></a><h2>Properties</h2> |
| <div class="informaltable"><table class="informaltable" border="0"> |
| <colgroup> |
| <col width="150px" class="properties_type"> |
| <col width="300px" class="properties_name"> |
| <col width="200px" class="properties_flags"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="property_type"> |
| <a href="/usr/share/gtk-doc/html/gdk-pixbufgdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf-struct"><span class="type">GdkPixbuf</span></a> *</td> |
| <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> |
| <td class="property_flags">Read</td> |
| </tr> |
| <tr> |
| <td class="property_type"><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td> |
| <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> |
| <td class="property_flags">Read / Write</td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <a name="GstGdkPixbufSink"></a><div class="refsect1"> |
| <a name="gst-plugins-good-plugins-gdkpixbufsink.other"></a><h2>Types and Values</h2> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="name"> |
| <col class="description"> |
| </colgroup> |
| <tbody><tr> |
| <td class="datatype_keyword">struct</td> |
| <td class="function_name"><a class="link" href="gst-plugins-good-plugins-gdkpixbufsink.html#GstGdkPixbufSink-struct" title="struct GstGdkPixbufSink">GstGdkPixbufSink</a></td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect1"> |
| <a name="gst-plugins-good-plugins-gdkpixbufsink.object-hierarchy"></a><h2>Object Hierarchy</h2> |
| <pre class="screen"> <a href="/usr/share/gtk-doc/html/gobjectgobject-The-Base-Object-Type.html#GObject-struct">GObject</a> |
| <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gobjectgobject-The-Base-Object-Type.html#GInitiallyUnowned">GInitiallyUnowned</a> |
| <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gstreamer-1.0GstObject.html#GstObject-struct">GstObject</a> |
| <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gstreamer-1.0GstElement.html#GstElement-struct">GstElement</a> |
| <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gstreamer-libs-1.0GstBaseSink.html#GstBaseSink-struct">GstBaseSink</a> |
| <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gst-plugins-base-libs-1.0gst-plugins-base-libs-gstvideosink.html#GstVideoSink-struct">GstVideoSink</a> |
| <span class="lineart">╰──</span> GstGdkPixbufSink |
| </pre> |
| </div> |
| <div class="refsect1"> |
| <a name="gst-plugins-good-plugins-gdkpixbufsink.description"></a><h2>Description</h2> |
| <p>This sink element takes RGB or RGBA images as input and wraps them into |
| <a href="/usr/share/gtk-doc/html/gdk-pixbufgdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf-struct"><span class="type">GdkPixbuf</span></a> objects, for easy saving to file via the |
| GdkPixbuf library API or displaying in Gtk+ applications (e.g. using |
| the <a href="/usr/share/gtk-doc/html/gtk3GtkImage.html#GtkImage-struct"><span class="type">GtkImage</span></a> widget).</p> |
| <p>There are two ways to use this element and obtain the <a href="/usr/share/gtk-doc/html/gdk-pixbufgdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf-struct"><span class="type">GdkPixbuf</span></a> objects |
| created:</p> |
| <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
| <li class="listitem"> |
| Watching for element messages named <code class="classname">"preroll-pixbuf" |
| </code> or <code class="classname">"pixbuf"</code> on the bus, which |
| will be posted whenever an image would usually be rendered. See below for |
| more details on these messages and how to extract the pixbuf object |
| contained in them. |
| </li> |
| <li class="listitem"> |
| Retrieving 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 |
| when needed. This is the easiest way to get at pixbufs for snapshotting |
| purposes - just wait until the pipeline is prerolled (ASYNC_DONE message |
| on the bus), then read the property. If you use this method, you may want |
| to 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> |
| property to <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#FALSE:CAPS"><span class="type">FALSE</span></a>. This avoids unnecessary memory overhead. |
| </li> |
| </ul></div> |
| <p>The primary purpose of this element is to abstract away the <a href="/usr/share/gtk-doc/html/gstreamer-1.0GstBuffer.html#GstBuffer-struct"><span class="type">GstBuffer</span></a> to |
| <a href="/usr/share/gtk-doc/html/gdk-pixbufgdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf-struct"><span class="type">GdkPixbuf</span></a> conversion. Other than that it's very similar to the fakesink |
| element.</p> |
| <p>This element is meant for easy no-hassle video snapshotting. It is not |
| suitable for video playback or video display at high framerates. Use |
| ximagesink, xvimagesink or some other suitable video sink in connection |
| with the <span class="type">GstXOverlay</span> interface instead if you want to do video playback.</p> |
| <div class="refsect2"> |
| <a name="id-1.2.67.7.7"></a><h3>Message details</h3> |
| As mentioned above, this element will by default post element messages |
| containing structures named <code class="classname">"preroll-pixbuf" |
| </code> or <code class="classname">"pixbuf"</code> on the bus (this |
| can 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 |
| to <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#FALSE:CAPS"><span class="type">FALSE</span></a> though). The element message structure has the following fields: |
| <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> |
| <li class="listitem"> |
| <code class="classname">"pixbuf"</code>: the <a href="/usr/share/gtk-doc/html/gdk-pixbufgdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf-struct"><span class="type">GdkPixbuf</span></a> object |
| </li> |
| <li class="listitem"> |
| <code class="classname">"pixel-aspect-ratio"</code>: the pixel aspect |
| ratio (PAR) of the input image (this field contains a <span class="type">GstFraction</span>); the |
| PAR is usually 1:1 for images, but is often something non-1:1 in the case |
| of video input. In this case the image may be distorted and you may need |
| to rescale it accordingly before saving it to file or displaying it. This |
| can easily be done using <a href="/usr/share/gtk-doc/html/gdk-pixbufgdk-pixbuf-Scaling.html#gdk-pixbuf-scale"><code class="function">gdk_pixbuf_scale()</code></a> (the reason this is not done |
| automatically is that the application will often scale the image anyway |
| according to the size of the output window, in which case it is much more |
| efficient to only scale once rather than twice). You can put a videoscale |
| element and a capsfilter element with |
| <code class="literal">video/x-raw-rgb,pixel-aspect-ratio=(fraction)1/1</code> caps |
| in front of this element to make sure the pixbufs always have a 1:1 PAR. |
| </li> |
| </ul></div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="id-1.2.67.7.8"></a><h3>Example pipeline</h3> |
| <div class="informalexample"> |
| <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> |
| <tbody> |
| <tr> |
| <td class="listing_lines" align="right"><pre>1</pre></td> |
| <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> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| Process one single test image as pixbuf (note that the output you see will |
| be slightly misleading. The message structure does contain a valid pixbuf |
| object even if the structure string says '(NULL)'). |
| </div> |
| <div class="refsynopsisdiv"> |
| <h2>Synopsis</h2> |
| <div class="refsect2"> |
| <a name="id-1.2.67.7.9.1"></a><h3>Element Information</h3> |
| <div class="variablelist"><table border="0" class="variablelist"> |
| <colgroup> |
| <col align="left" valign="top"> |
| <col> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td><p><span class="term">plugin</span></p></td> |
| <td> |
| <a class="link" href="gst-plugins-good-plugins-plugin-gdkpixbuf.html#plugin-gdkpixbuf">gdkpixbuf</a> |
| </td> |
| </tr> |
| <tr> |
| <td><p><span class="term">author</span></p></td> |
| <td>Tim-Philipp Müller <tim centricular net></td> |
| </tr> |
| <tr> |
| <td><p><span class="term">class</span></p></td> |
| <td>Sink/Video</td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="id-1.2.67.7.9.2"></a><h3>Element Pads</h3> |
| <div class="variablelist"><table border="0" class="variablelist"> |
| <colgroup> |
| <col align="left" valign="top"> |
| <col> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td><p><span class="term">name</span></p></td> |
| <td>sink</td> |
| </tr> |
| <tr> |
| <td><p><span class="term">direction</span></p></td> |
| <td>sink</td> |
| </tr> |
| <tr> |
| <td><p><span class="term">presence</span></p></td> |
| <td>always</td> |
| </tr> |
| <tr> |
| <td><p><span class="term">details</span></p></td> |
| <td>video/x-raw, format=(string)RGB, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</td> |
| </tr> |
| <tr> |
| <td><p><span class="term"></span></p></td> |
| <td> video/x-raw, format=(string)RGBA, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]</td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| </div> |
| <div class="refsect1"> |
| <a name="gst-plugins-good-plugins-gdkpixbufsink.functions_details"></a><h2>Functions</h2> |
| <p></p> |
| </div> |
| <div class="refsect1"> |
| <a name="gst-plugins-good-plugins-gdkpixbufsink.other_details"></a><h2>Types and Values</h2> |
| <div class="refsect2"> |
| <a name="GstGdkPixbufSink-struct"></a><h3>struct GstGdkPixbufSink</h3> |
| <pre class="programlisting">struct GstGdkPixbufSink;</pre> |
| <p>Opaque element structure.</p> |
| </div> |
| </div> |
| <div class="refsect1"> |
| <a name="gst-plugins-good-plugins-gdkpixbufsink.property-details"></a><h2>Property Details</h2> |
| <div class="refsect2"> |
| <a name="GstGdkPixbufSink--last-pixbuf"></a><h3>The <code class="literal">“last-pixbuf”</code> property</h3> |
| <pre class="programlisting"> “last-pixbuf” <a href="/usr/share/gtk-doc/html/gdk-pixbufgdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf-struct"><span class="type">GdkPixbuf</span></a> *</pre> |
| <p>Last GdkPixbuf object rendered.</p> |
| <p>Flags: Read</p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GstGdkPixbufSink--post-messages"></a><h3>The <code class="literal">“post-messages”</code> property</h3> |
| <pre class="programlisting"> “post-messages” <a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></pre> |
| <p>Whether to post messages containing pixbufs on the bus.</p> |
| <p>Flags: Read / Write</p> |
| <p>Default value: TRUE</p> |
| </div> |
| </div> |
| </div> |
| <div class="footer"> |
| <hr>Generated by GTK-Doc V1.25</div> |
| </body> |
| </html> |