Struct libspa_sys::spa_io_segment
source · #[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
impl Clone for spa_io_segment
source§fn clone(&self) -> spa_io_segment
fn clone(&self) -> spa_io_segment
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for spa_io_segment
impl Debug for spa_io_segment
source§impl PartialEq for spa_io_segment
impl PartialEq for spa_io_segment
source§fn eq(&self, other: &spa_io_segment) -> bool
fn eq(&self, other: &spa_io_segment) -> bool
self
and other
values to be equal, and is used
by ==
.