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() GType#
net_address_meta_get_info() MetaInfo#
net_control_message_meta_api_get_type() GType#
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: list[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_init_full(config: Structure) bool#

Initialize the GStreamer PTP subsystem and create a PTP ordinary clock in slave-only mode according to the config.

config is a Structure with the following optional fields: * int clock-id: The clock ID to use for the local clock. If the

clock-id is not provided or PTP_CLOCK_ID_NONE is provided, a clock id is automatically generated from the MAC address of the first network interface.

* GStrv interfaces: The interface names to listen on for PTP packets. If

none are provided then all compatible interfaces will be used.

  • int ttl: The TTL to use for multicast packets sent out by GStreamer.

    This defaults to 1, i.e. packets will not leave the local network.

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

Added in version 1.24.

Parameters:

config – Configuration for initializing the GStreamer PTP subsystem

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[[int, Structure, Any], bool], user_data: Any = None) 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