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