PtpClock

Added in version 1.6.

class PtpClock(**properties: Any)

Superclasses: SystemClock, Clock, Object, InitiallyUnowned, 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 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.

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 wait_for_sync(), the GstClock::synced signal and is_synced().

To gather statistics about the PTP clock synchronization, ptp_statistics_callback_add() can be used. This gives the application the possibility to collect all kinds of statistics from the clock synchronization.

Constructors

class PtpClock
classmethod new(name: str, domain: int) 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 ptp_init() was not called before, this will call 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 wait_for_sync(), the GstClock::synced signal and is_synced().

Added in version 1.6.

Parameters:
  • name – Name of the clock

  • domain – PTP domain

Properties

class PtpClock
props.domain: int
props.grandmaster_clock_id: int
props.internal_clock: Clock
props.master_clock_id: int

Fields

class PtpClock
clock
priv