| Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
| Safe Haskell | None |
| Language | Haskell2010 |
GI.Gst.Objects.Clock
Contents
- Exported types
- Methods
- addObservation
- addObservationUnapplied
- adjustUnlocked
- adjustWithCalibration
- getCalibration
- getInternalTime
- getMaster
- getResolution
- getTime
- getTimeout
- idCompareFunc
- idGetTime
- idRef
- idUnref
- idUnschedule
- idWait
- idWaitAsync
- isSynced
- newPeriodicId
- newSingleShotId
- periodicIdReinit
- setCalibration
- setMaster
- setResolution
- setSynced
- setTimeout
- singleShotIdReinit
- unadjustUnlocked
- unadjustWithCalibration
- waitForSync
- Properties
- Signals
Description
GStreamer uses a global clock to synchronize the plugins in a pipeline.
Different clock implementations are possible by implementing this abstract
base class or, more conveniently, by subclassing SystemClock.
The Clock returns a monotonically increasing time with the method
clockGetTime. Its accuracy and base time depend on the specific
clock implementation but time is always expressed in nanoseconds. Since the
baseline of the clock is undefined, the clock time returned is not
meaningful in itself, what matters are the deltas between two clock times.
The time returned by a clock is called the absolute time.
The pipeline uses the clock to calculate the running time. Usually all
renderers synchronize to the global clock using the buffer timestamps, the
newsegment events and the element's base time, see Pipeline.
A clock implementation can support periodic and single shot clock notifications both synchronous and asynchronous.
One first needs to create a GstClockID for the periodic or single shot
notification using clockNewSingleShotId or
clockNewPeriodicId.
To perform a blocking wait for the specific time of the GstClockID use the
clockIdWait. To receive a callback when the specific time is reached
in the clock use clockIdWaitAsync. Both these calls can be
interrupted with the clockIdUnschedule call. If the blocking wait is
unscheduled a return value of GST_CLOCK_UNSCHEDULED is returned.
Periodic callbacks scheduled async will be repeatedly called automatically
until it is unscheduled. To schedule a sync periodic callback,
clockIdWait should be called repeatedly.
The async callbacks can happen from any thread, either provided by the core or from a streaming thread. The application should be prepared for this.
A GstClockID that has been unscheduled cannot be used again for any wait
operation, a new GstClockID should be created and the old unscheduled one
should be destroyed with clockIdUnref.
It is possible to perform a blocking wait on the same GstClockID from
multiple threads. However, registering the same GstClockID for multiple
async notifications is not possible, the callback will only be called for
the thread registering the entry last.
None of the wait operations unref the GstClockID, the owner is responsible
for unreffing the ids itself. This holds for both periodic and single shot
notifications. The reason being that the owner of the GstClockID has to
keep a handle to the GstClockID to unblock the wait on FLUSHING events or
state changes and if the entry would be unreffed automatically, the handle
might become invalid without any notification.
These clock operations do not operate on the running time, so the callbacks will also occur when not in PLAYING state as if the clock just keeps on running. Some clocks however do not progress when the element that provided the clock is not PLAYING.
When a clock has the GST_CLOCK_FLAG_CAN_SET_MASTER flag set, it can be
slaved to another Clock with the clockSetMaster. The clock will
then automatically be synchronized to this master clock by repeatedly
sampling the master clock and the slave clock and recalibrating the slave
clock with clockSetCalibration. This feature is mostly useful for
plugins that have an internal clock but must operate with another clock
selected by the Pipeline. They can track the offset and rate difference
of their internal clock relative to the master clock by using the
clockGetCalibration function.
The master/slave synchronisation can be tuned with the Clock:timeout,
Clock:window-size and Clock:window-threshold properties.
The Clock:timeout property defines the interval to sample the master
clock and run the calibration functions. Clock:window-size defines the
number of samples to use when calibrating and Clock:window-threshold
defines the minimum number of samples before the calibration is performed.
- newtype Clock = Clock (ManagedPtr Clock)
- class GObject o => IsClock o
- toClock :: IsClock o => o -> IO Clock
- noClock :: Maybe Clock
- data ClockAddObservationMethodInfo
- clockAddObservation :: (HasCallStack, MonadIO m, IsClock a) => a -> Word64 -> Word64 -> m (Bool, Double)
- data ClockAddObservationUnappliedMethodInfo
- clockAddObservationUnapplied :: (HasCallStack, MonadIO m, IsClock a) => a -> Word64 -> Word64 -> m (Bool, Double, Word64, Word64, Word64, Word64)
- data ClockAdjustUnlockedMethodInfo
- clockAdjustUnlocked :: (HasCallStack, MonadIO m, IsClock a) => a -> Word64 -> m Word64
- data ClockAdjustWithCalibrationMethodInfo
- clockAdjustWithCalibration :: (HasCallStack, MonadIO m, IsClock a) => a -> Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> m Word64
- data ClockGetCalibrationMethodInfo
- clockGetCalibration :: (HasCallStack, MonadIO m, IsClock a) => a -> m (Word64, Word64, Word64, Word64)
- data ClockGetInternalTimeMethodInfo
- clockGetInternalTime :: (HasCallStack, MonadIO m, IsClock a) => a -> m Word64
- data ClockGetMasterMethodInfo
- clockGetMaster :: (HasCallStack, MonadIO m, IsClock a) => a -> m (Maybe Clock)
- data ClockGetResolutionMethodInfo
- clockGetResolution :: (HasCallStack, MonadIO m, IsClock a) => a -> m Word64
- data ClockGetTimeMethodInfo
- clockGetTime :: (HasCallStack, MonadIO m, IsClock a) => a -> m Word64
- data ClockGetTimeoutMethodInfo
- clockGetTimeout :: (HasCallStack, MonadIO m, IsClock a) => a -> m Word64
- clockIdCompareFunc :: (HasCallStack, MonadIO m) => Ptr () -> Ptr () -> m Int32
- clockIdGetTime :: (HasCallStack, MonadIO m) => Ptr () -> m Word64
- clockIdRef :: (HasCallStack, MonadIO m) => Ptr () -> m (Ptr ())
- clockIdUnref :: (HasCallStack, MonadIO m) => Ptr () -> m ()
- clockIdUnschedule :: (HasCallStack, MonadIO m) => Ptr () -> m ()
- clockIdWait :: (HasCallStack, MonadIO m) => Ptr () -> m (ClockReturn, Int64)
- clockIdWaitAsync :: (HasCallStack, MonadIO m) => Ptr () -> ClockCallback -> m ClockReturn
- data ClockIsSyncedMethodInfo
- clockIsSynced :: (HasCallStack, MonadIO m, IsClock a) => a -> m Bool
- data ClockNewPeriodicIdMethodInfo
- clockNewPeriodicId :: (HasCallStack, MonadIO m, IsClock a) => a -> Word64 -> Word64 -> m (Ptr ())
- data ClockNewSingleShotIdMethodInfo
- clockNewSingleShotId :: (HasCallStack, MonadIO m, IsClock a) => a -> Word64 -> m (Ptr ())
- data ClockPeriodicIdReinitMethodInfo
- clockPeriodicIdReinit :: (HasCallStack, MonadIO m, IsClock a) => a -> Ptr () -> Word64 -> Word64 -> m Bool
- data ClockSetCalibrationMethodInfo
- clockSetCalibration :: (HasCallStack, MonadIO m, IsClock a) => a -> Word64 -> Word64 -> Word64 -> Word64 -> m ()
- data ClockSetMasterMethodInfo
- clockSetMaster :: (HasCallStack, MonadIO m, IsClock a, IsClock b) => a -> Maybe b -> m Bool
- data ClockSetResolutionMethodInfo
- clockSetResolution :: (HasCallStack, MonadIO m, IsClock a) => a -> Word64 -> m Word64
- data ClockSetSyncedMethodInfo
- clockSetSynced :: (HasCallStack, MonadIO m, IsClock a) => a -> Bool -> m ()
- data ClockSetTimeoutMethodInfo
- clockSetTimeout :: (HasCallStack, MonadIO m, IsClock a) => a -> Word64 -> m ()
- data ClockSingleShotIdReinitMethodInfo
- clockSingleShotIdReinit :: (HasCallStack, MonadIO m, IsClock a) => a -> Ptr () -> Word64 -> m Bool
- data ClockUnadjustUnlockedMethodInfo
- clockUnadjustUnlocked :: (HasCallStack, MonadIO m, IsClock a) => a -> Word64 -> m Word64
- data ClockUnadjustWithCalibrationMethodInfo
- clockUnadjustWithCalibration :: (HasCallStack, MonadIO m, IsClock a) => a -> Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> m Word64
- data ClockWaitForSyncMethodInfo
- clockWaitForSync :: (HasCallStack, MonadIO m, IsClock a) => a -> Word64 -> m Bool
- data ClockTimeoutPropertyInfo
- clockTimeout :: AttrLabelProxy "timeout"
- constructClockTimeout :: IsClock o => Word64 -> IO (GValueConstruct o)
- getClockTimeout :: (MonadIO m, IsClock o) => o -> m Word64
- setClockTimeout :: (MonadIO m, IsClock o) => o -> Word64 -> m ()
- data ClockWindowSizePropertyInfo
- clockWindowSize :: AttrLabelProxy "windowSize"
- constructClockWindowSize :: IsClock o => Int32 -> IO (GValueConstruct o)
- getClockWindowSize :: (MonadIO m, IsClock o) => o -> m Int32
- setClockWindowSize :: (MonadIO m, IsClock o) => o -> Int32 -> m ()
- data ClockWindowThresholdPropertyInfo
- clockWindowThreshold :: AttrLabelProxy "windowThreshold"
- constructClockWindowThreshold :: IsClock o => Int32 -> IO (GValueConstruct o)
- getClockWindowThreshold :: (MonadIO m, IsClock o) => o -> m Int32
- setClockWindowThreshold :: (MonadIO m, IsClock o) => o -> Int32 -> m ()
- type C_ClockSyncedCallback = Ptr () -> CInt -> Ptr () -> IO ()
- type ClockSyncedCallback = Bool -> IO ()
- data ClockSyncedSignalInfo
- afterClockSynced :: (GObject a, MonadIO m) => a -> ClockSyncedCallback -> m SignalHandlerId
- genClosure_ClockSynced :: ClockSyncedCallback -> IO Closure
- mk_ClockSyncedCallback :: C_ClockSyncedCallback -> IO (FunPtr C_ClockSyncedCallback)
- noClockSyncedCallback :: Maybe ClockSyncedCallback
- onClockSynced :: (GObject a, MonadIO m) => a -> ClockSyncedCallback -> m SignalHandlerId
- wrap_ClockSyncedCallback :: ClockSyncedCallback -> Ptr () -> CInt -> Ptr () -> IO ()
Exported types
Constructors
| Clock (ManagedPtr Clock) |
Instances
| GObject Clock Source # | |
| IsObject Clock Source # | |
| IsObject Clock Source # | |
| IsClock Clock Source # | |
| ((~) * info (ResolveClockMethod t Clock), MethodInfo * info Clock p) => IsLabel t (Clock -> p) Source # | |
| ((~) * info (ResolveClockMethod t Clock), MethodInfo * info Clock p) => IsLabelProxy t (Clock -> p) Source # | |
| HasAttributeList * Clock Source # | |
| type AttributeList Clock Source # | |
| type SignalList Clock Source # | |
class GObject o => IsClock o Source #
Instances
| (GObject a, UnknownAncestorError Constraint Clock a) => IsClock a Source # | |
| IsClock Clock Source # | |
| IsClock SystemClock Source # | |
Methods
addObservation
Arguments
| :: (HasCallStack, MonadIO m, IsClock a) | |
| => a |
|
| -> Word64 |
|
| -> Word64 |
|
| -> m (Bool, Double) | Returns: MT safe. |
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.
If this functions returns True, rSquared will contain the
correlation coefficient of the interpolation. A value of 1.0
means a perfect regression was performed. This value can
be used to control the sampling frequency of the master and slave
clocks.
addObservationUnapplied
clockAddObservationUnapplied Source #
Arguments
| :: (HasCallStack, MonadIO m, IsClock a) | |
| => a |
|
| -> Word64 |
|
| -> Word64 |
|
| -> m (Bool, Double, Word64, Word64, Word64, Word64) |
Add a clock observation to the internal slaving algorithm the same as
clockAddObservation, and return the result of the master clock
estimation, without updating the internal calibration.
The caller can then take the results and call clockSetCalibration
with the values, or some modified version of them.
Since: 1.6
adjustUnlocked
data ClockAdjustUnlockedMethodInfo Source #
Instances
| ((~) * signature (Word64 -> m Word64), MonadIO m, IsClock a) => MethodInfo * ClockAdjustUnlockedMethodInfo a signature Source # | |
Arguments
| :: (HasCallStack, MonadIO m, IsClock a) | |
| => a |
|
| -> Word64 |
|
| -> m Word64 | Returns: the converted time of the clock. |
Converts the given internal clock time to the external time, adjusting for the
rate and reference time set with clockSetCalibration 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.
This function is the reverse of clockUnadjustUnlocked.
adjustWithCalibration
clockAdjustWithCalibration Source #
Arguments
| :: (HasCallStack, MonadIO m, IsClock a) | |
| => a |
|
| -> Word64 |
|
| -> Word64 |
|
| -> Word64 |
|
| -> Word64 |
|
| -> Word64 |
|
| -> m Word64 | Returns: the converted time of the clock. |
Converts the given internalTarget clock time to the external time,
using the passed calibration parameters. This function performs the
same calculation as clockAdjustUnlocked when called using the
current calibration parameters, but doesn't ensure a monotonically
increasing result as clockAdjustUnlocked does.
Note: The clock parameter is unused and can be NULL
Since: 1.6
getCalibration
Arguments
| :: (HasCallStack, MonadIO m, IsClock a) | |
| => a |
|
| -> m (Word64, Word64, Word64, Word64) |
Gets the internal rate and reference time of clock. See
clockSetCalibration for more information.
internal, external, rateNum, and rateDenom can be left Nothing if the
caller is not interested in the values.
MT safe.
getInternalTime
data ClockGetInternalTimeMethodInfo Source #
Instances
| ((~) * signature (m Word64), MonadIO m, IsClock a) => MethodInfo * ClockGetInternalTimeMethodInfo a signature Source # | |
Arguments
| :: (HasCallStack, MonadIO m, IsClock a) | |
| => a |
|
| -> m Word64 | Returns: the internal time of the clock. Or GST_CLOCK_TIME_NONE when given invalid input. MT safe. |
Gets the current internal time of the given clock. The time is returned unadjusted for the offset and the rate.
getMaster
data ClockGetMasterMethodInfo Source #
Instances
| ((~) * signature (m (Maybe Clock)), MonadIO m, IsClock a) => MethodInfo * ClockGetMasterMethodInfo a signature Source # | |
Arguments
| :: (HasCallStack, MonadIO m, IsClock a) | |
| => a |
|
| -> m (Maybe Clock) | Returns: a master MT safe. |
Get the master clock that clock is slaved to or Nothing when the clock is
not slaved to any master clock.
getResolution
data ClockGetResolutionMethodInfo Source #
Instances
| ((~) * signature (m Word64), MonadIO m, IsClock a) => MethodInfo * ClockGetResolutionMethodInfo a signature Source # | |
Arguments
| :: (HasCallStack, MonadIO m, IsClock a) | |
| => a |
|
| -> m Word64 | Returns: the resolution of the clock in units of MT safe. |
Get the accuracy of the clock. The accuracy of the clock is the granularity
of the values returned by clockGetTime.
getTime
data ClockGetTimeMethodInfo Source #
Instances
| ((~) * signature (m Word64), MonadIO m, IsClock a) => MethodInfo * ClockGetTimeMethodInfo a signature Source # | |
Arguments
| :: (HasCallStack, MonadIO m, IsClock a) | |
| => a |
|
| -> m Word64 | Returns: the time of the clock. Or GST_CLOCK_TIME_NONE when given invalid input. MT safe. |
Gets the current time of the given clock. The time is always monotonically increasing and adjusted according to the current offset and rate.
getTimeout
data ClockGetTimeoutMethodInfo Source #
Instances
| ((~) * signature (m Word64), MonadIO m, IsClock a) => MethodInfo * ClockGetTimeoutMethodInfo a signature Source # | |
Arguments
| :: (HasCallStack, MonadIO m, IsClock a) | |
| => a |
|
| -> m Word64 | Returns: the interval between samples. |
Get the amount of time that master and slave clocks are sampled.
idCompareFunc
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Ptr () |
|
| -> Ptr () |
|
| -> m Int32 | Returns: negative value if a < b; zero if a = b; positive value if a > b MT safe. |
Compares the two GstClockID instances. This function can be used
as a GCompareFunc when sorting ids.
idGetTime
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Ptr () |
|
| -> m Word64 | Returns: the time of the given clock id. MT safe. |
Get the time of the clock ID
idRef
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Ptr () |
|
| -> m (Ptr ()) | Returns: The same MT safe. |
Increase the refcount of given id.
idUnref
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Ptr () |
|
| -> m () |
Unref given id. When the refcount reaches 0 the
GstClockID will be freed.
MT safe.
idUnschedule
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Ptr () |
|
| -> m () |
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.
MT safe.
idWait
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Ptr () |
|
| -> m (ClockReturn, Int64) | Returns: the result of the blocking wait. MT safe. |
Perform a blocking wait on id.
id should have been created with clockNewSingleShotId
or clockNewPeriodicId and should not have been unscheduled
with a call to clockIdUnschedule.
If the jitter argument is not Nothing and this function returns GST_CLOCK_OK
or GST_CLOCK_EARLY, it will contain the difference
against the clock and the time of id when this method was
called.
Positive values indicate how late id was relative to the clock
(in which case this function will return GST_CLOCK_EARLY).
Negative values indicate how much time was spent waiting on the clock
before this function returned.
idWaitAsync
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Ptr () |
|
| -> ClockCallback |
|
| -> m ClockReturn | Returns: the result of the non blocking wait. MT safe. |
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.
The callback func can be invoked from any thread, either provided by the
core or from a streaming thread. The application should be prepared for this.
isSynced
data ClockIsSyncedMethodInfo Source #
Instances
| ((~) * signature (m Bool), MonadIO m, IsClock a) => MethodInfo * ClockIsSyncedMethodInfo a signature Source # | |
Arguments
| :: (HasCallStack, MonadIO m, IsClock a) | |
| => a |
|
| -> m Bool | Returns: |
Checks if the clock is currently synced.
This returns if GST_CLOCK_FLAG_NEEDS_STARTUP_SYNC is not set on the clock.
Since: 1.6
newPeriodicId
Arguments
| :: (HasCallStack, MonadIO m, IsClock a) | |
| => a |
|
| -> Word64 |
|
| -> Word64 |
|
| -> m (Ptr ()) | Returns: a MT safe. |
Get an ID from clock to trigger a periodic notification.
The periodic notifications will start at time startTime and
will then be fired with the given interval. id should be unreffed
after usage.
Free-function: gst_clock_id_unref
newSingleShotId
data ClockNewSingleShotIdMethodInfo Source #
Instances
| ((~) * signature (Word64 -> m (Ptr ())), MonadIO m, IsClock a) => MethodInfo * ClockNewSingleShotIdMethodInfo a signature Source # | |
Arguments
| :: (HasCallStack, MonadIO m, IsClock a) | |
| => a |
|
| -> Word64 |
|
| -> m (Ptr ()) | Returns: a MT safe. |
Get a GstClockID from clock to trigger a single shot
notification at the requested time. The single shot id should be
unreffed after usage.
Free-function: gst_clock_id_unref
periodicIdReinit
clockPeriodicIdReinit Source #
Arguments
| :: (HasCallStack, MonadIO m, IsClock a) | |
| => a |
|
| -> Ptr () |
|
| -> Word64 |
|
| -> Word64 |
|
| -> m Bool | Returns: |
Reinitializes the provided periodic id to the provided start time and
interval. Does not modify the reference count.
setCalibration
Arguments
| :: (HasCallStack, MonadIO m, IsClock a) | |
| => a |
|
| -> Word64 |
|
| -> Word64 |
|
| -> Word64 |
|
| -> Word64 |
|
| -> m () |
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.
internal and external are calibration parameters that arrange that
clockGetTime should have been external at internal time internal.
This internal time should not be in the future; that is, it should be less
than the value of clockGetInternalTime when this function is called.
Subsequent calls to clockGetTime will return clock times computed as
follows:
<programlisting> time = (internal_time - internal) * rate_num / rate_denom + external </programlisting>
This formula is implemented in clockAdjustUnlocked. Of course, it
tries to do the integer arithmetic as precisely as possible.
Note that clockGetTime always returns increasing values so when you
move the clock backwards, clockGetTime will report the previous value
until the clock catches up.
MT safe.
setMaster
Arguments
| :: (HasCallStack, MonadIO m, IsClock a, IsClock b) | |
| => a |
|
| -> Maybe b |
|
| -> m Bool | Returns: MT safe. |
Set master as the master clock for clock. clock will be automatically
calibrated so that clockGetTime reports the same time as the
master clock.
A clock provider that slaves its clock to a master can get the current
calibration values with clockGetCalibration.
master can be Nothing in which case clock will not be slaved anymore. It will
however keep reporting its time adjusted with the last configured rate
and time offsets.
setResolution
data ClockSetResolutionMethodInfo Source #
Instances
| ((~) * signature (Word64 -> m Word64), MonadIO m, IsClock a) => MethodInfo * ClockSetResolutionMethodInfo a signature Source # | |
Arguments
| :: (HasCallStack, MonadIO m, IsClock a) | |
| => a |
|
| -> Word64 |
|
| -> m Word64 | Returns: the new resolution of the clock. |
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
data ClockSetSyncedMethodInfo Source #
Instances
| ((~) * signature (Bool -> m ()), MonadIO m, IsClock a) => MethodInfo * ClockSetSyncedMethodInfo a signature Source # | |
Arguments
| :: (HasCallStack, MonadIO m, IsClock a) | |
| => a |
|
| -> Bool |
|
| -> m () |
Sets clock to synced and emits the GstClock::synced signal, and wakes up any
thread waiting in clockWaitForSync.
This function must only be called if GST_CLOCK_FLAG_NEEDS_STARTUP_SYNC is set on the clock, and is intended to be called by subclasses only.
Since: 1.6
setTimeout
data ClockSetTimeoutMethodInfo Source #
Instances
| ((~) * signature (Word64 -> m ()), MonadIO m, IsClock a) => MethodInfo * ClockSetTimeoutMethodInfo a signature Source # | |
Arguments
| :: (HasCallStack, MonadIO m, IsClock a) | |
| => a |
|
| -> Word64 |
|
| -> m () |
Set the amount of time, in nanoseconds, to sample master and slave clocks
singleShotIdReinit
clockSingleShotIdReinit Source #
Arguments
| :: (HasCallStack, MonadIO m, IsClock a) | |
| => a |
|
| -> Ptr () |
|
| -> Word64 |
|
| -> m Bool | Returns: |
Reinitializes the provided single shot id to the provided time. Does not
modify the reference count.
unadjustUnlocked
data ClockUnadjustUnlockedMethodInfo Source #
Instances
| ((~) * signature (Word64 -> m Word64), MonadIO m, IsClock a) => MethodInfo * ClockUnadjustUnlockedMethodInfo a signature Source # | |
clockUnadjustUnlocked Source #
Arguments
| :: (HasCallStack, MonadIO m, IsClock a) | |
| => a |
|
| -> Word64 |
|
| -> m Word64 | Returns: the internal time of the clock corresponding to |
Converts the given external clock time to the internal time of clock,
using the rate and reference time set with clockSetCalibration.
This function should be called with the clock's OBJECT_LOCK held and
is mainly used by clock subclasses.
This function is the reverse of clockAdjustUnlocked.
unadjustWithCalibration
clockUnadjustWithCalibration Source #
Arguments
| :: (HasCallStack, MonadIO m, IsClock a) | |
| => a |
|
| -> Word64 |
|
| -> Word64 |
|
| -> Word64 |
|
| -> Word64 |
|
| -> Word64 |
|
| -> m Word64 | Returns: the converted time of the clock. |
Converts the given externalTarget clock time to the internal time,
using the passed calibration parameters. This function performs the
same calculation as clockUnadjustUnlocked when called using the
current calibration parameters.
Note: The clock parameter is unused and can be NULL
Since: 1.8
waitForSync
data ClockWaitForSyncMethodInfo Source #
Instances
| ((~) * signature (Word64 -> m Bool), MonadIO m, IsClock a) => MethodInfo * ClockWaitForSyncMethodInfo a signature Source # | |
Arguments
| :: (HasCallStack, MonadIO m, IsClock a) | |
| => a |
|
| -> Word64 |
|
| -> m Bool | Returns: |
Waits until clock is synced for reporting the current time. If timeout
is CLOCK_TIME_NONE it will wait forever, otherwise it will time out
after timeout nanoseconds.
For asynchronous waiting, the GstClock::synced signal can be used.
This returns immediately with TRUE if GST_CLOCK_FLAG_NEEDS_STARTUP_SYNC is not set on the clock, or if the clock is already synced.
Since: 1.6
Properties
timeout
data ClockTimeoutPropertyInfo Source #
Instances
clockTimeout :: AttrLabelProxy "timeout" Source #
constructClockTimeout :: IsClock o => Word64 -> IO (GValueConstruct o) Source #
windowSize
data ClockWindowSizePropertyInfo Source #
Instances
clockWindowSize :: AttrLabelProxy "windowSize" Source #
constructClockWindowSize :: IsClock o => Int32 -> IO (GValueConstruct o) Source #
windowThreshold
data ClockWindowThresholdPropertyInfo Source #
Instances
clockWindowThreshold :: AttrLabelProxy "windowThreshold" Source #
constructClockWindowThreshold :: IsClock o => Int32 -> IO (GValueConstruct o) Source #
Signals
synced
type ClockSyncedCallback = Bool -> IO () Source #
data ClockSyncedSignalInfo Source #
Instances
afterClockSynced :: (GObject a, MonadIO m) => a -> ClockSyncedCallback -> m SignalHandlerId Source #
onClockSynced :: (GObject a, MonadIO m) => a -> ClockSyncedCallback -> m SignalHandlerId Source #
wrap_ClockSyncedCallback :: ClockSyncedCallback -> Ptr () -> CInt -> Ptr () -> IO () Source #