NetTimePacket#
- class NetTimePacket(*args, **kwargs)#
Various functions for receiving, sending an serializing NetTimePacket
structures.
Constructors#
- class NetTimePacket
- classmethod new(buffer: list[int] | None = None) NetTimePacket #
Creates a new
NetTimePacket
from a buffer received over the network. The caller is responsible for ensuring thatbuffer
is at leastGST_NET_TIME_PACKET_SIZE
bytes long.If
buffer
isNone
, the local and remote times will be set toGST_CLOCK_TIME_NONE
.MT safe. Caller owns return value (gst_net_time_packet_free to free).
- Parameters:
buffer – a buffer from which to construct the packet, or NULL
Methods#
- class NetTimePacket
-
- classmethod receive() Tuple[NetTimePacket, SocketAddress] #
Receives a
NetTimePacket
over a socket. Handles interrupted system calls, but otherwise returns NULL on error.
- send(socket: Socket, dest_address: SocketAddress) bool #
Sends a
NetTimePacket
over a socket.MT safe.
- Parameters:
socket – socket to send the time packet on
dest_address – address to send the time packet to
- serialize() list[int] #
Serialized a
NetTimePacket
into a newly-allocated sequence ofGST_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).