|  |  |  | GStreamer 1.0 Library Reference Manual |  | 
|---|---|---|---|---|
| Top | Description | ||||
| GstNetTimePacketGstNetTimePacket — Helper structure to construct clock packets used by network clocks. | 
#include <gst/net/gstnet.h> struct GstNetTimePacket; #define GST_NET_TIME_PACKET_SIZE GstNetTimePacket * gst_net_time_packet_new (const guint8 *buffer); GstNetTimePacket * gst_net_time_packet_receive (GSocket *socket,GSocketAddress **src_address,GError **error); gboolean gst_net_time_packet_send (const GstNetTimePacket *packet,GSocket *socket,GSocketAddress *dest_address,GError **error); guint8 * gst_net_time_packet_serialize (const GstNetTimePacket *packet);
Various functions for receiving, sending an serializing GstNetTimePacket structures.
Last reviewed on 2005-11-23 (0.9.5)
struct GstNetTimePacket {
  GstClockTime local_time;
  GstClockTime remote_time;
};
Content of a GstNetTimePacket.
| GstClockTime  | the local time when this packet was sent | 
| GstClockTime  | the remote time observation | 
#define GST_NET_TIME_PACKET_SIZE 16
The size of the packets sent between network clocks.
GstNetTimePacket *  gst_net_time_packet_new             (const guint8 *buffer);
Creates a new GstNetTimePacket from a buffer received over the network. The
caller is responsible for ensuring that buffer is at least
GST_NET_TIME_PACKET_SIZE bytes long.
If buffer is NULL, the local and remote times will be set to
GST_CLOCK_TIME_NONE.
MT safe. Caller owns return value (gst_net_time_packet_free to free).
| 
 | a buffer from which to construct the packet, or NULL. [array] | 
| Returns : | The new GstNetTimePacket. | 
GstNetTimePacket * gst_net_time_packet_receive (GSocket *socket,GSocketAddress **src_address,GError **error);
Receives a GstNetTimePacket over a socket. Handles interrupted system calls, but otherwise returns NULL on error.
| 
 | socket to receive the time packet on | 
| 
 | address of variable to return sender address. [out] | 
| 
 | return address for a GError, or NULL | 
| Returns : | a new GstNetTimePacket, or NULL on error. Free
with gst_net_time_packet_free()when done. [transfer full] | 
gboolean gst_net_time_packet_send (const GstNetTimePacket *packet,GSocket *socket,GSocketAddress *dest_address,GError **error);
Sends a GstNetTimePacket over a socket.
MT safe.
| 
 | the GstNetTimePacket to send | 
| 
 | socket to send the time packet on | 
| 
 | address to send the time packet to | 
| 
 | return address for a GError, or NULL | 
| Returns : | TRUE if successful, FALSE in case an error occured. | 
guint8 *            gst_net_time_packet_serialize       (const GstNetTimePacket *packet);
Serialized a GstNetTimePacket into a newly-allocated sequence of GST_NET_TIME_PACKET_SIZE bytes, in network byte order. The value returned is suitable for passing to write(2) or sendto(2) for communication over the network.
MT safe. Caller owns return value (g_free to free).
| 
 | the GstNetTimePacket | 
| Returns : | A newly allocated sequence of GST_NET_TIME_PACKET_SIZE bytes. |