<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <title>decodebin2</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-playbin.html" title="playbin"> <link rel="next" href="gst-plugins-base-plugins-tcpserversink.html" title="tcpserversink"> <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-playbin.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="gst-plugins-base-plugins-tcpserversink.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="#id2597262" class="shortcut">Top</a>  |  <a href="#id2607597" class="shortcut">Description</a>  |  <a href="#id2597221" class="shortcut">Object Hierarchy</a>  |  <a href="#id2607824" class="shortcut">Implemented Interfaces</a>  |  <a href="#id2563338" class="shortcut">Properties</a>  |  <a href="#id2578161" class="shortcut">Signals</a></nobr></td></tr> </table> <div class="refentry" lang="en"> <a name="gst-plugins-base-plugins-decodebin2"></a><div class="titlepage"></div> <div class="refnamediv"><table width="100%"><tr> <td valign="top"> <h2> <a name="id2597262"></a><span class="refentrytitle">decodebin2</span> </h2> <p>decodebin2 — Next-generation automatic decoding bin</p> </td> <td valign="top" align="right"></td> </tr></table></div> <div class="refsynopsisdiv"> <h2>Synopsis</h2> <a name="GstDecodeBin2"></a><pre class="synopsis"> typedef <a href="gst-plugins-base-plugins-decodebin2.html#GstDecodeBin2">GstDecodeBin2</a>; </pre> </div> <div class="refsect1" lang="en"> <a name="id2597221"></a><h2>Object Hierarchy</h2> <pre class="synopsis"> GObject +----GstObject +----GstElement +----GstBin +----GstDecodeBin2 </pre> </div> <div class="refsect1" lang="en"> <a name="id2607824"></a><h2>Implemented Interfaces</h2> <p> GstDecodeBin2 implements GstChildProxy.</p> </div> <div class="refsect1" lang="en"> <a name="id2563338"></a><h2>Properties</h2> <pre class="synopsis"> "<a href="gst-plugins-base-plugins-decodebin2.html#GstDecodeBin2--caps">caps</a>" GstCaps* : Read / Write "<a href="gst-plugins-base-plugins-decodebin2.html#GstDecodeBin2--subtitle-encoding">subtitle-encoding</a>" gchar* : Read / Write </pre> </div> <div class="refsect1" lang="en"> <a name="id2578161"></a><h2>Signals</h2> <pre class="synopsis"> "<a href="gst-plugins-base-plugins-decodebin2.html#GstDecodeBin2-autoplug-continue">autoplug-continue</a>" : Run Last "<a href="gst-plugins-base-plugins-decodebin2.html#GstDecodeBin2-autoplug-sort">autoplug-sort</a>" : Run Last "<a href="gst-plugins-base-plugins-decodebin2.html#GstDecodeBin2-new-decoded-pad">new-decoded-pad</a>" : Run Last "<a href="gst-plugins-base-plugins-decodebin2.html#GstDecodeBin2-removed-decoded-pad">removed-decoded-pad</a>" : Run Last "<a href="gst-plugins-base-plugins-decodebin2.html#GstDecodeBin2-unknown-type">unknown-type</a>" : Run Last "<a href="gst-plugins-base-plugins-decodebin2.html#GstDecodeBin2-autoplug-factories">autoplug-factories</a>" : Run Last "<a href="gst-plugins-base-plugins-decodebin2.html#GstDecodeBin2-autoplug-select">autoplug-select</a>" : Run Last "<a href="gst-plugins-base-plugins-decodebin2.html#GstDecodeBin2-drained">drained</a>" : Run Last </pre> </div> <div class="refsect1" lang="en"> <a name="id2607597"></a><h2>Description</h2> <p> <span class="type">GstBin</span> that auto-magically constructs a decoding pipeline using available decoders and demuxers via auto-plugging. </p> <p> At this stage, decodebin2 is considered UNSTABLE. The API provided in the signals is expected to change in the near future. </p> <p> To try out decodebin2, you can set the USE_DECODEBIN2 environment variable (USE_DECODEBIN2=1 for example). This will cause playbin to use decodebin2 instead of the older decodebin for its internal auto-plugging.</p> <div class="refsect2" lang="en"> <a name="id2607635"></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> uridecodebin </td> </tr> <tr> <td><span class="term">author</span></td> <td>Edward Hervey <edward@fluendo.com></td> </tr> <tr> <td><span class="term">class</span></td> <td>Generic/Bin/Decoder</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>ANY</td> </tr> </tbody> </table></div> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><span class="term">name</span></td> <td>src%d</td> </tr> <tr> <td><span class="term">direction</span></td> <td>source</td> </tr> <tr> <td><span class="term">presence</span></td> <td>sometimes</td> </tr> <tr> <td><span class="term">details</span></td> <td>ANY</td> </tr> </tbody> </table></div> </div> <p> </p> </div> <div class="refsect1" lang="en"> <a name="id2608575"></a><h2>Details</h2> <div class="refsect2" lang="en"> <a name="id2608586"></a><h3> <a name="GstDecodeBin2"></a>GstDecodeBin2</h3> <a class="indexterm" name="id2608598"></a><pre class="programlisting">typedef struct _GstDecodeBin GstDecodeBin2; </pre> <p> The opaque <span class="type">DecodeBin2</span> data structure</p> <p> </p> </div> </div> <div class="refsect1" lang="en"> <a name="id2608627"></a><h2>Property Details</h2> <div class="refsect2" lang="en"> <a name="id2608638"></a><h3> <a name="GstDecodeBin2--caps"></a>The "<code class="literal">caps</code>" property</h3> <a class="indexterm" name="id2608653"></a><pre class="programlisting"> "caps" GstCaps* : Read / Write</pre> <p>The caps on which to stop decoding.</p> </div> <hr> <div class="refsect2" lang="en"> <a name="id2608673"></a><h3> <a name="GstDecodeBin2--subtitle-encoding"></a>The "<code class="literal">subtitle-encoding</code>" property</h3> <a class="indexterm" name="id2608689"></a><pre class="programlisting"> "subtitle-encoding" gchar* : Read / Write</pre> <p>Encoding to assume if input subtitles are not in UTF-8 encoding. If not set, the GST_SUBTITLE_ENCODING environment variable will be checked for an encoding to use. If that is not set either, ISO-8859-15 will be assumed.</p> <p>Default value: NULL</p> </div> </div> <div class="refsect1" lang="en"> <a name="id2608720"></a><h2>Signal Details</h2> <div class="refsect2" lang="en"> <a name="id2608731"></a><h3> <a name="GstDecodeBin2-autoplug-continue"></a>The "autoplug-continue" signal</h3> <a class="indexterm" name="id2608740"></a><pre class="programlisting">gboolean user_function (<a href="gst-plugins-base-plugins-decodebin2.html#GstDecodeBin2">GstDecodeBin2</a> *pad, GstPad *caps, GstCaps *Returns, gpointer user_data) : Run Last</pre> <p> This signal is emitted whenever decodebin2 finds a new stream. It is emitted before looking for any elements that can handle that stream.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><span class="term"><em class="parameter"><code>pad</code></em> :</span></td> <td> The <span class="type">GstPad</span>. </td> </tr> <tr> <td><span class="term"><em class="parameter"><code>caps</code></em> :</span></td> <td> The <span class="type">GstCaps</span> found. </td> </tr> <tr> <td><span class="term"><em class="parameter"><code>user_data</code></em> :</span></td> <td>user data set when the signal handler was connected.</td> </tr> <tr> <td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td> <td> <span class="type">TRUE</span> if you wish decodebin2 to look for elements that can handle the given <em class="parameter"><code>caps</code></em>. If <span class="type">FALSE</span>, those caps will be considered as final and the pad will be exposed as such (see 'new-decoded-pad' signal). </td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" lang="en"> <a name="id2608890"></a><h3> <a name="GstDecodeBin2-autoplug-sort"></a>The "autoplug-sort" signal</h3> <a class="indexterm" name="id2608898"></a><pre class="programlisting">GValueArray* user_function (<a href="gst-plugins-base-plugins-decodebin2.html#GstDecodeBin2">GstDecodeBin2</a> *pad, GstPad *caps, GstCaps *factories, GValueArray *Returns, gpointer user_data) : Run Last</pre> <p> Once decodebin2 has found the possible <span class="type">GstElementFactory</span> objects to try for <em class="parameter"><code>caps</code></em> on <em class="parameter"><code>pad</code></em>, this signal is emited. The purpose of the signal is for the application to perform additional sorting or filtering on the element factory array. </p> <p> The callee should copy and modify <em class="parameter"><code>factories</code></em>.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><span class="term"><em class="parameter"><code>pad</code></em> :</span></td> <td> The <span class="type">GstPad</span>. </td> </tr> <tr> <td><span class="term"><em class="parameter"><code>caps</code></em> :</span></td> <td> The <span class="type">GstCaps</span>. </td> </tr> <tr> <td><span class="term"><em class="parameter"><code>factories</code></em> :</span></td> <td> A <span class="type">GValueArray</span> of possible <span class="type">GstElementFactory</span> to use. </td> </tr> <tr> <td><span class="term"><em class="parameter"><code>user_data</code></em> :</span></td> <td>user data set when the signal handler was connected.</td> </tr> <tr> <td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td> <td> A new sorted array of <span class="type">GstElementFactory</span> objects. </td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" lang="en"> <a name="id2609096"></a><h3> <a name="GstDecodeBin2-new-decoded-pad"></a>The "new-decoded-pad" signal</h3> <a class="indexterm" name="id2609106"></a><pre class="programlisting">void user_function (<a href="gst-plugins-base-plugins-decodebin2.html#GstDecodeBin2">GstDecodeBin2</a> *pad, GstPad *islast, gboolean arg2, gpointer user_data) : Run Last</pre> <p> This signal gets emitted as soon as a new pad of the same type as one of the valid 'raw' types is added.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><span class="term"><em class="parameter"><code>pad</code></em> :</span></td> <td> the newly created pad </td> </tr> <tr> <td><span class="term"><em class="parameter"><code>islast</code></em> :</span></td> <td> <span class="type">TRUE</span> if this is the last pad to be added. Deprecated. </td> </tr> <tr> <td><span class="term"><em class="parameter"><code>user_data</code></em> :</span></td> <td>user data set when the signal handler was connected.</td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" lang="en"> <a name="id2612366"></a><h3> <a name="GstDecodeBin2-removed-decoded-pad"></a>The "removed-decoded-pad" signal</h3> <a class="indexterm" name="id2612376"></a><pre class="programlisting">void user_function (<a href="gst-plugins-base-plugins-decodebin2.html#GstDecodeBin2">GstDecodeBin2</a> *pad, GstPad *arg1, gpointer user_data) : Run Last</pre> <p> This signal is emitted when a 'final' caps pad has been removed.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><span class="term"><em class="parameter"><code>pad</code></em> :</span></td> <td> the pad that was removed </td> </tr> <tr> <td><span class="term"><em class="parameter"><code>user_data</code></em> :</span></td> <td>user data set when the signal handler was connected.</td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" lang="en"> <a name="id2612448"></a><h3> <a name="GstDecodeBin2-unknown-type"></a>The "unknown-type" signal</h3> <a class="indexterm" name="id2612455"></a><pre class="programlisting">void user_function (<a href="gst-plugins-base-plugins-decodebin2.html#GstDecodeBin2">GstDecodeBin2</a> *pad, GstPad *caps, GstCaps *arg2, gpointer user_data) : Run Last</pre> <p> This signal is emitted when a pad for which there is no further possible decoding is added to the decodebin.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><span class="term"><em class="parameter"><code>pad</code></em> :</span></td> <td> the new pad containing caps that cannot be resolved to a 'final' stream type. </td> </tr> <tr> <td><span class="term"><em class="parameter"><code>caps</code></em> :</span></td> <td> the <span class="type">GstCaps</span> of the pad that cannot be resolved. </td> </tr> <tr> <td><span class="term"><em class="parameter"><code>user_data</code></em> :</span></td> <td>user data set when the signal handler was connected.</td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" lang="en"> <a name="id2612554"></a><h3> <a name="GstDecodeBin2-autoplug-factories"></a>The "autoplug-factories" signal</h3> <a class="indexterm" name="id2612564"></a><pre class="programlisting">GValueArray* user_function (<a href="gst-plugins-base-plugins-decodebin2.html#GstDecodeBin2">GstDecodeBin2</a> *pad, GstPad *caps, GstCaps *Returns, gpointer user_data) : Run Last</pre> <p> This function is emited when an array of possible factories for <em class="parameter"><code>caps</code></em> on <em class="parameter"><code>pad</code></em> is needed. Decodebin2 will by default return an array with all compatible factories, sorted by rank. </p> <p> If this function returns NULL, <em class="parameter"><code>pad</code></em> will be exposed as a final caps. </p> <p> If this function returns an empty array, the pad will be considered as having an unhandled type media type.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><span class="term"><em class="parameter"><code>pad</code></em> :</span></td> <td> The <span class="type">GstPad</span>. </td> </tr> <tr> <td><span class="term"><em class="parameter"><code>caps</code></em> :</span></td> <td> The <span class="type">GstCaps</span> found. </td> </tr> <tr> <td><span class="term"><em class="parameter"><code>user_data</code></em> :</span></td> <td>user data set when the signal handler was connected.</td> </tr> <tr> <td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td> <td> a <span class="type">GValueArray</span>* with a list of factories to try. The factories are by default tried in the returned order or based on the index returned by "autoplug-select". </td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" lang="en"> <a name="id2612713"></a><h3> <a name="GstDecodeBin2-autoplug-select"></a>The "autoplug-select" signal</h3> <a class="indexterm" name="id2612722"></a><pre class="programlisting">GstAutoplugSelectResultuser_function (<a href="gst-plugins-base-plugins-decodebin2.html#GstDecodeBin2">GstDecodeBin2</a> *pad, GstPad *caps, GstCaps *factories, GstElementFactory *Returns, gpointer user_data) : Run Last</pre> <p> This signal is emitted once decodebin2 has found all the possible <span class="type">GstElementFactory</span> that can be used to handle the given <em class="parameter"><code>caps</code></em>.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody> <tr> <td><span class="term"><em class="parameter"><code>pad</code></em> :</span></td> <td> The <span class="type">GstPad</span>. </td> </tr> <tr> <td><span class="term"><em class="parameter"><code>caps</code></em> :</span></td> <td> The <span class="type">GstCaps</span>. </td> </tr> <tr> <td><span class="term"><em class="parameter"><code>factories</code></em> :</span></td> <td> A <span class="type">GValueArray</span> of possible <span class="type">GstElementFactory</span> to use, sorted by rank (higher ranks come first). </td> </tr> <tr> <td><span class="term"><em class="parameter"><code>user_data</code></em> :</span></td> <td>user data set when the signal handler was connected.</td> </tr> <tr> <td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td> <td> A <span class="type">gint</span> indicating what factory index from the <em class="parameter"><code>factories</code></em> array that you wish decodebin2 to use for trying to decode the given <em class="parameter"><code>caps</code></em>. Return -1 to stop selection of a factory and expose the pad as a raw type. The default handler always returns the first possible factory (index 0). </td> </tr> </tbody> </table></div> </div> <hr> <div class="refsect2" lang="en"> <a name="id2612901"></a><h3> <a name="GstDecodeBin2-drained"></a>The "drained" signal</h3> <a class="indexterm" name="id2612908"></a><pre class="programlisting">void user_function (<a href="gst-plugins-base-plugins-decodebin2.html#GstDecodeBin2">GstDecodeBin2</a> *arg0, gpointer user_data) : Run Last</pre> <p> This signal is emitted once decodebin2 has finished decoding all the data.</p> <p> </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> <tbody><tr> <td><span class="term"><em class="parameter"><code>user_data</code></em> :</span></td> <td>user data set when the signal handler was connected.</td> </tr></tbody> </table></div> <p>Since 0.10.16 </p> </div> </div> </div> </body> </html>