• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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>GstAppSrc: GStreamer Base Plugins 1.0 Library Reference Manual</title>
6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7<link rel="home" href="index.html" title="GStreamer Base Plugins 1.0 Library Reference Manual">
8<link rel="up" href="gstreamer-app.html" title="App Library">
9<link rel="prev" href="gstreamer-app.html" title="App Library">
10<link rel="next" href="gst-plugins-base-libs-appsink.html" title="GstAppSink">
11<meta name="generator" content="GTK-Doc V1.28 (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="5"><tr valign="middle">
16<td width="100%" align="left" class="shortcuts">
17<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span18                  <a href="#gst-plugins-base-libs-appsrc.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span19                  <a href="#gst-plugins-base-libs-appsrc.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_properties">  <span class="dim">|</span20                  <a href="#gst-plugins-base-libs-appsrc.properties" class="shortcut">Properties</a></span><span id="nav_signals">  <span class="dim">|</span21                  <a href="#gst-plugins-base-libs-appsrc.signals" class="shortcut">Signals</a></span>
22</td>
23<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
24<td><a accesskey="u" href="gstreamer-app.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
25<td><a accesskey="p" href="gstreamer-app.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
26<td><a accesskey="n" href="gst-plugins-base-libs-appsink.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
27</tr></table>
28<div class="refentry">
29<a name="gst-plugins-base-libs-appsrc"></a><div class="titlepage"></div>
30<div class="refnamediv"><table width="100%"><tr>
31<td valign="top">
32<h2><span class="refentrytitle"><a name="gst-plugins-base-libs-appsrc.top_of_page"></a>GstAppSrc</span></h2>
33<p>GstAppSrc — Easy way for applications to inject buffers into a
34    pipeline</p>
35</td>
36<td class="gallery_image" valign="top" align="right"></td>
37</tr></table></div>
38<div class="refsect1">
39<a name="gst-plugins-base-libs-appsrc.functions"></a><h2>Functions</h2>
40<div class="informaltable"><table class="informaltable" width="100%" border="0">
41<colgroup>
42<col width="150px" class="functions_return">
43<col class="functions_name">
44</colgroup>
45<tbody>
46<tr>
47<td class="function_type">
48<span class="returnvalue">void</span>
49</td>
50<td class="function_name">
51<a class="link" href="gst-plugins-base-libs-appsrc.html#gst-app-src-set-caps" title="gst_app_src_set_caps ()">gst_app_src_set_caps</a> <span class="c_punctuation">()</span>
52</td>
53</tr>
54<tr>
55<td class="function_type">
56<a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstCaps.html#GstCaps-struct"><span class="returnvalue">GstCaps</span></a> *
57</td>
58<td class="function_name">
59<a class="link" href="gst-plugins-base-libs-appsrc.html#gst-app-src-get-caps" title="gst_app_src_get_caps ()">gst_app_src_get_caps</a> <span class="c_punctuation">()</span>
60</td>
61</tr>
62<tr>
63<td class="function_type">
64<span class="returnvalue">void</span>
65</td>
66<td class="function_name">
67<a class="link" href="gst-plugins-base-libs-appsrc.html#gst-app-src-get-latency" title="gst_app_src_get_latency ()">gst_app_src_get_latency</a> <span class="c_punctuation">()</span>
68</td>
69</tr>
70<tr>
71<td class="function_type">
72<span class="returnvalue">void</span>
73</td>
74<td class="function_name">
75<a class="link" href="gst-plugins-base-libs-appsrc.html#gst-app-src-set-latency" title="gst_app_src_set_latency ()">gst_app_src_set_latency</a> <span class="c_punctuation">()</span>
76</td>
77</tr>
78<tr>
79<td class="function_type">
80<span class="returnvalue">void</span>
81</td>
82<td class="function_name">
83<a class="link" href="gst-plugins-base-libs-appsrc.html#gst-app-src-set-size" title="gst_app_src_set_size ()">gst_app_src_set_size</a> <span class="c_punctuation">()</span>
84</td>
85</tr>
86<tr>
87<td class="function_type">
88<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint64"><span class="returnvalue">gint64</span></a>
89</td>
90<td class="function_name">
91<a class="link" href="gst-plugins-base-libs-appsrc.html#gst-app-src-get-size" title="gst_app_src_get_size ()">gst_app_src_get_size</a> <span class="c_punctuation">()</span>
92</td>
93</tr>
94<tr>
95<td class="function_type">
96<span class="returnvalue">void</span>
97</td>
98<td class="function_name">
99<a class="link" href="gst-plugins-base-libs-appsrc.html#gst-app-src-set-duration" title="gst_app_src_set_duration ()">gst_app_src_set_duration</a> <span class="c_punctuation">()</span>
100</td>
101</tr>
102<tr>
103<td class="function_type">
104<a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstClock.html#GstClockTime"><span class="returnvalue">GstClockTime</span></a>
105</td>
106<td class="function_name">
107<a class="link" href="gst-plugins-base-libs-appsrc.html#gst-app-src-get-duration" title="gst_app_src_get_duration ()">gst_app_src_get_duration</a> <span class="c_punctuation">()</span>
108</td>
109</tr>
110<tr>
111<td class="function_type">
112<span class="returnvalue">void</span>
113</td>
114<td class="function_name">
115<a class="link" href="gst-plugins-base-libs-appsrc.html#gst-app-src-set-stream-type" title="gst_app_src_set_stream_type ()">gst_app_src_set_stream_type</a> <span class="c_punctuation">()</span>
116</td>
117</tr>
118<tr>
119<td class="function_type">
120<a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppStreamType" title="enum GstAppStreamType"><span class="returnvalue">GstAppStreamType</span></a>
121</td>
122<td class="function_name">
123<a class="link" href="gst-plugins-base-libs-appsrc.html#gst-app-src-get-stream-type" title="gst_app_src_get_stream_type ()">gst_app_src_get_stream_type</a> <span class="c_punctuation">()</span>
124</td>
125</tr>
126<tr>
127<td class="function_type">
128<span class="returnvalue">void</span>
129</td>
130<td class="function_name">
131<a class="link" href="gst-plugins-base-libs-appsrc.html#gst-app-src-set-max-bytes" title="gst_app_src_set_max_bytes ()">gst_app_src_set_max_bytes</a> <span class="c_punctuation">()</span>
132</td>
133</tr>
134<tr>
135<td class="function_type">
136<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="returnvalue">guint64</span></a>
137</td>
138<td class="function_name">
139<a class="link" href="gst-plugins-base-libs-appsrc.html#gst-app-src-get-max-bytes" title="gst_app_src_get_max_bytes ()">gst_app_src_get_max_bytes</a> <span class="c_punctuation">()</span>
140</td>
141</tr>
142<tr>
143<td class="function_type">
144<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="returnvalue">guint64</span></a>
145</td>
146<td class="function_name">
147<a class="link" href="gst-plugins-base-libs-appsrc.html#gst-app-src-get-current-level-bytes" title="gst_app_src_get_current_level_bytes ()">gst_app_src_get_current_level_bytes</a> <span class="c_punctuation">()</span>
148</td>
149</tr>
150<tr>
151<td class="function_type">
152<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
153</td>
154<td class="function_name">
155<a class="link" href="gst-plugins-base-libs-appsrc.html#gst-app-src-get-emit-signals" title="gst_app_src_get_emit_signals ()">gst_app_src_get_emit_signals</a> <span class="c_punctuation">()</span>
156</td>
157</tr>
158<tr>
159<td class="function_type">
160<span class="returnvalue">void</span>
161</td>
162<td class="function_name">
163<a class="link" href="gst-plugins-base-libs-appsrc.html#gst-app-src-set-emit-signals" title="gst_app_src_set_emit_signals ()">gst_app_src_set_emit_signals</a> <span class="c_punctuation">()</span>
164</td>
165</tr>
166<tr>
167<td class="function_type">
168<span class="returnvalue">void</span>
169</td>
170<td class="function_name">
171<a class="link" href="gst-plugins-base-libs-appsrc.html#gst-app-src-set-callbacks" title="gst_app_src_set_callbacks ()">gst_app_src_set_callbacks</a> <span class="c_punctuation">()</span>
172</td>
173</tr>
174<tr>
175<td class="function_type">
176<a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstPad.html#GstFlowReturn"><span class="returnvalue">GstFlowReturn</span></a>
177</td>
178<td class="function_name">
179<a class="link" href="gst-plugins-base-libs-appsrc.html#gst-app-src-push-buffer" title="gst_app_src_push_buffer ()">gst_app_src_push_buffer</a> <span class="c_punctuation">()</span>
180</td>
181</tr>
182<tr>
183<td class="function_type">
184<a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstPad.html#GstFlowReturn"><span class="returnvalue">GstFlowReturn</span></a>
185</td>
186<td class="function_name">
187<a class="link" href="gst-plugins-base-libs-appsrc.html#gst-app-src-push-buffer-list" title="gst_app_src_push_buffer_list ()">gst_app_src_push_buffer_list</a> <span class="c_punctuation">()</span>
188</td>
189</tr>
190<tr>
191<td class="function_type">
192<a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstPad.html#GstFlowReturn"><span class="returnvalue">GstFlowReturn</span></a>
193</td>
194<td class="function_name">
195<a class="link" href="gst-plugins-base-libs-appsrc.html#gst-app-src-push-sample" title="gst_app_src_push_sample ()">gst_app_src_push_sample</a> <span class="c_punctuation">()</span>
196</td>
197</tr>
198<tr>
199<td class="function_type">
200<a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstPad.html#GstFlowReturn"><span class="returnvalue">GstFlowReturn</span></a>
201</td>
202<td class="function_name">
203<a class="link" href="gst-plugins-base-libs-appsrc.html#gst-app-src-end-of-stream" title="gst_app_src_end_of_stream ()">gst_app_src_end_of_stream</a> <span class="c_punctuation">()</span>
204</td>
205</tr>
206</tbody>
207</table></div>
208</div>
209<div class="refsect1">
210<a name="gst-plugins-base-libs-appsrc.properties"></a><h2>Properties</h2>
211<div class="informaltable"><table class="informaltable" border="0">
212<colgroup>
213<col width="150px" class="properties_type">
214<col width="300px" class="properties_name">
215<col width="200px" class="properties_flags">
216</colgroup>
217<tbody>
218<tr>
219<td class="property_type"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td>
220<td class="property_name"><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc--block" title="The “block” property">block</a></td>
221<td class="property_flags">Read / Write</td>
222</tr>
223<tr>
224<td class="property_type">
225<a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstCaps.html#GstCaps-struct"><span class="type">GstCaps</span></a> *</td>
226<td class="property_name"><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc--caps" title="The “caps” property">caps</a></td>
227<td class="property_flags">Read / Write</td>
228</tr>
229<tr>
230<td class="property_type"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a></td>
231<td class="property_name"><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc--current-level-bytes" title="The “current-level-bytes” property">current-level-bytes</a></td>
232<td class="property_flags">Read</td>
233</tr>
234<tr>
235<td class="property_type"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a></td>
236<td class="property_name"><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc--duration" title="The “duration” property">duration</a></td>
237<td class="property_flags">Read / Write</td>
238</tr>
239<tr>
240<td class="property_type"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td>
241<td class="property_name"><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc--emit-signals" title="The “emit-signals” property">emit-signals</a></td>
242<td class="property_flags">Read / Write</td>
243</tr>
244<tr>
245<td class="property_type"><a href="/usr/share/gtk-doc/html/gstreamer-1.0/gstreamer-GstFormat.html#GstFormat"><span class="type">GstFormat</span></a></td>
246<td class="property_name"><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc--format" title="The “format” property">format</a></td>
247<td class="property_flags">Read / Write</td>
248</tr>
249<tr>
250<td class="property_type"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td>
251<td class="property_name"><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc--is-live" title="The “is-live” property">is-live</a></td>
252<td class="property_flags">Read / Write</td>
253</tr>
254<tr>
255<td class="property_type"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a></td>
256<td class="property_name"><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc--max-bytes" title="The “max-bytes” property">max-bytes</a></td>
257<td class="property_flags">Read / Write</td>
258</tr>
259<tr>
260<td class="property_type"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint64"><span class="type">gint64</span></a></td>
261<td class="property_name"><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc--max-latency" title="The “max-latency” property">max-latency</a></td>
262<td class="property_flags">Read / Write</td>
263</tr>
264<tr>
265<td class="property_type"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint64"><span class="type">gint64</span></a></td>
266<td class="property_name"><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc--min-latency" title="The “min-latency” property">min-latency</a></td>
267<td class="property_flags">Read / Write</td>
268</tr>
269<tr>
270<td class="property_type"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a></td>
271<td class="property_name"><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc--min-percent" title="The “min-percent” property">min-percent</a></td>
272<td class="property_flags">Read / Write</td>
273</tr>
274<tr>
275<td class="property_type"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint64"><span class="type">gint64</span></a></td>
276<td class="property_name"><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc--size" title="The “size” property">size</a></td>
277<td class="property_flags">Read / Write</td>
278</tr>
279<tr>
280<td class="property_type"><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppStreamType" title="enum GstAppStreamType"><span class="type">GstAppStreamType</span></a></td>
281<td class="property_name"><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc--stream-type" title="The “stream-type” property">stream-type</a></td>
282<td class="property_flags">Read / Write</td>
283</tr>
284</tbody>
285</table></div>
286</div>
287<div class="refsect1">
288<a name="gst-plugins-base-libs-appsrc.signals"></a><h2>Signals</h2>
289<div class="informaltable"><table class="informaltable" border="0">
290<colgroup>
291<col width="150px" class="signals_return">
292<col width="300px" class="signals_name">
293<col width="200px" class="signals_flags">
294</colgroup>
295<tbody>
296<tr>
297<td class="signal_type"><a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstPad.html#GstFlowReturn"><span class="returnvalue">GstFlowReturn</span></a></td>
298<td class="signal_name"><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc-end-of-stream" title="The “end-of-stream” signal">end-of-stream</a></td>
299<td class="signal_flags"><a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#G-SIGNAL-ACTION:CAPS">Action</a></td>
300</tr>
301<tr>
302<td class="signal_type"><span class="returnvalue">void</span></td>
303<td class="signal_name"><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc-enough-data" title="The “enough-data” signal">enough-data</a></td>
304<td class="signal_flags"><a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS">Run Last</a></td>
305</tr>
306<tr>
307<td class="signal_type"><span class="returnvalue">void</span></td>
308<td class="signal_name"><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc-need-data" title="The “need-data” signal">need-data</a></td>
309<td class="signal_flags"><a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS">Run Last</a></td>
310</tr>
311<tr>
312<td class="signal_type"><a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstPad.html#GstFlowReturn"><span class="returnvalue">GstFlowReturn</span></a></td>
313<td class="signal_name"><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc-push-buffer" title="The “push-buffer” signal">push-buffer</a></td>
314<td class="signal_flags"><a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#G-SIGNAL-ACTION:CAPS">Action</a></td>
315</tr>
316<tr>
317<td class="signal_type"><a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstPad.html#GstFlowReturn"><span class="returnvalue">GstFlowReturn</span></a></td>
318<td class="signal_name"><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc-push-buffer-list" title="The “push-buffer-list” signal">push-buffer-list</a></td>
319<td class="signal_flags"><a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#G-SIGNAL-ACTION:CAPS">Action</a></td>
320</tr>
321<tr>
322<td class="signal_type"><a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstPad.html#GstFlowReturn"><span class="returnvalue">GstFlowReturn</span></a></td>
323<td class="signal_name"><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc-push-sample" title="The “push-sample” signal">push-sample</a></td>
324<td class="signal_flags"><a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#G-SIGNAL-ACTION:CAPS">Action</a></td>
325</tr>
326<tr>
327<td class="signal_type"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a></td>
328<td class="signal_name"><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc-seek-data" title="The “seek-data” signal">seek-data</a></td>
329<td class="signal_flags"><a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS">Run Last</a></td>
330</tr>
331</tbody>
332</table></div>
333</div>
334<a name="GstAppSrc"></a><div class="refsect1">
335<a name="gst-plugins-base-libs-appsrc.other"></a><h2>Types and Values</h2>
336<div class="informaltable"><table class="informaltable" width="100%" border="0">
337<colgroup>
338<col width="150px" class="name">
339<col class="description">
340</colgroup>
341<tbody>
342<tr>
343<td class="datatype_keyword">enum</td>
344<td class="function_name"><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppStreamType" title="enum GstAppStreamType">GstAppStreamType</a></td>
345</tr>
346<tr>
347<td class="datatype_keyword"> </td>
348<td class="function_name"><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrcCallbacks" title="GstAppSrcCallbacks">GstAppSrcCallbacks</a></td>
349</tr>
350</tbody>
351</table></div>
352</div>
353<div class="refsect1">
354<a name="gst-plugins-base-libs-appsrc.object-hierarchy"></a><h2>Object Hierarchy</h2>
355<pre class="screen">    <a href="/usr/share/gtk-doc/html/gobject/gobject-Enumeration-and-Flag-Types.html">GEnum</a>
356    <span class="lineart">╰──</span> GstAppStreamType
357    <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject-struct">GObject</a>
358    <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GInitiallyUnowned">GInitiallyUnowned</a>
359        <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstObject.html#GstObject-struct">GstObject</a>
360            <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstElement.html#GstElement-struct">GstElement</a>
361                <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gstreamer-libs-1.0/GstBaseSrc.html#GstBaseSrc-struct">GstBaseSrc</a>
362                    <span class="lineart">╰──</span> GstAppSrc
363</pre>
364</div>
365<div class="refsect1">
366<a name="gst-plugins-base-libs-appsrc.includes"></a><h2>Includes</h2>
367<pre class="synopsis">#include &lt;gst/app/app.h&gt;
368</pre>
369</div>
370<div class="refsect1">
371<a name="gst-plugins-base-libs-appsrc.description"></a><h2>Description</h2>
372<p>The appsrc element can be used by applications to insert data into a
373GStreamer pipeline. Unlike most GStreamer elements, appsrc provides
374external API functions.</p>
375<p>appsrc can be used by linking with the libgstapp library to access the
376methods directly or by using the appsrc action signals.</p>
377<p>Before operating appsrc, the caps property must be set to fixed caps
378describing the format of the data that will be pushed with appsrc. An
379exception to this is when pushing buffers with unknown caps, in which case no
380caps should be set. This is typically true of file-like sources that push raw
381byte buffers. If you don't want to explicitly set the caps, you can use
382gst_app_src_push_sample. This method gets the caps associated with the
383sample and sets them on the appsrc replacing any previously set caps (if
384different from sample's caps).</p>
385<p>The main way of handing data to the appsrc element is by calling the
386<a class="link" href="gst-plugins-base-libs-appsrc.html#gst-app-src-push-buffer" title="gst_app_src_push_buffer ()"><code class="function">gst_app_src_push_buffer()</code></a> method or by emitting the push-buffer action signal.
387This will put the buffer onto a queue from which appsrc will read from in its
388streaming thread. It is important to note that data transport will not happen
389from the thread that performed the push-buffer call.</p>
390<p>The "max-bytes" property controls how much data can be queued in appsrc
391before appsrc considers the queue full. A filled internal queue will always
392signal the "enough-data" signal, which signals the application that it should
393stop pushing data into appsrc. The "block" property will cause appsrc to
394block the push-buffer method until free data becomes available again.</p>
395<p>When the internal queue is running out of data, the "need-data" signal is
396emitted, which signals the application that it should start pushing more data
397into appsrc.</p>
398<p>In addition to the "need-data" and "enough-data" signals, appsrc can emit the
399"seek-data" signal when the "stream-mode" property is set to "seekable" or
400"random-access". The signal argument will contain the new desired position in
401the stream expressed in the unit set with the "format" property. After
402receiving the seek-data signal, the application should push-buffers from the
403new position.</p>
404<p>These signals allow the application to operate the appsrc in two different
405ways:</p>
406<p>The push mode, in which the application repeatedly calls the push-buffer/push-sample
407method with a new buffer/sample. Optionally, the queue size in the appsrc
408can be controlled with the enough-data and need-data signals by respectively
409stopping/starting the push-buffer/push-sample calls. This is a typical
410mode of operation for the stream-type "stream" and "seekable". Use this
411mode when implementing various network protocols or hardware devices.</p>
412<p>The pull mode, in which the need-data signal triggers the next push-buffer call.
413This mode is typically used in the "random-access" stream-type. Use this
414mode for file access or other randomly accessable sources. In this mode, a
415buffer of exactly the amount of bytes given by the need-data signal should be
416pushed into appsrc.</p>
417<p>In all modes, the size property on appsrc should contain the total stream
418size in bytes. Setting this property is mandatory in the random-access mode.
419For the stream and seekable modes, setting this property is optional but
420recommended.</p>
421<p>When the application has finished pushing data into appsrc, it should call
422<a class="link" href="gst-plugins-base-libs-appsrc.html#gst-app-src-end-of-stream" title="gst_app_src_end_of_stream ()"><code class="function">gst_app_src_end_of_stream()</code></a> or emit the end-of-stream action signal. After
423this call, no more buffers can be pushed into appsrc until a flushing seek
424occurs or the state of the appsrc has gone through READY.</p>
425</div>
426<div class="refsect1">
427<a name="gst-plugins-base-libs-appsrc.functions_details"></a><h2>Functions</h2>
428<div class="refsect2">
429<a name="gst-app-src-set-caps"></a><h3>gst_app_src_set_caps ()</h3>
430<pre class="programlisting"><span class="returnvalue">void</span>
431gst_app_src_set_caps (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a> *appsrc</code></em>,
432                      <em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstCaps.html#GstCaps-struct"><span class="type">GstCaps</span></a> *caps</code></em>);</pre>
433<p>Set the capabilities on the appsrc element.  This function takes
434a copy of the caps structure. After calling this method, the source will
435only produce caps that match <em class="parameter"><code>caps</code></em>
436. <em class="parameter"><code>caps</code></em>
437 must be fixed and the caps on the
438buffers must match the caps or left NULL.</p>
439<div class="refsect3">
440<a name="gst-app-src-set-caps.parameters"></a><h4>Parameters</h4>
441<div class="informaltable"><table class="informaltable" width="100%" border="0">
442<colgroup>
443<col width="150px" class="parameters_name">
444<col class="parameters_description">
445<col width="200px" class="parameters_annotations">
446</colgroup>
447<tbody>
448<tr>
449<td class="parameter_name"><p>appsrc</p></td>
450<td class="parameter_description"><p>a <a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a></p></td>
451<td class="parameter_annotations"> </td>
452</tr>
453<tr>
454<td class="parameter_name"><p>caps</p></td>
455<td class="parameter_description"><p>caps to set</p></td>
456<td class="parameter_annotations"> </td>
457</tr>
458</tbody>
459</table></div>
460</div>
461</div>
462<hr>
463<div class="refsect2">
464<a name="gst-app-src-get-caps"></a><h3>gst_app_src_get_caps ()</h3>
465<pre class="programlisting"><a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstCaps.html#GstCaps-struct"><span class="returnvalue">GstCaps</span></a> *
466gst_app_src_get_caps (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a> *appsrc</code></em>);</pre>
467<p>Get the configured caps on <em class="parameter"><code>appsrc</code></em>
468.</p>
469<div class="refsect3">
470<a name="gst-app-src-get-caps.parameters"></a><h4>Parameters</h4>
471<div class="informaltable"><table class="informaltable" width="100%" border="0">
472<colgroup>
473<col width="150px" class="parameters_name">
474<col class="parameters_description">
475<col width="200px" class="parameters_annotations">
476</colgroup>
477<tbody><tr>
478<td class="parameter_name"><p>appsrc</p></td>
479<td class="parameter_description"><p>a <a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a></p></td>
480<td class="parameter_annotations"> </td>
481</tr></tbody>
482</table></div>
483</div>
484<div class="refsect3">
485<a name="gst-app-src-get-caps.returns"></a><h4>Returns</h4>
486<p> the <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstCaps.html#GstCaps-struct"><span class="type">GstCaps</span></a> produced by the source. <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstCaps.html#gst-caps-unref"><code class="function">gst_caps_unref()</code></a> after usage.</p>
487</div>
488</div>
489<hr>
490<div class="refsect2">
491<a name="gst-app-src-get-latency"></a><h3>gst_app_src_get_latency ()</h3>
492<pre class="programlisting"><span class="returnvalue">void</span>
493gst_app_src_get_latency (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a> *appsrc</code></em>,
494                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> *min</code></em>,
495                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> *max</code></em>);</pre>
496<p>Retrieve the min and max latencies in <em class="parameter"><code>min</code></em>
497 and <em class="parameter"><code>max</code></em>
498 respectively.</p>
499<div class="refsect3">
500<a name="gst-app-src-get-latency.parameters"></a><h4>Parameters</h4>
501<div class="informaltable"><table class="informaltable" width="100%" border="0">
502<colgroup>
503<col width="150px" class="parameters_name">
504<col class="parameters_description">
505<col width="200px" class="parameters_annotations">
506</colgroup>
507<tbody>
508<tr>
509<td class="parameter_name"><p>appsrc</p></td>
510<td class="parameter_description"><p>a <a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a></p></td>
511<td class="parameter_annotations"> </td>
512</tr>
513<tr>
514<td class="parameter_name"><p>min</p></td>
515<td class="parameter_description"><p>the min latency. </p></td>
516<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
517</tr>
518<tr>
519<td class="parameter_name"><p>max</p></td>
520<td class="parameter_description"><p>the max latency. </p></td>
521<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
522</tr>
523</tbody>
524</table></div>
525</div>
526</div>
527<hr>
528<div class="refsect2">
529<a name="gst-app-src-set-latency"></a><h3>gst_app_src_set_latency ()</h3>
530<pre class="programlisting"><span class="returnvalue">void</span>
531gst_app_src_set_latency (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a> *appsrc</code></em>,
532                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> min</code></em>,
533                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> max</code></em>);</pre>
534<p>Configure the <em class="parameter"><code>min</code></em>
535 and <em class="parameter"><code>max</code></em>
536 latency in <em class="parameter"><code>src</code></em>
537. If <em class="parameter"><code>min</code></em>
538 is set to -1, the
539default latency calculations for pseudo-live sources will be used.</p>
540<div class="refsect3">
541<a name="gst-app-src-set-latency.parameters"></a><h4>Parameters</h4>
542<div class="informaltable"><table class="informaltable" width="100%" border="0">
543<colgroup>
544<col width="150px" class="parameters_name">
545<col class="parameters_description">
546<col width="200px" class="parameters_annotations">
547</colgroup>
548<tbody>
549<tr>
550<td class="parameter_name"><p>appsrc</p></td>
551<td class="parameter_description"><p>a <a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a></p></td>
552<td class="parameter_annotations"> </td>
553</tr>
554<tr>
555<td class="parameter_name"><p>min</p></td>
556<td class="parameter_description"><p>the min latency</p></td>
557<td class="parameter_annotations"> </td>
558</tr>
559<tr>
560<td class="parameter_name"><p>max</p></td>
561<td class="parameter_description"><p>the max latency</p></td>
562<td class="parameter_annotations"> </td>
563</tr>
564</tbody>
565</table></div>
566</div>
567</div>
568<hr>
569<div class="refsect2">
570<a name="gst-app-src-set-size"></a><h3>gst_app_src_set_size ()</h3>
571<pre class="programlisting"><span class="returnvalue">void</span>
572gst_app_src_set_size (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a> *appsrc</code></em>,
573                      <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint64"><span class="type">gint64</span></a> size</code></em>);</pre>
574<p>Set the size of the stream in bytes. A value of -1 means that the size is
575not known.</p>
576<div class="refsect3">
577<a name="gst-app-src-set-size.parameters"></a><h4>Parameters</h4>
578<div class="informaltable"><table class="informaltable" width="100%" border="0">
579<colgroup>
580<col width="150px" class="parameters_name">
581<col class="parameters_description">
582<col width="200px" class="parameters_annotations">
583</colgroup>
584<tbody>
585<tr>
586<td class="parameter_name"><p>appsrc</p></td>
587<td class="parameter_description"><p>a <a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a></p></td>
588<td class="parameter_annotations"> </td>
589</tr>
590<tr>
591<td class="parameter_name"><p>size</p></td>
592<td class="parameter_description"><p>the size to set</p></td>
593<td class="parameter_annotations"> </td>
594</tr>
595</tbody>
596</table></div>
597</div>
598</div>
599<hr>
600<div class="refsect2">
601<a name="gst-app-src-get-size"></a><h3>gst_app_src_get_size ()</h3>
602<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint64"><span class="returnvalue">gint64</span></a>
603gst_app_src_get_size (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a> *appsrc</code></em>);</pre>
604<p>Get the size of the stream in bytes. A value of -1 means that the size is
605not known.</p>
606<div class="refsect3">
607<a name="gst-app-src-get-size.parameters"></a><h4>Parameters</h4>
608<div class="informaltable"><table class="informaltable" width="100%" border="0">
609<colgroup>
610<col width="150px" class="parameters_name">
611<col class="parameters_description">
612<col width="200px" class="parameters_annotations">
613</colgroup>
614<tbody><tr>
615<td class="parameter_name"><p>appsrc</p></td>
616<td class="parameter_description"><p>a <a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a></p></td>
617<td class="parameter_annotations"> </td>
618</tr></tbody>
619</table></div>
620</div>
621<div class="refsect3">
622<a name="gst-app-src-get-size.returns"></a><h4>Returns</h4>
623<p> the size of the stream previously set with <a class="link" href="gst-plugins-base-libs-appsrc.html#gst-app-src-set-size" title="gst_app_src_set_size ()"><code class="function">gst_app_src_set_size()</code></a>;</p>
624</div>
625</div>
626<hr>
627<div class="refsect2">
628<a name="gst-app-src-set-duration"></a><h3>gst_app_src_set_duration ()</h3>
629<pre class="programlisting"><span class="returnvalue">void</span>
630gst_app_src_set_duration (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a> *appsrc</code></em>,
631                          <em class="parameter"><code><a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstClock.html#GstClockTime"><span class="type">GstClockTime</span></a> duration</code></em>);</pre>
632<p>Set the duration of the stream in nanoseconds. A value of GST_CLOCK_TIME_NONE means that the duration is
633not known.</p>
634<div class="refsect3">
635<a name="gst-app-src-set-duration.parameters"></a><h4>Parameters</h4>
636<div class="informaltable"><table class="informaltable" width="100%" border="0">
637<colgroup>
638<col width="150px" class="parameters_name">
639<col class="parameters_description">
640<col width="200px" class="parameters_annotations">
641</colgroup>
642<tbody>
643<tr>
644<td class="parameter_name"><p>appsrc</p></td>
645<td class="parameter_description"><p>a <a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a></p></td>
646<td class="parameter_annotations"> </td>
647</tr>
648<tr>
649<td class="parameter_name"><p>duration</p></td>
650<td class="parameter_description"><p>the duration to set</p></td>
651<td class="parameter_annotations"> </td>
652</tr>
653</tbody>
654</table></div>
655</div>
656<p class="since">Since: <a class="link" href="ix06.html#api-index-1.10">1.10</a></p>
657</div>
658<hr>
659<div class="refsect2">
660<a name="gst-app-src-get-duration"></a><h3>gst_app_src_get_duration ()</h3>
661<pre class="programlisting"><a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstClock.html#GstClockTime"><span class="returnvalue">GstClockTime</span></a>
662gst_app_src_get_duration (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a> *appsrc</code></em>);</pre>
663<p>Get the duration of the stream in nanoseconds. A value of GST_CLOCK_TIME_NONE means that the duration is
664not known.</p>
665<div class="refsect3">
666<a name="gst-app-src-get-duration.parameters"></a><h4>Parameters</h4>
667<div class="informaltable"><table class="informaltable" width="100%" border="0">
668<colgroup>
669<col width="150px" class="parameters_name">
670<col class="parameters_description">
671<col width="200px" class="parameters_annotations">
672</colgroup>
673<tbody><tr>
674<td class="parameter_name"><p>appsrc</p></td>
675<td class="parameter_description"><p>a <a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a></p></td>
676<td class="parameter_annotations"> </td>
677</tr></tbody>
678</table></div>
679</div>
680<div class="refsect3">
681<a name="gst-app-src-get-duration.returns"></a><h4>Returns</h4>
682<p> the duration of the stream previously set with <a class="link" href="gst-plugins-base-libs-appsrc.html#gst-app-src-set-duration" title="gst_app_src_set_duration ()"><code class="function">gst_app_src_set_duration()</code></a>;</p>
683</div>
684<p class="since">Since: <a class="link" href="ix06.html#api-index-1.10">1.10</a></p>
685</div>
686<hr>
687<div class="refsect2">
688<a name="gst-app-src-set-stream-type"></a><h3>gst_app_src_set_stream_type ()</h3>
689<pre class="programlisting"><span class="returnvalue">void</span>
690gst_app_src_set_stream_type (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a> *appsrc</code></em>,
691                             <em class="parameter"><code><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppStreamType" title="enum GstAppStreamType"><span class="type">GstAppStreamType</span></a> type</code></em>);</pre>
692<p>Set the stream type on <em class="parameter"><code>appsrc</code></em>
693. For seekable streams, the "seek" signal must
694be connected to.</p>
695<p>A stream_type stream</p>
696<div class="refsect3">
697<a name="gst-app-src-set-stream-type.parameters"></a><h4>Parameters</h4>
698<div class="informaltable"><table class="informaltable" width="100%" border="0">
699<colgroup>
700<col width="150px" class="parameters_name">
701<col class="parameters_description">
702<col width="200px" class="parameters_annotations">
703</colgroup>
704<tbody>
705<tr>
706<td class="parameter_name"><p>appsrc</p></td>
707<td class="parameter_description"><p>a <a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a></p></td>
708<td class="parameter_annotations"> </td>
709</tr>
710<tr>
711<td class="parameter_name"><p>type</p></td>
712<td class="parameter_description"><p>the new state</p></td>
713<td class="parameter_annotations"> </td>
714</tr>
715</tbody>
716</table></div>
717</div>
718</div>
719<hr>
720<div class="refsect2">
721<a name="gst-app-src-get-stream-type"></a><h3>gst_app_src_get_stream_type ()</h3>
722<pre class="programlisting"><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppStreamType" title="enum GstAppStreamType"><span class="returnvalue">GstAppStreamType</span></a>
723gst_app_src_get_stream_type (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a> *appsrc</code></em>);</pre>
724<p>Get the stream type. Control the stream type of <em class="parameter"><code>appsrc</code></em>
725
726with <a class="link" href="gst-plugins-base-libs-appsrc.html#gst-app-src-set-stream-type" title="gst_app_src_set_stream_type ()"><code class="function">gst_app_src_set_stream_type()</code></a>.</p>
727<div class="refsect3">
728<a name="gst-app-src-get-stream-type.parameters"></a><h4>Parameters</h4>
729<div class="informaltable"><table class="informaltable" width="100%" border="0">
730<colgroup>
731<col width="150px" class="parameters_name">
732<col class="parameters_description">
733<col width="200px" class="parameters_annotations">
734</colgroup>
735<tbody><tr>
736<td class="parameter_name"><p>appsrc</p></td>
737<td class="parameter_description"><p>a <a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a></p></td>
738<td class="parameter_annotations"> </td>
739</tr></tbody>
740</table></div>
741</div>
742<div class="refsect3">
743<a name="gst-app-src-get-stream-type.returns"></a><h4>Returns</h4>
744<p> the stream type.</p>
745</div>
746</div>
747<hr>
748<div class="refsect2">
749<a name="gst-app-src-set-max-bytes"></a><h3>gst_app_src_set_max_bytes ()</h3>
750<pre class="programlisting"><span class="returnvalue">void</span>
751gst_app_src_set_max_bytes (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a> *appsrc</code></em>,
752                           <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> max</code></em>);</pre>
753<p>Set the maximum amount of bytes that can be queued in <em class="parameter"><code>appsrc</code></em>
754.
755After the maximum amount of bytes are queued, <em class="parameter"><code>appsrc</code></em>
756 will emit the
757"enough-data" signal.</p>
758<div class="refsect3">
759<a name="gst-app-src-set-max-bytes.parameters"></a><h4>Parameters</h4>
760<div class="informaltable"><table class="informaltable" width="100%" border="0">
761<colgroup>
762<col width="150px" class="parameters_name">
763<col class="parameters_description">
764<col width="200px" class="parameters_annotations">
765</colgroup>
766<tbody>
767<tr>
768<td class="parameter_name"><p>appsrc</p></td>
769<td class="parameter_description"><p>a <a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a></p></td>
770<td class="parameter_annotations"> </td>
771</tr>
772<tr>
773<td class="parameter_name"><p>max</p></td>
774<td class="parameter_description"><p>the maximum number of bytes to queue</p></td>
775<td class="parameter_annotations"> </td>
776</tr>
777</tbody>
778</table></div>
779</div>
780</div>
781<hr>
782<div class="refsect2">
783<a name="gst-app-src-get-max-bytes"></a><h3>gst_app_src_get_max_bytes ()</h3>
784<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="returnvalue">guint64</span></a>
785gst_app_src_get_max_bytes (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a> *appsrc</code></em>);</pre>
786<p>Get the maximum amount of bytes that can be queued in <em class="parameter"><code>appsrc</code></em>
787.</p>
788<div class="refsect3">
789<a name="gst-app-src-get-max-bytes.parameters"></a><h4>Parameters</h4>
790<div class="informaltable"><table class="informaltable" width="100%" border="0">
791<colgroup>
792<col width="150px" class="parameters_name">
793<col class="parameters_description">
794<col width="200px" class="parameters_annotations">
795</colgroup>
796<tbody><tr>
797<td class="parameter_name"><p>appsrc</p></td>
798<td class="parameter_description"><p>a <a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a></p></td>
799<td class="parameter_annotations"> </td>
800</tr></tbody>
801</table></div>
802</div>
803<div class="refsect3">
804<a name="gst-app-src-get-max-bytes.returns"></a><h4>Returns</h4>
805<p> The maximum amount of bytes that can be queued.</p>
806</div>
807</div>
808<hr>
809<div class="refsect2">
810<a name="gst-app-src-get-current-level-bytes"></a><h3>gst_app_src_get_current_level_bytes ()</h3>
811<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="returnvalue">guint64</span></a>
812gst_app_src_get_current_level_bytes (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a> *appsrc</code></em>);</pre>
813<p>Get the number of currently queued bytes inside <em class="parameter"><code>appsrc</code></em>
814.</p>
815<div class="refsect3">
816<a name="gst-app-src-get-current-level-bytes.parameters"></a><h4>Parameters</h4>
817<div class="informaltable"><table class="informaltable" width="100%" border="0">
818<colgroup>
819<col width="150px" class="parameters_name">
820<col class="parameters_description">
821<col width="200px" class="parameters_annotations">
822</colgroup>
823<tbody><tr>
824<td class="parameter_name"><p>appsrc</p></td>
825<td class="parameter_description"><p>a <a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a></p></td>
826<td class="parameter_annotations"> </td>
827</tr></tbody>
828</table></div>
829</div>
830<div class="refsect3">
831<a name="gst-app-src-get-current-level-bytes.returns"></a><h4>Returns</h4>
832<p> The number of currently queued bytes.</p>
833</div>
834<p class="since">Since: <a class="link" href="ix14.html#api-index-1.2">1.2</a></p>
835</div>
836<hr>
837<div class="refsect2">
838<a name="gst-app-src-get-emit-signals"></a><h3>gst_app_src_get_emit_signals ()</h3>
839<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
840gst_app_src_get_emit_signals (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a> *appsrc</code></em>);</pre>
841<p>Check if appsrc will emit the "new-preroll" and "new-buffer" signals.</p>
842<div class="refsect3">
843<a name="gst-app-src-get-emit-signals.parameters"></a><h4>Parameters</h4>
844<div class="informaltable"><table class="informaltable" width="100%" border="0">
845<colgroup>
846<col width="150px" class="parameters_name">
847<col class="parameters_description">
848<col width="200px" class="parameters_annotations">
849</colgroup>
850<tbody><tr>
851<td class="parameter_name"><p>appsrc</p></td>
852<td class="parameter_description"><p>a <a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a></p></td>
853<td class="parameter_annotations"> </td>
854</tr></tbody>
855</table></div>
856</div>
857<div class="refsect3">
858<a name="gst-app-src-get-emit-signals.returns"></a><h4>Returns</h4>
859<p> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>appsrc</code></em>
860is emitting the "new-preroll" and "new-buffer"
861signals.</p>
862</div>
863</div>
864<hr>
865<div class="refsect2">
866<a name="gst-app-src-set-emit-signals"></a><h3>gst_app_src_set_emit_signals ()</h3>
867<pre class="programlisting"><span class="returnvalue">void</span>
868gst_app_src_set_emit_signals (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a> *appsrc</code></em>,
869                              <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> emit</code></em>);</pre>
870<p>Make appsrc emit the "new-preroll" and "new-buffer" signals. This option is
871by default disabled because signal emission is expensive and unneeded when
872the application prefers to operate in pull mode.</p>
873<div class="refsect3">
874<a name="gst-app-src-set-emit-signals.parameters"></a><h4>Parameters</h4>
875<div class="informaltable"><table class="informaltable" width="100%" border="0">
876<colgroup>
877<col width="150px" class="parameters_name">
878<col class="parameters_description">
879<col width="200px" class="parameters_annotations">
880</colgroup>
881<tbody>
882<tr>
883<td class="parameter_name"><p>appsrc</p></td>
884<td class="parameter_description"><p>a <a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a></p></td>
885<td class="parameter_annotations"> </td>
886</tr>
887<tr>
888<td class="parameter_name"><p>emit</p></td>
889<td class="parameter_description"><p>the new state</p></td>
890<td class="parameter_annotations"> </td>
891</tr>
892</tbody>
893</table></div>
894</div>
895</div>
896<hr>
897<div class="refsect2">
898<a name="gst-app-src-set-callbacks"></a><h3>gst_app_src_set_callbacks ()</h3>
899<pre class="programlisting"><span class="returnvalue">void</span>
900gst_app_src_set_callbacks (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a> *appsrc</code></em>,
901                           <em class="parameter"><code><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrcCallbacks" title="GstAppSrcCallbacks"><span class="type">GstAppSrcCallbacks</span></a> *callbacks</code></em>,
902                           <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>,
903                           <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> notify</code></em>);</pre>
904<p>Set callbacks which will be executed when data is needed, enough data has
905been collected or when a seek should be performed.
906This is an alternative to using the signals, it has lower overhead and is thus
907less expensive, but also less flexible.</p>
908<p>If callbacks are installed, no signals will be emitted for performance
909reasons.</p>
910<p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
911<div class="refsect3">
912<a name="gst-app-src-set-callbacks.parameters"></a><h4>Parameters</h4>
913<div class="informaltable"><table class="informaltable" width="100%" border="0">
914<colgroup>
915<col width="150px" class="parameters_name">
916<col class="parameters_description">
917<col width="200px" class="parameters_annotations">
918</colgroup>
919<tbody>
920<tr>
921<td class="parameter_name"><p>appsrc</p></td>
922<td class="parameter_description"><p>a <a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a></p></td>
923<td class="parameter_annotations"> </td>
924</tr>
925<tr>
926<td class="parameter_name"><p>callbacks</p></td>
927<td class="parameter_description"><p>the callbacks</p></td>
928<td class="parameter_annotations"> </td>
929</tr>
930<tr>
931<td class="parameter_name"><p>user_data</p></td>
932<td class="parameter_description"><p>a user_data argument for the callbacks</p></td>
933<td class="parameter_annotations"> </td>
934</tr>
935<tr>
936<td class="parameter_name"><p>notify</p></td>
937<td class="parameter_description"><p>a destroy notify function</p></td>
938<td class="parameter_annotations"> </td>
939</tr>
940</tbody>
941</table></div>
942</div>
943</div>
944<hr>
945<div class="refsect2">
946<a name="gst-app-src-push-buffer"></a><h3>gst_app_src_push_buffer ()</h3>
947<pre class="programlisting"><a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstPad.html#GstFlowReturn"><span class="returnvalue">GstFlowReturn</span></a>
948gst_app_src_push_buffer (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a> *appsrc</code></em>,
949                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstBuffer.html#GstBuffer-struct"><span class="type">GstBuffer</span></a> *buffer</code></em>);</pre>
950<p>Adds a buffer to the queue of buffers that the appsrc element will
951push to its source pad.  This function takes ownership of the buffer.</p>
952<p>When the block property is TRUE, this function can block until free
953space becomes available in the queue.</p>
954<div class="refsect3">
955<a name="gst-app-src-push-buffer.parameters"></a><h4>Parameters</h4>
956<div class="informaltable"><table class="informaltable" width="100%" border="0">
957<colgroup>
958<col width="150px" class="parameters_name">
959<col class="parameters_description">
960<col width="200px" class="parameters_annotations">
961</colgroup>
962<tbody>
963<tr>
964<td class="parameter_name"><p>appsrc</p></td>
965<td class="parameter_description"><p>a <a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a></p></td>
966<td class="parameter_annotations"> </td>
967</tr>
968<tr>
969<td class="parameter_name"><p>buffer</p></td>
970<td class="parameter_description"><p>a <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstBuffer.html#GstBuffer-struct"><span class="type">GstBuffer</span></a> to push. </p></td>
971<td class="parameter_annotations"><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></td>
972</tr>
973</tbody>
974</table></div>
975</div>
976<div class="refsect3">
977<a name="gst-app-src-push-buffer.returns"></a><h4>Returns</h4>
978<p> <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstPad.html#GST-FLOW-OK:CAPS"><span class="type">GST_FLOW_OK</span></a> when the buffer was successfuly queued.
979<a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstPad.html#GST-FLOW-FLUSHING:CAPS"><span class="type">GST_FLOW_FLUSHING</span></a> when <em class="parameter"><code>appsrc</code></em>
980is not PAUSED or PLAYING.
981<a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstPad.html#GST-FLOW-EOS:CAPS"><span class="type">GST_FLOW_EOS</span></a> when EOS occured.</p>
982</div>
983</div>
984<hr>
985<div class="refsect2">
986<a name="gst-app-src-push-buffer-list"></a><h3>gst_app_src_push_buffer_list ()</h3>
987<pre class="programlisting"><a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstPad.html#GstFlowReturn"><span class="returnvalue">GstFlowReturn</span></a>
988gst_app_src_push_buffer_list (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a> *appsrc</code></em>,
989                              <em class="parameter"><code><a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstBufferList.html#GstBufferList-struct"><span class="type">GstBufferList</span></a> *buffer_list</code></em>);</pre>
990<p>Adds a buffer list to the queue of buffers and buffer lists that the
991appsrc element will push to its source pad.  This function takes ownership
992of <em class="parameter"><code>buffer_list</code></em>
993.</p>
994<p>When the block property is TRUE, this function can block until free
995space becomes available in the queue.</p>
996<div class="refsect3">
997<a name="gst-app-src-push-buffer-list.parameters"></a><h4>Parameters</h4>
998<div class="informaltable"><table class="informaltable" width="100%" border="0">
999<colgroup>
1000<col width="150px" class="parameters_name">
1001<col class="parameters_description">
1002<col width="200px" class="parameters_annotations">
1003</colgroup>
1004<tbody>
1005<tr>
1006<td class="parameter_name"><p>appsrc</p></td>
1007<td class="parameter_description"><p>a <a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a></p></td>
1008<td class="parameter_annotations"> </td>
1009</tr>
1010<tr>
1011<td class="parameter_name"><p>buffer_list</p></td>
1012<td class="parameter_description"><p>a <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstBufferList.html#GstBufferList-struct"><span class="type">GstBufferList</span></a> to push. </p></td>
1013<td class="parameter_annotations"><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></td>
1014</tr>
1015</tbody>
1016</table></div>
1017</div>
1018<div class="refsect3">
1019<a name="gst-app-src-push-buffer-list.returns"></a><h4>Returns</h4>
1020<p> <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstPad.html#GST-FLOW-OK:CAPS"><span class="type">GST_FLOW_OK</span></a> when the buffer list was successfuly queued.
1021<a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstPad.html#GST-FLOW-FLUSHING:CAPS"><span class="type">GST_FLOW_FLUSHING</span></a> when <em class="parameter"><code>appsrc</code></em>
1022is not PAUSED or PLAYING.
1023<a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstPad.html#GST-FLOW-EOS:CAPS"><span class="type">GST_FLOW_EOS</span></a> when EOS occured.</p>
1024</div>
1025<p class="since">Since: <a class="link" href="ix04.html#api-index-1.14">1.14</a></p>
1026</div>
1027<hr>
1028<div class="refsect2">
1029<a name="gst-app-src-push-sample"></a><h3>gst_app_src_push_sample ()</h3>
1030<pre class="programlisting"><a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstPad.html#GstFlowReturn"><span class="returnvalue">GstFlowReturn</span></a>
1031gst_app_src_push_sample (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a> *appsrc</code></em>,
1032                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstSample.html#GstSample-struct"><span class="type">GstSample</span></a> *sample</code></em>);</pre>
1033<p>Extract a buffer from the provided sample and adds it to the queue of
1034buffers that the appsrc element will push to its source pad. Any
1035previous caps that were set on appsrc will be replaced by the caps
1036associated with the sample if not equal.</p>
1037<p>This function does not take ownership of the
1038sample so the sample needs to be unreffed after calling this function.</p>
1039<p>When the block property is TRUE, this function can block until free
1040space becomes available in the queue.</p>
1041<div class="refsect3">
1042<a name="gst-app-src-push-sample.parameters"></a><h4>Parameters</h4>
1043<div class="informaltable"><table class="informaltable" width="100%" border="0">
1044<colgroup>
1045<col width="150px" class="parameters_name">
1046<col class="parameters_description">
1047<col width="200px" class="parameters_annotations">
1048</colgroup>
1049<tbody>
1050<tr>
1051<td class="parameter_name"><p>appsrc</p></td>
1052<td class="parameter_description"><p>a <a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a></p></td>
1053<td class="parameter_annotations"> </td>
1054</tr>
1055<tr>
1056<td class="parameter_name"><p>sample</p></td>
1057<td class="parameter_description"><p>a <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstSample.html#GstSample-struct"><span class="type">GstSample</span></a> from which buffer and caps may be
1058extracted. </p></td>
1059<td class="parameter_annotations"><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></td>
1060</tr>
1061</tbody>
1062</table></div>
1063</div>
1064<div class="refsect3">
1065<a name="gst-app-src-push-sample.returns"></a><h4>Returns</h4>
1066<p> <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstPad.html#GST-FLOW-OK:CAPS"><span class="type">GST_FLOW_OK</span></a> when the buffer was successfuly queued.
1067<a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstPad.html#GST-FLOW-FLUSHING:CAPS"><span class="type">GST_FLOW_FLUSHING</span></a> when <em class="parameter"><code>appsrc</code></em>
1068is not PAUSED or PLAYING.
1069<a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstPad.html#GST-FLOW-EOS:CAPS"><span class="type">GST_FLOW_EOS</span></a> when EOS occured.</p>
1070</div>
1071<p class="since">Since: <a class="link" href="ix10.html#api-index-1.6">1.6</a></p>
1072</div>
1073<hr>
1074<div class="refsect2">
1075<a name="gst-app-src-end-of-stream"></a><h3>gst_app_src_end_of_stream ()</h3>
1076<pre class="programlisting"><a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstPad.html#GstFlowReturn"><span class="returnvalue">GstFlowReturn</span></a>
1077gst_app_src_end_of_stream (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a> *appsrc</code></em>);</pre>
1078<p>Indicates to the appsrc element that the last buffer queued in the
1079element is the last buffer of the stream.</p>
1080<div class="refsect3">
1081<a name="gst-app-src-end-of-stream.parameters"></a><h4>Parameters</h4>
1082<div class="informaltable"><table class="informaltable" width="100%" border="0">
1083<colgroup>
1084<col width="150px" class="parameters_name">
1085<col class="parameters_description">
1086<col width="200px" class="parameters_annotations">
1087</colgroup>
1088<tbody><tr>
1089<td class="parameter_name"><p>appsrc</p></td>
1090<td class="parameter_description"><p>a <a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a></p></td>
1091<td class="parameter_annotations"> </td>
1092</tr></tbody>
1093</table></div>
1094</div>
1095<div class="refsect3">
1096<a name="gst-app-src-end-of-stream.returns"></a><h4>Returns</h4>
1097<p> <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstPad.html#GST-FLOW-OK:CAPS"><span class="type">GST_FLOW_OK</span></a> when the EOS was successfuly queued.
1098<a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstPad.html#GST-FLOW-FLUSHING:CAPS"><span class="type">GST_FLOW_FLUSHING</span></a> when <em class="parameter"><code>appsrc</code></em>
1099is not PAUSED or PLAYING.</p>
1100</div>
1101</div>
1102</div>
1103<div class="refsect1">
1104<a name="gst-plugins-base-libs-appsrc.other_details"></a><h2>Types and Values</h2>
1105<div class="refsect2">
1106<a name="GstAppStreamType"></a><h3>enum GstAppStreamType</h3>
1107<p>The stream type.</p>
1108<div class="refsect3">
1109<a name="GstAppStreamType.members"></a><h4>Members</h4>
1110<div class="informaltable"><table class="informaltable" width="100%" border="0">
1111<colgroup>
1112<col width="300px" class="enum_members_name">
1113<col class="enum_members_description">
1114<col width="200px" class="enum_members_annotations">
1115</colgroup>
1116<tbody>
1117<tr>
1118<td class="enum_member_name"><p><a name="GST-APP-STREAM-TYPE-STREAM:CAPS"></a>GST_APP_STREAM_TYPE_STREAM</p></td>
1119<td class="enum_member_description">
1120<p>No seeking is supported in the stream, such as a
1121live stream.</p>
1122</td>
1123<td class="enum_member_annotations"> </td>
1124</tr>
1125<tr>
1126<td class="enum_member_name"><p><a name="GST-APP-STREAM-TYPE-SEEKABLE:CAPS"></a>GST_APP_STREAM_TYPE_SEEKABLE</p></td>
1127<td class="enum_member_description">
1128<p>The stream is seekable but seeking might not
1129be very fast, such as data from a webserver.</p>
1130</td>
1131<td class="enum_member_annotations"> </td>
1132</tr>
1133<tr>
1134<td class="enum_member_name"><p><a name="GST-APP-STREAM-TYPE-RANDOM-ACCESS:CAPS"></a>GST_APP_STREAM_TYPE_RANDOM_ACCESS</p></td>
1135<td class="enum_member_description">
1136<p>The stream is seekable and seeking is fast,
1137such as in a local file.</p>
1138</td>
1139<td class="enum_member_annotations"> </td>
1140</tr>
1141</tbody>
1142</table></div>
1143</div>
1144</div>
1145<hr>
1146<div class="refsect2">
1147<a name="GstAppSrcCallbacks"></a><h3>GstAppSrcCallbacks</h3>
1148<pre class="programlisting">typedef struct {
1149  void      (*need_data)    (GstAppSrc *src, guint length, gpointer user_data);
1150  void      (*enough_data)  (GstAppSrc *src, gpointer user_data);
1151  gboolean  (*seek_data)    (GstAppSrc *src, guint64 offset, gpointer user_data);
1152} GstAppSrcCallbacks;
1153</pre>
1154<p>A set of callbacks that can be installed on the appsrc with
1155<a class="link" href="gst-plugins-base-libs-appsrc.html#gst-app-src-set-callbacks" title="gst_app_src_set_callbacks ()"><code class="function">gst_app_src_set_callbacks()</code></a>.</p>
1156<div class="refsect3">
1157<a name="GstAppSrcCallbacks.members"></a><h4>Members</h4>
1158<div class="informaltable"><table class="informaltable" width="100%" border="0">
1159<colgroup>
1160<col width="300px" class="struct_members_name">
1161<col class="struct_members_description">
1162<col width="200px" class="struct_members_annotations">
1163</colgroup>
1164<tbody>
1165<tr>
1166<td class="struct_member_name"><p><em class="structfield"><code><a name="GstAppSrcCallbacks.need-data"></a>need_data</code></em> ()</p></td>
1167<td class="struct_member_description"><p>Called when the appsrc needs more data. A buffer or EOS should be
1168pushed to appsrc from this thread or another thread. <em class="parameter"><code>length</code></em>
1169is just a hint
1170and when it is set to -1, any number of bytes can be pushed into <em class="parameter"><code>appsrc</code></em>
1171.</p></td>
1172<td class="struct_member_annotations"> </td>
1173</tr>
1174<tr>
1175<td class="struct_member_name"><p><em class="structfield"><code><a name="GstAppSrcCallbacks.enough-data"></a>enough_data</code></em> ()</p></td>
1176<td class="struct_member_description"><p>Called when appsrc has enough data. It is recommended that the
1177application stops calling push-buffer until the need_data callback is
1178emitted again to avoid excessive buffer queueing.</p></td>
1179<td class="struct_member_annotations"> </td>
1180</tr>
1181<tr>
1182<td class="struct_member_name"><p><em class="structfield"><code><a name="GstAppSrcCallbacks.seek-data"></a>seek_data</code></em> ()</p></td>
1183<td class="struct_member_description"><p>Called when a seek should be performed to the offset.
1184The next push-buffer should produce buffers from the new <em class="parameter"><code>offset</code></em>
1185.
1186This callback is only called for seekable stream types.</p></td>
1187<td class="struct_member_annotations"> </td>
1188</tr>
1189</tbody>
1190</table></div>
1191</div>
1192</div>
1193</div>
1194<div class="refsect1">
1195<a name="gst-plugins-base-libs-appsrc.property-details"></a><h2>Property Details</h2>
1196<div class="refsect2">
1197<a name="GstAppSrc--block"></a><h3>The <code class="literal">“block”</code> property</h3>
1198<pre class="programlisting">  “block”                    <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></pre>
1199<p>Block push-buffer when max-bytes are queued.</p>
1200<p>Flags: Read / Write</p>
1201<p>Default value: FALSE</p>
1202</div>
1203<hr>
1204<div class="refsect2">
1205<a name="GstAppSrc--caps"></a><h3>The <code class="literal">“caps”</code> property</h3>
1206<pre class="programlisting">  “caps”                     <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstCaps.html#GstCaps-struct"><span class="type">GstCaps</span></a> *</pre>
1207<p>The allowed caps for the src pad.</p>
1208<p>Flags: Read / Write</p>
1209</div>
1210<hr>
1211<div class="refsect2">
1212<a name="GstAppSrc--current-level-bytes"></a><h3>The <code class="literal">“current-level-bytes”</code> property</h3>
1213<pre class="programlisting">  “current-level-bytes”      <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a></pre>
1214<p>The number of currently queued bytes.</p>
1215<p>Flags: Read</p>
1216<p>Default value: 0</p>
1217</div>
1218<hr>
1219<div class="refsect2">
1220<a name="GstAppSrc--duration"></a><h3>The <code class="literal">“duration”</code> property</h3>
1221<pre class="programlisting">  “duration”                 <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a></pre>
1222<p>The duration of the data stream in nanoseconds (GST_CLOCK_TIME_NONE if unknown).</p>
1223<p>Flags: Read / Write</p>
1224<p>Default value: 18446744073709551615</p>
1225</div>
1226<hr>
1227<div class="refsect2">
1228<a name="GstAppSrc--emit-signals"></a><h3>The <code class="literal">“emit-signals”</code> property</h3>
1229<pre class="programlisting">  “emit-signals”             <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></pre>
1230<p>Emit need-data, enough-data and seek-data signals.</p>
1231<p>Flags: Read / Write</p>
1232<p>Default value: TRUE</p>
1233</div>
1234<hr>
1235<div class="refsect2">
1236<a name="GstAppSrc--format"></a><h3>The <code class="literal">“format”</code> property</h3>
1237<pre class="programlisting">  “format”                   <a href="/usr/share/gtk-doc/html/gstreamer-1.0/gstreamer-GstFormat.html#GstFormat"><span class="type">GstFormat</span></a></pre>
1238<p>The format of the segment events and seek.</p>
1239<p>Flags: Read / Write</p>
1240<p>Default value: GST_FORMAT_BYTES</p>
1241</div>
1242<hr>
1243<div class="refsect2">
1244<a name="GstAppSrc--is-live"></a><h3>The <code class="literal">“is-live”</code> property</h3>
1245<pre class="programlisting">  “is-live”                  <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></pre>
1246<p>Whether to act as a live source.</p>
1247<p>Flags: Read / Write</p>
1248<p>Default value: FALSE</p>
1249</div>
1250<hr>
1251<div class="refsect2">
1252<a name="GstAppSrc--max-bytes"></a><h3>The <code class="literal">“max-bytes”</code> property</h3>
1253<pre class="programlisting">  “max-bytes”                <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a></pre>
1254<p>The maximum number of bytes to queue internally (0 = unlimited).</p>
1255<p>Flags: Read / Write</p>
1256<p>Default value: 200000</p>
1257</div>
1258<hr>
1259<div class="refsect2">
1260<a name="GstAppSrc--max-latency"></a><h3>The <code class="literal">“max-latency”</code> property</h3>
1261<pre class="programlisting">  “max-latency”              <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint64"><span class="type">gint64</span></a></pre>
1262<p>The maximum latency (-1 = unlimited).</p>
1263<p>Flags: Read / Write</p>
1264<p>Allowed values: &gt;= -1</p>
1265<p>Default value: -1</p>
1266</div>
1267<hr>
1268<div class="refsect2">
1269<a name="GstAppSrc--min-latency"></a><h3>The <code class="literal">“min-latency”</code> property</h3>
1270<pre class="programlisting">  “min-latency”              <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint64"><span class="type">gint64</span></a></pre>
1271<p>The minimum latency (-1 = default).</p>
1272<p>Flags: Read / Write</p>
1273<p>Allowed values: &gt;= -1</p>
1274<p>Default value: -1</p>
1275</div>
1276<hr>
1277<div class="refsect2">
1278<a name="GstAppSrc--min-percent"></a><h3>The <code class="literal">“min-percent”</code> property</h3>
1279<pre class="programlisting">  “min-percent”              <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a></pre>
1280<p>Emit need-data when queued bytes drops below this percent of max-bytes.</p>
1281<p>Flags: Read / Write</p>
1282<p>Allowed values: &lt;= 100</p>
1283<p>Default value: 0</p>
1284</div>
1285<hr>
1286<div class="refsect2">
1287<a name="GstAppSrc--size"></a><h3>The <code class="literal">“size”</code> property</h3>
1288<pre class="programlisting">  “size”                     <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint64"><span class="type">gint64</span></a></pre>
1289<p>The size of the data stream in bytes (-1 if unknown).</p>
1290<p>Flags: Read / Write</p>
1291<p>Allowed values: &gt;= -1</p>
1292<p>Default value: -1</p>
1293</div>
1294<hr>
1295<div class="refsect2">
1296<a name="GstAppSrc--stream-type"></a><h3>The <code class="literal">“stream-type”</code> property</h3>
1297<pre class="programlisting">  “stream-type”              <a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppStreamType" title="enum GstAppStreamType"><span class="type">GstAppStreamType</span></a></pre>
1298<p>the type of the stream.</p>
1299<p>Flags: Read / Write</p>
1300<p>Default value: GST_APP_STREAM_TYPE_STREAM</p>
1301</div>
1302</div>
1303<div class="refsect1">
1304<a name="gst-plugins-base-libs-appsrc.signal-details"></a><h2>Signal Details</h2>
1305<div class="refsect2">
1306<a name="GstAppSrc-end-of-stream"></a><h3>The <code class="literal">“end-of-stream”</code> signal</h3>
1307<pre class="programlisting"><a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstPad.html#GstFlowReturn"><span class="returnvalue">GstFlowReturn</span></a>
1308user_function (<a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a> *appsrc,
1309               <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a>   user_data)</pre>
1310<p>Notify <em class="parameter"><code>appsrc</code></em>
1311 that no more buffer are available.</p>
1312<div class="refsect3">
1313<a name="GstAppSrc-end-of-stream.parameters"></a><h4>Parameters</h4>
1314<div class="informaltable"><table class="informaltable" width="100%" border="0">
1315<colgroup>
1316<col width="150px" class="parameters_name">
1317<col class="parameters_description">
1318<col width="200px" class="parameters_annotations">
1319</colgroup>
1320<tbody>
1321<tr>
1322<td class="parameter_name"><p>appsrc</p></td>
1323<td class="parameter_description"><p>the appsrc</p></td>
1324<td class="parameter_annotations"> </td>
1325</tr>
1326<tr>
1327<td class="parameter_name"><p>user_data</p></td>
1328<td class="parameter_description"><p>user data set when the signal handler was connected.</p></td>
1329<td class="parameter_annotations"> </td>
1330</tr>
1331</tbody>
1332</table></div>
1333</div>
1334<p>Flags: <a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#G-SIGNAL-ACTION:CAPS">Action</a></p>
1335</div>
1336<hr>
1337<div class="refsect2">
1338<a name="GstAppSrc-enough-data"></a><h3>The <code class="literal">“enough-data”</code> signal</h3>
1339<pre class="programlisting"><span class="returnvalue">void</span>
1340user_function (<a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a> *appsrc,
1341               <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a>   user_data)</pre>
1342<p>Signal that the source has enough data. It is recommended that the
1343application stops calling push-buffer until the need-data signal is
1344emitted again to avoid excessive buffer queueing.</p>
1345<div class="refsect3">
1346<a name="GstAppSrc-enough-data.parameters"></a><h4>Parameters</h4>
1347<div class="informaltable"><table class="informaltable" width="100%" border="0">
1348<colgroup>
1349<col width="150px" class="parameters_name">
1350<col class="parameters_description">
1351<col width="200px" class="parameters_annotations">
1352</colgroup>
1353<tbody>
1354<tr>
1355<td class="parameter_name"><p>appsrc</p></td>
1356<td class="parameter_description"><p>the appsrc element that emitted the signal</p></td>
1357<td class="parameter_annotations"> </td>
1358</tr>
1359<tr>
1360<td class="parameter_name"><p>user_data</p></td>
1361<td class="parameter_description"><p>user data set when the signal handler was connected.</p></td>
1362<td class="parameter_annotations"> </td>
1363</tr>
1364</tbody>
1365</table></div>
1366</div>
1367<p>Flags: <a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS">Run Last</a></p>
1368</div>
1369<hr>
1370<div class="refsect2">
1371<a name="GstAppSrc-need-data"></a><h3>The <code class="literal">“need-data”</code> signal</h3>
1372<pre class="programlisting"><span class="returnvalue">void</span>
1373user_function (<a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a> *appsrc,
1374               <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a>      length,
1375               <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a>   user_data)</pre>
1376<p>Signal that the source needs more data. In the callback or from another
1377thread you should call push-buffer or end-of-stream.</p>
1378<p><em class="parameter"><code>length</code></em>
1379 is just a hint and when it is set to -1, any number of bytes can be
1380pushed into <em class="parameter"><code>appsrc</code></em>
1381.</p>
1382<p>You can call push-buffer multiple times until the enough-data signal is
1383fired.</p>
1384<div class="refsect3">
1385<a name="GstAppSrc-need-data.parameters"></a><h4>Parameters</h4>
1386<div class="informaltable"><table class="informaltable" width="100%" border="0">
1387<colgroup>
1388<col width="150px" class="parameters_name">
1389<col class="parameters_description">
1390<col width="200px" class="parameters_annotations">
1391</colgroup>
1392<tbody>
1393<tr>
1394<td class="parameter_name"><p>appsrc</p></td>
1395<td class="parameter_description"><p>the appsrc element that emitted the signal</p></td>
1396<td class="parameter_annotations"> </td>
1397</tr>
1398<tr>
1399<td class="parameter_name"><p>length</p></td>
1400<td class="parameter_description"><p>the amount of bytes needed.</p></td>
1401<td class="parameter_annotations"> </td>
1402</tr>
1403<tr>
1404<td class="parameter_name"><p>user_data</p></td>
1405<td class="parameter_description"><p>user data set when the signal handler was connected.</p></td>
1406<td class="parameter_annotations"> </td>
1407</tr>
1408</tbody>
1409</table></div>
1410</div>
1411<p>Flags: <a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS">Run Last</a></p>
1412</div>
1413<hr>
1414<div class="refsect2">
1415<a name="GstAppSrc-push-buffer"></a><h3>The <code class="literal">“push-buffer”</code> signal</h3>
1416<pre class="programlisting"><a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstPad.html#GstFlowReturn"><span class="returnvalue">GstFlowReturn</span></a>
1417user_function (<a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a> *appsrc,
1418               <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstBuffer.html#GstBuffer-struct"><span class="type">GstBuffer</span></a> *buffer,
1419               <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a>   user_data)</pre>
1420<p>Adds a buffer to the queue of buffers that the appsrc element will
1421push to its source pad. This function does not take ownership of the
1422buffer so the buffer needs to be unreffed after calling this function.</p>
1423<p>When the block property is TRUE, this function can block until free space
1424becomes available in the queue.</p>
1425<div class="refsect3">
1426<a name="GstAppSrc-push-buffer.parameters"></a><h4>Parameters</h4>
1427<div class="informaltable"><table class="informaltable" width="100%" border="0">
1428<colgroup>
1429<col width="150px" class="parameters_name">
1430<col class="parameters_description">
1431<col width="200px" class="parameters_annotations">
1432</colgroup>
1433<tbody>
1434<tr>
1435<td class="parameter_name"><p>appsrc</p></td>
1436<td class="parameter_description"><p>the appsrc</p></td>
1437<td class="parameter_annotations"> </td>
1438</tr>
1439<tr>
1440<td class="parameter_name"><p>buffer</p></td>
1441<td class="parameter_description"><p>a buffer to push</p></td>
1442<td class="parameter_annotations"> </td>
1443</tr>
1444<tr>
1445<td class="parameter_name"><p>user_data</p></td>
1446<td class="parameter_description"><p>user data set when the signal handler was connected.</p></td>
1447<td class="parameter_annotations"> </td>
1448</tr>
1449</tbody>
1450</table></div>
1451</div>
1452<p>Flags: <a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#G-SIGNAL-ACTION:CAPS">Action</a></p>
1453</div>
1454<hr>
1455<div class="refsect2">
1456<a name="GstAppSrc-push-buffer-list"></a><h3>The <code class="literal">“push-buffer-list”</code> signal</h3>
1457<pre class="programlisting"><a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstPad.html#GstFlowReturn"><span class="returnvalue">GstFlowReturn</span></a>
1458user_function (<a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a>     *appsrc,
1459               <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstBufferList.html#GstBufferList-struct"><span class="type">GstBufferList</span></a> *buffer_list,
1460               <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a>       user_data)</pre>
1461<p>Adds a buffer list to the queue of buffers and buffer lists that the
1462appsrc element will push to its source pad. This function does not take
1463ownership of the buffer list so the buffer list needs to be unreffed
1464after calling this function.</p>
1465<p>When the block property is TRUE, this function can block until free space
1466becomes available in the queue.</p>
1467<div class="refsect3">
1468<a name="GstAppSrc-push-buffer-list.parameters"></a><h4>Parameters</h4>
1469<div class="informaltable"><table class="informaltable" width="100%" border="0">
1470<colgroup>
1471<col width="150px" class="parameters_name">
1472<col class="parameters_description">
1473<col width="200px" class="parameters_annotations">
1474</colgroup>
1475<tbody>
1476<tr>
1477<td class="parameter_name"><p>appsrc</p></td>
1478<td class="parameter_description"><p>the appsrc</p></td>
1479<td class="parameter_annotations"> </td>
1480</tr>
1481<tr>
1482<td class="parameter_name"><p>buffer_list</p></td>
1483<td class="parameter_description"><p>a buffer list to push</p></td>
1484<td class="parameter_annotations"> </td>
1485</tr>
1486<tr>
1487<td class="parameter_name"><p>user_data</p></td>
1488<td class="parameter_description"><p>user data set when the signal handler was connected.</p></td>
1489<td class="parameter_annotations"> </td>
1490</tr>
1491</tbody>
1492</table></div>
1493</div>
1494<p>Flags: <a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#G-SIGNAL-ACTION:CAPS">Action</a></p>
1495<p class="since">Since: <a class="link" href="ix04.html#api-index-1.14">1.14</a></p>
1496</div>
1497<hr>
1498<div class="refsect2">
1499<a name="GstAppSrc-push-sample"></a><h3>The <code class="literal">“push-sample”</code> signal</h3>
1500<pre class="programlisting"><a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstPad.html#GstFlowReturn"><span class="returnvalue">GstFlowReturn</span></a>
1501user_function (<a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a> *appsrc,
1502               <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstSample.html#GstSample-struct"><span class="type">GstSample</span></a> *sample,
1503               <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a>   user_data)</pre>
1504<p>Extract a buffer from the provided sample and adds the extracted buffer
1505to the queue of buffers that the appsrc element will
1506push to its source pad. This function set the appsrc caps based on the caps
1507in the sample and reset the caps if they change.
1508Only the caps and the buffer of the provided sample are used and not
1509for example the segment in the sample.
1510This function does not take ownership of the
1511sample so the sample needs to be unreffed after calling this function.</p>
1512<p>When the block property is TRUE, this function can block until free space
1513becomes available in the queue.</p>
1514<div class="refsect3">
1515<a name="GstAppSrc-push-sample.parameters"></a><h4>Parameters</h4>
1516<div class="informaltable"><table class="informaltable" width="100%" border="0">
1517<colgroup>
1518<col width="150px" class="parameters_name">
1519<col class="parameters_description">
1520<col width="200px" class="parameters_annotations">
1521</colgroup>
1522<tbody>
1523<tr>
1524<td class="parameter_name"><p>appsrc</p></td>
1525<td class="parameter_description"><p>the appsrc</p></td>
1526<td class="parameter_annotations"> </td>
1527</tr>
1528<tr>
1529<td class="parameter_name"><p>sample</p></td>
1530<td class="parameter_description"><p>a sample from which extract buffer to push</p></td>
1531<td class="parameter_annotations"> </td>
1532</tr>
1533<tr>
1534<td class="parameter_name"><p>user_data</p></td>
1535<td class="parameter_description"><p>user data set when the signal handler was connected.</p></td>
1536<td class="parameter_annotations"> </td>
1537</tr>
1538</tbody>
1539</table></div>
1540</div>
1541<p>Flags: <a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#G-SIGNAL-ACTION:CAPS">Action</a></p>
1542<p class="since">Since: <a class="link" href="ix10.html#api-index-1.6">1.6</a></p>
1543</div>
1544<hr>
1545<div class="refsect2">
1546<a name="GstAppSrc-seek-data"></a><h3>The <code class="literal">“seek-data”</code> signal</h3>
1547<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
1548user_function (<a class="link" href="gst-plugins-base-libs-appsrc.html#GstAppSrc"><span class="type">GstAppSrc</span></a> *appsrc,
1549               <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a>    offset,
1550               <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a>   user_data)</pre>
1551<p>Seek to the given offset. The next push-buffer should produce buffers from
1552the new <em class="parameter"><code>offset</code></em>
1553.
1554This callback is only called for seekable stream types.</p>
1555<div class="refsect3">
1556<a name="GstAppSrc-seek-data.parameters"></a><h4>Parameters</h4>
1557<div class="informaltable"><table class="informaltable" width="100%" border="0">
1558<colgroup>
1559<col width="150px" class="parameters_name">
1560<col class="parameters_description">
1561<col width="200px" class="parameters_annotations">
1562</colgroup>
1563<tbody>
1564<tr>
1565<td class="parameter_name"><p>appsrc</p></td>
1566<td class="parameter_description"><p>the appsrc element that emitted the signal</p></td>
1567<td class="parameter_annotations"> </td>
1568</tr>
1569<tr>
1570<td class="parameter_name"><p>offset</p></td>
1571<td class="parameter_description"><p>the offset to seek to</p></td>
1572<td class="parameter_annotations"> </td>
1573</tr>
1574<tr>
1575<td class="parameter_name"><p>user_data</p></td>
1576<td class="parameter_description"><p>user data set when the signal handler was connected.</p></td>
1577<td class="parameter_annotations"> </td>
1578</tr>
1579</tbody>
1580</table></div>
1581</div>
1582<div class="refsect3">
1583<a name="GstAppSrc-seek-data.returns"></a><h4>Returns</h4>
1584<p> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the seek succeeded.</p>
1585</div>
1586<p>Flags: <a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS">Run Last</a></p>
1587</div>
1588</div>
1589<div class="refsect1">
1590<a name="gst-plugins-base-libs-appsrc.see-also"></a><h2>See Also</h2>
1591<p><a href="/usr/share/gtk-doc/html/gstreamer-libs-1.0/GstBaseSrc.html#GstBaseSrc-struct"><span class="type">GstBaseSrc</span></a>, appsink</p>
1592</div>
1593</div>
1594<div class="footer">
1595<hr>Generated by GTK-Doc V1.28</div>
1596</body>
1597</html>