• 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>GstTaskPool: GStreamer 1.0 Core Reference Manual</title>
6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7<link rel="home" href="index.html" title="GStreamer 1.0 Core Reference Manual">
8<link rel="up" href="libgstreamer.html" title="GStreamer Core Library">
9<link rel="prev" href="GstTask.html" title="GstTask">
10<link rel="next" href="GstToc.html" title="GstToc">
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="#GstTaskPool.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span19                  <a href="#GstTaskPool.object-hierarchy" class="shortcut">Object Hierarchy</a></span>
20</td>
21<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
22<td><a accesskey="u" href="libgstreamer.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
23<td><a accesskey="p" href="GstTask.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
24<td><a accesskey="n" href="GstToc.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
25</tr></table>
26<div class="refentry">
27<a name="GstTaskPool"></a><div class="titlepage"></div>
28<div class="refnamediv"><table width="100%"><tr>
29<td valign="top">
30<h2><span class="refentrytitle"><a name="GstTaskPool.top_of_page"></a>GstTaskPool</span></h2>
31<p>GstTaskPool — Pool of GStreamer streaming threads</p>
32</td>
33<td class="gallery_image" valign="top" align="right"></td>
34</tr></table></div>
35<div class="refsect1">
36<a name="GstTaskPool.functions"></a><h2>Functions</h2>
37<div class="informaltable"><table class="informaltable" width="100%" border="0">
38<colgroup>
39<col width="150px" class="functions_return">
40<col class="functions_name">
41</colgroup>
42<tbody>
43<tr>
44<td class="function_type">
45<span class="returnvalue">void</span>
46</td>
47<td class="function_name">
48<span class="c_punctuation">(</span><a class="link" href="GstTaskPool.html#GstTaskPoolFunction" title="GstTaskPoolFunction ()">*GstTaskPoolFunction</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
49</td>
50</tr>
51<tr>
52<td class="function_type">
53<a class="link" href="GstTaskPool.html" title="GstTaskPool"><span class="returnvalue">GstTaskPool</span></a> *
54</td>
55<td class="function_name">
56<a class="link" href="GstTaskPool.html#gst-task-pool-new" title="gst_task_pool_new ()">gst_task_pool_new</a> <span class="c_punctuation">()</span>
57</td>
58</tr>
59<tr>
60<td class="function_type">
61<span class="returnvalue">void</span>
62</td>
63<td class="function_name">
64<a class="link" href="GstTaskPool.html#gst-task-pool-prepare" title="gst_task_pool_prepare ()">gst_task_pool_prepare</a> <span class="c_punctuation">()</span>
65</td>
66</tr>
67<tr>
68<td class="function_type">
69<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>
70</td>
71<td class="function_name">
72<a class="link" href="GstTaskPool.html#gst-task-pool-push" title="gst_task_pool_push ()">gst_task_pool_push</a> <span class="c_punctuation">()</span>
73</td>
74</tr>
75<tr>
76<td class="function_type">
77<span class="returnvalue">void</span>
78</td>
79<td class="function_name">
80<a class="link" href="GstTaskPool.html#gst-task-pool-join" title="gst_task_pool_join ()">gst_task_pool_join</a> <span class="c_punctuation">()</span>
81</td>
82</tr>
83<tr>
84<td class="function_type">
85<span class="returnvalue">void</span>
86</td>
87<td class="function_name">
88<a class="link" href="GstTaskPool.html#gst-task-pool-cleanup" title="gst_task_pool_cleanup ()">gst_task_pool_cleanup</a> <span class="c_punctuation">()</span>
89</td>
90</tr>
91</tbody>
92</table></div>
93</div>
94<div class="refsect1">
95<a name="GstTaskPool.other"></a><h2>Types and Values</h2>
96<div class="informaltable"><table class="informaltable" width="100%" border="0">
97<colgroup>
98<col width="150px" class="name">
99<col class="description">
100</colgroup>
101<tbody>
102<tr>
103<td class="datatype_keyword">struct</td>
104<td class="function_name"><a class="link" href="GstTaskPool.html#GstTaskPool-struct" title="struct GstTaskPool">GstTaskPool</a></td>
105</tr>
106<tr>
107<td class="datatype_keyword">struct</td>
108<td class="function_name"><a class="link" href="GstTaskPool.html#GstTaskPoolClass" title="struct GstTaskPoolClass">GstTaskPoolClass</a></td>
109</tr>
110</tbody>
111</table></div>
112</div>
113<div class="refsect1">
114<a name="GstTaskPool.object-hierarchy"></a><h2>Object Hierarchy</h2>
115<pre class="screen">    <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject-struct">GObject</a>
116    <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GInitiallyUnowned">GInitiallyUnowned</a>
117        <span class="lineart">╰──</span> <a class="link" href="GstObject.html" title="GstObject">GstObject</a>
118            <span class="lineart">╰──</span> GstTaskPool
119</pre>
120</div>
121<div class="refsect1">
122<a name="GstTaskPool.includes"></a><h2>Includes</h2>
123<pre class="synopsis">#include &lt;gst/gst.h&gt;
124</pre>
125</div>
126<div class="refsect1">
127<a name="GstTaskPool.description"></a><h2>Description</h2>
128<p>This object provides an abstraction for creating threads. The default
129implementation uses a regular GThreadPool to start tasks.</p>
130<p>Subclasses can be made to create custom threads.</p>
131</div>
132<div class="refsect1">
133<a name="GstTaskPool.functions_details"></a><h2>Functions</h2>
134<div class="refsect2">
135<a name="GstTaskPoolFunction"></a><h3>GstTaskPoolFunction ()</h3>
136<pre class="programlisting"><span class="returnvalue">void</span>
137<span class="c_punctuation">(</span>*GstTaskPoolFunction<span class="c_punctuation">)</span> (<em class="parameter"><code><span class="type">void</span> *user_data</code></em>);</pre>
138<p>Task function, see <a class="link" href="GstTaskPool.html#gst-task-pool-push" title="gst_task_pool_push ()"><code class="function">gst_task_pool_push()</code></a>.</p>
139<div class="refsect3">
140<a name="GstTaskPoolFunction.parameters"></a><h4>Parameters</h4>
141<div class="informaltable"><table class="informaltable" width="100%" border="0">
142<colgroup>
143<col width="150px" class="parameters_name">
144<col class="parameters_description">
145<col width="200px" class="parameters_annotations">
146</colgroup>
147<tbody><tr>
148<td class="parameter_name"><p>user_data</p></td>
149<td class="parameter_description"><p>user data for the task function</p></td>
150<td class="parameter_annotations"> </td>
151</tr></tbody>
152</table></div>
153</div>
154</div>
155<hr>
156<div class="refsect2">
157<a name="gst-task-pool-new"></a><h3>gst_task_pool_new ()</h3>
158<pre class="programlisting"><a class="link" href="GstTaskPool.html" title="GstTaskPool"><span class="returnvalue">GstTaskPool</span></a> *
159gst_task_pool_new (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
160<p>Create a new default task pool. The default task pool will use a regular
161GThreadPool for threads.</p>
162<div class="refsect3">
163<a name="gst-task-pool-new.returns"></a><h4>Returns</h4>
164<p>a new <a class="link" href="GstTaskPool.html" title="GstTaskPool"><span class="type">GstTaskPool</span></a>. <a class="link" href="GstObject.html#gst-object-unref" title="gst_object_unref ()"><code class="function">gst_object_unref()</code></a> after usage. </p>
165<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
166</div>
167</div>
168<hr>
169<div class="refsect2">
170<a name="gst-task-pool-prepare"></a><h3>gst_task_pool_prepare ()</h3>
171<pre class="programlisting"><span class="returnvalue">void</span>
172gst_task_pool_prepare (<em class="parameter"><code><a class="link" href="GstTaskPool.html" title="GstTaskPool"><span class="type">GstTaskPool</span></a> *pool</code></em>,
173                       <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
174<p>Prepare the taskpool for accepting <a class="link" href="GstTaskPool.html#gst-task-pool-push" title="gst_task_pool_push ()"><code class="function">gst_task_pool_push()</code></a> operations.</p>
175<p>MT safe.</p>
176<div class="refsect3">
177<a name="gst-task-pool-prepare.parameters"></a><h4>Parameters</h4>
178<div class="informaltable"><table class="informaltable" width="100%" border="0">
179<colgroup>
180<col width="150px" class="parameters_name">
181<col class="parameters_description">
182<col width="200px" class="parameters_annotations">
183</colgroup>
184<tbody>
185<tr>
186<td class="parameter_name"><p>pool</p></td>
187<td class="parameter_description"><p>a <a class="link" href="GstTaskPool.html" title="GstTaskPool"><span class="type">GstTaskPool</span></a></p></td>
188<td class="parameter_annotations"> </td>
189</tr>
190<tr>
191<td class="parameter_name"><p>error</p></td>
192<td class="parameter_description"><p>an error return location</p></td>
193<td class="parameter_annotations"> </td>
194</tr>
195</tbody>
196</table></div>
197</div>
198</div>
199<hr>
200<div class="refsect2">
201<a name="gst-task-pool-push"></a><h3>gst_task_pool_push ()</h3>
202<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>
203gst_task_pool_push (<em class="parameter"><code><a class="link" href="GstTaskPool.html" title="GstTaskPool"><span class="type">GstTaskPool</span></a> *pool</code></em>,
204                    <em class="parameter"><code><a class="link" href="GstTaskPool.html#GstTaskPoolFunction" title="GstTaskPoolFunction ()"><span class="type">GstTaskPoolFunction</span></a> func</code></em>,
205                    <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>,
206                    <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
207<p>Start the execution of a new thread from <em class="parameter"><code>pool</code></em>
208.</p>
209<div class="refsect3">
210<a name="gst-task-pool-push.parameters"></a><h4>Parameters</h4>
211<div class="informaltable"><table class="informaltable" width="100%" border="0">
212<colgroup>
213<col width="150px" class="parameters_name">
214<col class="parameters_description">
215<col width="200px" class="parameters_annotations">
216</colgroup>
217<tbody>
218<tr>
219<td class="parameter_name"><p>pool</p></td>
220<td class="parameter_description"><p>a <a class="link" href="GstTaskPool.html" title="GstTaskPool"><span class="type">GstTaskPool</span></a></p></td>
221<td class="parameter_annotations"> </td>
222</tr>
223<tr>
224<td class="parameter_name"><p>func</p></td>
225<td class="parameter_description"><p>the function to call. </p></td>
226<td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span></td>
227</tr>
228<tr>
229<td class="parameter_name"><p>user_data</p></td>
230<td class="parameter_description"><p>data to pass to <em class="parameter"><code>func</code></em>
231. </p></td>
232<td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td>
233</tr>
234<tr>
235<td class="parameter_name"><p>error</p></td>
236<td class="parameter_description"><p>return location for an error</p></td>
237<td class="parameter_annotations"> </td>
238</tr>
239</tbody>
240</table></div>
241</div>
242<div class="refsect3">
243<a name="gst-task-pool-push.returns"></a><h4>Returns</h4>
244<p>a pointer that should be used
245for the gst_task_pool_join function. This pointer can be <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, you
246must check <em class="parameter"><code>error</code></em>
247to detect errors. </p>
248<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></p>
249</div>
250</div>
251<hr>
252<div class="refsect2">
253<a name="gst-task-pool-join"></a><h3>gst_task_pool_join ()</h3>
254<pre class="programlisting"><span class="returnvalue">void</span>
255gst_task_pool_join (<em class="parameter"><code><a class="link" href="GstTaskPool.html" title="GstTaskPool"><span class="type">GstTaskPool</span></a> *pool</code></em>,
256                    <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> id</code></em>);</pre>
257<p>Join a task and/or return it to the pool. <em class="parameter"><code>id</code></em>
258 is the id obtained from
259<a class="link" href="GstTaskPool.html#gst-task-pool-push" title="gst_task_pool_push ()"><code class="function">gst_task_pool_push()</code></a>.</p>
260<div class="refsect3">
261<a name="gst-task-pool-join.parameters"></a><h4>Parameters</h4>
262<div class="informaltable"><table class="informaltable" width="100%" border="0">
263<colgroup>
264<col width="150px" class="parameters_name">
265<col class="parameters_description">
266<col width="200px" class="parameters_annotations">
267</colgroup>
268<tbody>
269<tr>
270<td class="parameter_name"><p>pool</p></td>
271<td class="parameter_description"><p>a <a class="link" href="GstTaskPool.html" title="GstTaskPool"><span class="type">GstTaskPool</span></a></p></td>
272<td class="parameter_annotations"> </td>
273</tr>
274<tr>
275<td class="parameter_name"><p>id</p></td>
276<td class="parameter_description"><p>the id</p></td>
277<td class="parameter_annotations"> </td>
278</tr>
279</tbody>
280</table></div>
281</div>
282</div>
283<hr>
284<div class="refsect2">
285<a name="gst-task-pool-cleanup"></a><h3>gst_task_pool_cleanup ()</h3>
286<pre class="programlisting"><span class="returnvalue">void</span>
287gst_task_pool_cleanup (<em class="parameter"><code><a class="link" href="GstTaskPool.html" title="GstTaskPool"><span class="type">GstTaskPool</span></a> *pool</code></em>);</pre>
288<p>Wait for all tasks to be stopped. This is mainly used internally
289to ensure proper cleanup of internal data structures in test suites.</p>
290<p>MT safe.</p>
291<div class="refsect3">
292<a name="gst-task-pool-cleanup.parameters"></a><h4>Parameters</h4>
293<div class="informaltable"><table class="informaltable" width="100%" border="0">
294<colgroup>
295<col width="150px" class="parameters_name">
296<col class="parameters_description">
297<col width="200px" class="parameters_annotations">
298</colgroup>
299<tbody><tr>
300<td class="parameter_name"><p>pool</p></td>
301<td class="parameter_description"><p>a <a class="link" href="GstTaskPool.html" title="GstTaskPool"><span class="type">GstTaskPool</span></a></p></td>
302<td class="parameter_annotations"> </td>
303</tr></tbody>
304</table></div>
305</div>
306</div>
307</div>
308<div class="refsect1">
309<a name="GstTaskPool.other_details"></a><h2>Types and Values</h2>
310<div class="refsect2">
311<a name="GstTaskPool-struct"></a><h3>struct GstTaskPool</h3>
312<pre class="programlisting">struct GstTaskPool;</pre>
313<p>The <a class="link" href="GstTaskPool.html" title="GstTaskPool"><span class="type">GstTaskPool</span></a> object.</p>
314</div>
315<hr>
316<div class="refsect2">
317<a name="GstTaskPoolClass"></a><h3>struct GstTaskPoolClass</h3>
318<pre class="programlisting">struct GstTaskPoolClass {
319  GstObjectClass parent_class;
320
321  void      (*prepare)  (GstTaskPool *pool, GError **error);
322  void      (*cleanup)  (GstTaskPool *pool);
323
324  gpointer  (*push)     (GstTaskPool *pool, GstTaskPoolFunction func,
325                         gpointer user_data, GError **error);
326  void      (*join)     (GstTaskPool *pool, gpointer id);
327};
328</pre>
329<p>The <a class="link" href="GstTaskPool.html#GstTaskPoolClass" title="struct GstTaskPoolClass"><span class="type">GstTaskPoolClass</span></a> object.</p>
330<div class="refsect3">
331<a name="GstTaskPoolClass.members"></a><h4>Members</h4>
332<div class="informaltable"><table class="informaltable" width="100%" border="0">
333<colgroup>
334<col width="300px" class="struct_members_name">
335<col class="struct_members_description">
336<col width="200px" class="struct_members_annotations">
337</colgroup>
338<tbody>
339<tr>
340<td class="struct_member_name"><p><em class="structfield"><code><a name="GstTaskPoolClass.prepare"></a>prepare</code></em> ()</p></td>
341<td class="struct_member_description"><p>prepare the threadpool</p></td>
342<td class="struct_member_annotations"> </td>
343</tr>
344<tr>
345<td class="struct_member_name"><p><em class="structfield"><code><a name="GstTaskPoolClass.cleanup"></a>cleanup</code></em> ()</p></td>
346<td class="struct_member_description"><p>make sure all threads are stopped</p></td>
347<td class="struct_member_annotations"> </td>
348</tr>
349<tr>
350<td class="struct_member_name"><p><em class="structfield"><code><a name="GstTaskPoolClass.push"></a>push</code></em> ()</p></td>
351<td class="struct_member_description"><p>start a new thread</p></td>
352<td class="struct_member_annotations"> </td>
353</tr>
354<tr>
355<td class="struct_member_name"><p><em class="structfield"><code><a name="GstTaskPoolClass.join"></a>join</code></em> ()</p></td>
356<td class="struct_member_description"><p>join a thread</p></td>
357<td class="struct_member_annotations"> </td>
358</tr>
359</tbody>
360</table></div>
361</div>
362</div>
363</div>
364<div class="refsect1">
365<a name="GstTaskPool.see-also"></a><h2>See Also</h2>
366<p><a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a>, <a class="link" href="GstPad.html" title="GstPad"><span class="type">GstPad</span></a></p>
367</div>
368</div>
369<div class="footer">
370<hr>Generated by GTK-Doc V1.28</div>
371</body>
372</html>