#[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
impl Clone for spa_io_clock
Source§fn clone(&self) -> spa_io_clock
fn clone(&self) -> spa_io_clock
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more