Trait gstreamer::prelude::ClockExtManual
source · pub trait ClockExtManual: Sealed + IsA<Clock> + 'static {
// Provided methods
fn new_periodic_id(
&self,
start_time: ClockTime,
interval: ClockTime,
) -> PeriodicClockId { ... }
fn periodic_id_reinit(
&self,
id: &PeriodicClockId,
start_time: ClockTime,
interval: ClockTime,
) -> Result<(), BoolError> { ... }
fn new_single_shot_id(&self, time: ClockTime) -> SingleShotClockId { ... }
fn single_shot_id_reinit(
&self,
id: &SingleShotClockId,
time: ClockTime,
) -> Result<(), BoolError> { ... }
fn set_clock_flags(&self, flags: ClockFlags) { ... }
fn unset_clock_flags(&self, flags: ClockFlags) { ... }
fn clock_flags(&self) -> ClockFlags { ... }
fn calibration(&self) -> (ClockTime, ClockTime, u64, u64) { ... }
fn set_calibration(
&self,
internal: ClockTime,
external: ClockTime,
rate_num: u64,
rate_denom: u64,
) { ... }
}
Provided Methods§
sourcefn new_periodic_id(
&self,
start_time: ClockTime,
interval: ClockTime,
) -> PeriodicClockId
fn new_periodic_id( &self, start_time: ClockTime, interval: ClockTime, ) -> PeriodicClockId
Gets an ID from self
to trigger a periodic notification.
The periodic notifications will start at time start_time
and
will then be fired with the given interval
.
§start_time
the requested start time
§interval
the requested interval
§Returns
a GstClockID
that can be used to request the
time notification.
sourcefn periodic_id_reinit(
&self,
id: &PeriodicClockId,
start_time: ClockTime,
interval: ClockTime,
) -> Result<(), BoolError>
fn periodic_id_reinit( &self, id: &PeriodicClockId, start_time: ClockTime, interval: ClockTime, ) -> Result<(), BoolError>
sourcefn new_single_shot_id(&self, time: ClockTime) -> SingleShotClockId
fn new_single_shot_id(&self, time: ClockTime) -> SingleShotClockId
sourcefn single_shot_id_reinit(
&self,
id: &SingleShotClockId,
time: ClockTime,
) -> Result<(), BoolError>
fn single_shot_id_reinit( &self, id: &SingleShotClockId, time: ClockTime, ) -> Result<(), BoolError>
fn set_clock_flags(&self, flags: ClockFlags)
fn unset_clock_flags(&self, flags: ClockFlags)
fn clock_flags(&self) -> ClockFlags
sourcefn calibration(&self) -> (ClockTime, ClockTime, u64, u64)
fn calibration(&self) -> (ClockTime, ClockTime, u64, u64)
Gets the internal rate and reference time of self
. See
set_calibration()
for more information.
internal
, external
, rate_num
, and rate_denom
can be left None
if the
caller is not interested in the values.
§Returns
§internal
a location to store the internal time
§external
a location to store the external time
§rate_num
a location to store the rate numerator
§rate_denom
a location to store the rate denominator
sourcefn set_calibration(
&self,
internal: ClockTime,
external: ClockTime,
rate_num: u64,
rate_denom: u64,
)
fn set_calibration( &self, internal: ClockTime, external: ClockTime, rate_num: u64, rate_denom: u64, )
Adjusts the rate and time of self
. 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
ClockExt::time()
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 ClockExt::internal_time()
when this function is called.
Subsequent calls to ClockExt::time()
will return clock times computed as
follows:
⚠️ The following code is in C ⚠️
time = (internal_time - internal) * rate_num / rate_denom + external
This formula is implemented in ClockExt::adjust_unlocked()
. Of course, it
tries to do the integer arithmetic as precisely as possible.
Note that ClockExt::time()
always returns increasing values so when you
move the clock backwards, ClockExt::time()
will report the previous value
until the clock catches up.
§internal
a reference internal time
§external
a reference external time
§rate_num
the numerator of the rate of the clock relative to its internal time
§rate_denom
the denominator of the rate of the clock