blob: 61b6f79c60bf4f24a2d0d5e932548a6e85e45e46 [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>GStreamer 1.0 Library Reference Manual: GstNetTimePacket</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="GstNetClientClock.html" title="GstNetClientClock">
<link rel="next" href="GstNetTimeProvider.html" title="GstNetTimeProvider">
<meta name="generator" content="GTK-Doc V1.20 (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="10"><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="#gstreamer-libs-GstNetTimePacket.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span> 
<a href="#gstreamer-libs-GstNetTimePacket.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="gstreamer-net.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="GstNetClientClock.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="GstNetTimeProvider.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="gstreamer-libs-GstNetTimePacket"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gstreamer-libs-GstNetTimePacket.top_of_page"></a>GstNetTimePacket</span></h2>
<p>GstNetTimePacket — Helper structure to construct clock packets used
by network clocks.</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="gstreamer-libs-GstNetTimePacket.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 class="link" href="gstreamer-libs-GstNetTimePacket.html#GstNetTimePacket" title="struct GstNetTimePacket"><span class="returnvalue">GstNetTimePacket</span></a> *
</td>
<td class="function_name">
<a class="link" href="gstreamer-libs-GstNetTimePacket.html#gst-net-time-packet-new" title="gst_net_time_packet_new ()">gst_net_time_packet_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="gstreamer-libs-GstNetTimePacket.html#GstNetTimePacket" title="struct GstNetTimePacket"><span class="returnvalue">GstNetTimePacket</span></a> *
</td>
<td class="function_name">
<a class="link" href="gstreamer-libs-GstNetTimePacket.html#gst-net-time-packet-copy" title="gst_net_time_packet_copy ()">gst_net_time_packet_copy</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="gstreamer-libs-GstNetTimePacket.html#gst-net-time-packet-free" title="gst_net_time_packet_free ()">gst_net_time_packet_free</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="gstreamer-libs-GstNetTimePacket.html#GstNetTimePacket" title="struct GstNetTimePacket"><span class="returnvalue">GstNetTimePacket</span></a> *
</td>
<td class="function_name">
<a class="link" href="gstreamer-libs-GstNetTimePacket.html#gst-net-time-packet-receive" title="gst_net_time_packet_receive ()">gst_net_time_packet_receive</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="gstreamer-libs-GstNetTimePacket.html#gst-net-time-packet-send" title="gst_net_time_packet_send ()">gst_net_time_packet_send</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">guint8</span> *
</td>
<td class="function_name">
<a class="link" href="gstreamer-libs-GstNetTimePacket.html#gst-net-time-packet-serialize" title="gst_net_time_packet_serialize ()">gst_net_time_packet_serialize</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gstreamer-libs-GstNetTimePacket.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="gstreamer-libs-GstNetTimePacket.html#GstNetTimePacket" title="struct GstNetTimePacket">GstNetTimePacket</a></td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="gstreamer-libs-GstNetTimePacket.html#GST-NET-TIME-PACKET-SIZE:CAPS" title="GST_NET_TIME_PACKET_SIZE">GST_NET_TIME_PACKET_SIZE</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gstreamer-libs-GstNetTimePacket.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen">
</pre>
</div>
<div class="refsect1">
<a name="gstreamer-libs-GstNetTimePacket.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;gst/net/gstnet.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="gstreamer-libs-GstNetTimePacket.description"></a><h2>Description</h2>
<p>Various functions for receiving, sending an serializing <a class="link" href="gstreamer-libs-GstNetTimePacket.html#GstNetTimePacket" title="struct GstNetTimePacket"><span class="type">GstNetTimePacket</span></a>
structures.</p>
</div>
<div class="refsect1">
<a name="gstreamer-libs-GstNetTimePacket.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gst-net-time-packet-new"></a><h3>gst_net_time_packet_new ()</h3>
<pre class="programlisting"><a class="link" href="gstreamer-libs-GstNetTimePacket.html#GstNetTimePacket" title="struct GstNetTimePacket"><span class="returnvalue">GstNetTimePacket</span></a> *
gst_net_time_packet_new (<em class="parameter"><code>const <span class="type">guint8</span> *buffer</code></em>);</pre>
<p>Creates a new <a class="link" href="gstreamer-libs-GstNetTimePacket.html#GstNetTimePacket" title="struct GstNetTimePacket"><span class="type">GstNetTimePacket</span></a> from a buffer received over the network. The
caller is responsible for ensuring that <em class="parameter"><code>buffer</code></em>
is at least
<a class="link" href="gstreamer-libs-GstNetTimePacket.html#GST-NET-TIME-PACKET-SIZE:CAPS" title="GST_NET_TIME_PACKET_SIZE"><span class="type">GST_NET_TIME_PACKET_SIZE</span></a> bytes long.</p>
<p>If <em class="parameter"><code>buffer</code></em>
is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a>, the local and remote times will be set to
<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>.</p>
<p>MT safe. Caller owns return value (gst_net_time_packet_free to free).</p>
<div class="refsect3">
<a name="id-1.2.6.4.8.2.7"></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>buffer</p></td>
<td class="parameter_description"><p> a buffer from which to construct the packet, or NULL. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym>]</span></td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.6.4.8.2.8"></a><h4>Returns</h4>
<p> The new <a class="link" href="gstreamer-libs-GstNetTimePacket.html#GstNetTimePacket" title="struct GstNetTimePacket"><span class="type">GstNetTimePacket</span></a>.</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-net-time-packet-copy"></a><h3>gst_net_time_packet_copy ()</h3>
<pre class="programlisting"><a class="link" href="gstreamer-libs-GstNetTimePacket.html#GstNetTimePacket" title="struct GstNetTimePacket"><span class="returnvalue">GstNetTimePacket</span></a> *
gst_net_time_packet_copy (<em class="parameter"><code>const <a class="link" href="gstreamer-libs-GstNetTimePacket.html#GstNetTimePacket" title="struct GstNetTimePacket"><span class="type">GstNetTimePacket</span></a> *packet</code></em>);</pre>
<p>Make a copy of <em class="parameter"><code>packet</code></em>
.</p>
<div class="refsect3">
<a name="id-1.2.6.4.8.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>packet</p></td>
<td class="parameter_description"><p>the <a class="link" href="gstreamer-libs-GstNetTimePacket.html#GstNetTimePacket" title="struct GstNetTimePacket"><span class="type">GstNetTimePacket</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.6.4.8.3.6"></a><h4>Returns</h4>
<p> a copy of <em class="parameter"><code>packet</code></em>
, free with <a class="link" href="gstreamer-libs-GstNetTimePacket.html#gst-net-time-packet-free" title="gst_net_time_packet_free ()"><code class="function">gst_net_time_packet_free()</code></a>.</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-net-time-packet-free"></a><h3>gst_net_time_packet_free ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gst_net_time_packet_free (<em class="parameter"><code><a class="link" href="gstreamer-libs-GstNetTimePacket.html#GstNetTimePacket" title="struct GstNetTimePacket"><span class="type">GstNetTimePacket</span></a> *packet</code></em>);</pre>
<p>Free <em class="parameter"><code>packet</code></em>
.</p>
<div class="refsect3">
<a name="id-1.2.6.4.8.4.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>packet</p></td>
<td class="parameter_description"><p>the <a class="link" href="gstreamer-libs-GstNetTimePacket.html#GstNetTimePacket" title="struct GstNetTimePacket"><span class="type">GstNetTimePacket</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-net-time-packet-receive"></a><h3>gst_net_time_packet_receive ()</h3>
<pre class="programlisting"><a class="link" href="gstreamer-libs-GstNetTimePacket.html#GstNetTimePacket" title="struct GstNetTimePacket"><span class="returnvalue">GstNetTimePacket</span></a> *
gst_net_time_packet_receive (<em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GSocket.html"><span class="type">GSocket</span></a> *socket</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GSocketAddress.html"><span class="type">GSocketAddress</span></a> **src_address</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>Receives a <a class="link" href="gstreamer-libs-GstNetTimePacket.html#GstNetTimePacket" title="struct GstNetTimePacket"><span class="type">GstNetTimePacket</span></a> over a socket. Handles interrupted system
calls, but otherwise returns NULL on error.</p>
<div class="refsect3">
<a name="id-1.2.6.4.8.5.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>socket</p></td>
<td class="parameter_description"><p>socket to receive the time packet on</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>src_address</p></td>
<td class="parameter_description"><p> address of variable to return sender address. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>return address for a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or NULL</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.6.4.8.5.6"></a><h4>Returns</h4>
<p> a new <a class="link" href="gstreamer-libs-GstNetTimePacket.html#GstNetTimePacket" title="struct GstNetTimePacket"><span class="type">GstNetTimePacket</span></a>, or NULL on error. Free
with <a class="link" href="gstreamer-libs-GstNetTimePacket.html#gst-net-time-packet-free" title="gst_net_time_packet_free ()"><code class="function">gst_net_time_packet_free()</code></a> when done. </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-net-time-packet-send"></a><h3>gst_net_time_packet_send ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gst_net_time_packet_send (<em class="parameter"><code>const <a class="link" href="gstreamer-libs-GstNetTimePacket.html#GstNetTimePacket" title="struct GstNetTimePacket"><span class="type">GstNetTimePacket</span></a> *packet</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GSocket.html"><span class="type">GSocket</span></a> *socket</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GSocketAddress.html"><span class="type">GSocketAddress</span></a> *dest_address</code></em>,
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>Sends a <a class="link" href="gstreamer-libs-GstNetTimePacket.html#GstNetTimePacket" title="struct GstNetTimePacket"><span class="type">GstNetTimePacket</span></a> over a socket.</p>
<p>MT safe.</p>
<div class="refsect3">
<a name="id-1.2.6.4.8.6.6"></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>packet</p></td>
<td class="parameter_description"><p>the <a class="link" href="gstreamer-libs-GstNetTimePacket.html#GstNetTimePacket" title="struct GstNetTimePacket"><span class="type">GstNetTimePacket</span></a> to send</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>socket</p></td>
<td class="parameter_description"><p>socket to send the time packet on</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>dest_address</p></td>
<td class="parameter_description"><p>address to send the time packet to</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>return address for a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or NULL</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.6.4.8.6.7"></a><h4>Returns</h4>
<p> TRUE if successful, FALSE in case an error occurred.</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-net-time-packet-serialize"></a><h3>gst_net_time_packet_serialize ()</h3>
<pre class="programlisting"><span class="returnvalue">guint8</span> *
gst_net_time_packet_serialize (<em class="parameter"><code>const <a class="link" href="gstreamer-libs-GstNetTimePacket.html#GstNetTimePacket" title="struct GstNetTimePacket"><span class="type">GstNetTimePacket</span></a> *packet</code></em>);</pre>
<p>Serialized a <a class="link" href="gstreamer-libs-GstNetTimePacket.html#GstNetTimePacket" title="struct GstNetTimePacket"><span class="type">GstNetTimePacket</span></a> into a newly-allocated sequence of
<a class="link" href="gstreamer-libs-GstNetTimePacket.html#GST-NET-TIME-PACKET-SIZE:CAPS" title="GST_NET_TIME_PACKET_SIZE"><span class="type">GST_NET_TIME_PACKET_SIZE</span></a> bytes, in network byte order. The value returned is
suitable for passing to write(2) or sendto(2) for communication over the
network.</p>
<p>MT safe. Caller owns return value (g_free to free).</p>
<div class="refsect3">
<a name="id-1.2.6.4.8.7.6"></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>packet</p></td>
<td class="parameter_description"><p>the <a class="link" href="gstreamer-libs-GstNetTimePacket.html#GstNetTimePacket" title="struct GstNetTimePacket"><span class="type">GstNetTimePacket</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.6.4.8.7.7"></a><h4>Returns</h4>
<p> A newly allocated sequence of <a class="link" href="gstreamer-libs-GstNetTimePacket.html#GST-NET-TIME-PACKET-SIZE:CAPS" title="GST_NET_TIME_PACKET_SIZE"><span class="type">GST_NET_TIME_PACKET_SIZE</span></a> bytes.</p>
<p></p>
</div>
</div>
</div>
<div class="refsect1">
<a name="gstreamer-libs-GstNetTimePacket.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GstNetTimePacket"></a><h3>struct GstNetTimePacket</h3>
<pre class="programlisting">struct GstNetTimePacket {
GstClockTime local_time;
GstClockTime remote_time;
};
</pre>
<p>Content of a <a class="link" href="gstreamer-libs-GstNetTimePacket.html#GstNetTimePacket" title="struct GstNetTimePacket"><span class="type">GstNetTimePacket</span></a>.</p>
<div class="refsect3">
<a name="id-1.2.6.4.9.2.5"></a><h4>Members</h4>
<div class="informaltable"><table 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 href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html#GstClockTime"><span class="type">GstClockTime</span></a> <em class="structfield"><code><a name="GstNetTimePacket.local-time"></a>local_time</code></em>;</p></td>
<td class="struct_member_description"><p>the local time when this packet was sent</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstClock.html#GstClockTime"><span class="type">GstClockTime</span></a> <em class="structfield"><code><a name="GstNetTimePacket.remote-time"></a>remote_time</code></em>;</p></td>
<td class="struct_member_description"><p>the remote time observation</p></td>
<td class="struct_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GST-NET-TIME-PACKET-SIZE:CAPS"></a><h3>GST_NET_TIME_PACKET_SIZE</h3>
<pre class="programlisting">#define GST_NET_TIME_PACKET_SIZE 16
</pre>
<p>The size of the packets sent between network clocks.</p>
</div>
</div>
<div class="refsect1">
<a name="gstreamer-libs-GstNetTimePacket.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="GstNetClientClock.html" title="GstNetClientClock"><span class="type">GstNetClientClock</span></a>, <a class="link" href="GstNetTimeProvider.html" title="GstNetTimeProvider"><span class="type">GstNetTimeProvider</span></a></p>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.20</div>
</body>
</html>