1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>GStreamer RTSP Server Reference Manual: GstRTSPThreadPool</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
7 <link rel="home" href="index.html" title="GStreamer RTSP Server Reference Manual">
8 <link rel="up" href="ch01.html" title="">
9 <link rel="prev" href="gst-rtsp-server-GstRTSPAddressPool.html" title="GstRTSPAddressPool">
10 <link rel="next" href="GstRTSPAuth.html" title="GstRTSPAuth">
11 <meta name="generator" content="GTK-Doc V1.21 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
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">|</span>
18 <a href="#gst-rtsp-server-GstRTSPThreadPool.description" class="shortcut">Description</a></span>
20 <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
21 <td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
22 <td><a accesskey="p" href="gst-rtsp-server-GstRTSPAddressPool.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
23 <td><a accesskey="n" href="GstRTSPAuth.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
25 <div class="refentry">
26 <a name="gst-rtsp-server-GstRTSPThreadPool"></a><div class="titlepage"></div>
27 <div class="refnamediv"><table width="100%"><tr>
29 <h2><span class="refentrytitle"><a name="gst-rtsp-server-GstRTSPThreadPool.top_of_page"></a>GstRTSPThreadPool</span></h2>
30 <p>GstRTSPThreadPool — A pool of threads</p>
32 <td class="gallery_image" valign="top" align="right"></td>
34 <div class="refsect1">
35 <a name="gst-rtsp-server-GstRTSPThreadPool.functions"></a><h2>Functions</h2>
36 <div class="informaltable"><table width="100%" border="0">
38 <col width="150px" class="functions_return">
39 <col class="functions_name">
43 <td class="function_type">
44 <a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GstRTSPThread" title="struct GstRTSPThread"><span class="returnvalue">GstRTSPThread</span></a> *
46 <td class="function_name">
47 <a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#gst-rtsp-thread-new" title="gst_rtsp_thread_new ()">gst_rtsp_thread_new</a> <span class="c_punctuation">()</span>
51 <td class="function_type">
52 <a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GstRTSPThread" title="struct GstRTSPThread"><span class="returnvalue">GstRTSPThread</span></a> *
54 <td class="function_name">
55 <a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#gst-rtsp-thread-ref" title="gst_rtsp_thread_ref ()">gst_rtsp_thread_ref</a> <span class="c_punctuation">()</span>
59 <td class="function_type">
60 <span class="returnvalue">void</span>
62 <td class="function_name">
63 <a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#gst-rtsp-thread-unref" title="gst_rtsp_thread_unref ()">gst_rtsp_thread_unref</a> <span class="c_punctuation">()</span>
67 <td class="function_type">
68 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
70 <td class="function_name">
71 <a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#gst-rtsp-thread-reuse" title="gst_rtsp_thread_reuse ()">gst_rtsp_thread_reuse</a> <span class="c_punctuation">()</span>
75 <td class="function_type">
76 <span class="returnvalue">void</span>
78 <td class="function_name">
79 <a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#gst-rtsp-thread-stop" title="gst_rtsp_thread_stop ()">gst_rtsp_thread_stop</a> <span class="c_punctuation">()</span>
83 <td class="function_type">
84 <a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GstRTSPThreadPool" title="struct GstRTSPThreadPool"><span class="returnvalue">GstRTSPThreadPool</span></a> *
86 <td class="function_name">
87 <a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#gst-rtsp-thread-pool-new" title="gst_rtsp_thread_pool_new ()">gst_rtsp_thread_pool_new</a> <span class="c_punctuation">()</span>
91 <td class="function_type">
92 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>
94 <td class="function_name">
95 <a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#gst-rtsp-thread-pool-get-max-threads" title="gst_rtsp_thread_pool_get_max_threads ()">gst_rtsp_thread_pool_get_max_threads</a> <span class="c_punctuation">()</span>
99 <td class="function_type">
100 <span class="returnvalue">void</span>
102 <td class="function_name">
103 <a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#gst-rtsp-thread-pool-set-max-threads" title="gst_rtsp_thread_pool_set_max_threads ()">gst_rtsp_thread_pool_set_max_threads</a> <span class="c_punctuation">()</span>
107 <td class="function_type">
108 <a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GstRTSPThread" title="struct GstRTSPThread"><span class="returnvalue">GstRTSPThread</span></a> *
110 <td class="function_name">
111 <a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#gst-rtsp-thread-pool-get-thread" title="gst_rtsp_thread_pool_get_thread ()">gst_rtsp_thread_pool_get_thread</a> <span class="c_punctuation">()</span>
115 <td class="function_type">
116 <span class="returnvalue">void</span>
118 <td class="function_name">
119 <a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#gst-rtsp-thread-pool-cleanup" title="gst_rtsp_thread_pool_cleanup ()">gst_rtsp_thread_pool_cleanup</a> <span class="c_punctuation">()</span>
125 <div class="refsect1">
126 <a name="gst-rtsp-server-GstRTSPThreadPool.other"></a><h2>Types and Values</h2>
127 <div class="informaltable"><table width="100%" border="0">
129 <col width="150px" class="name">
130 <col class="description">
134 <td class="datatype_keyword">enum</td>
135 <td class="function_name"><a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GstRTSPThreadType" title="enum GstRTSPThreadType">GstRTSPThreadType</a></td>
138 <td class="datatype_keyword">struct</td>
139 <td class="function_name"><a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GstRTSPThread" title="struct GstRTSPThread">GstRTSPThread</a></td>
142 <td class="datatype_keyword">struct</td>
143 <td class="function_name"><a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GstRTSPThreadPool" title="struct GstRTSPThreadPool">GstRTSPThreadPool</a></td>
146 <td class="datatype_keyword">struct</td>
147 <td class="function_name"><a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GstRTSPThreadPoolClass" title="struct GstRTSPThreadPoolClass">GstRTSPThreadPoolClass</a></td>
152 <div class="refsect1">
153 <a name="gst-rtsp-server-GstRTSPThreadPool.description"></a><h2>Description</h2>
154 <p>A <a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GstRTSPThreadPool" title="struct GstRTSPThreadPool"><span class="type">GstRTSPThreadPool</span></a> manages reusable threads for various server tasks.
155 Currently the defined thread types can be found in <a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GstRTSPThreadType" title="enum GstRTSPThreadType"><span class="type">GstRTSPThreadType</span></a>.</p>
156 <p>Threads of type <a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GST-RTSP-THREAD-TYPE-CLIENT:CAPS"><span class="type">GST_RTSP_THREAD_TYPE_CLIENT</span></a> are used to handle requests from
157 a connected client. With <a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#gst-rtsp-thread-pool-get-max-threads" title="gst_rtsp_thread_pool_get_max_threads ()"><code class="function">gst_rtsp_thread_pool_get_max_threads()</code></a> a maximum
158 number of threads can be set after which the pool will start to reuse the
159 same thread for multiple clients.</p>
160 <p>Threads of type <a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GST-RTSP-THREAD-TYPE-MEDIA:CAPS"><span class="type">GST_RTSP_THREAD_TYPE_MEDIA</span></a> will be used to perform the state
161 changes of the media pipelines and handle its bus messages.</p>
162 <p>gst_rtsp_thread_pool_get_thread() can be used to create a <a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GstRTSPThread" title="struct GstRTSPThread"><span class="type">GstRTSPThread</span></a>
163 object of the right type. The thread object contains a mainloop and context
164 that run in a seperate thread and can be used to attached sources to.</p>
165 <p>gst_rtsp_thread_reuse() can be used to reuse a thread for multiple purposes.
166 If all <a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#gst-rtsp-thread-reuse" title="gst_rtsp_thread_reuse ()"><code class="function">gst_rtsp_thread_reuse()</code></a> calls are matched with a
167 <a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#gst-rtsp-thread-stop" title="gst_rtsp_thread_stop ()"><code class="function">gst_rtsp_thread_stop()</code></a> call, the mainloop will be quit and the thread will
169 <p>To configure the threads, a subclass of this object should be made and the
170 virtual methods should be overriden to implement the desired functionality.</p>
171 <p>Last reviewed on 2013-07-11 (1.0.0)</p>
173 <div class="refsect1">
174 <a name="gst-rtsp-server-GstRTSPThreadPool.functions_details"></a><h2>Functions</h2>
175 <div class="refsect2">
176 <a name="gst-rtsp-thread-new"></a><h3>gst_rtsp_thread_new ()</h3>
177 <pre class="programlisting"><a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GstRTSPThread" title="struct GstRTSPThread"><span class="returnvalue">GstRTSPThread</span></a> *
178 gst_rtsp_thread_new (<em class="parameter"><code><a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GstRTSPThreadType" title="enum GstRTSPThreadType"><span class="type">GstRTSPThreadType</span></a> type</code></em>);</pre>
179 <p>Create a new thread object that can run a mainloop.</p>
180 <div class="refsect3">
181 <a name="id-1.2.15.6.2.5"></a><h4>Parameters</h4>
182 <div class="informaltable"><table width="100%" border="0">
184 <col width="150px" class="parameters_name">
185 <col class="parameters_description">
186 <col width="200px" class="parameters_annotations">
189 <td class="parameter_name"><p>type</p></td>
190 <td class="parameter_description"><p>the thread type</p></td>
191 <td class="parameter_annotations"> </td>
195 <div class="refsect3">
196 <a name="id-1.2.15.6.2.6"></a><h4>Returns</h4>
197 <p> a <a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GstRTSPThread" title="struct GstRTSPThread"><span class="type">GstRTSPThread</span></a>. </p>
198 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
202 <div class="refsect2">
203 <a name="gst-rtsp-thread-ref"></a><h3>gst_rtsp_thread_ref ()</h3>
204 <pre class="programlisting"><a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GstRTSPThread" title="struct GstRTSPThread"><span class="returnvalue">GstRTSPThread</span></a> *
205 gst_rtsp_thread_ref (<em class="parameter"><code><a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GstRTSPThread" title="struct GstRTSPThread"><span class="type">GstRTSPThread</span></a> *thread</code></em>);</pre>
206 <p>Increase the refcount of this thread.</p>
207 <div class="refsect3">
208 <a name="id-1.2.15.6.3.5"></a><h4>Parameters</h4>
209 <div class="informaltable"><table width="100%" border="0">
211 <col width="150px" class="parameters_name">
212 <col class="parameters_description">
213 <col width="200px" class="parameters_annotations">
216 <td class="parameter_name"><p>thread</p></td>
217 <td class="parameter_description"><p>The thread to refcount</p></td>
218 <td class="parameter_annotations"> </td>
222 <div class="refsect3">
223 <a name="id-1.2.15.6.3.6"></a><h4>Returns</h4>
224 <p> <em class="parameter"><code>thread</code></em>
225 (for convenience when doing assignments). </p>
226 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
230 <div class="refsect2">
231 <a name="gst-rtsp-thread-unref"></a><h3>gst_rtsp_thread_unref ()</h3>
232 <pre class="programlisting"><span class="returnvalue">void</span>
233 gst_rtsp_thread_unref (<em class="parameter"><code><a class="link" href="gst-rtsp-server-GstRTSPPermissions.html#GstRTSPPermissions" title="struct GstRTSPPermissions"><span class="type">GstRTSPPermissions</span></a> *thread</code></em>);</pre>
234 <p>Decrease the refcount of an thread, freeing it if the refcount reaches 0.</p>
235 <div class="refsect3">
236 <a name="id-1.2.15.6.4.5"></a><h4>Parameters</h4>
237 <div class="informaltable"><table width="100%" border="0">
239 <col width="150px" class="parameters_name">
240 <col class="parameters_description">
241 <col width="200px" class="parameters_annotations">
244 <td class="parameter_name"><p>thread</p></td>
245 <td class="parameter_description"><p> the thread to refcount. </p></td>
246 <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>
252 <div class="refsect2">
253 <a name="gst-rtsp-thread-reuse"></a><h3>gst_rtsp_thread_reuse ()</h3>
254 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
255 gst_rtsp_thread_reuse (<em class="parameter"><code><a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GstRTSPThread" title="struct GstRTSPThread"><span class="type">GstRTSPThread</span></a> *thread</code></em>);</pre>
256 <p>Reuse the mainloop of <em class="parameter"><code>thread</code></em>
258 <div class="refsect3">
259 <a name="id-1.2.15.6.5.5"></a><h4>Parameters</h4>
260 <div class="informaltable"><table width="100%" border="0">
262 <col width="150px" class="parameters_name">
263 <col class="parameters_description">
264 <col width="200px" class="parameters_annotations">
267 <td class="parameter_name"><p>thread</p></td>
268 <td class="parameter_description"><p> a <a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GstRTSPThread" title="struct GstRTSPThread"><span class="type">GstRTSPThread</span></a>. </p></td>
269 <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>
273 <div class="refsect3">
274 <a name="id-1.2.15.6.5.6"></a><h4>Returns</h4>
275 <p> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the mainloop could be reused</p>
280 <div class="refsect2">
281 <a name="gst-rtsp-thread-stop"></a><h3>gst_rtsp_thread_stop ()</h3>
282 <pre class="programlisting"><span class="returnvalue">void</span>
283 gst_rtsp_thread_stop (<em class="parameter"><code><a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GstRTSPThread" title="struct GstRTSPThread"><span class="type">GstRTSPThread</span></a> *thread</code></em>);</pre>
284 <p>Stop and unref <em class="parameter"><code>thread</code></em>
285 . When no threads are using the mainloop, the thread
286 will be stopped and the final ref to <em class="parameter"><code>thread</code></em>
287 will be released.</p>
288 <div class="refsect3">
289 <a name="id-1.2.15.6.6.5"></a><h4>Parameters</h4>
290 <div class="informaltable"><table width="100%" border="0">
292 <col width="150px" class="parameters_name">
293 <col class="parameters_description">
294 <col width="200px" class="parameters_annotations">
297 <td class="parameter_name"><p>thread</p></td>
298 <td class="parameter_description"><p> a <a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GstRTSPThread" title="struct GstRTSPThread"><span class="type">GstRTSPThread</span></a>. </p></td>
299 <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>
305 <div class="refsect2">
306 <a name="gst-rtsp-thread-pool-new"></a><h3>gst_rtsp_thread_pool_new ()</h3>
307 <pre class="programlisting"><a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GstRTSPThreadPool" title="struct GstRTSPThreadPool"><span class="returnvalue">GstRTSPThreadPool</span></a> *
308 gst_rtsp_thread_pool_new (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
309 <p>Create a new <a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GstRTSPThreadPool" title="struct GstRTSPThreadPool"><span class="type">GstRTSPThreadPool</span></a> instance.</p>
310 <div class="refsect3">
311 <a name="id-1.2.15.6.7.5"></a><h4>Returns</h4>
312 <p> a new <a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GstRTSPThreadPool" title="struct GstRTSPThreadPool"><span class="type">GstRTSPThreadPool</span></a>. </p>
313 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
317 <div class="refsect2">
318 <a name="gst-rtsp-thread-pool-get-max-threads"></a><h3>gst_rtsp_thread_pool_get_max_threads ()</h3>
319 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>
320 gst_rtsp_thread_pool_get_max_threads (<em class="parameter"><code><a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GstRTSPThreadPool" title="struct GstRTSPThreadPool"><span class="type">GstRTSPThreadPool</span></a> *pool</code></em>);</pre>
321 <p>Get the maximum number of threads used for client connections.
322 See <a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#gst-rtsp-thread-pool-set-max-threads" title="gst_rtsp_thread_pool_set_max_threads ()"><code class="function">gst_rtsp_thread_pool_set_max_threads()</code></a>.</p>
323 <div class="refsect3">
324 <a name="id-1.2.15.6.8.5"></a><h4>Parameters</h4>
325 <div class="informaltable"><table width="100%" border="0">
327 <col width="150px" class="parameters_name">
328 <col class="parameters_description">
329 <col width="200px" class="parameters_annotations">
332 <td class="parameter_name"><p>pool</p></td>
333 <td class="parameter_description"><p>a <a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GstRTSPThreadPool" title="struct GstRTSPThreadPool"><span class="type">GstRTSPThreadPool</span></a></p></td>
334 <td class="parameter_annotations"> </td>
338 <div class="refsect3">
339 <a name="id-1.2.15.6.8.6"></a><h4>Returns</h4>
340 <p> the maximum number of threads.</p>
345 <div class="refsect2">
346 <a name="gst-rtsp-thread-pool-set-max-threads"></a><h3>gst_rtsp_thread_pool_set_max_threads ()</h3>
347 <pre class="programlisting"><span class="returnvalue">void</span>
348 gst_rtsp_thread_pool_set_max_threads (<em class="parameter"><code><a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GstRTSPThreadPool" title="struct GstRTSPThreadPool"><span class="type">GstRTSPThreadPool</span></a> *pool</code></em>,
349 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> max_threads</code></em>);</pre>
350 <p>Set the maximum threads used by the pool to handle client requests.
351 A value of 0 will use the pool mainloop, a value of -1 will use an
352 unlimited number of threads.</p>
353 <div class="refsect3">
354 <a name="id-1.2.15.6.9.5"></a><h4>Parameters</h4>
355 <div class="informaltable"><table width="100%" border="0">
357 <col width="150px" class="parameters_name">
358 <col class="parameters_description">
359 <col width="200px" class="parameters_annotations">
363 <td class="parameter_name"><p>pool</p></td>
364 <td class="parameter_description"><p>a <a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GstRTSPThreadPool" title="struct GstRTSPThreadPool"><span class="type">GstRTSPThreadPool</span></a></p></td>
365 <td class="parameter_annotations"> </td>
368 <td class="parameter_name"><p>max_threads</p></td>
369 <td class="parameter_description"><p>maximum threads</p></td>
370 <td class="parameter_annotations"> </td>
377 <div class="refsect2">
378 <a name="gst-rtsp-thread-pool-get-thread"></a><h3>gst_rtsp_thread_pool_get_thread ()</h3>
379 <pre class="programlisting"><a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GstRTSPThread" title="struct GstRTSPThread"><span class="returnvalue">GstRTSPThread</span></a> *
380 gst_rtsp_thread_pool_get_thread (<em class="parameter"><code><a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GstRTSPThreadPool" title="struct GstRTSPThreadPool"><span class="type">GstRTSPThreadPool</span></a> *pool</code></em>,
381 <em class="parameter"><code><a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GstRTSPThreadType" title="enum GstRTSPThreadType"><span class="type">GstRTSPThreadType</span></a> type</code></em>,
382 <em class="parameter"><code><a class="link" href="gst-rtsp-server-GstRTSPContext.html#GstRTSPContext" title="struct GstRTSPContext"><span class="type">GstRTSPContext</span></a> *ctx</code></em>);</pre>
383 <p>Get a new <a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GstRTSPThread" title="struct GstRTSPThread"><span class="type">GstRTSPThread</span></a> for <em class="parameter"><code>type</code></em>
384 and <em class="parameter"><code>ctx</code></em>
386 <div class="refsect3">
387 <a name="id-1.2.15.6.10.5"></a><h4>Parameters</h4>
388 <div class="informaltable"><table width="100%" border="0">
390 <col width="150px" class="parameters_name">
391 <col class="parameters_description">
392 <col width="200px" class="parameters_annotations">
396 <td class="parameter_name"><p>pool</p></td>
397 <td class="parameter_description"><p>a <a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GstRTSPThreadPool" title="struct GstRTSPThreadPool"><span class="type">GstRTSPThreadPool</span></a></p></td>
398 <td class="parameter_annotations"> </td>
401 <td class="parameter_name"><p>type</p></td>
402 <td class="parameter_description"><p>the <a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GstRTSPThreadType" title="enum GstRTSPThreadType"><span class="type">GstRTSPThreadType</span></a></p></td>
403 <td class="parameter_annotations"> </td>
406 <td class="parameter_name"><p>ctx</p></td>
407 <td class="parameter_description"><p> a <a class="link" href="gst-rtsp-server-GstRTSPContext.html#GstRTSPContext" title="struct GstRTSPContext"><span class="type">GstRTSPContext</span></a>. </p></td>
408 <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>
413 <div class="refsect3">
414 <a name="id-1.2.15.6.10.6"></a><h4>Returns</h4>
415 <p> a new <a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GstRTSPThread" title="struct GstRTSPThread"><span class="type">GstRTSPThread</span></a>, <a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#gst-rtsp-thread-stop" title="gst_rtsp_thread_stop ()"><code class="function">gst_rtsp_thread_stop()</code></a> after usage. </p>
416 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
420 <div class="refsect2">
421 <a name="gst-rtsp-thread-pool-cleanup"></a><h3>gst_rtsp_thread_pool_cleanup ()</h3>
422 <pre class="programlisting"><span class="returnvalue">void</span>
423 gst_rtsp_thread_pool_cleanup (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
424 <p>Wait for all tasks to be stopped and free all allocated resources. This is
425 mainly used in test suites to ensure proper cleanup of internal data
429 <div class="refsect1">
430 <a name="gst-rtsp-server-GstRTSPThreadPool.other_details"></a><h2>Types and Values</h2>
431 <div class="refsect2">
432 <a name="GstRTSPThreadType"></a><h3>enum GstRTSPThreadType</h3>
433 <p>Different thread types</p>
434 <div class="refsect3">
435 <a name="id-1.2.15.7.2.4"></a><h4>Members</h4>
436 <div class="informaltable"><table width="100%" border="0">
438 <col width="300px" class="enum_members_name">
439 <col class="enum_members_description">
440 <col width="200px" class="enum_members_annotations">
444 <td class="enum_member_name"><p><a name="GST-RTSP-THREAD-TYPE-CLIENT:CAPS"></a>GST_RTSP_THREAD_TYPE_CLIENT</p></td>
445 <td class="enum_member_description">
446 <p>a thread to handle the client communication</p>
448 <td class="enum_member_annotations"> </td>
451 <td class="enum_member_name"><p><a name="GST-RTSP-THREAD-TYPE-MEDIA:CAPS"></a>GST_RTSP_THREAD_TYPE_MEDIA</p></td>
452 <td class="enum_member_description">
453 <p>a thread to handle media </p>
455 <td class="enum_member_annotations"> </td>
462 <div class="refsect2">
463 <a name="GstRTSPThread"></a><h3>struct GstRTSPThread</h3>
464 <pre class="programlisting">struct GstRTSPThread {
465 GstMiniObject mini_object;
467 GstRTSPThreadType type;
468 GMainContext *context;
472 <p>Structure holding info about a mainloop running in a thread</p>
473 <div class="refsect3">
474 <a name="id-1.2.15.7.3.5"></a><h4>Members</h4>
475 <div class="informaltable"><table width="100%" border="0">
477 <col width="300px" class="struct_members_name">
478 <col class="struct_members_description">
479 <col width="200px" class="struct_members_annotations">
483 <td class="struct_member_name"><p><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstMiniObject.html#GstMiniObject"><span class="type">GstMiniObject</span></a> <em class="structfield"><code><a name="GstRTSPThread.mini-object"></a>mini_object</code></em>;</p></td>
484 <td class="struct_member_description"><p>parent <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstMiniObject.html#GstMiniObject"><span class="type">GstMiniObject</span></a></p></td>
485 <td class="struct_member_annotations"> </td>
488 <td class="struct_member_name"><p><a class="link" href="gst-rtsp-server-GstRTSPThreadPool.html#GstRTSPThreadType" title="enum GstRTSPThreadType"><span class="type">GstRTSPThreadType</span></a> <em class="structfield"><code><a name="GstRTSPThread.type"></a>type</code></em>;</p></td>
489 <td class="struct_member_description"><p>the thread type</p></td>
490 <td class="struct_member_annotations"> </td>
493 <td class="struct_member_name"><p><a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainContext"><span class="type">GMainContext</span></a> *<em class="structfield"><code><a name="GstRTSPThread.context"></a>context</code></em>;</p></td>
494 <td class="struct_member_description"><p>a <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainContext"><span class="type">GMainContext</span></a></p></td>
495 <td class="struct_member_annotations"> </td>
498 <td class="struct_member_name"><p><a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainLoop"><span class="type">GMainLoop</span></a> *<em class="structfield"><code><a name="GstRTSPThread.loop"></a>loop</code></em>;</p></td>
499 <td class="struct_member_description"><p>a <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainLoop"><span class="type">GMainLoop</span></a></p></td>
500 <td class="struct_member_annotations"> </td>
507 <div class="refsect2">
508 <a name="GstRTSPThreadPool"></a><h3>struct GstRTSPThreadPool</h3>
509 <pre class="programlisting">struct GstRTSPThreadPool {
513 <p>The thread pool structure.</p>
516 <div class="refsect2">
517 <a name="GstRTSPThreadPoolClass"></a><h3>struct GstRTSPThreadPoolClass</h3>
518 <pre class="programlisting">struct GstRTSPThreadPoolClass {
519 GObjectClass parent_class;
523 GstRTSPThread * (*get_thread) (GstRTSPThreadPool *pool,
524 GstRTSPThreadType type,
525 GstRTSPContext *ctx);
526 void (*configure_thread) (GstRTSPThreadPool *pool,
527 GstRTSPThread * thread,
528 GstRTSPContext *ctx);
530 void (*thread_enter) (GstRTSPThreadPool *pool,
531 GstRTSPThread *thread);
532 void (*thread_leave) (GstRTSPThreadPool *pool,
533 GstRTSPThread *thread);
536 <p>Class for managing threads.</p>
537 <div class="refsect3">
538 <a name="id-1.2.15.7.5.5"></a><h4>Members</h4>
539 <div class="informaltable"><table width="100%" border="0">
541 <col width="300px" class="struct_members_name">
542 <col class="struct_members_description">
543 <col width="200px" class="struct_members_annotations">
547 <td class="struct_member_name"><p><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObjectClass"><span class="type">GObjectClass</span></a> <em class="structfield"><code><a name="GstRTSPThreadPoolClass.parent-class"></a>parent_class</code></em>;</p></td>
552 <td class="struct_member_name"><p><a href="http://library.gnome.org/devel/glib/unstable/glib-Thread-Pools.html#GThreadPool"><span class="type">GThreadPool</span></a> *<em class="structfield"><code><a name="GstRTSPThreadPoolClass.pool"></a>pool</code></em>;</p></td>
553 <td class="struct_member_description"><p>a <a href="http://library.gnome.org/devel/glib/unstable/glib-Thread-Pools.html#GThreadPool"><span class="type">GThreadPool</span></a> used internally</p></td>
554 <td class="struct_member_annotations"> </td>
557 <td class="struct_member_name"><p><em class="structfield"><code><a name="GstRTSPThreadPoolClass.get-thread"></a>get_thread</code></em> ()</p></td>
558 <td class="struct_member_description"><p>this function should make or reuse an existing thread that runs
560 <td class="struct_member_annotations"> </td>
563 <td class="struct_member_name"><p><em class="structfield"><code><a name="GstRTSPThreadPoolClass.configure-thread"></a>configure_thread</code></em> ()</p></td>
564 <td class="struct_member_description"><p>configure a thread object. this vmethod is called when
565 a new thread has been created and should be configured.</p></td>
566 <td class="struct_member_annotations"> </td>
569 <td class="struct_member_name"><p><em class="structfield"><code><a name="GstRTSPThreadPoolClass.thread-enter"></a>thread_enter</code></em> ()</p></td>
570 <td class="struct_member_description"><p>called from the thread when it is entered</p></td>
571 <td class="struct_member_annotations"> </td>
574 <td class="struct_member_name"><p><em class="structfield"><code><a name="GstRTSPThreadPoolClass.thread-leave"></a>thread_leave</code></em> ()</p></td>
575 <td class="struct_member_description"><p>called from the thread when it is left</p></td>
576 <td class="struct_member_annotations"> </td>
583 <div class="refsect1">
584 <a name="gst-rtsp-server-GstRTSPThreadPool.see-also"></a><h2>See Also</h2>
585 <p><a class="link" href="GstRTSPMedia.html" title="GstRTSPMedia"><span class="type">GstRTSPMedia</span></a>, <a class="link" href="GstRTSPClient.html" title="GstRTSPClient"><span class="type">GstRTSPClient</span></a></p>
590 Generated by GTK-Doc V1.21</div>