Functions#
- buffer_add_net_address_meta(buffer: Buffer, addr: SocketAddress) NetAddressMeta #
Attaches
addr
as metadata in aNetAddressMeta
tobuffer
.- Parameters:
buffer – a
Buffer
addr – a
GSocketAddress
to connect tobuffer
- Returns:
a
NetAddressMeta
connected tobuffer
- buffer_add_net_control_message_meta(buffer: Buffer, message: SocketControlMessage) NetControlMessageMeta #
Attaches
message
as metadata in aNetControlMessageMeta
tobuffer
.- Parameters:
buffer – a
Buffer
message – a
GSocketControlMessage
to attach tobuffer
- Returns:
a
NetControlMessageMeta
connected tobuffer
- buffer_get_net_address_meta(buffer: Buffer) NetAddressMeta | None #
Find the
NetAddressMeta
onbuffer
.- Parameters:
buffer – a
Buffer
- Returns:
the
NetAddressMeta
orNone
when there is no such metadata onbuffer
.
- net_address_meta_api_get_type() GType #
- net_control_message_meta_api_get_type() GType #
- 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 givenclock_id
.If
clock_id
isPTP_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 aStructure
with the following optional fields: *int
clock-id
: The clock ID to use for the local clock. If theclock-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