blob: 3d53caf7be0e15caef2780901b86eb8ea21ea520 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GstFlowCombiner: GStreamer 1.0 Library Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="GStreamer 1.0 Library Reference Manual">
<link rel="up" href="gstreamer-base.html" title="GStreamer Base and Utillity Classes">
<link rel="prev" href="GstCollectPads.html" title="GstCollectPads">
<link rel="next" href="gstreamer-libs-GstTypeFindHelper.html" title="GstTypeFindHelper">
<meta name="generator" content="GTK-Doc V1.24 (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="#gstreamer-libs-GstFlowCombiner.description" class="shortcut">Description</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="gstreamer-base.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="GstCollectPads.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="gstreamer-libs-GstTypeFindHelper.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="gstreamer-libs-GstFlowCombiner"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gstreamer-libs-GstFlowCombiner.top_of_page"></a>GstFlowCombiner</span></h2>
<p>GstFlowCombiner — Utility to combine multiple flow returns into one</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="gstreamer-libs-GstFlowCombiner.functions"></a><h2>Functions</h2>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<span class="returnvalue">GstFlowCombiner</span> *
</td>
<td class="function_name">
<a class="link" href="gstreamer-libs-GstFlowCombiner.html#gst-flow-combiner-new" title="gst_flow_combiner_new ()">gst_flow_combiner_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gstreamer-libs-GstFlowCombiner.html#gst-flow-combiner-free" title="gst_flow_combiner_free ()">gst_flow_combiner_free</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#GstFlowReturn"><span class="returnvalue">GstFlowReturn</span></a>
</td>
<td class="function_name">
<a class="link" href="gstreamer-libs-GstFlowCombiner.html#gst-flow-combiner-update-flow" title="gst_flow_combiner_update_flow ()">gst_flow_combiner_update_flow</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gstreamer-libs-GstFlowCombiner.html#gst-flow-combiner-add-pad" title="gst_flow_combiner_add_pad ()">gst_flow_combiner_add_pad</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gstreamer-libs-GstFlowCombiner.html#gst-flow-combiner-remove-pad" title="gst_flow_combiner_remove_pad ()">gst_flow_combiner_remove_pad</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gstreamer-libs-GstFlowCombiner.html#gst-flow-combiner-clear" title="gst_flow_combiner_clear ()">gst_flow_combiner_clear</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gstreamer-libs-GstFlowCombiner.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;gst/base/gstflowcombiner.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="gstreamer-libs-GstFlowCombiner.description"></a><h2>Description</h2>
<p>Utility struct to help handling <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#GstFlowReturn"><span class="type">GstFlowReturn</span></a> combination. Useful for
<a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstElement.html"><span class="type">GstElement</span></a>s that have multiple source pads and need to combine
the different <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#GstFlowReturn"><span class="type">GstFlowReturn</span></a> for those pads.</p>
<p><span class="type">GstFlowCombiner</span> works by using the last <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#GstFlowReturn"><span class="type">GstFlowReturn</span></a> for all <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html"><span class="type">GstPad</span></a>
it has in its list and computes the combined return value and provides
it to the caller.</p>
<p>To add a new pad to the <span class="type">GstFlowCombiner</span> use <a class="link" href="gstreamer-libs-GstFlowCombiner.html#gst-flow-combiner-add-pad" title="gst_flow_combiner_add_pad ()"><code class="function">gst_flow_combiner_add_pad()</code></a>.
The new <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html"><span class="type">GstPad</span></a> is stored with a default value of <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#GST-FLOW-OK:CAPS"><code class="literal">GST_FLOW_OK</code></a>.</p>
<p>In case you want a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html"><span class="type">GstPad</span></a> to be removed, use <a class="link" href="gstreamer-libs-GstFlowCombiner.html#gst-flow-combiner-remove-pad" title="gst_flow_combiner_remove_pad ()"><code class="function">gst_flow_combiner_remove_pad()</code></a>.</p>
<p>Please be aware that this struct isn't thread safe as its designed to be
used by demuxers, those usually will have a single thread operating it.</p>
<p>These functions will take refs on the passed <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html"><span class="type">GstPad</span></a>s.</p>
<p>Aside from reducing the user's code size, the main advantage of using this
helper struct is to follow the standard rules for <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#GstFlowReturn"><span class="type">GstFlowReturn</span></a> combination.
These rules are:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#GST-FLOW-EOS:CAPS"><code class="literal">GST_FLOW_EOS</code></a>: only if all returns are EOS too</p></li>
<li class="listitem"><p><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#GST-FLOW-NOT-LINKED:CAPS"><code class="literal">GST_FLOW_NOT_LINKED</code></a>: only if all returns are NOT_LINKED too</p></li>
<li class="listitem"><p><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#GST-FLOW-ERROR:CAPS"><code class="literal">GST_FLOW_ERROR</code></a> or below: if at least one returns an error return</p></li>
<li class="listitem"><p><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#GST-FLOW-NOT-NEGOTIATED:CAPS"><code class="literal">GST_FLOW_NOT_NEGOTIATED</code></a>: if at least one returns a not-negotiated return</p></li>
<li class="listitem"><p><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#GST-FLOW-FLUSHING:CAPS"><code class="literal">GST_FLOW_FLUSHING</code></a>: if at least one returns flushing</p></li>
<li class="listitem"><p><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#GST-FLOW-OK:CAPS"><code class="literal">GST_FLOW_OK</code></a>: otherwise</p></li>
</ul></div>
<p><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#GST-FLOW-ERROR:CAPS"><code class="literal">GST_FLOW_ERROR</code></a> or below, GST_FLOW_NOT_NEGOTIATED and GST_FLOW_FLUSHING are
returned immediatelly from the <a class="link" href="gstreamer-libs-GstFlowCombiner.html#gst-flow-combiner-update-flow" title="gst_flow_combiner_update_flow ()"><code class="function">gst_flow_combiner_update_flow()</code></a> function.</p>
</div>
<div class="refsect1">
<a name="gstreamer-libs-GstFlowCombiner.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gst-flow-combiner-new"></a><h3>gst_flow_combiner_new ()</h3>
<pre class="programlisting"><span class="returnvalue">GstFlowCombiner</span> *
gst_flow_combiner_new (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Creates a new <span class="type">GstFlowCombiner</span>, use <a class="link" href="gstreamer-libs-GstFlowCombiner.html#gst-flow-combiner-free" title="gst_flow_combiner_free ()"><code class="function">gst_flow_combiner_free()</code></a> to free it.</p>
<div class="refsect3">
<a name="id-1.2.4.13.6.2.5"></a><h4>Returns</h4>
<p> A new <span class="type">GstFlowCombiner</span></p>
</div>
<p class="since">Since: 1.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gst-flow-combiner-free"></a><h3>gst_flow_combiner_free ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gst_flow_combiner_free (<em class="parameter"><code><span class="type">GstFlowCombiner</span> *combiner</code></em>);</pre>
<p>Frees a <span class="type">GstFlowCombiner</span> struct and all its internal data.</p>
<div class="refsect3">
<a name="id-1.2.4.13.6.3.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>combiner</p></td>
<td class="parameter_description"><p>the <span class="type">GstFlowCombiner</span> to free</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<p class="since">Since: 1.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gst-flow-combiner-update-flow"></a><h3>gst_flow_combiner_update_flow ()</h3>
<pre class="programlisting"><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#GstFlowReturn"><span class="returnvalue">GstFlowReturn</span></a>
gst_flow_combiner_update_flow (<em class="parameter"><code><span class="type">GstFlowCombiner</span> *combiner</code></em>,
<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#GstFlowReturn"><span class="type">GstFlowReturn</span></a> fret</code></em>);</pre>
<p>Computes the combined flow return for the pads in it.</p>
<p>The <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#GstFlowReturn"><span class="type">GstFlowReturn</span></a> parameter should be the last flow return update for a pad
in this <span class="type">GstFlowCombiner</span>. It will use this value to be able to shortcut some
combinations and avoid looking over all pads again. e.g. The last combined
return is the same as the latest obtained <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#GstFlowReturn"><span class="type">GstFlowReturn</span></a>.</p>
<div class="refsect3">
<a name="id-1.2.4.13.6.4.6"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>combiner</p></td>
<td class="parameter_description"><p>the <span class="type">GstFlowCombiner</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>fret</p></td>
<td class="parameter_description"><p>the latest <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#GstFlowReturn"><span class="type">GstFlowReturn</span></a> received for a pad in this <span class="type">GstFlowCombiner</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.4.13.6.4.7"></a><h4>Returns</h4>
<p> The combined <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html#GstFlowReturn"><span class="type">GstFlowReturn</span></a></p>
</div>
<p class="since">Since: 1.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gst-flow-combiner-add-pad"></a><h3>gst_flow_combiner_add_pad ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gst_flow_combiner_add_pad (<em class="parameter"><code><span class="type">GstFlowCombiner</span> *combiner</code></em>,
<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html"><span class="type">GstPad</span></a> *pad</code></em>);</pre>
<p>Adds a new <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html"><span class="type">GstPad</span></a> to the <span class="type">GstFlowCombiner</span>.</p>
<div class="refsect3">
<a name="id-1.2.4.13.6.5.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>combiner</p></td>
<td class="parameter_description"><p>the <span class="type">GstFlowCombiner</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>pad</p></td>
<td class="parameter_description"><p> the <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html"><span class="type">GstPad</span></a> that is being added. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: 1.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gst-flow-combiner-remove-pad"></a><h3>gst_flow_combiner_remove_pad ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gst_flow_combiner_remove_pad (<em class="parameter"><code><span class="type">GstFlowCombiner</span> *combiner</code></em>,
<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html"><span class="type">GstPad</span></a> *pad</code></em>);</pre>
<p>Removes a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html"><span class="type">GstPad</span></a> from the <span class="type">GstFlowCombiner</span>.</p>
<div class="refsect3">
<a name="id-1.2.4.13.6.6.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>combiner</p></td>
<td class="parameter_description"><p>the <span class="type">GstFlowCombiner</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>pad</p></td>
<td class="parameter_description"><p> the <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPad.html"><span class="type">GstPad</span></a> to remove. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: 1.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gst-flow-combiner-clear"></a><h3>gst_flow_combiner_clear ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gst_flow_combiner_clear (<em class="parameter"><code><span class="type">GstFlowCombiner</span> *combiner</code></em>);</pre>
<p>Removes all pads from a <span class="type">GstFlowCombiner</span> and resets it to its initial state.</p>
<div class="refsect3">
<a name="id-1.2.4.13.6.7.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>combiner</p></td>
<td class="parameter_description"><p>the <span class="type">GstFlowCombiner</span> to clear</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<p class="since">Since: 1.6</p>
</div>
</div>
<div class="refsect1">
<a name="gstreamer-libs-GstFlowCombiner.other_details"></a><h2>Types and Values</h2>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.24</div>
</body>
</html>