tizen 2.3 release
[framework/multimedia/gst-plugins-base0.10.git] / docs / libs / html / gst-plugins-base-libs-appsink.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>appsink</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="GStreamer Base Plugins 0.10 Library Reference Manual">
8 <link rel="up" href="gstreamer-app.html" title="App Library">
9 <link rel="prev" href="gst-plugins-base-libs-appsrc.html" title="appsrc">
10 <link rel="next" href="gstreamer-audio.html" title="Audio Library">
11 <meta name="generator" content="GTK-Doc V1.18 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 </head>
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
16 <tr valign="middle">
17 <td><a accesskey="p" href="gst-plugins-base-libs-appsrc.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="gstreamer-app.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20 <th width="100%" align="center">GStreamer Base Plugins 0.10 Library Reference Manual</th>
21 <td><a accesskey="n" href="gstreamer-audio.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
22 </tr>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#gst-plugins-base-libs-appsink.synopsis" class="shortcut">Top</a>
25                    | 
26                   <a href="#gst-plugins-base-libs-appsink.description" class="shortcut">Description</a>
27 </td></tr>
28 </table>
29 <div class="refentry">
30 <a name="gst-plugins-base-libs-appsink"></a><div class="titlepage"></div>
31 <div class="refnamediv"><table width="100%"><tr>
32 <td valign="top">
33 <h2><span class="refentrytitle"><a name="gst-plugins-base-libs-appsink.top_of_page"></a>appsink</span></h2>
34 <p>appsink — Easy way for applications to extract buffers from a
35     pipeline</p>
36 </td>
37 <td valign="top" align="right"></td>
38 </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 &lt;gst/app/gstappsink.h&gt;
43
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-GstBuffer.html#GstBuffer"><span class="returnvalue">GstBuffer</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-GstBuffer.html#GstBuffer"><span class="returnvalue">GstBuffer</span></a> *         <a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-pull-buffer" title="gst_app_sink_pull_buffer ()">gst_app_sink_pull_buffer</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 href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstBufferList.html#GstBufferList"><span class="returnvalue">GstBufferList</span></a> *     <a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-pull-buffer-list" title="gst_app_sink_pull_buffer_list ()">gst_app_sink_pull_buffer_list</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>);
60                     <a class="link" href="gst-plugins-base-libs-appsink.html#GstAppSinkCallbacks" title="GstAppSinkCallbacks">GstAppSinkCallbacks</a>;
61 <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>,
62                                                          <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>,
63                                                          <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>,
64                                                          <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>);
65 </pre>
66 </div>
67 <div class="refsect1">
68 <a name="gst-plugins-base-libs-appsink.description"></a><h2>Description</h2>
69 <p>
70 Appsink is a sink plugin that supports many different methods for making
71 the application get a handle on the GStreamer data in a pipeline. Unlike
72 most GStreamer elements, Appsink provides external API functions.
73 </p>
74 <p>
75 appsink can be used by linking to the gstappsink.h header file to access the
76 methods or by using the appsink action signals and properties.
77 </p>
78 <p>
79 The normal way of retrieving buffers from appsink is by using the
80 <a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-pull-buffer" title="gst_app_sink_pull_buffer ()"><code class="function">gst_app_sink_pull_buffer()</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.
81 These methods block until a buffer becomes available in the sink or when the
82 sink is shut down or reaches EOS.
83 </p>
84 <p>
85 Appsink will internally use a queue to collect buffers from the streaming
86 thread. If the application is not pulling buffers fast enough, this queue
87 will consume a lot of memory over time. The "max-buffers" property can be
88 used to limit the queue size. The "drop" property controls whether the
89 streaming thread blocks or if older buffers are dropped when the maximum
90 queue size is reached. Note that blocking the streaming thread can negatively
91 affect real-time performance and should be avoided.
92 </p>
93 <p>
94 If a blocking behaviour is not desirable, setting the "emit-signals" property
95 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-buffer" and "new-preroll" signals
96 when a buffer can be pulled without blocking.
97 </p>
98 <p>
99 The "caps" property on appsink can be used to control the formats that
100 appsink can receive. This property can contain non-fixed caps, the format of
101 the pulled buffers can be obtained by getting the buffer caps.
102 </p>
103 <p>
104 If one of the pull-preroll or pull-buffer 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
105 is stopped or in the EOS state. You can check for the EOS state with the
106 "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.
107 </p>
108 <p>
109 The eos signal can also be used to be informed when the EOS state is reached
110 to avoid polling.
111 </p>
112 <p>
113 Last reviewed on 2008-12-17 (0.10.22)
114 </p>
115 </div>
116 <div class="refsect1">
117 <a name="gst-plugins-base-libs-appsink.details"></a><h2>Details</h2>
118 <div class="refsect2">
119 <a name="gst-app-sink-set-caps"></a><h3>gst_app_sink_set_caps ()</h3>
120 <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>,
121                                                          <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 <p>
123 Set the capabilities on the appsink element.  This function takes
124 a copy of the caps structure. After calling this method, the sink will only
125 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
126 on the buffers to get the actual used caps.
127 </p>
128 <div class="variablelist"><table border="0">
129 <col align="left" valign="top">
130 <tbody>
131 <tr>
132 <td><p><span class="term"><em class="parameter"><code>appsink</code></em> :</span></p></td>
133 <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>
134 </td>
135 </tr>
136 <tr>
137 <td><p><span class="term"><em class="parameter"><code>caps</code></em> :</span></p></td>
138 <td>caps to set</td>
139 </tr>
140 </tbody>
141 </table></div>
142 <p class="since">Since 0.10.22</p>
143 </div>
144 <hr>
145 <div class="refsect2">
146 <a name="gst-app-sink-get-caps"></a><h3>gst_app_sink_get_caps ()</h3>
147 <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>
148 <p>
149 Get the configured caps on <em class="parameter"><code>appsink</code></em>.
150 </p>
151 <div class="variablelist"><table border="0">
152 <col align="left" valign="top">
153 <tbody>
154 <tr>
155 <td><p><span class="term"><em class="parameter"><code>appsink</code></em> :</span></p></td>
156 <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>
157 </td>
158 </tr>
159 <tr>
160 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
161 <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>
162 </tr>
163 </tbody>
164 </table></div>
165 <p class="since">Since 0.10.22</p>
166 </div>
167 <hr>
168 <div class="refsect2">
169 <a name="gst-app-sink-is-eos"></a><h3>gst_app_sink_is_eos ()</h3>
170 <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>
171 <p>
172 Check if <em class="parameter"><code>appsink</code></em> is EOS, which is when no more buffers can be pulled because
173 an EOS event was received.
174 </p>
175 <p>
176 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
177 PLAYING state.
178 </p>
179 <div class="variablelist"><table border="0">
180 <col align="left" valign="top">
181 <tbody>
182 <tr>
183 <td><p><span class="term"><em class="parameter"><code>appsink</code></em> :</span></p></td>
184 <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>
185 </td>
186 </tr>
187 <tr>
188 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
189 <td>
190 <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if no more buffers can be pulled and the appsink is EOS.</td>
191 </tr>
192 </tbody>
193 </table></div>
194 <p class="since">Since 0.10.22</p>
195 </div>
196 <hr>
197 <div class="refsect2">
198 <a name="gst-app-sink-set-emit-signals"></a><h3>gst_app_sink_set_emit_signals ()</h3>
199 <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>,
200                                                          <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>
201 <p>
202 Make appsink emit the "new-preroll" and "new-buffer" signals. This option is
203 by default disabled because signal emission is expensive and unneeded when
204 the application prefers to operate in pull mode.
205 </p>
206 <div class="variablelist"><table border="0">
207 <col align="left" valign="top">
208 <tbody>
209 <tr>
210 <td><p><span class="term"><em class="parameter"><code>appsink</code></em> :</span></p></td>
211 <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>
212 </td>
213 </tr>
214 <tr>
215 <td><p><span class="term"><em class="parameter"><code>emit</code></em> :</span></p></td>
216 <td>the new state</td>
217 </tr>
218 </tbody>
219 </table></div>
220 <p class="since">Since 0.10.22</p>
221 </div>
222 <hr>
223 <div class="refsect2">
224 <a name="gst-app-sink-get-emit-signals"></a><h3>gst_app_sink_get_emit_signals ()</h3>
225 <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>
226 <p>
227 Check if appsink will emit the "new-preroll" and "new-buffer" signals.
228 </p>
229 <div class="variablelist"><table border="0">
230 <col align="left" valign="top">
231 <tbody>
232 <tr>
233 <td><p><span class="term"><em class="parameter"><code>appsink</code></em> :</span></p></td>
234 <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>
235 </td>
236 </tr>
237 <tr>
238 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
239 <td>
240 <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 emitting the "new-preroll" and "new-buffer"
241 signals.</td>
242 </tr>
243 </tbody>
244 </table></div>
245 <p class="since">Since 0.10.22</p>
246 </div>
247 <hr>
248 <div class="refsect2">
249 <a name="gst-app-sink-set-max-buffers"></a><h3>gst_app_sink_set_max_buffers ()</h3>
250 <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>,
251                                                          <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>
252 <p>
253 Set the maximum amount of buffers that can be queued in <em class="parameter"><code>appsink</code></em>. After this
254 amount of buffers are queued in appsink, any more buffers will block upstream
255 elements until a buffer is pulled from <em class="parameter"><code>appsink</code></em>.
256 </p>
257 <div class="variablelist"><table border="0">
258 <col align="left" valign="top">
259 <tbody>
260 <tr>
261 <td><p><span class="term"><em class="parameter"><code>appsink</code></em> :</span></p></td>
262 <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>
263 </td>
264 </tr>
265 <tr>
266 <td><p><span class="term"><em class="parameter"><code>max</code></em> :</span></p></td>
267 <td>the maximum number of buffers to queue</td>
268 </tr>
269 </tbody>
270 </table></div>
271 <p class="since">Since 0.10.22</p>
272 </div>
273 <hr>
274 <div class="refsect2">
275 <a name="gst-app-sink-get-max-buffers"></a><h3>gst_app_sink_get_max_buffers ()</h3>
276 <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>
277 <p>
278 Get the maximum amount of buffers that can be queued in <em class="parameter"><code>appsink</code></em>.
279 </p>
280 <div class="variablelist"><table border="0">
281 <col align="left" valign="top">
282 <tbody>
283 <tr>
284 <td><p><span class="term"><em class="parameter"><code>appsink</code></em> :</span></p></td>
285 <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>
286 </td>
287 </tr>
288 <tr>
289 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
290 <td>The maximum amount of buffers that can be queued.</td>
291 </tr>
292 </tbody>
293 </table></div>
294 <p class="since">Since 0.10.22</p>
295 </div>
296 <hr>
297 <div class="refsect2">
298 <a name="gst-app-sink-set-drop"></a><h3>gst_app_sink_set_drop ()</h3>
299 <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>,
300                                                          <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>
301 <p>
302 Instruct <em class="parameter"><code>appsink</code></em> to drop old buffers when the maximum amount of queued
303 buffers is reached.
304 </p>
305 <div class="variablelist"><table border="0">
306 <col align="left" valign="top">
307 <tbody>
308 <tr>
309 <td><p><span class="term"><em class="parameter"><code>appsink</code></em> :</span></p></td>
310 <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>
311 </td>
312 </tr>
313 <tr>
314 <td><p><span class="term"><em class="parameter"><code>drop</code></em> :</span></p></td>
315 <td>the new state</td>
316 </tr>
317 </tbody>
318 </table></div>
319 <p class="since">Since 0.10.22</p>
320 </div>
321 <hr>
322 <div class="refsect2">
323 <a name="gst-app-sink-get-drop"></a><h3>gst_app_sink_get_drop ()</h3>
324 <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>
325 <p>
326 Check if <em class="parameter"><code>appsink</code></em> will drop old buffers when the maximum amount of queued
327 buffers is reached.
328 </p>
329 <div class="variablelist"><table border="0">
330 <col align="left" valign="top">
331 <tbody>
332 <tr>
333 <td><p><span class="term"><em class="parameter"><code>appsink</code></em> :</span></p></td>
334 <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>
335 </td>
336 </tr>
337 <tr>
338 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
339 <td>
340 <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
341 filled.</td>
342 </tr>
343 </tbody>
344 </table></div>
345 <p class="since">Since 0.10.22</p>
346 </div>
347 <hr>
348 <div class="refsect2">
349 <a name="gst-app-sink-pull-preroll"></a><h3>gst_app_sink_pull_preroll ()</h3>
350 <pre class="programlisting"><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstBuffer.html#GstBuffer"><span class="returnvalue">GstBuffer</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>
351 <p>
352 Get the last preroll buffer in <em class="parameter"><code>appsink</code></em>. This was the buffer that caused the
353 appsink to preroll in the PAUSED state. This buffer can be pulled many times
354 and remains available to the application even after EOS.
355 </p>
356 <p>
357 This function is typically used when dealing with a pipeline in the PAUSED
358 state. Calling this function after doing a seek will give the buffer right
359 after the seek position.
360 </p>
361 <p>
362 Note that the preroll buffer will also be returned as the first buffer
363 when calling <a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-pull-buffer" title="gst_app_sink_pull_buffer ()"><code class="function">gst_app_sink_pull_buffer()</code></a>.
364 </p>
365 <p>
366 If an EOS event was received before any buffers, this function returns
367 <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.
368 </p>
369 <p>
370 This function blocks until a preroll buffer or EOS is received or the appsink
371 element is set to the READY/NULL state.
372 </p>
373 <div class="variablelist"><table border="0">
374 <col align="left" valign="top">
375 <tbody>
376 <tr>
377 <td><p><span class="term"><em class="parameter"><code>appsink</code></em> :</span></p></td>
378 <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>
379 </td>
380 </tr>
381 <tr>
382 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
383 <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>
384 </tr>
385 </tbody>
386 </table></div>
387 <p class="since">Since 0.10.22</p>
388 </div>
389 <hr>
390 <div class="refsect2">
391 <a name="gst-app-sink-pull-buffer"></a><h3>gst_app_sink_pull_buffer ()</h3>
392 <pre class="programlisting"><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstBuffer.html#GstBuffer"><span class="returnvalue">GstBuffer</span></a> *         gst_app_sink_pull_buffer            (<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>
393 <p>
394 This function blocks until a buffer or EOS becomes available or the appsink
395 element is set to the READY/NULL state.
396 </p>
397 <p>
398 This function will only return buffers when the appsink is in the PLAYING
399 state. All rendered buffers will be put in a queue so that the application
400 can pull buffers at its own rate. Note that when the application does not
401 pull buffers fast enough, the queued buffers could consume a lot of memory,
402 especially when dealing with raw video frames.
403 </p>
404 <p>
405 If an EOS event was received before any buffers, this function returns
406 <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.
407 </p>
408 <div class="variablelist"><table border="0">
409 <col align="left" valign="top">
410 <tbody>
411 <tr>
412 <td><p><span class="term"><em class="parameter"><code>appsink</code></em> :</span></p></td>
413 <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>
414 </td>
415 </tr>
416 <tr>
417 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
418 <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>
419 </tr>
420 </tbody>
421 </table></div>
422 <p class="since">Since 0.10.22</p>
423 </div>
424 <hr>
425 <div class="refsect2">
426 <a name="gst-app-sink-pull-buffer-list"></a><h3>gst_app_sink_pull_buffer_list ()</h3>
427 <pre class="programlisting"><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstBufferList.html#GstBufferList"><span class="returnvalue">GstBufferList</span></a> *     gst_app_sink_pull_buffer_list       (<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>
428 <p>
429 This function blocks until a buffer list or EOS becomes available or the
430 appsink element is set to the READY/NULL state.
431 </p>
432 <p>
433 This function will only return buffer lists when the appsink is in the
434 PLAYING state. All rendered buffer lists will be put in a queue so that
435 the application can pull buffer lists at its own rate. Note that when
436 the application does not pull buffer lists fast enough, the queued buffer
437 lists could consume a lot of memory, especially when dealing with raw
438 video frames.
439 </p>
440 <p>
441 If an EOS event was received before any buffer lists, this function returns
442 <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.
443 </p>
444 <div class="variablelist"><table border="0">
445 <col align="left" valign="top">
446 <tbody>
447 <tr>
448 <td><p><span class="term"><em class="parameter"><code>appsink</code></em> :</span></p></td>
449 <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>
450 </td>
451 </tr>
452 <tr>
453 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
454 <td>a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstBufferList.html#GstBufferList"><span class="type">GstBufferList</span></a> or NULL when the appsink is stopped or EOS.</td>
455 </tr>
456 </tbody>
457 </table></div>
458 </div>
459 <hr>
460 <div class="refsect2">
461 <a name="GstAppSinkCallbacks"></a><h3>GstAppSinkCallbacks</h3>
462 <pre class="programlisting">typedef struct {
463   void          (*eos)              (GstAppSink *sink, gpointer user_data);
464   GstFlowReturn (*new_preroll)      (GstAppSink *sink, gpointer user_data);
465   GstFlowReturn (*new_buffer)       (GstAppSink *sink, gpointer user_data);
466   GstFlowReturn (*new_buffer_list)  (GstAppSink *sink, gpointer user_data);
467 } GstAppSinkCallbacks;
468 </pre>
469 <p>
470 A set of callbacks that can be installed on the appsink with
471 <a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-set-callbacks" title="gst_app_sink_set_callbacks ()"><code class="function">gst_app_sink_set_callbacks()</code></a>.
472 </p>
473 <div class="variablelist"><table border="0">
474 <col align="left" valign="top">
475 <tbody>
476 <tr>
477 <td><p><span class="term"><em class="structfield"><code><a name="GstAppSinkCallbacks.eos"></a>eos</code></em> ()</span></p></td>
478 <td>Called when the end-of-stream has been reached. This callback
479 is called from the steaming thread.</td>
480 </tr>
481 <tr>
482 <td><p><span class="term"><em class="structfield"><code><a name="GstAppSinkCallbacks.new-preroll"></a>new_preroll</code></em> ()</span></p></td>
483 <td>Called when a new preroll buffer is available.
484 This callback is called from the steaming thread.
485 The new preroll buffer can be retrieved with
486 <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> either from this callback
487 or from any other thread.</td>
488 </tr>
489 <tr>
490 <td><p><span class="term"><em class="structfield"><code><a name="GstAppSinkCallbacks.new-buffer"></a>new_buffer</code></em> ()</span></p></td>
491 <td>Called when a new buffer is available.
492 This callback is called from the steaming thread.
493 The new buffer can be retrieved with
494 <a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-pull-buffer" title="gst_app_sink_pull_buffer ()"><code class="function">gst_app_sink_pull_buffer()</code></a> either from this callback
495 or from any other thread.</td>
496 </tr>
497 <tr>
498 <td><p><span class="term"><em class="structfield"><code><a name="GstAppSinkCallbacks.new-buffer-list"></a>new_buffer_list</code></em> ()</span></p></td>
499 <td>Called when a new bufferlist is available.
500 This callback is called from the steaming thread.
501 The new bufferlist can be retrieved with
502 <a class="link" href="gst-plugins-base-libs-appsink.html#gst-app-sink-pull-buffer-list" title="gst_app_sink_pull_buffer_list ()"><code class="function">gst_app_sink_pull_buffer_list()</code></a> either from this callback
503 or from any other thread.</td>
504 </tr>
505 </tbody>
506 </table></div>
507 <p class="since">Since 0.10.23</p>
508 </div>
509 <hr>
510 <div class="refsect2">
511 <a name="gst-app-sink-set-callbacks"></a><h3>gst_app_sink_set_callbacks ()</h3>
512 <pre class="programlisting"><span class="returnvalue">void</span>                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>,
513                                                          <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>,
514                                                          <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>,
515                                                          <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>
516 <p>
517 Set callbacks which will be executed for each new preroll, new buffer and eos.
518 This is an alternative to using the signals, it has lower overhead and is thus
519 less expensive, but also less flexible.
520 </p>
521 <p>
522 If callbacks are installed, no signals will be emitted for performance
523 reasons.
524 </p>
525 <div class="variablelist"><table border="0">
526 <col align="left" valign="top">
527 <tbody>
528 <tr>
529 <td><p><span class="term"><em class="parameter"><code>appsink</code></em> :</span></p></td>
530 <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>
531 </td>
532 </tr>
533 <tr>
534 <td><p><span class="term"><em class="parameter"><code>callbacks</code></em> :</span></p></td>
535 <td>the callbacks</td>
536 </tr>
537 <tr>
538 <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
539 <td>a user_data argument for the callbacks</td>
540 </tr>
541 <tr>
542 <td><p><span class="term"><em class="parameter"><code>notify</code></em> :</span></p></td>
543 <td>a destroy notify function</td>
544 </tr>
545 </tbody>
546 </table></div>
547 <p class="since">Since 0.10.23</p>
548 </div>
549 </div>
550 <div class="refsect1">
551 <a name="gst-plugins-base-libs-appsink.see-also"></a><h2>See Also</h2>
552 <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-libs/html/GstBaseSink.html"><span class="type">GstBaseSink</span></a>, appsrc
553 </div>
554 </div>
555 <div class="footer">
556 <hr>
557           Generated by GTK-Doc V1.18</div>
558 </body>
559 </html>