Functions

buffer_add_net_address_meta(buffer: Buffer, addr: SocketAddress) NetAddressMeta

Attaches addr as metadata in a NetAddressMeta to buffer.

Parameters:
  • buffer – a Buffer

  • addr – a GSocketAddress to connect to buffer

Returns:

a NetAddressMeta connected to buffer

buffer_add_net_control_message_meta(buffer: Buffer, message: SocketControlMessage) NetControlMessageMeta

Attaches message as metadata in a NetControlMessageMeta to buffer.

Parameters:
  • buffer – a Buffer

  • message – a GSocketControlMessage to attach to buffer

Returns:

a NetControlMessageMeta connected to buffer

buffer_get_net_address_meta(buffer: Buffer) NetAddressMeta | None

Find the NetAddressMeta on buffer.

Parameters:

buffer – a Buffer

Returns:

the NetAddressMeta or None when there is no such metadata on buffer.

net_address_meta_api_get_type() type
net_address_meta_get_info() MetaInfo
net_control_message_meta_api_get_type() type
net_control_message_meta_get_info() MetaInfo
net_time_packet_receive(socket: Socket) tuple[NetTimePacket, SocketAddress]
Parameters:

socket

net_utils_set_socket_tos(socket: Socket, qos_dscp: int) bool

Configures IP_TOS value of socket, i.e. sets QoS DSCP.

Added in version 1.18.

Parameters:
  • socket – Socket to configure

  • qos_dscp – QoS DSCP value

Returns:

TRUE if successful, FALSE in case an error occurred.

ptp_deinit() None

Deinitialize the GStreamer PTP subsystem and stop the PTP clock. If there are any remaining GstPtpClock instances, they won’t be further synchronized to the PTP network clock.

Added in version 1.6.

ptp_init(clock_id: int, interfaces: Sequence[str] | None = None) bool

Initialize the GStreamer PTP subsystem and create a PTP ordinary clock in slave-only mode for all domains on the given interfaces with the given clock_id.

If clock_id is PTP_CLOCK_ID_NONE, a clock id is automatically generated from the MAC address of the first network interface.

This function is automatically called by new() with default parameters if it wasn’t called before.

Added in version 1.6.

Parameters:
  • clock_id – PTP clock id of this process’ clock or PTP_CLOCK_ID_NONE

  • interfaces – network interfaces to run the clock on

Returns:

True if the GStreamer PTP clock subsystem could be initialized.

ptp_is_initialized() bool

Check if the GStreamer PTP clock subsystem is initialized.

Added in version 1.6.

Returns:

True if the GStreamer PTP clock subsystem is initialized.

ptp_is_supported() bool

Check if PTP clocks are generally supported on this system, and if previous initializations did not fail.

Added in version 1.6.

Returns:

True if PTP clocks are generally supported on this system, and previous initializations did not fail.

ptp_statistics_callback_add(callback: Callable[[...], bool], *user_data: Any) int

Installs a new statistics callback for gathering PTP statistics. See GstPtpStatisticsCallback for a list of statistics that are provided.

Added in version 1.6.

Parameters:
  • callback – GstPtpStatisticsCallback to call

  • user_data – Data to pass to the callback

Returns:

Id for the callback that can be passed to ptp_statistics_callback_remove()

ptp_statistics_callback_remove(id: int) None

Removes a PTP statistics callback that was previously added with ptp_statistics_callback_add().

Added in version 1.6.

Parameters:

id – Callback id to remove