| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| <html> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <title>GstTask: GStreamer 1.0 Core Reference Manual</title> |
| <meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> |
| <link rel="home" href="index.html" title="GStreamer 1.0 Core Reference Manual"> |
| <link rel="up" href="libgstreamer.html" title="GStreamer Core Library"> |
| <link rel="prev" href="GstTagSetter.html" title="GstTagSetter"> |
| <link rel="next" href="GstTaskPool.html" title="GstTaskPool"> |
| <meta name="generator" content="GTK-Doc V1.25 (XML mode)"> |
| <link rel="stylesheet" href="style.css" type="text/css"> |
| </head> |
| <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
| <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle"> |
| <td width="100%" align="left" class="shortcuts"> |
| <a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span> |
| <a href="#GstTask.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span> |
| <a href="#GstTask.object-hierarchy" class="shortcut">Object Hierarchy</a></span> |
| </td> |
| <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td> |
| <td><a accesskey="u" href="libgstreamer.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td> |
| <td><a accesskey="p" href="GstTagSetter.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td> |
| <td><a accesskey="n" href="GstTaskPool.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td> |
| </tr></table> |
| <div class="refentry"> |
| <a name="GstTask"></a><div class="titlepage"></div> |
| <div class="refnamediv"><table width="100%"><tr> |
| <td valign="top"> |
| <h2><span class="refentrytitle"><a name="GstTask.top_of_page"></a>GstTask</span></h2> |
| <p>GstTask — Abstraction of GStreamer streaming threads.</p> |
| </td> |
| <td class="gallery_image" valign="top" align="right"></td> |
| </tr></table></div> |
| <div class="refsect1"> |
| <a name="GstTask.functions"></a><h2>Functions</h2> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="functions_return"> |
| <col class="functions_name"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <span class="c_punctuation">(</span><a class="link" href="GstTask.html#GstTaskFunction" title="GstTaskFunction ()">*GstTaskFunction</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="GstTask.html#GST-TASK-BROADCAST:CAPS" title="GST_TASK_BROADCAST()">GST_TASK_BROADCAST</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="GstTask.html#GST-TASK-GET-COND:CAPS" title="GST_TASK_GET_COND()">GST_TASK_GET_COND</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="GstTask.html#GST-TASK-GET-LOCK:CAPS" title="GST_TASK_GET_LOCK()">GST_TASK_GET_LOCK</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="GstTask.html#GST-TASK-SIGNAL:CAPS" title="GST_TASK_SIGNAL()">GST_TASK_SIGNAL</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="GstTask.html#GST-TASK-STATE:CAPS" title="GST_TASK_STATE()">GST_TASK_STATE</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="define_keyword">#define</td> |
| <td class="function_name"> |
| <a class="link" href="GstTask.html#GST-TASK-WAIT:CAPS" title="GST_TASK_WAIT()">GST_TASK_WAIT</a><span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a class="link" href="GstTask.html" title="GstTask"><span class="returnvalue">GstTask</span></a> * |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GstTask.html#gst-task-new" title="gst_task_new ()">gst_task_new</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GstTask.html#gst-task-set-lock" title="gst_task_set_lock ()">gst_task_set_lock</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GstTask.html#gst-task-set-pool" title="gst_task_set_pool ()">gst_task_set_pool</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a class="link" href="GstTaskPool.html" title="GstTaskPool"><span class="returnvalue">GstTaskPool</span></a> * |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GstTask.html#gst-task-get-pool" title="gst_task_get_pool ()">gst_task_get_pool</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <span class="c_punctuation">(</span><a class="link" href="GstTask.html#GstTaskThreadFunc" title="GstTaskThreadFunc ()">*GstTaskThreadFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GstTask.html#gst-task-set-enter-callback" title="gst_task_set_enter_callback ()">gst_task_set_enter_callback</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GstTask.html#gst-task-set-leave-callback" title="gst_task_set_leave_callback ()">gst_task_set_leave_callback</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a class="link" href="GstTask.html#GstTaskState" title="enum GstTaskState"><span class="returnvalue">GstTaskState</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GstTask.html#gst-task-get-state" title="gst_task_get_state ()">gst_task_get_state</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GstTask.html#gst-task-set-state" title="gst_task_set_state ()">gst_task_set_state</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GstTask.html#gst-task-pause" title="gst_task_pause ()">gst_task_pause</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GstTask.html#gst-task-start" title="gst_task_start ()">gst_task_start</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GstTask.html#gst-task-stop" title="gst_task_stop ()">gst_task_stop</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GstTask.html#gst-task-join" title="gst_task_join ()">gst_task_join</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <span class="returnvalue">void</span> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GstTask.html#gst-task-cleanup-all" title="gst_task_cleanup_all ()">gst_task_cleanup_all</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect1"> |
| <a name="GstTask.other"></a><h2>Types and Values</h2> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="name"> |
| <col class="description"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="datatype_keyword">struct</td> |
| <td class="function_name"><a class="link" href="GstTask.html#GstTask-struct" title="struct GstTask">GstTask</a></td> |
| </tr> |
| <tr> |
| <td class="datatype_keyword">enum</td> |
| <td class="function_name"><a class="link" href="GstTask.html#GstTaskState" title="enum GstTaskState">GstTaskState</a></td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect1"> |
| <a name="GstTask.object-hierarchy"></a><h2>Object Hierarchy</h2> |
| <pre class="screen"> <a href="/usr/share/gtk-doc/html/gobjectgobject-The-Base-Object-Type.html#GObject-struct">GObject</a> |
| <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gobjectgobject-The-Base-Object-Type.html#GInitiallyUnowned">GInitiallyUnowned</a> |
| <span class="lineart">╰──</span> <a class="link" href="GstObject.html" title="GstObject">GstObject</a> |
| <span class="lineart">╰──</span> GstTask |
| </pre> |
| </div> |
| <div class="refsect1"> |
| <a name="GstTask.includes"></a><h2>Includes</h2> |
| <pre class="synopsis">#include <gst/gst.h> |
| </pre> |
| </div> |
| <div class="refsect1"> |
| <a name="GstTask.description"></a><h2>Description</h2> |
| <p><a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> is used by <a class="link" href="GstElement.html" title="GstElement"><span class="type">GstElement</span></a> and <a class="link" href="GstPad.html" title="GstPad"><span class="type">GstPad</span></a> to provide the data passing |
| threads in a <a class="link" href="GstPipeline.html" title="GstPipeline"><span class="type">GstPipeline</span></a>.</p> |
| <p>A <a class="link" href="GstPad.html" title="GstPad"><span class="type">GstPad</span></a> will typically start a <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> to push or pull data to/from the |
| peer pads. Most source elements start a <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> to push data. In some cases |
| a demuxer element can start a <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> to pull data from a peer element. This |
| is typically done when the demuxer can perform random access on the upstream |
| peer element for improved performance.</p> |
| <p>Although convenience functions exist on <a class="link" href="GstPad.html" title="GstPad"><span class="type">GstPad</span></a> to start/pause/stop tasks, it |
| might sometimes be needed to create a <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> manually if it is not related to |
| a <a class="link" href="GstPad.html" title="GstPad"><span class="type">GstPad</span></a>.</p> |
| <p>Before the <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> can be run, it needs a <a href="/usr/share/gtk-doc/html/glibglib-Threads.html#GRecMutex"><span class="type">GRecMutex</span></a> that can be set with |
| <a class="link" href="GstTask.html#gst-task-set-lock" title="gst_task_set_lock ()"><code class="function">gst_task_set_lock()</code></a>.</p> |
| <p>The task can be started, paused and stopped with <a class="link" href="GstTask.html#gst-task-start" title="gst_task_start ()"><code class="function">gst_task_start()</code></a>, <a class="link" href="GstTask.html#gst-task-pause" title="gst_task_pause ()"><code class="function">gst_task_pause()</code></a> |
| and <a class="link" href="GstTask.html#gst-task-stop" title="gst_task_stop ()"><code class="function">gst_task_stop()</code></a> respectively or with the <a class="link" href="GstTask.html#gst-task-set-state" title="gst_task_set_state ()"><code class="function">gst_task_set_state()</code></a> function.</p> |
| <p>A <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> will repeatedly call the <a class="link" href="GstTask.html#GstTaskFunction" title="GstTaskFunction ()"><span class="type">GstTaskFunction</span></a> with the user data |
| that was provided when creating the task with <a class="link" href="GstTask.html#gst-task-new" title="gst_task_new ()"><code class="function">gst_task_new()</code></a>. While calling |
| the function it will acquire the provided lock. The provided lock is released |
| when the task pauses or stops.</p> |
| <p>Stopping a task with <a class="link" href="GstTask.html#gst-task-stop" title="gst_task_stop ()"><code class="function">gst_task_stop()</code></a> will not immediately make sure the task is |
| not running anymore. Use <a class="link" href="GstTask.html#gst-task-join" title="gst_task_join ()"><code class="function">gst_task_join()</code></a> to make sure the task is completely |
| stopped and the thread is stopped.</p> |
| <p>After creating a <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a>, use <a class="link" href="GstObject.html#gst-object-unref" title="gst_object_unref ()"><code class="function">gst_object_unref()</code></a> to free its resources. This can |
| only be done when the task is not running anymore.</p> |
| <p>Task functions can send a <a class="link" href="GstMessage.html" title="GstMessage"><span class="type">GstMessage</span></a> to send out-of-band data to the |
| application. The application can receive messages from the <a class="link" href="GstBus.html" title="GstBus"><span class="type">GstBus</span></a> in its |
| mainloop.</p> |
| <p>For debugging purposes, the task will configure its object name as the thread |
| name on Linux. Please note that the object name should be configured before the |
| task is started; changing the object name after the task has been started, has |
| no effect on the thread name.</p> |
| </div> |
| <div class="refsect1"> |
| <a name="GstTask.functions_details"></a><h2>Functions</h2> |
| <div class="refsect2"> |
| <a name="GstTaskFunction"></a><h3>GstTaskFunction ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| <span class="c_punctuation">(</span>*GstTaskFunction<span class="c_punctuation">)</span> (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre> |
| <p>A function that will repeatedly be called in the thread created by |
| a <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a>.</p> |
| <div class="refsect3"> |
| <a name="GstTaskFunction.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>user_data</p></td> |
| <td class="parameter_description"><p>user data passed to the function</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GST-TASK-BROADCAST:CAPS"></a><h3>GST_TASK_BROADCAST()</h3> |
| <pre class="programlisting">#define GST_TASK_BROADCAST(task) g_cond_broadcast(GST_TASK_GET_COND (task)) |
| </pre> |
| <p>Send a broadcast signal to all waiting task conds</p> |
| <div class="refsect3"> |
| <a name="GST-TASK-BROADCAST.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>task</p></td> |
| <td class="parameter_description"><p>Task to broadcast</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GST-TASK-GET-COND:CAPS"></a><h3>GST_TASK_GET_COND()</h3> |
| <pre class="programlisting">#define GST_TASK_GET_COND(task) (&GST_TASK_CAST(task)->cond) |
| </pre> |
| <p>Get access to the cond of the task.</p> |
| <div class="refsect3"> |
| <a name="GST-TASK-GET-COND.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>task</p></td> |
| <td class="parameter_description"><p>Task to get the cond of</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GST-TASK-GET-LOCK:CAPS"></a><h3>GST_TASK_GET_LOCK()</h3> |
| <pre class="programlisting">#define GST_TASK_GET_LOCK(task) (GST_TASK_CAST(task)->lock) |
| </pre> |
| <p>Get access to the task lock.</p> |
| <div class="refsect3"> |
| <a name="GST-TASK-GET-LOCK.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>task</p></td> |
| <td class="parameter_description"><p>Task to get the lock of</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GST-TASK-SIGNAL:CAPS"></a><h3>GST_TASK_SIGNAL()</h3> |
| <pre class="programlisting">#define GST_TASK_SIGNAL(task) g_cond_signal(GST_TASK_GET_COND (task)) |
| </pre> |
| <p>Signal the task cond</p> |
| <div class="refsect3"> |
| <a name="GST-TASK-SIGNAL.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>task</p></td> |
| <td class="parameter_description"><p>Task to signal</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GST-TASK-STATE:CAPS"></a><h3>GST_TASK_STATE()</h3> |
| <pre class="programlisting">#define GST_TASK_STATE(task) (GST_TASK_CAST(task)->state) |
| </pre> |
| <p>Get access to the state of the task.</p> |
| <div class="refsect3"> |
| <a name="GST-TASK-STATE.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>task</p></td> |
| <td class="parameter_description"><p>Task to get the state of</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GST-TASK-WAIT:CAPS"></a><h3>GST_TASK_WAIT()</h3> |
| <pre class="programlisting">#define GST_TASK_WAIT(task) g_cond_wait(GST_TASK_GET_COND (task), GST_OBJECT_GET_LOCK (task)) |
| </pre> |
| <p>Wait for the task cond to be signalled</p> |
| <div class="refsect3"> |
| <a name="GST-TASK-WAIT.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>task</p></td> |
| <td class="parameter_description"><p>Task to wait for</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="gst-task-new"></a><h3>gst_task_new ()</h3> |
| <pre class="programlisting"><a class="link" href="GstTask.html" title="GstTask"><span class="returnvalue">GstTask</span></a> * |
| gst_task_new (<em class="parameter"><code><a class="link" href="GstTask.html#GstTaskFunction" title="GstTaskFunction ()"><span class="type">GstTaskFunction</span></a> func</code></em>, |
| <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>, |
| <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> notify</code></em>);</pre> |
| <p>Create a new Task that will repeatedly call the provided <em class="parameter"><code>func</code></em> |
| |
| with <em class="parameter"><code>user_data</code></em> |
| as a parameter. Typically the task will run in |
| a new thread.</p> |
| <p>The function cannot be changed after the task has been created. You |
| must create a new <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> to change the function.</p> |
| <p>This function will not yet create and start a thread. Use <a class="link" href="GstTask.html#gst-task-start" title="gst_task_start ()"><code class="function">gst_task_start()</code></a> or |
| <a class="link" href="GstTask.html#gst-task-pause" title="gst_task_pause ()"><code class="function">gst_task_pause()</code></a> to create and start the GThread.</p> |
| <p>Before the task can be used, a <a href="/usr/share/gtk-doc/html/glibglib-Threads.html#GRecMutex"><span class="type">GRecMutex</span></a> must be configured using the |
| <a class="link" href="GstTask.html#gst-task-set-lock" title="gst_task_set_lock ()"><code class="function">gst_task_set_lock()</code></a> function. This lock will always be acquired while |
| <em class="parameter"><code>func</code></em> |
| is called.</p> |
| <div class="refsect3"> |
| <a name="gst-task-new.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>func</p></td> |
| <td class="parameter_description"><p>The <a class="link" href="GstTask.html#GstTaskFunction" title="GstTaskFunction ()"><span class="type">GstTaskFunction</span></a> to use</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>user_data</p></td> |
| <td class="parameter_description"><p>User data to pass to <em class="parameter"><code>func</code></em> |
| </p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>notify</p></td> |
| <td class="parameter_description"><p>the function to call when <em class="parameter"><code>user_data</code></em> |
| is no longer needed.</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="gst-task-new.returns"></a><h4>Returns</h4> |
| <p> A new <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a>.</p> |
| <p>MT safe. </p> |
| <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="gst-task-set-lock"></a><h3>gst_task_set_lock ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| gst_task_set_lock (<em class="parameter"><code><a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> *task</code></em>, |
| <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Threads.html#GRecMutex"><span class="type">GRecMutex</span></a> *mutex</code></em>);</pre> |
| <p>Set the mutex used by the task. The mutex will be acquired before |
| calling the <a class="link" href="GstTask.html#GstTaskFunction" title="GstTaskFunction ()"><span class="type">GstTaskFunction</span></a>.</p> |
| <p>This function has to be called before calling <a class="link" href="GstTask.html#gst-task-pause" title="gst_task_pause ()"><code class="function">gst_task_pause()</code></a> or |
| <a class="link" href="GstTask.html#gst-task-start" title="gst_task_start ()"><code class="function">gst_task_start()</code></a>.</p> |
| <p>MT safe.</p> |
| <div class="refsect3"> |
| <a name="gst-task-set-lock.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>task</p></td> |
| <td class="parameter_description"><p>The <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> to use</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>mutex</p></td> |
| <td class="parameter_description"><p>The <a href="/usr/share/gtk-doc/html/glibglib-Threads.html#GRecMutex"><span class="type">GRecMutex</span></a> to use</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="gst-task-set-pool"></a><h3>gst_task_set_pool ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| gst_task_set_pool (<em class="parameter"><code><a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> *task</code></em>, |
| <em class="parameter"><code><a class="link" href="GstTaskPool.html" title="GstTaskPool"><span class="type">GstTaskPool</span></a> *pool</code></em>);</pre> |
| <p>Set <em class="parameter"><code>pool</code></em> |
| as the new GstTaskPool for <em class="parameter"><code>task</code></em> |
| . Any new streaming threads that |
| will be created by <em class="parameter"><code>task</code></em> |
| will now use <em class="parameter"><code>pool</code></em> |
| .</p> |
| <p>MT safe.</p> |
| <div class="refsect3"> |
| <a name="gst-task-set-pool.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>task</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>pool</p></td> |
| <td class="parameter_description"><p> a <a class="link" href="GstTaskPool.html" title="GstTaskPool"><span class="type">GstTaskPool</span></a>. </p></td> |
| <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> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="gst-task-get-pool"></a><h3>gst_task_get_pool ()</h3> |
| <pre class="programlisting"><a class="link" href="GstTaskPool.html" title="GstTaskPool"><span class="returnvalue">GstTaskPool</span></a> * |
| gst_task_get_pool (<em class="parameter"><code><a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> *task</code></em>);</pre> |
| <p>Get the <a class="link" href="GstTaskPool.html" title="GstTaskPool"><span class="type">GstTaskPool</span></a> that this task will use for its streaming |
| threads.</p> |
| <p>MT safe.</p> |
| <div class="refsect3"> |
| <a name="gst-task-get-pool.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>task</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="gst-task-get-pool.returns"></a><h4>Returns</h4> |
| <p> the <a class="link" href="GstTaskPool.html" title="GstTaskPool"><span class="type">GstTaskPool</span></a> used by <em class="parameter"><code>task</code></em> |
| . <a class="link" href="GstObject.html#gst-object-unref" title="gst_object_unref ()"><code class="function">gst_object_unref()</code></a> |
| after usage. </p> |
| <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GstTaskThreadFunc"></a><h3>GstTaskThreadFunc ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| <span class="c_punctuation">(</span>*GstTaskThreadFunc<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> *task</code></em>, |
| <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Threads.html#GThread"><span class="type">GThread</span></a> *thread</code></em>, |
| <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre> |
| <p>Custom GstTask thread callback functions that can be installed.</p> |
| <div class="refsect3"> |
| <a name="GstTaskThreadFunc.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>task</p></td> |
| <td class="parameter_description"><p>The <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>thread</p></td> |
| <td class="parameter_description"><p>The <a href="/usr/share/gtk-doc/html/glibglib-Threads.html#GThread"><span class="type">GThread</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>user_data</p></td> |
| <td class="parameter_description"><p>user data</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="gst-task-set-enter-callback"></a><h3>gst_task_set_enter_callback ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| gst_task_set_enter_callback (<em class="parameter"><code><a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> *task</code></em>, |
| <em class="parameter"><code><a class="link" href="GstTask.html#GstTaskThreadFunc" title="GstTaskThreadFunc ()"><span class="type">GstTaskThreadFunc</span></a> enter_func</code></em>, |
| <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>, |
| <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> notify</code></em>);</pre> |
| <p>Call <em class="parameter"><code>enter_func</code></em> |
| when the task function of <em class="parameter"><code>task</code></em> |
| is entered. <em class="parameter"><code>user_data</code></em> |
| will |
| be passed to <em class="parameter"><code>enter_func</code></em> |
| and <em class="parameter"><code>notify</code></em> |
| will be called when <em class="parameter"><code>user_data</code></em> |
| is no |
| longer referenced.</p> |
| <div class="refsect3"> |
| <a name="gst-task-set-enter-callback.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>task</p></td> |
| <td class="parameter_description"><p>The <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> to use</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>enter_func</p></td> |
| <td class="parameter_description"><p> a <a class="link" href="GstTask.html#GstTaskThreadFunc" title="GstTaskThreadFunc ()"><span class="type">GstTaskThreadFunc</span></a>. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for input. Default is transfer none."><span class="acronym">in</span></acronym>]</span></td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>user_data</p></td> |
| <td class="parameter_description"><p>user data passed to <em class="parameter"><code>enter_func</code></em> |
| </p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>notify</p></td> |
| <td class="parameter_description"><p>called when <em class="parameter"><code>user_data</code></em> |
| is no longer referenced</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="gst-task-set-leave-callback"></a><h3>gst_task_set_leave_callback ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| gst_task_set_leave_callback (<em class="parameter"><code><a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> *task</code></em>, |
| <em class="parameter"><code><a class="link" href="GstTask.html#GstTaskThreadFunc" title="GstTaskThreadFunc ()"><span class="type">GstTaskThreadFunc</span></a> leave_func</code></em>, |
| <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>, |
| <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> notify</code></em>);</pre> |
| <p>Call <em class="parameter"><code>leave_func</code></em> |
| when the task function of <em class="parameter"><code>task</code></em> |
| is left. <em class="parameter"><code>user_data</code></em> |
| will |
| be passed to <em class="parameter"><code>leave_func</code></em> |
| and <em class="parameter"><code>notify</code></em> |
| will be called when <em class="parameter"><code>user_data</code></em> |
| is no |
| longer referenced.</p> |
| <div class="refsect3"> |
| <a name="gst-task-set-leave-callback.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>task</p></td> |
| <td class="parameter_description"><p>The <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> to use</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>leave_func</p></td> |
| <td class="parameter_description"><p> a <a class="link" href="GstTask.html#GstTaskThreadFunc" title="GstTaskThreadFunc ()"><span class="type">GstTaskThreadFunc</span></a>. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for input. Default is transfer none."><span class="acronym">in</span></acronym>]</span></td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>user_data</p></td> |
| <td class="parameter_description"><p>user data passed to <em class="parameter"><code>leave_func</code></em> |
| </p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>notify</p></td> |
| <td class="parameter_description"><p>called when <em class="parameter"><code>user_data</code></em> |
| is no longer referenced</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="gst-task-get-state"></a><h3>gst_task_get_state ()</h3> |
| <pre class="programlisting"><a class="link" href="GstTask.html#GstTaskState" title="enum GstTaskState"><span class="returnvalue">GstTaskState</span></a> |
| gst_task_get_state (<em class="parameter"><code><a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> *task</code></em>);</pre> |
| <p>Get the current state of the task.</p> |
| <div class="refsect3"> |
| <a name="gst-task-get-state.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>task</p></td> |
| <td class="parameter_description"><p>The <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> to query</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="gst-task-get-state.returns"></a><h4>Returns</h4> |
| <p> The <a class="link" href="GstTask.html#GstTaskState" title="enum GstTaskState"><span class="type">GstTaskState</span></a> of the task</p> |
| <p>MT safe.</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="gst-task-set-state"></a><h3>gst_task_set_state ()</h3> |
| <pre class="programlisting"><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| gst_task_set_state (<em class="parameter"><code><a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> *task</code></em>, |
| <em class="parameter"><code><a class="link" href="GstTask.html#GstTaskState" title="enum GstTaskState"><span class="type">GstTaskState</span></a> state</code></em>);</pre> |
| <p>Sets the state of <em class="parameter"><code>task</code></em> |
| to <em class="parameter"><code>state</code></em> |
| .</p> |
| <p>The <em class="parameter"><code>task</code></em> |
| must have a lock associated with it using |
| <a class="link" href="GstTask.html#gst-task-set-lock" title="gst_task_set_lock ()"><code class="function">gst_task_set_lock()</code></a> when going to GST_TASK_STARTED or GST_TASK_PAUSED or |
| this function will return <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>.</p> |
| <p>MT safe.</p> |
| <div class="refsect3"> |
| <a name="gst-task-set-state.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>task</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>state</p></td> |
| <td class="parameter_description"><p>the new task state</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="gst-task-set-state.returns"></a><h4>Returns</h4> |
| <p> <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the state could be changed.</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="gst-task-pause"></a><h3>gst_task_pause ()</h3> |
| <pre class="programlisting"><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| gst_task_pause (<em class="parameter"><code><a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> *task</code></em>);</pre> |
| <p>Pauses <em class="parameter"><code>task</code></em> |
| . This method can also be called on a task in the |
| stopped state, in which case a thread will be started and will remain |
| in the paused state. This function does not wait for the task to complete |
| the paused state.</p> |
| <div class="refsect3"> |
| <a name="gst-task-pause.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>task</p></td> |
| <td class="parameter_description"><p>The <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> to pause</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="gst-task-pause.returns"></a><h4>Returns</h4> |
| <p> <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the task could be paused.</p> |
| <p>MT safe.</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="gst-task-start"></a><h3>gst_task_start ()</h3> |
| <pre class="programlisting"><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| gst_task_start (<em class="parameter"><code><a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> *task</code></em>);</pre> |
| <p>Starts <em class="parameter"><code>task</code></em> |
| . The <em class="parameter"><code>task</code></em> |
| must have a lock associated with it using |
| <a class="link" href="GstTask.html#gst-task-set-lock" title="gst_task_set_lock ()"><code class="function">gst_task_set_lock()</code></a> or this function will return <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>.</p> |
| <div class="refsect3"> |
| <a name="gst-task-start.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>task</p></td> |
| <td class="parameter_description"><p>The <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> to start</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="gst-task-start.returns"></a><h4>Returns</h4> |
| <p> <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the task could be started.</p> |
| <p>MT safe.</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="gst-task-stop"></a><h3>gst_task_stop ()</h3> |
| <pre class="programlisting"><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| gst_task_stop (<em class="parameter"><code><a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> *task</code></em>);</pre> |
| <p>Stops <em class="parameter"><code>task</code></em> |
| . This method merely schedules the task to stop and |
| will not wait for the task to have completely stopped. Use |
| <a class="link" href="GstTask.html#gst-task-join" title="gst_task_join ()"><code class="function">gst_task_join()</code></a> to stop and wait for completion.</p> |
| <div class="refsect3"> |
| <a name="gst-task-stop.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>task</p></td> |
| <td class="parameter_description"><p>The <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> to stop</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="gst-task-stop.returns"></a><h4>Returns</h4> |
| <p> <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the task could be stopped.</p> |
| <p>MT safe.</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="gst-task-join"></a><h3>gst_task_join ()</h3> |
| <pre class="programlisting"><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| gst_task_join (<em class="parameter"><code><a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> *task</code></em>);</pre> |
| <p>Joins <em class="parameter"><code>task</code></em> |
| . After this call, it is safe to unref the task |
| and clean up the lock set with <a class="link" href="GstTask.html#gst-task-set-lock" title="gst_task_set_lock ()"><code class="function">gst_task_set_lock()</code></a>.</p> |
| <p>The task will automatically be stopped with this call.</p> |
| <p>This function cannot be called from within a task function as this |
| would cause a deadlock. The function will detect this and print a |
| g_warning.</p> |
| <div class="refsect3"> |
| <a name="gst-task-join.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>task</p></td> |
| <td class="parameter_description"><p>The <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> to join</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="gst-task-join.returns"></a><h4>Returns</h4> |
| <p> <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the task could be joined.</p> |
| <p>MT safe.</p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="gst-task-cleanup-all"></a><h3>gst_task_cleanup_all ()</h3> |
| <pre class="programlisting"><span class="returnvalue">void</span> |
| gst_task_cleanup_all (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> |
| <p>Wait for all tasks to be stopped. This is mainly used internally |
| to ensure proper cleanup of internal data structures in test suites.</p> |
| <p>MT safe.</p> |
| </div> |
| </div> |
| <div class="refsect1"> |
| <a name="GstTask.other_details"></a><h2>Types and Values</h2> |
| <div class="refsect2"> |
| <a name="GstTask-struct"></a><h3>struct GstTask</h3> |
| <pre class="programlisting">struct GstTask { |
| GstTaskState state; |
| GCond cond; |
| |
| GRecMutex *lock; |
| |
| GstTaskFunction func; |
| gpointer user_data; |
| GDestroyNotify notify; |
| |
| gboolean running; |
| }; |
| </pre> |
| <p>The <a class="link" href="GstTask.html" title="GstTask"><span class="type">GstTask</span></a> object.</p> |
| <div class="refsect3"> |
| <a name="GstTask.members"></a><h4>Members</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="300px" class="struct_members_name"> |
| <col class="struct_members_description"> |
| <col width="200px" class="struct_members_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="struct_member_name"><p><a class="link" href="GstTask.html#GstTaskState" title="enum GstTaskState"><span class="type">GstTaskState</span></a> <em class="structfield"><code><a name="GstTask-struct.state"></a>state</code></em>;</p></td> |
| <td class="struct_member_description"><p>the state of the task</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><a href="/usr/share/gtk-doc/html/glibglib-Threads.html#GCond"><span class="type">GCond</span></a> <em class="structfield"><code><a name="GstTask-struct.cond"></a>cond</code></em>;</p></td> |
| <td class="struct_member_description"><p>used to pause/resume the task</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><a href="/usr/share/gtk-doc/html/glibglib-Threads.html#GRecMutex"><span class="type">GRecMutex</span></a> *<em class="structfield"><code><a name="GstTask-struct.lock"></a>lock</code></em>;</p></td> |
| <td class="struct_member_description"><p>The lock taken when iterating the task function</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><a class="link" href="GstTask.html#GstTaskFunction" title="GstTaskFunction ()"><span class="type">GstTaskFunction</span></a> <em class="structfield"><code><a name="GstTask-struct.func"></a>func</code></em>;</p></td> |
| <td class="struct_member_description"><p>the function executed by this task</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> <em class="structfield"><code><a name="GstTask-struct.user-data"></a>user_data</code></em>;</p></td> |
| <td class="struct_member_description"><p>user_data passed to the task function</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><a href="/usr/share/gtk-doc/html/glibglib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> <em class="structfield"><code><a name="GstTask-struct.notify"></a>notify</code></em>;</p></td> |
| <td class="struct_member_description"><p>GDestroyNotify for <em class="parameter"><code>user_data</code></em> |
| </p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="struct_member_name"><p><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> <em class="structfield"><code><a name="GstTask-struct.running"></a>running</code></em>;</p></td> |
| <td class="struct_member_description"><p>a flag indicating that the task is running</p></td> |
| <td class="struct_member_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GstTaskState"></a><h3>enum GstTaskState</h3> |
| <p>The different states a task can be in</p> |
| <div class="refsect3"> |
| <a name="GstTaskState.members"></a><h4>Members</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="300px" class="enum_members_name"> |
| <col class="enum_members_description"> |
| <col width="200px" class="enum_members_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="enum_member_name"><p><a name="GST-TASK-STARTED:CAPS"></a>GST_TASK_STARTED</p></td> |
| <td class="enum_member_description"> |
| <p>the task is started and running</p> |
| </td> |
| <td class="enum_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="enum_member_name"><p><a name="GST-TASK-STOPPED:CAPS"></a>GST_TASK_STOPPED</p></td> |
| <td class="enum_member_description"> |
| <p>the task is stopped</p> |
| </td> |
| <td class="enum_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="enum_member_name"><p><a name="GST-TASK-PAUSED:CAPS"></a>GST_TASK_PAUSED</p></td> |
| <td class="enum_member_description"> |
| <p>the task is paused</p> |
| </td> |
| <td class="enum_member_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| </div> |
| </div> |
| <div class="refsect1"> |
| <a name="GstTask.see-also"></a><h2>See Also</h2> |
| <p><a class="link" href="GstElement.html" title="GstElement"><span class="type">GstElement</span></a>, <a class="link" href="GstPad.html" title="GstPad"><span class="type">GstPad</span></a></p> |
| </div> |
| </div> |
| <div class="footer"> |
| <hr>Generated by GTK-Doc V1.25</div> |
| </body> |
| </html> |