:right-sidebar: True PtpClock =================================================================== .. currentmodule:: gi.repository.GstNet .. versionadded:: 1.6 .. class:: PtpClock(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gst.SystemClock`, :class:`~gi.repository.Gst.Clock`, :class:`~gi.repository.Gst.Object`, :class:`~gi.repository.GObject.InitiallyUnowned`, :class:`~gi.repository.GObject.Object` GstPtpClock implements a PTP (IEEE1588:2008) ordinary clock in slave-only mode, that allows a GStreamer pipeline to synchronize to a PTP network clock in some specific domain. The PTP subsystem can be initialized with :func:`~gi.repository.GstNet.ptp_init`, which then starts a helper process to do the actual communication via the PTP ports. This is required as PTP listens on ports < 1024 and thus requires special privileges. Once this helper process is started, the main process will synchronize to all PTP domains that are detected on the selected interfaces. :func:`~gi.repository.GstNet.PtpClock.new` then allows to create a GstClock that provides the PTP time from a master clock inside a specific PTP domain. This clock will only return valid timestamps once the timestamps in the PTP domain are known. To check this, you can use :func:`~gi.repository.Gst.Gst.Clock.wait_for_sync`, the GstClock::synced signal and :func:`~gi.repository.Gst.Gst.Clock.is_synced`. To gather statistics about the PTP clock synchronization, :func:`~gi.repository.GstNet.ptp_statistics_callback_add` can be used. This gives the application the possibility to collect all kinds of statistics from the clock synchronization. Constructors ------------ .. rst-class:: interim-class .. class:: PtpClock :no-index: .. classmethod:: new(name: str, domain: int) -> ~gi.repository.Gst.Clock Creates a new PTP clock instance that exports the PTP time of the master clock in ``domain``\. This clock can be slaved to other clocks as needed. If :func:`~gi.repository.GstNet.ptp_init` was not called before, this will call :func:`~gi.repository.GstNet.ptp_init` with default parameters. This clock only returns valid timestamps after it received the first times from the PTP master clock on the network. Once this happens the GstPtpClock::internal-clock property will become non-NULL. You can check this with :func:`~gi.repository.Gst.Gst.Clock.wait_for_sync`, the GstClock::synced signal and :func:`~gi.repository.Gst.Gst.Clock.is_synced`. .. versionadded:: 1.6 :param name: Name of the clock :param domain: PTP domain Properties ---------- .. rst-class:: interim-class .. class:: PtpClock :no-index: .. attribute:: props.domain :type: int The type of the None singleton. .. attribute:: props.grandmaster_clock_id :type: int The type of the None singleton. .. attribute:: props.internal_clock :type: ~gi.repository.Gst.Clock The type of the None singleton. .. attribute:: props.master_clock_id :type: int The type of the None singleton. Fields ------ .. rst-class:: interim-class .. class:: PtpClock :no-index: .. attribute:: clock .. attribute:: priv