Functions ========= .. currentmodule:: gi.repository.GstNet .. function:: buffer_add_net_address_meta(buffer: ~gi.repository.Gst.Buffer, addr: ~gi.repository.Gio.SocketAddress) -> ~gi.repository.GstNet.NetAddressMeta Attaches ``addr`` as metadata in a :obj:`~gi.repository.GstNet.NetAddressMeta` to ``buffer``\. :param buffer: a :obj:`~gi.repository.Gst.Buffer` :param addr: a ``GSocketAddress`` to connect to ``buffer`` :return: a :obj:`~gi.repository.GstNet.NetAddressMeta` connected to ``buffer`` .. function:: buffer_add_net_control_message_meta(buffer: ~gi.repository.Gst.Buffer, message: ~gi.repository.Gio.SocketControlMessage) -> ~gi.repository.GstNet.NetControlMessageMeta Attaches ``message`` as metadata in a :obj:`~gi.repository.GstNet.NetControlMessageMeta` to ``buffer``\. :param buffer: a :obj:`~gi.repository.Gst.Buffer` :param message: a ``GSocketControlMessage`` to attach to ``buffer`` :return: a :obj:`~gi.repository.GstNet.NetControlMessageMeta` connected to ``buffer`` .. function:: buffer_get_net_address_meta(buffer: ~gi.repository.Gst.Buffer) -> ~gi.repository.GstNet.NetAddressMeta | None Find the :obj:`~gi.repository.GstNet.NetAddressMeta` on ``buffer``\. :param buffer: a :obj:`~gi.repository.Gst.Buffer` :return: the :obj:`~gi.repository.GstNet.NetAddressMeta` or :const:`None` when there is no such metadata on ``buffer``\. .. function:: net_address_meta_api_get_type() -> ~gobject.GType .. function:: net_address_meta_get_info() -> ~gi.repository.Gst.MetaInfo .. function:: net_control_message_meta_api_get_type() -> ~gobject.GType .. function:: net_control_message_meta_get_info() -> ~gi.repository.Gst.MetaInfo .. function:: net_time_packet_receive(socket: ~gi.repository.Gio.Socket) -> ~typing.Tuple[~gi.repository.GstNet.NetTimePacket, ~gi.repository.Gio.SocketAddress] :param socket: .. function:: net_utils_set_socket_tos(socket: ~gi.repository.Gio.Socket, qos_dscp: int) -> bool Configures IP_TOS value of socket, i.e. sets QoS DSCP. .. versionadded:: 1.18 :param socket: Socket to configure :param qos_dscp: QoS DSCP value :return: TRUE if successful, FALSE in case an error occurred. .. function:: 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. .. versionadded:: 1.6 .. function:: 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 :const:`~gi.repository.GstNet.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 :func:`~gi.repository.GstNet.PtpClock.new` with default parameters if it wasn't called before. .. versionadded:: 1.6 :param clock_id: PTP clock id of this process' clock or :const:`~gi.repository.GstNet.PTP_CLOCK_ID_NONE` :param interfaces: network interfaces to run the clock on :return: :const:`True` if the GStreamer PTP clock subsystem could be initialized. .. function:: ptp_init_full(config: ~gi.repository.Gst.Structure) -> bool Initialize the GStreamer PTP subsystem and create a PTP ordinary clock in slave-only mode according to the ``config``\. ``config`` is a :obj:`~gi.repository.Gst.Structure` with the following optional fields: \* :obj:`int` ``clock-id``\: The clock ID to use for the local clock. If the clock-id is not provided or :const:`~gi.repository.GstNet.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. * :obj:`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 :func:`~gi.repository.GstNet.PtpClock.new` with default parameters if it wasn't called before. .. versionadded:: 1.24 :param config: Configuration for initializing the GStreamer PTP subsystem :return: :const:`True` if the GStreamer PTP clock subsystem could be initialized. .. function:: ptp_is_initialized() -> bool Check if the GStreamer PTP clock subsystem is initialized. .. versionadded:: 1.6 :return: :const:`True` if the GStreamer PTP clock subsystem is initialized. .. function:: ptp_is_supported() -> bool Check if PTP clocks are generally supported on this system, and if previous initializations did not fail. .. versionadded:: 1.6 :return: :const:`True` if PTP clocks are generally supported on this system, and previous initializations did not fail. .. function:: ptp_statistics_callback_add(callback: ~typing.Callable[[int, ~gi.repository.Gst.Structure, ~typing.Any], bool], user_data: ~typing.Any = None) -> int Installs a new statistics callback for gathering PTP statistics. See GstPtpStatisticsCallback for a list of statistics that are provided. .. versionadded:: 1.6 :param callback: GstPtpStatisticsCallback to call :param user_data: Data to pass to the callback :return: Id for the callback that can be passed to :func:`~gi.repository.GstNet.ptp_statistics_callback_remove` .. function:: ptp_statistics_callback_remove(id: int) -> None Removes a PTP statistics callback that was previously added with :func:`~gi.repository.GstNet.ptp_statistics_callback_add`. .. versionadded:: 1.6 :param id: Callback id to remove