Functions#
- buffer_add_net_address_meta(buffer: Buffer, addr: SocketAddress) NetAddressMeta#
Attaches
addras metadata in aNetAddressMetatobuffer.- Parameters:
buffer – a
Bufferaddr – a
GSocketAddressto connect tobuffer
- Returns:
a
NetAddressMetaconnected tobuffer
- buffer_add_net_control_message_meta(buffer: Buffer, message: SocketControlMessage) NetControlMessageMeta#
Attaches
messageas metadata in aNetControlMessageMetatobuffer.- Parameters:
buffer – a
Buffermessage – a
GSocketControlMessageto attach tobuffer
- Returns:
a
NetControlMessageMetaconnected tobuffer
- buffer_get_net_address_meta(buffer: Buffer) NetAddressMeta | None#
Find the
NetAddressMetaonbuffer.- Parameters:
buffer – a
Buffer- Returns:
the
NetAddressMetaorNonewhen 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
interfaceswith the givenclock_id.If
clock_idisPTP_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_NONEinterfaces – network interfaces to run the clock on
- Returns:
Trueif 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.configis aStructurewith the following optional fields: *intclock-id: The clock ID to use for the local clock. If theclock-id is not provided or
PTP_CLOCK_ID_NONEis provided, a clock id is automatically generated from the MAC address of the first network interface.- *
GStrvinterfaces: The interface names to listen on for PTP packets. If none are provided then all compatible interfaces will be used.
intttl: 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:
Trueif 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:
Trueif 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:
Trueif 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