Struct spa_io_clock

Source
#[repr(C)]
pub struct spa_io_clock {
Show 15 fields pub flags: u32, pub id: u32, pub name: [c_char; 64], pub nsec: u64, pub rate: spa_fraction, pub position: u64, pub duration: u64, pub delay: i64, pub rate_diff: f64, pub next_nsec: u64, pub target_rate: spa_fraction, pub target_duration: u64, pub target_seq: u32, pub cycle: u32, pub xrun: u64,
}
Expand description

Absolute time reporting.

Nodes that can report clocking information will receive this io block. The application sets the id. This is usually set as part of the position information but can also be set separately.

The clock counts the elapsed time according to the clock provider since the provider was last started.

Driver nodes are supposed to update the contents of \ref SPA_IO_Clock before signaling the start of a graph cycle. These updated clock values become visible to other nodes in \ref SPA_IO_Position. Non-driver nodes do not need to update the contents of their \ref SPA_IO_Clock.

The host generally gives each node a separate \ref spa_io_clock in \ref SPA_IO_Clock, so that updates made by the driver are not visible in the contents of \ref SPA_IO_Clock of other nodes. Instead, \ref SPA_IO_Position is used to look up the current graph time.

A node is a driver when \ref spa_io_clock.id in \ref SPA_IO_Clock and \ref spa_io_position.clock.id in \ref SPA_IO_Position are the same.

Fields§

§flags: u32

< Clock flags

§id: u32

< Unique clock id, set by host application

§name: [c_char; 64]

< Clock name prefixed with API, set by node when it receives \ref SPA_IO_Clock. The clock name is unique per clock and can be used to check if nodes share the same clock.

§nsec: u64

< Time in nanoseconds against monotonic clock (CLOCK_MONOTONIC). This fields reflects a real time instant in the past. The value may have jitter.

§rate: spa_fraction

< Rate for position/duration/delay/xrun

§position: u64

< Current position, in samples @ \ref rate

§duration: u64

< Duration of current cycle, in samples @ \ref rate

§delay: i64

< Delay between position and hardware, in samples @ \ref rate

§rate_diff: f64

< Rate difference between clock and monotonic time, as a ratio of clock speeds.

§next_nsec: u64

< Estimated next wakeup time in nanoseconds. This time is a logical start time of the next cycle, and is not necessarily in the future.

§target_rate: spa_fraction

< Target rate of next cycle

§target_duration: u64

< Target duration of next cycle

§target_seq: u32

< Seq counter. must be equal at start and end of read and lower bit must be 0

§cycle: u32

< incremented each time the graph is started

§xrun: u64

< Estimated accumulated xrun duration

Trait Implementations§

Source§

impl Clone for spa_io_clock

Source§

fn clone(&self) -> spa_io_clock

Returns a duplicate 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_clock

Source§

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

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

impl PartialEq for spa_io_clock

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for spa_io_clock

Source§

impl StructuralPartialEq for spa_io_clock

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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,

Source§

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>,

Source§

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>,

Source§

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.