gstreamer::prelude

Trait ClockExtManual

Source
pub trait ClockExtManual: 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§

Source

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.

Source

fn periodic_id_reinit( &self, id: &PeriodicClockId, start_time: ClockTime, interval: ClockTime, ) -> Result<(), BoolError>

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

§id

a GstClockID

§start_time

the requested start time

§interval

the requested interval

§Returns

true if the GstClockID could be reinitialized to the provided time, else false.

Source

fn new_single_shot_id(&self, time: ClockTime) -> SingleShotClockId

Gets a GstClockID from self to trigger a single shot notification at the requested time.

§time

the requested time

§Returns

a GstClockID that can be used to request the time notification.

Source

fn single_shot_id_reinit( &self, id: &SingleShotClockId, time: ClockTime, ) -> Result<(), BoolError>

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

§id

a GstClockID

§time

The requested time.

§Returns

true if the GstClockID could be reinitialized to the provided time, else false.

Source

fn set_clock_flags(&self, flags: ClockFlags)

Source

fn unset_clock_flags(&self, flags: ClockFlags)

Source

fn clock_flags(&self) -> ClockFlags

Source

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

Source

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§