SystemClock

The GStreamer core provides a GstSystemClock based on the system time. Asynchronous callbacks are scheduled from an internal thread.

Clock implementors are encouraged to subclass this systemclock as it implements the async notification.

Subclasses can however override all of the important methods for sync and async notifications to implement their own callback methods or blocking wait operations.

Constructors

this
this(GstSystemClock* gstSystemClock, bool ownedRef)

Sets our main struct and passes it to the parent class.

Members

Functions

getStruct
void* getStruct()

the main Gtk struct as a void*

getSystemClockStruct
GstSystemClock* getSystemClockStruct(bool transferOwnership)

Get the main Gtk struct

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

getType
GType getType()
obtain
Clock obtain()

Get a handle to the default system clock. The refcount of the clock will be increased so you need to unref the clock after usage.

setDefault
void setDefault(Clock newClock)

Sets the default system clock that can be obtained with gst_system_clock_obtain().

Variables

gstSystemClock
GstSystemClock* gstSystemClock;

the main Gtk struct

Inherited Members

From Clock

gstClock
GstClock* gstClock;

the main Gtk struct

getClockStruct
GstClock* getClockStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
getType
GType getType()
idCompareFunc
int idCompareFunc(void* id1, void* id2)

Compares the two #GstClockID instances. This function can be used as a GCompareFunc when sorting ids.

idGetTime
GstClockTime idGetTime(GstClockID id)

Get the time of the clock ID

idRef
GstClockID idRef(GstClockID id)

Increase the refcount of given @id.

idUnref
void idUnref(GstClockID id)

Unref given @id. When the refcount reaches 0 the #GstClockID will be freed.

idUnschedule
void idUnschedule(GstClockID id)

Cancel an outstanding request with @id. This can either be an outstanding async notification or a pending sync notification. After this call, @id cannot be used anymore to receive sync or async notifications, you need to create a new #GstClockID.

idWait
GstClockReturn idWait(GstClockID id, GstClockTimeDiff jitter)

Perform a blocking wait on @id. @id should have been created with gst_clock_new_single_shot_id() or gst_clock_new_periodic_id() and should not have been unscheduled with a call to gst_clock_id_unschedule().

idWaitAsync
GstClockReturn idWaitAsync(GstClockID id, GstClockCallback func, void* userData, GDestroyNotify destroyData)

Register a callback on the given #GstClockID @id with the given function and user_data. When passing a #GstClockID with an invalid time to this function, the callback will be called immediately with a time set to GST_CLOCK_TIME_NONE. The callback will be called when the time of @id has been reached.

addObservation
bool addObservation(GstClockTime slave, GstClockTime master, double rSquared)

The time @master of the master clock and the time @slave of the slave clock are added to the list of observations. If enough observations are available, a linear regression algorithm is run on the observations and @clock is recalibrated.

addObservationUnapplied
bool addObservationUnapplied(GstClockTime slave, GstClockTime master, double rSquared, GstClockTime internal, GstClockTime external, GstClockTime rateNum, GstClockTime rateDenom)

Add a clock observation to the internal slaving algorithm the same as gst_clock_add_observation(), and return the result of the master clock estimation, without updating the internal calibration.

adjustUnlocked
GstClockTime adjustUnlocked(GstClockTime internal)

Converts the given @internal clock time to the external time, adjusting for the rate and reference time set with gst_clock_set_calibration() and making sure that the returned time is increasing. This function should be called with the clock's OBJECT_LOCK held and is mainly used by clock subclasses.

adjustWithCalibration
GstClockTime adjustWithCalibration(GstClockTime internalTarget, GstClockTime cinternal, GstClockTime cexternal, GstClockTime cnum, GstClockTime cdenom)

Converts the given @internal_target clock time to the external time, using the passed calibration parameters. This function performs the same calculation as gst_clock_adjust_unlocked() when called using the current calibration parameters, but doesn't ensure a monotonically increasing result as gst_clock_adjust_unlocked() does.

getCalibration
void getCalibration(GstClockTime internal, GstClockTime external, GstClockTime rateNum, GstClockTime rateDenom)

Gets the internal rate and reference time of @clock. See gst_clock_set_calibration() for more information.

getInternalTime
GstClockTime getInternalTime()

Gets the current internal time of the given clock. The time is returned unadjusted for the offset and the rate.

getMaster
Clock getMaster()

Get the master clock that @clock is slaved to or %NULL when the clock is not slaved to any master clock.

getResolution
GstClockTime getResolution()

Get the accuracy of the clock. The accuracy of the clock is the granularity of the values returned by gst_clock_get_time().

getTime
GstClockTime getTime()

Gets the current time of the given clock. The time is always monotonically increasing and adjusted according to the current offset and rate.

getTimeout
GstClockTime getTimeout()

Get the amount of time that master and slave clocks are sampled.

isSynced
bool isSynced()

Checks if the clock is currently synced.

newPeriodicId
GstClockID newPeriodicId(GstClockTime startTime, GstClockTime interval)

Get an ID from @clock to trigger a periodic notification. The periodic notifications will start at time @start_time and will then be fired with the given @interval. @id should be unreffed after usage.

newSingleShotId
GstClockID newSingleShotId(GstClockTime time)

Get a #GstClockID from @clock to trigger a single shot notification at the requested time. The single shot id should be unreffed after usage.

periodicIdReinit
bool periodicIdReinit(GstClockID id, GstClockTime startTime, GstClockTime interval)

Reinitializes the provided periodic @id to the provided start time and interval. Does not modify the reference count.

setCalibration
void setCalibration(GstClockTime internal, GstClockTime external, GstClockTime rateNum, GstClockTime rateDenom)

Adjusts the rate and time of @clock. A rate of 1/1 is the normal speed of the clock. Values bigger than 1/1 make the clock go faster.

setMaster
bool setMaster(Clock master)

Set @master as the master clock for @clock. @clock will be automatically calibrated so that gst_clock_get_time() reports the same time as the master clock.

setResolution
GstClockTime setResolution(GstClockTime resolution)

Set the accuracy of the clock. Some clocks have the possibility to operate with different accuracy at the expense of more resource usage. There is normally no need to change the default resolution of a clock. The resolution of a clock can only be changed if the clock has the #GST_CLOCK_FLAG_CAN_SET_RESOLUTION flag set.

setSynced
void setSynced(bool synced)

Sets @clock to synced and emits the GstClock::synced signal, and wakes up any thread waiting in gst_clock_wait_for_sync().

setTimeout
void setTimeout(GstClockTime timeout)

Set the amount of time, in nanoseconds, to sample master and slave clocks

singleShotIdReinit
bool singleShotIdReinit(GstClockID id, GstClockTime time)

Reinitializes the provided single shot @id to the provided time. Does not modify the reference count.

unadjustUnlocked
GstClockTime unadjustUnlocked(GstClockTime external)

Converts the given @external clock time to the internal time of @clock, using the rate and reference time set with gst_clock_set_calibration(). This function should be called with the clock's OBJECT_LOCK held and is mainly used by clock subclasses.

unadjustWithCalibration
GstClockTime unadjustWithCalibration(GstClockTime externalTarget, GstClockTime cinternal, GstClockTime cexternal, GstClockTime cnum, GstClockTime cdenom)

Converts the given @external_target clock time to the internal time, using the passed calibration parameters. This function performs the same calculation as gst_clock_unadjust_unlocked() when called using the current calibration parameters.

waitForSync
bool waitForSync(GstClockTime timeout)

Waits until @clock is synced for reporting the current time. If @timeout is %GST_CLOCK_TIME_NONE it will wait forever, otherwise it will time out after @timeout nanoseconds.

OnSyncedDelegateWrapper
class OnSyncedDelegateWrapper
Undocumented in source.
addOnSynced
gulong addOnSynced(void delegate(bool, Clock) dlg, ConnectFlags connectFlags)

Signaled on clocks with GST_CLOCK_FLAG_NEEDS_STARTUP_SYNC set once the clock is synchronized, or when it completely lost synchronization. This signal will not be emitted on clocks without the flag.

callBackSynced
void callBackSynced(GstClock* clockStruct, bool synced, OnSyncedDelegateWrapper wrapper)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackSyncedDestroy
void callBackSyncedDestroy(OnSyncedDelegateWrapper wrapper, GClosure* closure)
Undocumented in source. Be warned that the author may not have intended to support it.

Meta