blob: f670a7a321160c28d3f6f14a3bb4261794051244 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GstNetClientClock: GStreamer 1.0 Library Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="GStreamer 1.0 Library Reference Manual">
<link rel="up" href="gstreamer-net.html" title="GStreamer Network Classes">
<link rel="prev" href="gstreamer-libs-GstNetAddressMeta.html" title="GstNetAddressMeta">
<link rel="next" href="gstreamer-libs-GstNetControlMessageMeta.html" title="GstNetControlMessageMeta">
<meta name="generator" content="GTK-Doc V1.24 (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="#GstNetClientClock.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span> 
<a href="#GstNetClientClock.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_properties">  <span class="dim">|</span> 
<a href="#GstNetClientClock.properties" class="shortcut">Properties</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="gstreamer-net.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="gstreamer-libs-GstNetAddressMeta.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="gstreamer-libs-GstNetControlMessageMeta.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="GstNetClientClock"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GstNetClientClock.top_of_page"></a>GstNetClientClock</span></h2>
<p>GstNetClientClock — Special clock that synchronizes to a remote time
provider.</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="GstNetClientClock.functions"></a><h2>Functions</h2>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html"><span class="returnvalue">GstClock</span></a> *
</td>
<td class="function_name">
<a class="link" href="GstNetClientClock.html#gst-net-client-clock-new" title="gst_net_client_clock_new ()">gst_net_client_clock_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html"><span class="returnvalue">GstClock</span></a> *
</td>
<td class="function_name">
<a class="link" href="GstNetClientClock.html#gst-ntp-clock-new" title="gst_ntp_clock_new ()">gst_ntp_clock_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GstNetClientClock.properties"></a><h2>Properties</h2>
<div class="informaltable"><table border="0">
<colgroup>
<col width="150px" class="properties_type">
<col width="300px" class="properties_name">
<col width="200px" class="properties_flags">
</colgroup>
<tbody>
<tr>
<td class="property_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *</td>
<td class="property_name"><a class="link" href="GstNetClientClock.html#GstNetClientClock--address" title="The “address” property">address</a></td>
<td class="property_flags">Read / Write / Construct</td>
</tr>
<tr>
<td class="property_type"><span class="type">guint64</span></td>
<td class="property_name"><a class="link" href="GstNetClientClock.html#GstNetClientClock--base-time" title="The “base-time” property">base-time</a></td>
<td class="property_flags">Read / Write / Construct Only</td>
</tr>
<tr>
<td class="property_type">
<a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstBus.html"><span class="type">GstBus</span></a> *</td>
<td class="property_name"><a class="link" href="GstNetClientClock.html#GstNetClientClock--bus" title="The “bus” property">bus</a></td>
<td class="property_flags">Read / Write</td>
</tr>
<tr>
<td class="property_type">
<a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html"><span class="type">GstClock</span></a> *</td>
<td class="property_name"><a class="link" href="GstNetClientClock.html#GstNetClientClock--internal-clock" title="The “internal-clock” property">internal-clock</a></td>
<td class="property_flags">Read</td>
</tr>
<tr>
<td class="property_type"><span class="type">guint64</span></td>
<td class="property_name"><a class="link" href="GstNetClientClock.html#GstNetClientClock--minimum-update-interval" title="The “minimum-update-interval” property">minimum-update-interval</a></td>
<td class="property_flags">Read / Write</td>
</tr>
<tr>
<td class="property_type"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a></td>
<td class="property_name"><a class="link" href="GstNetClientClock.html#GstNetClientClock--port" title="The “port” property">port</a></td>
<td class="property_flags">Read / Write / Construct</td>
</tr>
<tr>
<td class="property_type"><span class="type">guint64</span></td>
<td class="property_name"><a class="link" href="GstNetClientClock.html#GstNetClientClock--round-trip-limit" title="The “round-trip-limit” property">round-trip-limit</a></td>
<td class="property_flags">Read / Write</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GstNetClientClock.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table 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="GstNetClientClock.html#GstNetClientClock-struct" title="struct GstNetClientClock">GstNetClientClock</a></td>
</tr>
<tr>
<td class="typedef_keyword">typedef</td>
<td class="function_name"><a class="link" href="GstNetClientClock.html#GstNtpClock" title="GstNtpClock">GstNtpClock</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GstNetClientClock.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen"> <a href="https://developer.gnome.org/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
<span class="lineart">╰──</span> <a href="https://developer.gnome.org/gobject/unstable/gobject-The-Base-Object-Type.html#GInitiallyUnowned">GInitiallyUnowned</a>
<span class="lineart">╰──</span> <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstObject.html">GstObject</a>
<span class="lineart">╰──</span> <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html">GstClock</a>
<span class="lineart">╰──</span> <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstSystemClock.html">GstSystemClock</a>
<span class="lineart">╰──</span> GstNetClientClock
</pre>
</div>
<div class="refsect1">
<a name="GstNetClientClock.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;gst/net/gstnet.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="GstNetClientClock.description"></a><h2>Description</h2>
<p><a class="link" href="GstNetClientClock.html" title="GstNetClientClock"><span class="type">GstNetClientClock</span></a> implements a custom <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html"><span class="type">GstClock</span></a> that synchronizes its time
to a remote time provider such as <a class="link" href="GstNetTimeProvider.html" title="GstNetTimeProvider"><span class="type">GstNetTimeProvider</span></a>. <a class="link" href="GstNetClientClock.html#GstNtpClock" title="GstNtpClock"><span class="type">GstNtpClock</span></a>
implements a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html"><span class="type">GstClock</span></a> that synchronizes its time to a remote NTPv4 server.</p>
<p>A new clock is created with <a class="link" href="GstNetClientClock.html#gst-net-client-clock-new" title="gst_net_client_clock_new ()"><code class="function">gst_net_client_clock_new()</code></a> or
<a class="link" href="GstNetClientClock.html#gst-ntp-clock-new" title="gst_ntp_clock_new ()"><code class="function">gst_ntp_clock_new()</code></a>, which takes the address and port of the remote time
provider along with a name and an initial time.</p>
<p>This clock will poll the time provider and will update its calibration
parameters based on the local and remote observations.</p>
<p>The "round-trip" property limits the maximum round trip packets can take.</p>
<p>Various parameters of the clock can be configured with the parent <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html"><span class="type">GstClock</span></a>
"timeout", "window-size" and "window-threshold" object properties.</p>
<p>A <a class="link" href="GstNetClientClock.html" title="GstNetClientClock"><span class="type">GstNetClientClock</span></a> and <a class="link" href="GstNetClientClock.html#GstNtpClock" title="GstNtpClock"><span class="type">GstNtpClock</span></a> is typically set on a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPipeline.html"><span class="type">GstPipeline</span></a> with
<a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPipeline.html#gst-pipeline-use-clock"><code class="function">gst_pipeline_use_clock()</code></a>.</p>
<p>If you set a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstBus.html"><span class="type">GstBus</span></a> on the clock via the "bus" object property, it will
send <em class="parameter"><code>GST_MESSAGE_ELEMENT</code></em>
messages with an attached <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstStructure.html"><span class="type">GstStructure</span></a> containing
statistics about clock accuracy and network traffic.</p>
</div>
<div class="refsect1">
<a name="GstNetClientClock.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gst-net-client-clock-new"></a><h3>gst_net_client_clock_new ()</h3>
<pre class="programlisting"><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html"><span class="returnvalue">GstClock</span></a> *
gst_net_client_clock_new (<em class="parameter"><code>const <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>,
<em class="parameter"><code>const <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *remote_address</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> remote_port</code></em>,
<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> base_time</code></em>);</pre>
<p>Create a new <a class="link" href="GstNetClientClock.html" title="GstNetClientClock"><span class="type">GstNetClientClock</span></a> that will report the time
provided by the <a class="link" href="GstNetTimeProvider.html" title="GstNetTimeProvider"><span class="type">GstNetTimeProvider</span></a> on <em class="parameter"><code>remote_address</code></em>
and
<em class="parameter"><code>remote_port</code></em>
.</p>
<div class="refsect3">
<a name="id-1.2.6.4.9.2.5"></a><h4>Parameters</h4>
<div class="informaltable"><table 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>name</p></td>
<td class="parameter_description"><p>a name for the clock</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>remote_address</p></td>
<td class="parameter_description"><p>the address of the remote clock provider</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>remote_port</p></td>
<td class="parameter_description"><p>the port of the remote clock provider</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>base_time</p></td>
<td class="parameter_description"><p>initial time of the clock</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.6.4.9.2.6"></a><h4>Returns</h4>
<p> a new <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html"><span class="type">GstClock</span></a> that receives a time from the remote
clock.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-ntp-clock-new"></a><h3>gst_ntp_clock_new ()</h3>
<pre class="programlisting"><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html"><span class="returnvalue">GstClock</span></a> *
gst_ntp_clock_new (<em class="parameter"><code>const <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>,
<em class="parameter"><code>const <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *remote_address</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> remote_port</code></em>,
<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> base_time</code></em>);</pre>
<p>Create a new <a class="link" href="GstNetClientClock.html#GstNtpClock" title="GstNtpClock"><span class="type">GstNtpClock</span></a> that will report the time provided by
the NTPv4 server on <em class="parameter"><code>remote_address</code></em>
and <em class="parameter"><code>remote_port</code></em>
.</p>
<div class="refsect3">
<a name="id-1.2.6.4.9.3.5"></a><h4>Parameters</h4>
<div class="informaltable"><table 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>name</p></td>
<td class="parameter_description"><p>a name for the clock</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>remote_address</p></td>
<td class="parameter_description"><p>the address of the remote clock provider</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>remote_port</p></td>
<td class="parameter_description"><p>the port of the remote clock provider</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>base_time</p></td>
<td class="parameter_description"><p>initial time of the clock</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.6.4.9.3.6"></a><h4>Returns</h4>
<p> a new <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html"><span class="type">GstClock</span></a> that receives a time from the remote
clock.</p>
</div>
<p class="since">Since: <a class="link" href="ix03.html#api-index-1.6">1.6</a></p>
</div>
</div>
<div class="refsect1">
<a name="GstNetClientClock.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GstNetClientClock-struct"></a><h3>struct GstNetClientClock</h3>
<pre class="programlisting">struct GstNetClientClock;</pre>
<p>Opaque <a class="link" href="GstNetClientClock.html" title="GstNetClientClock"><span class="type">GstNetClientClock</span></a> structure.</p>
</div>
<hr>
<div class="refsect2">
<a name="GstNtpClock"></a><h3>GstNtpClock</h3>
<pre class="programlisting">typedef struct _GstNetClientClock GstNtpClock;
</pre>
</div>
</div>
<div class="refsect1">
<a name="GstNetClientClock.property-details"></a><h2>Property Details</h2>
<div class="refsect2">
<a name="GstNetClientClock--address"></a><h3>The <code class="literal">“address”</code> property</h3>
<pre class="programlisting"> “address” <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *</pre>
<p>The IP address of the machine providing a time server.</p>
<p>Flags: Read / Write / Construct</p>
<p>Default value: "127.0.0.1"</p>
</div>
<hr>
<div class="refsect2">
<a name="GstNetClientClock--base-time"></a><h3>The <code class="literal">“base-time”</code> property</h3>
<pre class="programlisting"> “base-time” <span class="type">guint64</span></pre>
<p>Initial time that is reported before synchronization.</p>
<p>Flags: Read / Write / Construct Only</p>
<p>Default value: 0</p>
</div>
<hr>
<div class="refsect2">
<a name="GstNetClientClock--bus"></a><h3>The <code class="literal">“bus”</code> property</h3>
<pre class="programlisting"> “bus” <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstBus.html"><span class="type">GstBus</span></a> *</pre>
<p>A GstBus on which to send clock status information.</p>
<p>Flags: Read / Write</p>
</div>
<hr>
<div class="refsect2">
<a name="GstNetClientClock--internal-clock"></a><h3>The <code class="literal">“internal-clock”</code> property</h3>
<pre class="programlisting"> “internal-clock” <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html"><span class="type">GstClock</span></a> *</pre>
<p>Internal clock that directly slaved to the remote clock.</p>
<p>Flags: Read</p>
</div>
<hr>
<div class="refsect2">
<a name="GstNetClientClock--minimum-update-interval"></a><h3>The <code class="literal">“minimum-update-interval”</code> property</h3>
<pre class="programlisting"> “minimum-update-interval” <span class="type">guint64</span></pre>
<p>Minimum polling interval for packets, in nanoseconds(0 = no limit).</p>
<p>Flags: Read / Write</p>
<p>Default value: 50000000</p>
</div>
<hr>
<div class="refsect2">
<a name="GstNetClientClock--port"></a><h3>The <code class="literal">“port”</code> property</h3>
<pre class="programlisting"> “port” <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a></pre>
<p>The port on which the remote server is listening.</p>
<p>Flags: Read / Write / Construct</p>
<p>Allowed values: [0,65535]</p>
<p>Default value: 5637</p>
</div>
<hr>
<div class="refsect2">
<a name="GstNetClientClock--round-trip-limit"></a><h3>The <code class="literal">“round-trip-limit”</code> property</h3>
<pre class="programlisting"> “round-trip-limit” <span class="type">guint64</span></pre>
<p>Maximum tolerable round-trip interval for packets, in nanoseconds (0 = no limit).</p>
<p>Flags: Read / Write</p>
<p>Default value: 1000000000</p>
</div>
</div>
<div class="refsect1">
<a name="GstNetClientClock.see-also"></a><h2>See Also</h2>
<p><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html"><span class="type">GstClock</span></a>, <a class="link" href="GstNetTimeProvider.html" title="GstNetTimeProvider"><span class="type">GstNetTimeProvider</span></a>, <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPipeline.html"><span class="type">GstPipeline</span></a></p>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.24</div>
</body>
</html>