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.NetTimePacket
structures.- classmethod new(buffer)[source]¶
- Parameters:
buffer (
bytes
orNone
) – a buffer from which to construct the packet, orNone
- Returns:
The new
GstNet.NetTimePacket
.- Return type:
Creates a new
GstNet.NetTimePacket
from a buffer received over the network. The caller is responsible for ensuring that buffer is at leastGstNet.NET_TIME_PACKET_SIZE
bytes 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.free
to free).
- classmethod receive(socket)[source]¶
- Parameters:
socket (
Gio.Socket
) – socket to receive the time packet on- Raises:
- Returns:
a new
GstNet.NetTimePacket
, orNone
on 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.NetTimePacket
over a socket. Handles interrupted system calls, but otherwise returnsNone
on 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.NetTimePacket
over a socket.MT safe.
- serialize()[source]¶
- Returns:
A newly allocated sequence of
GstNet.NET_TIME_PACKET_SIZE
bytes.- Return type:
Serialized a
GstNet.NetTimePacket
into a newly-allocated sequence ofGstNet.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 (
GLib.free
to free).