GstNet.NetTimePacket¶
Fields¶
Name |
Type |
Access |
Description |
|---|---|---|---|
local_time |
r/w |
the local time when this packet was sent |
|
remote_time |
r/w |
the remote time observation |
Methods¶
class |
|
class |
|
|
|
|
|
|
|
|
Details¶
- class GstNet.NetTimePacket¶
Various functions for receiving, sending an serializing
GstNet.NetTimePacketstructures.- classmethod new(buffer)[source]¶
- Parameters:
buffer (
bytesorNone) – a buffer from which to construct the packet, orNone- Returns:
The new
GstNet.NetTimePacket.- Return type:
Creates a new
GstNet.NetTimePacketfrom a buffer received over the network. The caller is responsible for ensuring that buffer is at leastGstNet.NET_TIME_PACKET_SIZEbytes long.If buffer is
None, the local and remote times will be set toGst.CLOCK_TIME_NONE.MT safe. Caller owns return value (
GstNet.NetTimePacket.freeto free).
- classmethod receive(socket)[source]¶
- Parameters:
socket (
Gio.Socket) – socket to receive the time packet on- Raises:
- Returns:
a new
GstNet.NetTimePacket, orNoneon error. Free withGstNet.NetTimePacket.free() when done.- src_address:
address of variable to return sender address
- Return type:
(
GstNet.NetTimePacket, src_address:Gio.SocketAddress)
Receives a
GstNet.NetTimePacketover a socket. Handles interrupted system calls, but otherwise returnsNoneon error.
- copy()[source]¶
- Returns:
a copy of self, free with
GstNet.NetTimePacket.free().- Return type:
Make a copy of self.
- send(socket, dest_address)[source]¶
- Parameters:
socket (
Gio.Socket) – socket to send the time packet ondest_address (
Gio.SocketAddress) – address to send the time packet to
- Raises:
- Returns:
- Return type:
Sends a
GstNet.NetTimePacketover a socket.MT safe.
- serialize()[source]¶
- Returns:
A newly allocated sequence of
GstNet.NET_TIME_PACKET_SIZEbytes.- Return type:
Serialized a
GstNet.NetTimePacketinto a newly-allocated sequence ofGstNet.NET_TIME_PACKET_SIZEbytes, 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 (
GLib.freeto free).