Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (inaki@blueleaf.cc) |
Safe Haskell | None |
Language | Haskell2010 |
- Exported types
- Methods
- addObservation
- addObservationUnapplied
- adjustUnlocked
- adjustWithCalibration
- getCalibration
- getInternalTime
- getMaster
- getResolution
- getTime
- getTimeout
- idCompareFunc
- idGetClock
- idGetTime
- idRef
- idUnref
- idUnschedule
- idUsesClock
- idWait
- idWaitAsync
- isSynced
- newPeriodicId
- newSingleShotId
- periodicIdReinit
- setCalibration
- setMaster
- setResolution
- setSynced
- setTimeout
- singleShotIdReinit
- unadjustUnlocked
- unadjustWithCalibration
- waitForSync
- Properties
- Signals
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.
Synopsis
- newtype Clock = Clock (ManagedPtr Clock)
- class (GObject o, IsDescendantOf Clock o) => IsClock o
- toClock :: (MonadIO m, IsClock o) => o -> m Clock
- noClock :: Maybe Clock
- clockAddObservation :: (HasCallStack, MonadIO m, IsClock a) => a -> Word64 -> Word64 -> m (Bool, Double)
- clockAddObservationUnapplied :: (HasCallStack, MonadIO m, IsClock a) => a -> Word64 -> Word64 -> m (Bool, Double, Word64, Word64, Word64, Word64)
- clockAdjustUnlocked :: (HasCallStack, MonadIO m, IsClock a) => a -> Word64 -> m Word64
- clockAdjustWithCalibration :: (HasCallStack, MonadIO m, IsClock a) => a -> Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> m Word64
- clockGetCalibration :: (HasCallStack, MonadIO m, IsClock a) => a -> m (Word64, Word64, Word64, Word64)
- clockGetInternalTime :: (HasCallStack, MonadIO m, IsClock a) => a -> m Word64
- clockGetMaster :: (HasCallStack, MonadIO m, IsClock a) => a -> m (Maybe Clock)
- clockGetResolution :: (HasCallStack, MonadIO m, IsClock a) => a -> m Word64
- clockGetTime :: (HasCallStack, MonadIO m, IsClock a) => a -> m Word64
- clockGetTimeout :: (HasCallStack, MonadIO m, IsClock a) => a -> m Word64
- clockIdCompareFunc :: (HasCallStack, MonadIO m) => Ptr () -> Ptr () -> m Int32
- clockIdGetClock :: (HasCallStack, MonadIO m) => Ptr () -> m (Maybe Clock)
- 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 ()
- clockIdUsesClock :: (HasCallStack, MonadIO m, IsClock a) => Ptr () -> a -> m Bool
- clockIdWait :: (HasCallStack, MonadIO m) => Ptr () -> m (ClockReturn, Int64)
- clockIdWaitAsync :: (HasCallStack, MonadIO m) => Ptr () -> ClockCallback -> m ClockReturn
- clockIsSynced :: (HasCallStack, MonadIO m, IsClock a) => a -> m Bool
- clockNewPeriodicId :: (HasCallStack, MonadIO m, IsClock a) => a -> Word64 -> Word64 -> m (Ptr ())
- clockNewSingleShotId :: (HasCallStack, MonadIO m, IsClock a) => a -> Word64 -> m (Ptr ())
- clockPeriodicIdReinit :: (HasCallStack, MonadIO m, IsClock a) => a -> Ptr () -> Word64 -> Word64 -> m Bool
- clockSetCalibration :: (HasCallStack, MonadIO m, IsClock a) => a -> Word64 -> Word64 -> Word64 -> Word64 -> m ()
- clockSetMaster :: (HasCallStack, MonadIO m, IsClock a, IsClock b) => a -> Maybe b -> m Bool
- clockSetResolution :: (HasCallStack, MonadIO m, IsClock a) => a -> Word64 -> m Word64
- clockSetSynced :: (HasCallStack, MonadIO m, IsClock a) => a -> Bool -> m ()
- clockSetTimeout :: (HasCallStack, MonadIO m, IsClock a) => a -> Word64 -> m ()
- clockSingleShotIdReinit :: (HasCallStack, MonadIO m, IsClock a) => a -> Ptr () -> Word64 -> m Bool
- clockUnadjustUnlocked :: (HasCallStack, MonadIO m, IsClock a) => a -> Word64 -> m Word64
- clockUnadjustWithCalibration :: (HasCallStack, MonadIO m, IsClock a) => a -> Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> m Word64
- clockWaitForSync :: (HasCallStack, MonadIO m, IsClock a) => a -> Word64 -> m Bool
- constructClockTimeout :: IsClock o => Word64 -> IO (GValueConstruct o)
- getClockTimeout :: (MonadIO m, IsClock o) => o -> m Word64
- setClockTimeout :: (MonadIO m, IsClock o) => o -> Word64 -> m ()
- constructClockWindowSize :: IsClock o => Int32 -> IO (GValueConstruct o)
- getClockWindowSize :: (MonadIO m, IsClock o) => o -> m Int32
- setClockWindowSize :: (MonadIO m, IsClock o) => o -> Int32 -> m ()
- 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 ()
- afterClockSynced :: (IsClock a, MonadIO m) => a -> ClockSyncedCallback -> m SignalHandlerId
- genClosure_ClockSynced :: MonadIO m => ClockSyncedCallback -> m (GClosure C_ClockSyncedCallback)
- mk_ClockSyncedCallback :: C_ClockSyncedCallback -> IO (FunPtr C_ClockSyncedCallback)
- noClockSyncedCallback :: Maybe ClockSyncedCallback
- onClockSynced :: (IsClock a, MonadIO m) => a -> ClockSyncedCallback -> m SignalHandlerId
- wrap_ClockSyncedCallback :: ClockSyncedCallback -> C_ClockSyncedCallback
Exported types
Memory-managed wrapper type.
Instances
GObject Clock Source # | |
Defined in GI.Gst.Objects.Clock gobjectType :: IO GType | |
HasParentTypes Clock Source # | |
Defined in GI.Gst.Objects.Clock | |
type ParentTypes Clock Source # | |
Defined in GI.Gst.Objects.Clock |
class (GObject o, IsDescendantOf Clock o) => IsClock o Source #
Instances
(GObject o, IsDescendantOf Clock o) => IsClock o Source # | |
Defined in GI.Gst.Objects.Clock |
Methods
addObservation
:: (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 #
:: (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
:: (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 #
:: (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
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
:: (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
:: (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
:: (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
:: (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
:: (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
:: (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.
idGetClock
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m (Maybe Clock) | Returns: a MT safe. |
This function returns the underlying clock.
Since: 1.16
idGetTime
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m Word64 | Returns: the time of the given clock id. MT safe. |
Get the time of the clock ID
idRef
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m (Ptr ()) | Returns: The same MT safe. |
Increase the refcount of given id
.
idUnref
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m () |
Unref given id
. When the refcount reaches 0 the
GstClockID
will be freed.
MT safe.
idUnschedule
:: (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.
idUsesClock
:: (HasCallStack, MonadIO m, IsClock a) | |
=> Ptr () |
|
-> a |
|
-> m Bool | Returns: whether the clock MT safe. |
This function returns whether id
uses clock
as the underlying clock.
clock
can be NULL, in which case the return value indicates whether
the underlying clock has been freed. If this is the case, the id
is
no longer usable and should be freed.
Since: 1.16
idWait
:: (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
:: (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
:: (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
:: (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
:: (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 #
:: (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
:: (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:
time = (internal_time - internal) * rate_num / rate_denom + external
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
:: (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
:: (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
:: (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
:: (HasCallStack, MonadIO m, IsClock a) | |
=> a |
|
-> Word64 |
|
-> m () |
Set the amount of time, in nanoseconds, to sample master and slave clocks
singleShotIdReinit
clockSingleShotIdReinit Source #
:: (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
clockUnadjustUnlocked Source #
:: (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 #
:: (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
:: (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
No description available in the introspection data.
constructClockTimeout :: IsClock o => Word64 -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “timeout
” property. This is rarely needed directly, but it is used by new
.
getClockTimeout :: (MonadIO m, IsClock o) => o -> m Word64 Source #
Get the value of the “timeout
” property.
When overloading is enabled, this is equivalent to
get
clock #timeout
setClockTimeout :: (MonadIO m, IsClock o) => o -> Word64 -> m () Source #
Set the value of the “timeout
” property.
When overloading is enabled, this is equivalent to
set
clock [ #timeout:=
value ]
windowSize
No description available in the introspection data.
constructClockWindowSize :: IsClock o => Int32 -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “window-size
” property. This is rarely needed directly, but it is used by new
.
getClockWindowSize :: (MonadIO m, IsClock o) => o -> m Int32 Source #
Get the value of the “window-size
” property.
When overloading is enabled, this is equivalent to
get
clock #windowSize
setClockWindowSize :: (MonadIO m, IsClock o) => o -> Int32 -> m () Source #
Set the value of the “window-size
” property.
When overloading is enabled, this is equivalent to
set
clock [ #windowSize:=
value ]
windowThreshold
No description available in the introspection data.
constructClockWindowThreshold :: IsClock o => Int32 -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “window-threshold
” property. This is rarely needed directly, but it is used by new
.
getClockWindowThreshold :: (MonadIO m, IsClock o) => o -> m Int32 Source #
Get the value of the “window-threshold
” property.
When overloading is enabled, this is equivalent to
get
clock #windowThreshold
setClockWindowThreshold :: (MonadIO m, IsClock o) => o -> Int32 -> m () Source #
Set the value of the “window-threshold
” property.
When overloading is enabled, this is equivalent to
set
clock [ #windowThreshold:=
value ]
Signals
synced
type C_ClockSyncedCallback = Ptr () -> CInt -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type ClockSyncedCallback Source #
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.
This signal will be emitted from an arbitrary thread, most likely not the application's main thread.
Since: 1.6
afterClockSynced :: (IsClock a, MonadIO m) => a -> ClockSyncedCallback -> m SignalHandlerId Source #
Connect a signal handler for the “synced
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
clock #synced callback
genClosure_ClockSynced :: MonadIO m => ClockSyncedCallback -> m (GClosure C_ClockSyncedCallback) Source #
Wrap the callback into a GClosure
.
mk_ClockSyncedCallback :: C_ClockSyncedCallback -> IO (FunPtr C_ClockSyncedCallback) Source #
Generate a function pointer callable from C code, from a C_ClockSyncedCallback
.
noClockSyncedCallback :: Maybe ClockSyncedCallback Source #
A convenience synonym for
.Nothing
:: Maybe
ClockSyncedCallback
onClockSynced :: (IsClock a, MonadIO m) => a -> ClockSyncedCallback -> m SignalHandlerId Source #
Connect a signal handler for the “synced
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
clock #synced callback