| Top |
GstNetTimePacketGstNetTimePacket — Helper structure to construct clock packets used by 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).
GstNetTimePacket *
gst_net_time_packet_copy (const GstNetTimePacket *packet);
Make a copy of packet
.
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 |
socket to receive the time packet on |
|
src_address |
address of variable to return sender address. |
[out] |
error |
return address for a GError, or NULL |
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.
packet |
the GstNetTimePacket to send |
|
socket |
socket to send the time packet on |
|
dest_address |
address to send the time packet to |
|
error |
return address for a GError, or NULL |
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).
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 |