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>gstaudioclock</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
7 <link rel="home" href="index.html" title="GStreamer Base Plugins 0.10 Library Reference Manual">
8 <link rel="up" href="gstreamer-audio.html" title="Audio Library">
9 <link rel="prev" href="gst-plugins-base-libs-gstaudio.html" title="gstaudio">
10 <link rel="next" href="gst-plugins-base-libs-gstaudiofilter.html" title="gstaudiofilter">
11 <meta name="generator" content="GTK-Doc V1.17 (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="2">
17 <td><a accesskey="p" href="gst-plugins-base-libs-gstaudio.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="gstreamer-audio.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20 <th width="100%" align="center">GStreamer Base Plugins 0.10 Library Reference Manual</th>
21 <td><a accesskey="n" href="gst-plugins-base-libs-gstaudiofilter.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#gst-plugins-base-libs-gstaudioclock.synopsis" class="shortcut">Top</a>
26 <a href="#gst-plugins-base-libs-gstaudioclock.description" class="shortcut">Description</a>
28 <a href="#gst-plugins-base-libs-gstaudioclock.object-hierarchy" class="shortcut">Object Hierarchy</a>
31 <div class="refentry">
32 <a name="gst-plugins-base-libs-gstaudioclock"></a><div class="titlepage"></div>
33 <div class="refnamediv"><table width="100%"><tr>
35 <h2><span class="refentrytitle"><a name="gst-plugins-base-libs-gstaudioclock.top_of_page"></a>gstaudioclock</span></h2>
36 <p>gstaudioclock — Helper object for implementing audio clocks</p>
38 <td valign="top" align="right"></td>
40 <div class="refsynopsisdiv">
41 <a name="gst-plugins-base-libs-gstaudioclock.synopsis"></a><h2>Synopsis</h2>
42 <a name="GstAudioClock"></a><pre class="synopsis">
43 #include <gst/audio/gstaudioclock.h>
45 struct <a class="link" href="gst-plugins-base-libs-gstaudioclock.html#GstAudioClock-struct" title="struct GstAudioClock">GstAudioClock</a>;
46 <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html#GstClockTime"><span class="returnvalue">GstClockTime</span></a> (<a class="link" href="gst-plugins-base-libs-gstaudioclock.html#GstAudioClockGetTimeFunc" title="GstAudioClockGetTimeFunc ()">*GstAudioClockGetTimeFunc</a>) (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html"><span class="type">GstClock</span></a> *clock</code></em>,
47 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
48 <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html"><span class="returnvalue">GstClock</span></a> * <a class="link" href="gst-plugins-base-libs-gstaudioclock.html#gst-audio-clock-new" title="gst_audio_clock_new ()">gst_audio_clock_new</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>,
49 <em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstaudioclock.html#GstAudioClockGetTimeFunc" title="GstAudioClockGetTimeFunc ()"><span class="type">GstAudioClockGetTimeFunc</span></a> func</code></em>,
50 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
51 <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html"><span class="returnvalue">GstClock</span></a> * <a class="link" href="gst-plugins-base-libs-gstaudioclock.html#gst-audio-clock-new-full" title="gst_audio_clock_new_full ()">gst_audio_clock_new_full</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>,
52 <em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstaudioclock.html#GstAudioClockGetTimeFunc" title="GstAudioClockGetTimeFunc ()"><span class="type">GstAudioClockGetTimeFunc</span></a> func</code></em>,
53 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>,
54 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> destroy_notify</code></em>);
55 <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html#GstClockTime"><span class="returnvalue">GstClockTime</span></a> <a class="link" href="gst-plugins-base-libs-gstaudioclock.html#gst-audio-clock-adjust" title="gst_audio_clock_adjust ()">gst_audio_clock_adjust</a> (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html"><span class="type">GstClock</span></a> *clock</code></em>,
56 <em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html#GstClockTime"><span class="type">GstClockTime</span></a> time</code></em>);
57 <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html#GstClockTime"><span class="returnvalue">GstClockTime</span></a> <a class="link" href="gst-plugins-base-libs-gstaudioclock.html#gst-audio-clock-get-time" title="gst_audio_clock_get_time ()">gst_audio_clock_get_time</a> (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html"><span class="type">GstClock</span></a> *clock</code></em>);
58 <span class="returnvalue">void</span> <a class="link" href="gst-plugins-base-libs-gstaudioclock.html#gst-audio-clock-reset" title="gst_audio_clock_reset ()">gst_audio_clock_reset</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstaudioclock.html#GstAudioClock"><span class="type">GstAudioClock</span></a> *clock</code></em>,
59 <em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html#GstClockTime"><span class="type">GstClockTime</span></a> time</code></em>);
60 <span class="returnvalue">void</span> <a class="link" href="gst-plugins-base-libs-gstaudioclock.html#gst-audio-clock-invalidate" title="gst_audio_clock_invalidate ()">gst_audio_clock_invalidate</a> (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html"><span class="type">GstClock</span></a> *clock</code></em>);
63 <div class="refsect1">
64 <a name="gst-plugins-base-libs-gstaudioclock.object-hierarchy"></a><h2>Object Hierarchy</h2>
65 <pre class="synopsis">
66 <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
67 +----<a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstObject.html">GstObject</a>
68 +----<a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html">GstClock</a>
69 +----<a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstSystemClock.html">GstSystemClock</a>
73 <div class="refsect1">
74 <a name="gst-plugins-base-libs-gstaudioclock.description"></a><h2>Description</h2>
76 <a class="link" href="gst-plugins-base-libs-gstaudioclock.html#GstAudioClock"><span class="type">GstAudioClock</span></a> makes it easy for elements to implement a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html"><span class="type">GstClock</span></a>, they
77 simply need to provide a function that returns the current clock time.
80 This object is internally used to implement the clock in <a class="link" href="gst-plugins-base-libs-gstbaseaudiosink.html#GstBaseAudioSink"><span class="type">GstBaseAudioSink</span></a>.
83 Last reviewed on 2006-09-27 (0.10.12)
86 <div class="refsect1">
87 <a name="gst-plugins-base-libs-gstaudioclock.details"></a><h2>Details</h2>
88 <div class="refsect2">
89 <a name="GstAudioClock-struct"></a><h3>struct GstAudioClock</h3>
90 <pre class="programlisting">struct GstAudioClock;</pre>
92 Opaque <a class="link" href="gst-plugins-base-libs-gstaudioclock.html#GstAudioClock"><span class="type">GstAudioClock</span></a>.
94 <div class="variablelist"><table border="0">
95 <col align="left" valign="top">
100 <div class="refsect2">
101 <a name="GstAudioClockGetTimeFunc"></a><h3>GstAudioClockGetTimeFunc ()</h3>
102 <pre class="programlisting"><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html#GstClockTime"><span class="returnvalue">GstClockTime</span></a> (*GstAudioClockGetTimeFunc) (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html"><span class="type">GstClock</span></a> *clock</code></em>,
103 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
105 This function will be called whenever the current clock time needs to be
106 calculated. If this function returns <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html#GST-CLOCK-TIME-NONE:CAPS"><span class="type">GST_CLOCK_TIME_NONE</span></a>, the last reported
107 time will be returned by the clock.
109 <div class="variablelist"><table border="0">
110 <col align="left" valign="top">
113 <td><p><span class="term"><em class="parameter"><code>clock</code></em> :</span></p></td>
114 <td>the <a class="link" href="gst-plugins-base-libs-gstaudioclock.html#GstAudioClock"><span class="type">GstAudioClock</span></a>
118 <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
122 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
123 <td>the current time or <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html#GST-CLOCK-TIME-NONE:CAPS"><span class="type">GST_CLOCK_TIME_NONE</span></a> if the previous time should
130 <div class="refsect2">
131 <a name="gst-audio-clock-new"></a><h3>gst_audio_clock_new ()</h3>
132 <pre class="programlisting"><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html"><span class="returnvalue">GstClock</span></a> * gst_audio_clock_new (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>,
133 <em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstaudioclock.html#GstAudioClockGetTimeFunc" title="GstAudioClockGetTimeFunc ()"><span class="type">GstAudioClockGetTimeFunc</span></a> func</code></em>,
134 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
136 Create a new <a class="link" href="gst-plugins-base-libs-gstaudioclock.html#GstAudioClock"><span class="type">GstAudioClock</span></a> instance. Whenever the clock time should be
137 calculated it will call <em class="parameter"><code>func</code></em> with <em class="parameter"><code>user_data</code></em>. When <em class="parameter"><code>func</code></em> returns
138 <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html#GST-CLOCK-TIME-NONE:CAPS"><span class="type">GST_CLOCK_TIME_NONE</span></a>, the clock will return the last reported time.
140 <div class="variablelist"><table border="0">
141 <col align="left" valign="top">
144 <td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
145 <td>the name of the clock</td>
148 <td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
152 <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
156 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
157 <td>a new <a class="link" href="gst-plugins-base-libs-gstaudioclock.html#GstAudioClock"><span class="type">GstAudioClock</span></a> casted to a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html"><span class="type">GstClock</span></a>.</td>
163 <div class="refsect2">
164 <a name="gst-audio-clock-new-full"></a><h3>gst_audio_clock_new_full ()</h3>
165 <pre class="programlisting"><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html"><span class="returnvalue">GstClock</span></a> * gst_audio_clock_new_full (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>,
166 <em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstaudioclock.html#GstAudioClockGetTimeFunc" title="GstAudioClockGetTimeFunc ()"><span class="type">GstAudioClockGetTimeFunc</span></a> func</code></em>,
167 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>,
168 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> destroy_notify</code></em>);</pre>
170 Create a new <a class="link" href="gst-plugins-base-libs-gstaudioclock.html#GstAudioClock"><span class="type">GstAudioClock</span></a> instance. Whenever the clock time should be
171 calculated it will call <em class="parameter"><code>func</code></em> with <em class="parameter"><code>user_data</code></em>. When <em class="parameter"><code>func</code></em> returns
172 <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html#GST-CLOCK-TIME-NONE:CAPS"><span class="type">GST_CLOCK_TIME_NONE</span></a>, the clock will return the last reported time.
174 <div class="variablelist"><table border="0">
175 <col align="left" valign="top">
178 <td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
179 <td>the name of the clock</td>
182 <td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
186 <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
190 <td><p><span class="term"><em class="parameter"><code>destroy_notify</code></em> :</span></p></td>
192 <a href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> for <em class="parameter"><code>user_data</code></em>
196 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
197 <td>a new <a class="link" href="gst-plugins-base-libs-gstaudioclock.html#GstAudioClock"><span class="type">GstAudioClock</span></a> casted to a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html"><span class="type">GstClock</span></a>.</td>
201 <p class="since">Since 0.10.31</p>
204 <div class="refsect2">
205 <a name="gst-audio-clock-adjust"></a><h3>gst_audio_clock_adjust ()</h3>
206 <pre class="programlisting"><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html#GstClockTime"><span class="returnvalue">GstClockTime</span></a> gst_audio_clock_adjust (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html"><span class="type">GstClock</span></a> *clock</code></em>,
207 <em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html#GstClockTime"><span class="type">GstClockTime</span></a> time</code></em>);</pre>
209 Adjust <em class="parameter"><code>time</code></em> with the internal offset of the audio clock.
211 <div class="variablelist"><table border="0">
212 <col align="left" valign="top">
215 <td><p><span class="term"><em class="parameter"><code>clock</code></em> :</span></p></td>
216 <td>a <a class="link" href="gst-plugins-base-libs-gstaudioclock.html#GstAudioClock"><span class="type">GstAudioClock</span></a>
220 <td><p><span class="term"><em class="parameter"><code>time</code></em> :</span></p></td>
221 <td>a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html#GstClockTime"><span class="type">GstClockTime</span></a>
225 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
227 <em class="parameter"><code>time</code></em> adjusted with the internal offset.</td>
231 <p class="since">Since 0.10.23</p>
234 <div class="refsect2">
235 <a name="gst-audio-clock-get-time"></a><h3>gst_audio_clock_get_time ()</h3>
236 <pre class="programlisting"><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html#GstClockTime"><span class="returnvalue">GstClockTime</span></a> gst_audio_clock_get_time (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html"><span class="type">GstClock</span></a> *clock</code></em>);</pre>
238 Report the time as returned by the <a class="link" href="gst-plugins-base-libs-gstaudioclock.html#GstAudioClockGetTimeFunc" title="GstAudioClockGetTimeFunc ()"><span class="type">GstAudioClockGetTimeFunc</span></a> without applying
241 <div class="variablelist"><table border="0">
242 <col align="left" valign="top">
245 <td><p><span class="term"><em class="parameter"><code>clock</code></em> :</span></p></td>
246 <td>a <a class="link" href="gst-plugins-base-libs-gstaudioclock.html#GstAudioClock"><span class="type">GstAudioClock</span></a>
250 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
251 <td>the time as reported by the time function of the audio clock</td>
255 <p class="since">Since 0.10.23</p>
258 <div class="refsect2">
259 <a name="gst-audio-clock-reset"></a><h3>gst_audio_clock_reset ()</h3>
260 <pre class="programlisting"><span class="returnvalue">void</span> gst_audio_clock_reset (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstaudioclock.html#GstAudioClock"><span class="type">GstAudioClock</span></a> *clock</code></em>,
261 <em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html#GstClockTime"><span class="type">GstClockTime</span></a> time</code></em>);</pre>
263 Inform <em class="parameter"><code>clock</code></em> that future calls to <a class="link" href="gst-plugins-base-libs-gstaudioclock.html#GstAudioClockGetTimeFunc" title="GstAudioClockGetTimeFunc ()"><span class="type">GstAudioClockGetTimeFunc</span></a> will return values
264 starting from <em class="parameter"><code>time</code></em>. The clock will update an internal offset to make sure that
265 future calls to internal_time will return an increasing result as required by
266 the <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html"><span class="type">GstClock</span></a> object.
268 <div class="variablelist"><table border="0">
269 <col align="left" valign="top">
272 <td><p><span class="term"><em class="parameter"><code>clock</code></em> :</span></p></td>
273 <td>a <a class="link" href="gst-plugins-base-libs-gstaudioclock.html#GstAudioClock"><span class="type">GstAudioClock</span></a>
277 <td><p><span class="term"><em class="parameter"><code>time</code></em> :</span></p></td>
278 <td>a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html#GstClockTime"><span class="type">GstClockTime</span></a>
285 <div class="refsect2">
286 <a name="gst-audio-clock-invalidate"></a><h3>gst_audio_clock_invalidate ()</h3>
287 <pre class="programlisting"><span class="returnvalue">void</span> gst_audio_clock_invalidate (<em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html"><span class="type">GstClock</span></a> *clock</code></em>);</pre>
289 Invalidate the clock function. Call this function when the provided
290 <a class="link" href="gst-plugins-base-libs-gstaudioclock.html#GstAudioClockGetTimeFunc" title="GstAudioClockGetTimeFunc ()"><span class="type">GstAudioClockGetTimeFunc</span></a> cannot be called anymore, for example, when the
291 user_data becomes invalid.
294 After calling this function, <em class="parameter"><code>clock</code></em> will return the last returned time for
295 the rest of its lifetime.
297 <div class="variablelist"><table border="0">
298 <col align="left" valign="top">
300 <td><p><span class="term"><em class="parameter"><code>clock</code></em> :</span></p></td>
301 <td>a <a class="link" href="gst-plugins-base-libs-gstaudioclock.html#GstAudioClock"><span class="type">GstAudioClock</span></a>
305 <p class="since">Since 0.10.31</p>
308 <div class="refsect1">
309 <a name="gst-plugins-base-libs-gstaudioclock.see-also"></a><h2>See Also</h2>
310 <a class="link" href="gst-plugins-base-libs-gstbaseaudiosink.html#GstBaseAudioSink"><span class="type">GstBaseAudioSink</span></a>, <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstSystemClock.html"><span class="type">GstSystemClock</span></a>
315 Generated by GTK-Doc V1.17</div>