34
31
<p>appsink — Easy way for applications to extract samples from a
37
<td valign="top" align="right"></td>
34
<td class="gallery_image" valign="top" align="right"></td>
38
35
</tr></table></div>
39
<div class="refsynopsisdiv">
40
<a name="gst-plugins-base-libs-appsink.synopsis"></a><h2>Synopsis</h2>
41
<pre class="synopsis">
42
#include <gst/app/gstappsink.h>
44
<span class="returnvalue">void</span> <a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-set-caps" title="gst_app_sink_set_caps ()">gst_app_sink_set_caps</a> (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a> *appsink</code></em>,
45
<em class="parameter"><code>const <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstCaps.html#GstCaps"><span class="type">GstCaps</span></a> *caps</code></em>);
46
<a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstCaps.html#GstCaps"><span class="returnvalue">GstCaps</span></a> * <a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-get-caps" title="gst_app_sink_get_caps ()">gst_app_sink_get_caps</a> (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a> *appsink</code></em>);
47
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-is-eos" title="gst_app_sink_is_eos ()">gst_app_sink_is_eos</a> (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a> *appsink</code></em>);
48
<span class="returnvalue">void</span> <a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-set-emit-signals" title="gst_app_sink_set_emit_signals ()">gst_app_sink_set_emit_signals</a> (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a> *appsink</code></em>,
49
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> emit</code></em>);
50
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-get-emit-signals" title="gst_app_sink_get_emit_signals ()">gst_app_sink_get_emit_signals</a> (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a> *appsink</code></em>);
51
<span class="returnvalue">void</span> <a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-set-max-buffers" title="gst_app_sink_set_max_buffers ()">gst_app_sink_set_max_buffers</a> (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a> *appsink</code></em>,
52
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> max</code></em>);
53
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> <a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-get-max-buffers" title="gst_app_sink_get_max_buffers ()">gst_app_sink_get_max_buffers</a> (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a> *appsink</code></em>);
54
<span class="returnvalue">void</span> <a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-set-drop" title="gst_app_sink_set_drop ()">gst_app_sink_set_drop</a> (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a> *appsink</code></em>,
55
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> drop</code></em>);
56
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-get-drop" title="gst_app_sink_get_drop ()">gst_app_sink_get_drop</a> (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a> *appsink</code></em>);
57
<a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstSample.html#GstSample"><span class="returnvalue">GstSample</span></a> * <a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-pull-preroll" title="gst_app_sink_pull_preroll ()">gst_app_sink_pull_preroll</a> (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a> *appsink</code></em>);
58
<a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstSample.html#GstSample"><span class="returnvalue">GstSample</span></a> * <a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-pull-sample" title="gst_app_sink_pull_sample ()">gst_app_sink_pull_sample</a> (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a> *appsink</code></em>);
59
<a class="link" href="gst-plugins-base-libs-appsink.html#GstAppSinkCallbacks" title="GstAppSinkCallbacks">GstAppSinkCallbacks</a>;
60
<span class="returnvalue">void</span> <a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-set-callbacks" title="gst_app_sink_set_callbacks ()">gst_app_sink_set_callbacks</a> (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a> *appsink</code></em>,
61
<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-appsink.html#GstAppSinkCallbacks" title="GstAppSinkCallbacks"><span class="type">GstAppSinkCallbacks</span></a> *callbacks</code></em>,
62
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>,
63
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> notify</code></em>);
36
<div class="refsect1">
37
<a name="gst-plugins-base-libs-appsink.functions"></a><h2>Functions</h2>
38
<div class="informaltable"><table width="100%" border="0">
40
<col width="150px" class="functions_return">
41
<col class="functions_name">
45
<td class="function_type">
46
<span class="returnvalue">void</span>
48
<td class="function_name">
49
<a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-set-caps" title="gst_app_sink_set_caps ()">gst_app_sink_set_caps</a> <span class="c_punctuation">()</span>
53
<td class="function_type">
54
<a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstCaps.html#GstCaps"><span class="returnvalue">GstCaps</span></a> *
56
<td class="function_name">
57
<a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-get-caps" title="gst_app_sink_get_caps ()">gst_app_sink_get_caps</a> <span class="c_punctuation">()</span>
61
<td class="function_type">
62
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
64
<td class="function_name">
65
<a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-is-eos" title="gst_app_sink_is_eos ()">gst_app_sink_is_eos</a> <span class="c_punctuation">()</span>
69
<td class="function_type">
70
<span class="returnvalue">void</span>
72
<td class="function_name">
73
<a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-set-emit-signals" title="gst_app_sink_set_emit_signals ()">gst_app_sink_set_emit_signals</a> <span class="c_punctuation">()</span>
77
<td class="function_type">
78
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
80
<td class="function_name">
81
<a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-get-emit-signals" title="gst_app_sink_get_emit_signals ()">gst_app_sink_get_emit_signals</a> <span class="c_punctuation">()</span>
85
<td class="function_type">
86
<span class="returnvalue">void</span>
88
<td class="function_name">
89
<a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-set-max-buffers" title="gst_app_sink_set_max_buffers ()">gst_app_sink_set_max_buffers</a> <span class="c_punctuation">()</span>
93
<td class="function_type">
94
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>
96
<td class="function_name">
97
<a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-get-max-buffers" title="gst_app_sink_get_max_buffers ()">gst_app_sink_get_max_buffers</a> <span class="c_punctuation">()</span>
101
<td class="function_type">
102
<span class="returnvalue">void</span>
104
<td class="function_name">
105
<a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-set-drop" title="gst_app_sink_set_drop ()">gst_app_sink_set_drop</a> <span class="c_punctuation">()</span>
109
<td class="function_type">
110
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
112
<td class="function_name">
113
<a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-get-drop" title="gst_app_sink_get_drop ()">gst_app_sink_get_drop</a> <span class="c_punctuation">()</span>
117
<td class="function_type">
118
<a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstSample.html#GstSample"><span class="returnvalue">GstSample</span></a> *
120
<td class="function_name">
121
<a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-pull-preroll" title="gst_app_sink_pull_preroll ()">gst_app_sink_pull_preroll</a> <span class="c_punctuation">()</span>
125
<td class="function_type">
126
<a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstSample.html#GstSample"><span class="returnvalue">GstSample</span></a> *
128
<td class="function_name">
129
<a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-pull-sample" title="gst_app_sink_pull_sample ()">gst_app_sink_pull_sample</a> <span class="c_punctuation">()</span>
133
<td class="function_type">
134
<span class="returnvalue">void</span>
136
<td class="function_name">
137
<a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-set-callbacks" title="gst_app_sink_set_callbacks ()">gst_app_sink_set_callbacks</a> <span class="c_punctuation">()</span>
143
<div class="refsect1">
144
<a name="gst-plugins-base-libs-appsink.other"></a><h2>Types and Values</h2>
145
<div class="informaltable"><table width="100%" border="0">
147
<col width="150px" class="name">
148
<col class="description">
151
<td class="datatype_keyword"> </td>
152
<td class="function_name"><a class="link" href="gst-plugins-base-libs-appsink.html#GstAppSinkCallbacks" title="GstAppSinkCallbacks">GstAppSinkCallbacks</a></td>
156
<div class="refsect1">
157
<a name="gst-plugins-base-libs-appsink.object-hierarchy"></a><h2>Object Hierarchy</h2>
161
<div class="refsect1">
162
<a name="gst-plugins-base-libs-appsink.includes"></a><h2>Includes</h2>
163
<pre class="synopsis">#include <gst/app/gstappsink.h>
66
166
<div class="refsect1">
67
167
<a name="gst-plugins-base-libs-appsink.description"></a><h2>Description</h2>
69
Appsink is a sink plugin that supports many different methods for making
168
<p>Appsink is a sink plugin that supports many different methods for making
70
169
the application get a handle on the GStreamer data in a pipeline. Unlike
71
most GStreamer elements, Appsink provides external API functions.
74
appsink can be used by linking to the gstappsink.h header file to access the
75
methods or by using the appsink action signals and properties.
78
The normal way of retrieving samples from appsink is by using the
79
<a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-pull-sample" title="gst_app_sink_pull_sample ()"><code class="function">gst_app_sink_pull_sample()</code></a> and <a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-pull-preroll" title="gst_app_sink_pull_preroll ()"><code class="function">gst_app_sink_pull_preroll()</code></a> methods.
170
most GStreamer elements, Appsink provides external API functions.</p>
171
<p>appsink can be used by linking to the gstappsink.h header file to access the
172
methods or by using the appsink action signals and properties.</p>
173
<p>The normal way of retrieving samples from appsink is by using the
174
<a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-pull-sample" title="gst_app_sink_pull_sample ()"><code class="function">gst_app_sink_pull_sample()</code></a> and <a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-pull-preroll" title="gst_app_sink_pull_preroll ()"><code class="function">gst_app_sink_pull_preroll()</code></a> methods.
80
175
These methods block until a sample becomes available in the sink or when the
81
sink is shut down or reaches EOS.
84
Appsink will internally use a queue to collect buffers from the streaming
176
sink is shut down or reaches EOS.</p>
177
<p>Appsink will internally use a queue to collect buffers from the streaming
85
178
thread. If the application is not pulling samples fast enough, this queue
86
179
will consume a lot of memory over time. The "max-buffers" property can be
87
180
used to limit the queue size. The "drop" property controls whether the
88
181
streaming thread blocks or if older buffers are dropped when the maximum
89
182
queue size is reached. Note that blocking the streaming thread can negatively
90
affect real-time performance and should be avoided.
93
If a blocking behaviour is not desirable, setting the "emit-signals" property
183
affect real-time performance and should be avoided.</p>
184
<p>If a blocking behaviour is not desirable, setting the "emit-signals" property
94
185
to <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> will make appsink emit the "new-sample" and "new-preroll" signals
95
when a sample can be pulled without blocking.
98
The "caps" property on appsink can be used to control the formats that
186
when a sample can be pulled without blocking.</p>
187
<p>The "caps" property on appsink can be used to control the formats that
99
188
appsink can receive. This property can contain non-fixed caps, the format of
100
the pulled samples can be obtained by getting the sample caps.
103
If one of the pull-preroll or pull-sample methods return <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, the appsink
189
the pulled samples can be obtained by getting the sample caps.</p>
190
<p>If one of the pull-preroll or pull-sample methods return <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, the appsink
104
191
is stopped or in the EOS state. You can check for the EOS state with the
105
"eos" property or with the <a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-is-eos" title="gst_app_sink_is_eos ()"><code class="function">gst_app_sink_is_eos()</code></a> method.
108
The eos signal can also be used to be informed when the EOS state is reached
112
Last reviewed on 2008-12-17 (0.10.22)
192
"eos" property or with the <a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-is-eos" title="gst_app_sink_is_eos ()"><code class="function">gst_app_sink_is_eos()</code></a> method.</p>
193
<p>The eos signal can also be used to be informed when the EOS state is reached
194
to avoid polling.</p>
195
<p>Last reviewed on 2008-12-17 (0.10.22)</p>
115
197
<div class="refsect1">
116
<a name="gst-plugins-base-libs-appsink.details"></a><h2>Details</h2>
198
<a name="gst-plugins-base-libs-appsink.functions_details"></a><h2>Functions</h2>
117
199
<div class="refsect2">
118
<a name="gst-app-sink-set-caps"></a><h3>gst_app_sink_set_caps ()</h3>
119
<pre class="programlisting"><span class="returnvalue">void</span> gst_app_sink_set_caps (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a> *appsink</code></em>,
120
<em class="parameter"><code>const <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstCaps.html#GstCaps"><span class="type">GstCaps</span></a> *caps</code></em>);</pre>
122
Set the capabilities on the appsink element. This function takes
200
<a name="gst-app-sink-set-caps"></a><h3>gst_app_sink_set_caps ()</h3>
201
<pre class="programlisting"><span class="returnvalue">void</span>
202
gst_app_sink_set_caps (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a> *appsink</code></em>,
203
<em class="parameter"><code>const <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstCaps.html#GstCaps"><span class="type">GstCaps</span></a> *caps</code></em>);</pre>
204
<p>Set the capabilities on the appsink element. This function takes
123
205
a copy of the caps structure. After calling this method, the sink will only
124
accept caps that match <em class="parameter"><code>caps</code></em>. If <em class="parameter"><code>caps</code></em> is non-fixed, you must check the caps
125
on the buffers to get the actual used caps.
127
<div class="variablelist"><table border="0" class="variablelist">
129
<col align="left" valign="top">
134
<td><p><span class="term"><em class="parameter"><code>appsink</code></em> :</span></p></td>
135
<td>a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a>
139
<td><p><span class="term"><em class="parameter"><code>caps</code></em> :</span></p></td>
146
<div class="refsect2">
147
<a name="gst-app-sink-get-caps"></a><h3>gst_app_sink_get_caps ()</h3>
148
<pre class="programlisting"><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstCaps.html#GstCaps"><span class="returnvalue">GstCaps</span></a> * gst_app_sink_get_caps (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a> *appsink</code></em>);</pre>
150
Get the configured caps on <em class="parameter"><code>appsink</code></em>.
152
<div class="variablelist"><table border="0" class="variablelist">
154
<col align="left" valign="top">
159
<td><p><span class="term"><em class="parameter"><code>appsink</code></em> :</span></p></td>
160
<td>a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a>
164
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
165
<td>the <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstCaps.html#GstCaps"><span class="type">GstCaps</span></a> accepted by the sink. <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstCaps.html#gst-caps-unref"><code class="function">gst_caps_unref()</code></a> after usage.</td>
171
<div class="refsect2">
172
<a name="gst-app-sink-is-eos"></a><h3>gst_app_sink_is_eos ()</h3>
173
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gst_app_sink_is_eos (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a> *appsink</code></em>);</pre>
175
Check if <em class="parameter"><code>appsink</code></em> is EOS, which is when no more samples can be pulled because
176
an EOS event was received.
179
This function also returns <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> when the appsink is not in the PAUSED or
182
<div class="variablelist"><table border="0" class="variablelist">
184
<col align="left" valign="top">
189
<td><p><span class="term"><em class="parameter"><code>appsink</code></em> :</span></p></td>
190
<td>a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a>
194
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
196
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if no more samples can be pulled and the appsink is EOS.</td>
202
<div class="refsect2">
203
<a name="gst-app-sink-set-emit-signals"></a><h3>gst_app_sink_set_emit_signals ()</h3>
204
<pre class="programlisting"><span class="returnvalue">void</span> gst_app_sink_set_emit_signals (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a> *appsink</code></em>,
205
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> emit</code></em>);</pre>
207
Make appsink emit the "new-preroll" and "new-sample" signals. This option is
206
accept caps that match <em class="parameter"><code>caps</code></em>
207
. If <em class="parameter"><code>caps</code></em>
208
is non-fixed, you must check the caps
209
on the buffers to get the actual used caps.</p>
210
<div class="refsect3">
211
<a name="id-1.2.5.5.8.2.5"></a><h4>Parameters</h4>
212
<div class="informaltable"><table width="100%" border="0">
214
<col width="150px" class="parameters_name">
215
<col class="parameters_description">
216
<col width="200px" class="parameters_annotations">
220
<td class="parameter_name"><p>appsink</p></td>
221
<td class="parameter_description"><p>a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a></p></td>
222
<td class="parameter_annotations"> </td>
225
<td class="parameter_name"><p>caps</p></td>
226
<td class="parameter_description"><p>caps to set</p></td>
227
<td class="parameter_annotations"> </td>
234
<div class="refsect2">
235
<a name="gst-app-sink-get-caps"></a><h3>gst_app_sink_get_caps ()</h3>
236
<pre class="programlisting"><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstCaps.html#GstCaps"><span class="returnvalue">GstCaps</span></a> *
237
gst_app_sink_get_caps (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a> *appsink</code></em>);</pre>
238
<p>Get the configured caps on <em class="parameter"><code>appsink</code></em>
240
<div class="refsect3">
241
<a name="id-1.2.5.5.8.3.5"></a><h4>Parameters</h4>
242
<div class="informaltable"><table width="100%" border="0">
244
<col width="150px" class="parameters_name">
245
<col class="parameters_description">
246
<col width="200px" class="parameters_annotations">
249
<td class="parameter_name"><p>appsink</p></td>
250
<td class="parameter_description"><p>a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a></p></td>
251
<td class="parameter_annotations"> </td>
255
<div class="refsect3">
256
<a name="id-1.2.5.5.8.3.6"></a><h4>Returns</h4>
257
<p> the <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstCaps.html#GstCaps"><span class="type">GstCaps</span></a> accepted by the sink. <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstCaps.html#gst-caps-unref"><code class="function">gst_caps_unref()</code></a> after usage.</p>
262
<div class="refsect2">
263
<a name="gst-app-sink-is-eos"></a><h3>gst_app_sink_is_eos ()</h3>
264
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
265
gst_app_sink_is_eos (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a> *appsink</code></em>);</pre>
266
<p>Check if <em class="parameter"><code>appsink</code></em>
267
is EOS, which is when no more samples can be pulled because
268
an EOS event was received.</p>
269
<p>This function also returns <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> when the appsink is not in the PAUSED or
271
<div class="refsect3">
272
<a name="id-1.2.5.5.8.4.6"></a><h4>Parameters</h4>
273
<div class="informaltable"><table width="100%" border="0">
275
<col width="150px" class="parameters_name">
276
<col class="parameters_description">
277
<col width="200px" class="parameters_annotations">
280
<td class="parameter_name"><p>appsink</p></td>
281
<td class="parameter_description"><p>a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a></p></td>
282
<td class="parameter_annotations"> </td>
286
<div class="refsect3">
287
<a name="id-1.2.5.5.8.4.7"></a><h4>Returns</h4>
288
<p> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if no more samples can be pulled and the appsink is EOS.</p>
293
<div class="refsect2">
294
<a name="gst-app-sink-set-emit-signals"></a><h3>gst_app_sink_set_emit_signals ()</h3>
295
<pre class="programlisting"><span class="returnvalue">void</span>
296
gst_app_sink_set_emit_signals (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a> *appsink</code></em>,
297
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> emit</code></em>);</pre>
298
<p>Make appsink emit the "new-preroll" and "new-sample" signals. This option is
208
299
by default disabled because signal emission is expensive and unneeded when
209
the application prefers to operate in pull mode.
211
<div class="variablelist"><table border="0" class="variablelist">
213
<col align="left" valign="top">
218
<td><p><span class="term"><em class="parameter"><code>appsink</code></em> :</span></p></td>
219
<td>a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a>
223
<td><p><span class="term"><em class="parameter"><code>emit</code></em> :</span></p></td>
224
<td>the new state</td>
230
<div class="refsect2">
231
<a name="gst-app-sink-get-emit-signals"></a><h3>gst_app_sink_get_emit_signals ()</h3>
232
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gst_app_sink_get_emit_signals (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a> *appsink</code></em>);</pre>
234
Check if appsink will emit the "new-preroll" and "new-sample" signals.
236
<div class="variablelist"><table border="0" class="variablelist">
238
<col align="left" valign="top">
243
<td><p><span class="term"><em class="parameter"><code>appsink</code></em> :</span></p></td>
244
<td>a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a>
248
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
250
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>appsink</code></em> is emiting the "new-preroll" and "new-sample"
257
<div class="refsect2">
258
<a name="gst-app-sink-set-max-buffers"></a><h3>gst_app_sink_set_max_buffers ()</h3>
259
<pre class="programlisting"><span class="returnvalue">void</span> gst_app_sink_set_max_buffers (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a> *appsink</code></em>,
260
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> max</code></em>);</pre>
262
Set the maximum amount of buffers that can be queued in <em class="parameter"><code>appsink</code></em>. After this
300
the application prefers to operate in pull mode.</p>
301
<div class="refsect3">
302
<a name="id-1.2.5.5.8.5.5"></a><h4>Parameters</h4>
303
<div class="informaltable"><table width="100%" border="0">
305
<col width="150px" class="parameters_name">
306
<col class="parameters_description">
307
<col width="200px" class="parameters_annotations">
311
<td class="parameter_name"><p>appsink</p></td>
312
<td class="parameter_description"><p>a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a></p></td>
313
<td class="parameter_annotations"> </td>
316
<td class="parameter_name"><p>emit</p></td>
317
<td class="parameter_description"><p>the new state</p></td>
318
<td class="parameter_annotations"> </td>
325
<div class="refsect2">
326
<a name="gst-app-sink-get-emit-signals"></a><h3>gst_app_sink_get_emit_signals ()</h3>
327
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
328
gst_app_sink_get_emit_signals (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a> *appsink</code></em>);</pre>
329
<p>Check if appsink will emit the "new-preroll" and "new-sample" signals.</p>
330
<div class="refsect3">
331
<a name="id-1.2.5.5.8.6.5"></a><h4>Parameters</h4>
332
<div class="informaltable"><table width="100%" border="0">
334
<col width="150px" class="parameters_name">
335
<col class="parameters_description">
336
<col width="200px" class="parameters_annotations">
339
<td class="parameter_name"><p>appsink</p></td>
340
<td class="parameter_description"><p>a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a></p></td>
341
<td class="parameter_annotations"> </td>
345
<div class="refsect3">
346
<a name="id-1.2.5.5.8.6.6"></a><h4>Returns</h4>
347
<p> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>appsink</code></em>
348
is emiting the "new-preroll" and "new-sample"
354
<div class="refsect2">
355
<a name="gst-app-sink-set-max-buffers"></a><h3>gst_app_sink_set_max_buffers ()</h3>
356
<pre class="programlisting"><span class="returnvalue">void</span>
357
gst_app_sink_set_max_buffers (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a> *appsink</code></em>,
358
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> max</code></em>);</pre>
359
<p>Set the maximum amount of buffers that can be queued in <em class="parameter"><code>appsink</code></em>
263
361
amount of buffers are queued in appsink, any more buffers will block upstream
264
elements until a sample is pulled from <em class="parameter"><code>appsink</code></em>.
266
<div class="variablelist"><table border="0" class="variablelist">
268
<col align="left" valign="top">
273
<td><p><span class="term"><em class="parameter"><code>appsink</code></em> :</span></p></td>
274
<td>a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a>
278
<td><p><span class="term"><em class="parameter"><code>max</code></em> :</span></p></td>
279
<td>the maximum number of buffers to queue</td>
285
<div class="refsect2">
286
<a name="gst-app-sink-get-max-buffers"></a><h3>gst_app_sink_get_max_buffers ()</h3>
287
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> gst_app_sink_get_max_buffers (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a> *appsink</code></em>);</pre>
289
Get the maximum amount of buffers that can be queued in <em class="parameter"><code>appsink</code></em>.
291
<div class="variablelist"><table border="0" class="variablelist">
293
<col align="left" valign="top">
298
<td><p><span class="term"><em class="parameter"><code>appsink</code></em> :</span></p></td>
299
<td>a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a>
303
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
304
<td>The maximum amount of buffers that can be queued.</td>
310
<div class="refsect2">
311
<a name="gst-app-sink-set-drop"></a><h3>gst_app_sink_set_drop ()</h3>
312
<pre class="programlisting"><span class="returnvalue">void</span> gst_app_sink_set_drop (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a> *appsink</code></em>,
313
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> drop</code></em>);</pre>
315
Instruct <em class="parameter"><code>appsink</code></em> to drop old buffers when the maximum amount of queued
318
<div class="variablelist"><table border="0" class="variablelist">
320
<col align="left" valign="top">
325
<td><p><span class="term"><em class="parameter"><code>appsink</code></em> :</span></p></td>
326
<td>a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a>
330
<td><p><span class="term"><em class="parameter"><code>drop</code></em> :</span></p></td>
331
<td>the new state</td>
337
<div class="refsect2">
338
<a name="gst-app-sink-get-drop"></a><h3>gst_app_sink_get_drop ()</h3>
339
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gst_app_sink_get_drop (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a> *appsink</code></em>);</pre>
341
Check if <em class="parameter"><code>appsink</code></em> will drop old buffers when the maximum amount of queued
344
<div class="variablelist"><table border="0" class="variablelist">
346
<col align="left" valign="top">
351
<td><p><span class="term"><em class="parameter"><code>appsink</code></em> :</span></p></td>
352
<td>a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a>
356
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
358
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>appsink</code></em> is dropping old buffers when the queue is
365
<div class="refsect2">
366
<a name="gst-app-sink-pull-preroll"></a><h3>gst_app_sink_pull_preroll ()</h3>
367
<pre class="programlisting"><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstSample.html#GstSample"><span class="returnvalue">GstSample</span></a> * gst_app_sink_pull_preroll (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a> *appsink</code></em>);</pre>
369
Get the last preroll sample in <em class="parameter"><code>appsink</code></em>. This was the sample that caused the
362
elements until a sample is pulled from <em class="parameter"><code>appsink</code></em>
364
<div class="refsect3">
365
<a name="id-1.2.5.5.8.7.5"></a><h4>Parameters</h4>
366
<div class="informaltable"><table width="100%" border="0">
368
<col width="150px" class="parameters_name">
369
<col class="parameters_description">
370
<col width="200px" class="parameters_annotations">
374
<td class="parameter_name"><p>appsink</p></td>
375
<td class="parameter_description"><p>a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a></p></td>
376
<td class="parameter_annotations"> </td>
379
<td class="parameter_name"><p>max</p></td>
380
<td class="parameter_description"><p>the maximum number of buffers to queue</p></td>
381
<td class="parameter_annotations"> </td>
388
<div class="refsect2">
389
<a name="gst-app-sink-get-max-buffers"></a><h3>gst_app_sink_get_max_buffers ()</h3>
390
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>
391
gst_app_sink_get_max_buffers (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a> *appsink</code></em>);</pre>
392
<p>Get the maximum amount of buffers that can be queued in <em class="parameter"><code>appsink</code></em>
394
<div class="refsect3">
395
<a name="id-1.2.5.5.8.8.5"></a><h4>Parameters</h4>
396
<div class="informaltable"><table width="100%" border="0">
398
<col width="150px" class="parameters_name">
399
<col class="parameters_description">
400
<col width="200px" class="parameters_annotations">
403
<td class="parameter_name"><p>appsink</p></td>
404
<td class="parameter_description"><p>a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a></p></td>
405
<td class="parameter_annotations"> </td>
409
<div class="refsect3">
410
<a name="id-1.2.5.5.8.8.6"></a><h4>Returns</h4>
411
<p> The maximum amount of buffers that can be queued.</p>
416
<div class="refsect2">
417
<a name="gst-app-sink-set-drop"></a><h3>gst_app_sink_set_drop ()</h3>
418
<pre class="programlisting"><span class="returnvalue">void</span>
419
gst_app_sink_set_drop (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a> *appsink</code></em>,
420
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> drop</code></em>);</pre>
421
<p>Instruct <em class="parameter"><code>appsink</code></em>
422
to drop old buffers when the maximum amount of queued
423
buffers is reached.</p>
424
<div class="refsect3">
425
<a name="id-1.2.5.5.8.9.5"></a><h4>Parameters</h4>
426
<div class="informaltable"><table width="100%" border="0">
428
<col width="150px" class="parameters_name">
429
<col class="parameters_description">
430
<col width="200px" class="parameters_annotations">
434
<td class="parameter_name"><p>appsink</p></td>
435
<td class="parameter_description"><p>a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a></p></td>
436
<td class="parameter_annotations"> </td>
439
<td class="parameter_name"><p>drop</p></td>
440
<td class="parameter_description"><p>the new state</p></td>
441
<td class="parameter_annotations"> </td>
448
<div class="refsect2">
449
<a name="gst-app-sink-get-drop"></a><h3>gst_app_sink_get_drop ()</h3>
450
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
451
gst_app_sink_get_drop (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a> *appsink</code></em>);</pre>
452
<p>Check if <em class="parameter"><code>appsink</code></em>
453
will drop old buffers when the maximum amount of queued
454
buffers is reached.</p>
455
<div class="refsect3">
456
<a name="id-1.2.5.5.8.10.5"></a><h4>Parameters</h4>
457
<div class="informaltable"><table width="100%" border="0">
459
<col width="150px" class="parameters_name">
460
<col class="parameters_description">
461
<col width="200px" class="parameters_annotations">
464
<td class="parameter_name"><p>appsink</p></td>
465
<td class="parameter_description"><p>a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a></p></td>
466
<td class="parameter_annotations"> </td>
470
<div class="refsect3">
471
<a name="id-1.2.5.5.8.10.6"></a><h4>Returns</h4>
472
<p> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>appsink</code></em>
473
is dropping old buffers when the queue is
479
<div class="refsect2">
480
<a name="gst-app-sink-pull-preroll"></a><h3>gst_app_sink_pull_preroll ()</h3>
481
<pre class="programlisting"><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstSample.html#GstSample"><span class="returnvalue">GstSample</span></a> *
482
gst_app_sink_pull_preroll (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a> *appsink</code></em>);</pre>
483
<p>Get the last preroll sample in <em class="parameter"><code>appsink</code></em>
484
. This was the sample that caused the
370
485
appsink to preroll in the PAUSED state. This sample can be pulled many times
371
and remains available to the application even after EOS.
374
This function is typically used when dealing with a pipeline in the PAUSED
486
and remains available to the application even after EOS.</p>
487
<p>This function is typically used when dealing with a pipeline in the PAUSED
375
488
state. Calling this function after doing a seek will give the sample right
376
after the seek position.
379
Note that the preroll sample will also be returned as the first sample
380
when calling <a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-pull-sample" title="gst_app_sink_pull_sample ()"><code class="function">gst_app_sink_pull_sample()</code></a>.
383
If an EOS event was received before any buffers, this function returns
384
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. Use <a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-is-eos" title="gst_app_sink_is_eos ()"><code class="function">gst_app_sink_is_eos()</code></a> to check for the EOS condition.
387
This function blocks until a preroll sample or EOS is received or the appsink
388
element is set to the READY/NULL state.
390
<div class="variablelist"><table border="0" class="variablelist">
489
after the seek position.</p>
490
<p>Note that the preroll sample will also be returned as the first sample
491
when calling <a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-pull-sample" title="gst_app_sink_pull_sample ()"><code class="function">gst_app_sink_pull_sample()</code></a>.</p>
492
<p>If an EOS event was received before any buffers, this function returns
493
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. Use <a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-is-eos" title="gst_app_sink_is_eos ()"><code class="function">gst_app_sink_is_eos()</code></a> to check for the EOS condition.</p>
494
<p>This function blocks until a preroll sample or EOS is received or the appsink
495
element is set to the READY/NULL state.</p>
496
<div class="refsect3">
497
<a name="id-1.2.5.5.8.11.9"></a><h4>Parameters</h4>
498
<div class="informaltable"><table width="100%" border="0">
392
<col align="left" valign="top">
500
<col width="150px" class="parameters_name">
501
<col class="parameters_description">
502
<col width="200px" class="parameters_annotations">
397
<td><p><span class="term"><em class="parameter"><code>appsink</code></em> :</span></p></td>
398
<td>a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a>
402
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
403
<td>a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstBuffer.html#GstBuffer"><span class="type">GstBuffer</span></a> or NULL when the appsink is stopped or EOS.</td>
505
<td class="parameter_name"><p>appsink</p></td>
506
<td class="parameter_description"><p>a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a></p></td>
507
<td class="parameter_annotations"> </td>
511
<div class="refsect3">
512
<a name="id-1.2.5.5.8.11.10"></a><h4>Returns</h4>
513
<p> a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstBuffer.html#GstBuffer"><span class="type">GstBuffer</span></a> or NULL when the appsink is stopped or EOS.</p>
409
518
<div class="refsect2">
410
<a name="gst-app-sink-pull-sample"></a><h3>gst_app_sink_pull_sample ()</h3>
411
<pre class="programlisting"><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstSample.html#GstSample"><span class="returnvalue">GstSample</span></a> * gst_app_sink_pull_sample (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a> *appsink</code></em>);</pre>
413
This function blocks until a sample or EOS becomes available or the appsink
414
element is set to the READY/NULL state.
417
This function will only return samples when the appsink is in the PLAYING
519
<a name="gst-app-sink-pull-sample"></a><h3>gst_app_sink_pull_sample ()</h3>
520
<pre class="programlisting"><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstSample.html#GstSample"><span class="returnvalue">GstSample</span></a> *
521
gst_app_sink_pull_sample (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a> *appsink</code></em>);</pre>
522
<p>This function blocks until a sample or EOS becomes available or the appsink
523
element is set to the READY/NULL state.</p>
524
<p>This function will only return samples when the appsink is in the PLAYING
418
525
state. All rendered buffers will be put in a queue so that the application
419
526
can pull samples at its own rate. Note that when the application does not
420
527
pull samples fast enough, the queued buffers could consume a lot of memory,
421
especially when dealing with raw video frames.
424
If an EOS event was received before any buffers, this function returns
425
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. Use <a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-is-eos" title="gst_app_sink_is_eos ()"><code class="function">gst_app_sink_is_eos()</code></a> to check for the EOS condition.
427
<div class="variablelist"><table border="0" class="variablelist">
429
<col align="left" valign="top">
528
especially when dealing with raw video frames.</p>
529
<p>If an EOS event was received before any buffers, this function returns
530
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. Use <a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-is-eos" title="gst_app_sink_is_eos ()"><code class="function">gst_app_sink_is_eos()</code></a> to check for the EOS condition.</p>
531
<div class="refsect3">
532
<a name="id-1.2.5.5.8.12.7"></a><h4>Parameters</h4>
533
<div class="informaltable"><table width="100%" border="0">
535
<col width="150px" class="parameters_name">
536
<col class="parameters_description">
537
<col width="200px" class="parameters_annotations">
540
<td class="parameter_name"><p>appsink</p></td>
541
<td class="parameter_description"><p>a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a></p></td>
542
<td class="parameter_annotations"> </td>
546
<div class="refsect3">
547
<a name="id-1.2.5.5.8.12.8"></a><h4>Returns</h4>
548
<p> a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstBuffer.html#GstBuffer"><span class="type">GstBuffer</span></a> or NULL when the appsink is stopped or EOS.</p>
553
<div class="refsect2">
554
<a name="gst-app-sink-set-callbacks"></a><h3>gst_app_sink_set_callbacks ()</h3>
555
<pre class="programlisting"><span class="returnvalue">void</span>
556
gst_app_sink_set_callbacks (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a> *appsink</code></em>,
557
<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-appsink.html#GstAppSinkCallbacks" title="GstAppSinkCallbacks"><span class="type">GstAppSinkCallbacks</span></a> *callbacks</code></em>,
558
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>,
559
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> notify</code></em>);</pre>
560
<p>Set callbacks which will be executed for each new preroll, new sample and eos.
561
This is an alternative to using the signals, it has lower overhead and is thus
562
less expensive, but also less flexible.</p>
563
<p>If callbacks are installed, no signals will be emitted for performance
565
<div class="refsect3">
566
<a name="id-1.2.5.5.8.13.6"></a><h4>Parameters</h4>
567
<div class="informaltable"><table width="100%" border="0">
569
<col width="150px" class="parameters_name">
570
<col class="parameters_description">
571
<col width="200px" class="parameters_annotations">
434
<td><p><span class="term"><em class="parameter"><code>appsink</code></em> :</span></p></td>
435
<td>a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a>
439
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
440
<td>a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstBuffer.html#GstBuffer"><span class="type">GstBuffer</span></a> or NULL when the appsink is stopped or EOS.</td>
575
<td class="parameter_name"><p>appsink</p></td>
576
<td class="parameter_description"><p>a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base/html/gst-plugins-base-plugins-appsink.html#GstAppSink"><span class="type">GstAppSink</span></a></p></td>
577
<td class="parameter_annotations"> </td>
580
<td class="parameter_name"><p>callbacks</p></td>
581
<td class="parameter_description"><p>the callbacks</p></td>
582
<td class="parameter_annotations"> </td>
585
<td class="parameter_name"><p>user_data</p></td>
586
<td class="parameter_description"><p>a user_data argument for the callbacks</p></td>
587
<td class="parameter_annotations"> </td>
590
<td class="parameter_name"><p>notify</p></td>
591
<td class="parameter_description"><p>a destroy notify function</p></td>
592
<td class="parameter_annotations"> </td>
599
<div class="refsect1">
600
<a name="gst-plugins-base-libs-appsink.other_details"></a><h2>Types and Values</h2>
446
601
<div class="refsect2">
447
602
<a name="GstAppSinkCallbacks"></a><h3>GstAppSinkCallbacks</h3>
448
603
<pre class="programlisting">typedef struct {