#[repr(C)]
pub struct spa_io_segment { pub version: u32, pub flags: u32, pub start: u64, pub duration: u64, pub rate: f64, pub position: u64, pub bar: spa_io_segment_bar, pub video: spa_io_segment_video, }
Expand description

A segment converts a running time to a segment (stream) position.

The segment position is valid when the current running time is between start and start + duration. The position is then calculated as:

(running time - start) * rate + position;

Support for looping is done by specifying the LOOPING flags with a non-zero duration. When the running time reaches start + duration, duration is added to start and the loop repeats.

Care has to be taken when the running time + clock.duration extends past the start + duration from the segment; the user should correctly wrap around and partially repeat the loop in the current cycle.

Extra information can be placed in the segment by setting the valid flags and filling up the corresponding structures.

Fields§

§version: u32§flags: u32

< extra flags

§start: u64

< value of running time when this info is active. Can be in the future for pending changes. It does not have to be in exact multiples of the clock duration.

§duration: u64

< duration when this info becomes invalid expressed in running time. If the duration is 0, this segment extends to the next segment. If the segment becomes invalid and the looping flag is set, the segment repeats.

§rate: f64

< overall rate of the segment, can be negative for backwards time reporting.

§position: u64

< The position when the running time == start. can be invalid when the owner of the extra segment information has not yet made the mapping.

§bar: spa_io_segment_bar§video: spa_io_segment_video

Trait Implementations§

source§

impl Clone for spa_io_segment

source§

fn clone(&self) -> spa_io_segment

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for spa_io_segment

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for spa_io_segment

source§

fn eq(&self, other: &spa_io_segment) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for spa_io_segment

source§

impl StructuralPartialEq for spa_io_segment

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.