GstNet.NetTimePacket

Fields

Name

Type

Access

Description

local_time

int

r/w

the local time when this packet was sent

remote_time

int

r/w

the remote time observation

Methods

class

new (buffer)

class

receive (socket)

copy ()

free ()

send (socket, dest_address)

serialize ()

Details

class GstNet.NetTimePacket

Various functions for receiving, sending an serializing GstNet.NetTimePacket structures.

classmethod new(buffer)[source]
Parameters:

buffer (bytes or None) – a buffer from which to construct the packet, or None

Returns:

The new GstNet.NetTimePacket.

Return type:

GstNet.NetTimePacket

Creates a new GstNet.NetTimePacket from a buffer received over the network. The caller is responsible for ensuring that buffer is at least GstNet.NET_TIME_PACKET_SIZE bytes long.

If buffer is None, the local and remote times will be set to Gst.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:

GLib.Error

Returns:

a new GstNet.NetTimePacket, or None on error. Free with GstNet.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 returns None on error.

copy()[source]
Returns:

a copy of self, free with GstNet.NetTimePacket.free().

Return type:

GstNet.NetTimePacket

Make a copy of self.

free()[source]

Free self.

send(socket, dest_address)[source]
Parameters:
Raises:

GLib.Error

Returns:

True if successful, False in case an error occurred.

Return type:

bool

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:

bytes

Serialized a GstNet.NetTimePacket into a newly-allocated sequence of GstNet.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).