Initial release including wifi display based on gst-rtsp-server-1.4.1
[platform/upstream/gstreamer.git] / docs / libs / html / gst-rtsp-server-GstRTSPThreadPool.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>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">
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">|</span> 
18                   <a href="#gst-rtsp-server-GstRTSPThreadPool.description" class="shortcut">Description</a></span>
19 </td>
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>
24 </tr></table>
25 <div class="refentry">
26 <a name="gst-rtsp-server-GstRTSPThreadPool"></a><div class="titlepage"></div>
27 <div class="refnamediv"><table width="100%"><tr>
28 <td valign="top">
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>
31 </td>
32 <td class="gallery_image" valign="top" align="right"></td>
33 </tr></table></div>
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">
37 <colgroup>
38 <col width="150px" class="functions_return">
39 <col class="functions_name">
40 </colgroup>
41 <tbody>
42 <tr>
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> *
45 </td>
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>
48 </td>
49 </tr>
50 <tr>
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> *
53 </td>
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>
56 </td>
57 </tr>
58 <tr>
59 <td class="function_type">
60 <span class="returnvalue">void</span>
61 </td>
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>
64 </td>
65 </tr>
66 <tr>
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>
69 </td>
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>
72 </td>
73 </tr>
74 <tr>
75 <td class="function_type">
76 <span class="returnvalue">void</span>
77 </td>
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>
80 </td>
81 </tr>
82 <tr>
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> *
85 </td>
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>
88 </td>
89 </tr>
90 <tr>
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>
93 </td>
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>
96 </td>
97 </tr>
98 <tr>
99 <td class="function_type">
100 <span class="returnvalue">void</span>
101 </td>
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>
104 </td>
105 </tr>
106 <tr>
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> *
109 </td>
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>
112 </td>
113 </tr>
114 <tr>
115 <td class="function_type">
116 <span class="returnvalue">void</span>
117 </td>
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>
120 </td>
121 </tr>
122 </tbody>
123 </table></div>
124 </div>
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">
128 <colgroup>
129 <col width="150px" class="name">
130 <col class="description">
131 </colgroup>
132 <tbody>
133 <tr>
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>
136 </tr>
137 <tr>
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>
140 </tr>
141 <tr>
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>
144 </tr>
145 <tr>
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>
148 </tr>
149 </tbody>
150 </table></div>
151 </div>
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
168 stop.</p>
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>
172 </div>
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">
183 <colgroup>
184 <col width="150px" class="parameters_name">
185 <col class="parameters_description">
186 <col width="200px" class="parameters_annotations">
187 </colgroup>
188 <tbody><tr>
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>
192 </tr></tbody>
193 </table></div>
194 </div>
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>
199 </div>
200 </div>
201 <hr>
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">
210 <colgroup>
211 <col width="150px" class="parameters_name">
212 <col class="parameters_description">
213 <col width="200px" class="parameters_annotations">
214 </colgroup>
215 <tbody><tr>
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>
219 </tr></tbody>
220 </table></div>
221 </div>
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>
227 </div>
228 </div>
229 <hr>
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">
238 <colgroup>
239 <col width="150px" class="parameters_name">
240 <col class="parameters_description">
241 <col width="200px" class="parameters_annotations">
242 </colgroup>
243 <tbody><tr>
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>
247 </tr></tbody>
248 </table></div>
249 </div>
250 </div>
251 <hr>
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>
257 </p>
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">
261 <colgroup>
262 <col width="150px" class="parameters_name">
263 <col class="parameters_description">
264 <col width="200px" class="parameters_annotations">
265 </colgroup>
266 <tbody><tr>
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>
270 </tr></tbody>
271 </table></div>
272 </div>
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>
276 <p></p>
277 </div>
278 </div>
279 <hr>
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">
291 <colgroup>
292 <col width="150px" class="parameters_name">
293 <col class="parameters_description">
294 <col width="200px" class="parameters_annotations">
295 </colgroup>
296 <tbody><tr>
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>
300 </tr></tbody>
301 </table></div>
302 </div>
303 </div>
304 <hr>
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>
314 </div>
315 </div>
316 <hr>
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">
326 <colgroup>
327 <col width="150px" class="parameters_name">
328 <col class="parameters_description">
329 <col width="200px" class="parameters_annotations">
330 </colgroup>
331 <tbody><tr>
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>
335 </tr></tbody>
336 </table></div>
337 </div>
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>
341 <p></p>
342 </div>
343 </div>
344 <hr>
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">
356 <colgroup>
357 <col width="150px" class="parameters_name">
358 <col class="parameters_description">
359 <col width="200px" class="parameters_annotations">
360 </colgroup>
361 <tbody>
362 <tr>
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>
366 </tr>
367 <tr>
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>
371 </tr>
372 </tbody>
373 </table></div>
374 </div>
375 </div>
376 <hr>
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>
385 .</p>
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">
389 <colgroup>
390 <col width="150px" class="parameters_name">
391 <col class="parameters_description">
392 <col width="200px" class="parameters_annotations">
393 </colgroup>
394 <tbody>
395 <tr>
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>
399 </tr>
400 <tr>
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>
404 </tr>
405 <tr>
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>
409 </tr>
410 </tbody>
411 </table></div>
412 </div>
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>
417 </div>
418 </div>
419 <hr>
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
426 structures.</p>
427 </div>
428 </div>
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">
437 <colgroup>
438 <col width="300px" class="enum_members_name">
439 <col class="enum_members_description">
440 <col width="200px" class="enum_members_annotations">
441 </colgroup>
442 <tbody>
443 <tr>
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>
447 </td>
448 <td class="enum_member_annotations"> </td>
449 </tr>
450 <tr>
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>
454 </td>
455 <td class="enum_member_annotations"> </td>
456 </tr>
457 </tbody>
458 </table></div>
459 </div>
460 </div>
461 <hr>
462 <div class="refsect2">
463 <a name="GstRTSPThread"></a><h3>struct GstRTSPThread</h3>
464 <pre class="programlisting">struct GstRTSPThread {
465   GstMiniObject mini_object;
466
467   GstRTSPThreadType type;
468   GMainContext *context;
469   GMainLoop *loop;
470 };
471 </pre>
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">
476 <colgroup>
477 <col width="300px" class="struct_members_name">
478 <col class="struct_members_description">
479 <col width="200px" class="struct_members_annotations">
480 </colgroup>
481 <tbody>
482 <tr>
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>
486 </tr>
487 <tr>
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>
491 </tr>
492 <tr>
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>
496 </tr>
497 <tr>
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>
501 </tr>
502 </tbody>
503 </table></div>
504 </div>
505 </div>
506 <hr>
507 <div class="refsect2">
508 <a name="GstRTSPThreadPool"></a><h3>struct GstRTSPThreadPool</h3>
509 <pre class="programlisting">struct GstRTSPThreadPool {
510   GObject       parent;
511 };
512 </pre>
513 <p>The thread pool structure.</p>
514 </div>
515 <hr>
516 <div class="refsect2">
517 <a name="GstRTSPThreadPoolClass"></a><h3>struct GstRTSPThreadPoolClass</h3>
518 <pre class="programlisting">struct GstRTSPThreadPoolClass {
519   GObjectClass  parent_class;
520
521   GThreadPool *pool;
522
523   GstRTSPThread * (*get_thread)        (GstRTSPThreadPool *pool,
524                                         GstRTSPThreadType type,
525                                         GstRTSPContext *ctx);
526   void            (*configure_thread)  (GstRTSPThreadPool *pool,
527                                         GstRTSPThread * thread,
528                                         GstRTSPContext *ctx);
529
530   void            (*thread_enter)      (GstRTSPThreadPool *pool,
531                                         GstRTSPThread *thread);
532   void            (*thread_leave)      (GstRTSPThreadPool *pool,
533                                         GstRTSPThread *thread);
534 };
535 </pre>
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">
540 <colgroup>
541 <col width="300px" class="struct_members_name">
542 <col class="struct_members_description">
543 <col width="200px" class="struct_members_annotations">
544 </colgroup>
545 <tbody>
546 <tr>
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>
548 <td> </td>
549 <td> </td>
550 </tr>
551 <tr>
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>
555 </tr>
556 <tr>
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
559 a mainloop.</p></td>
560 <td class="struct_member_annotations"> </td>
561 </tr>
562 <tr>
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>
567 </tr>
568 <tr>
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>
572 </tr>
573 <tr>
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>
577 </tr>
578 </tbody>
579 </table></div>
580 </div>
581 </div>
582 </div>
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>
586 </div>
587 </div>
588 <div class="footer">
589 <hr>
590           Generated by GTK-Doc V1.21</div>
591 </body>
592 </html>