AUDIO
Source snapshot · 12 October 2026

API reference / ravet_device::PreparedClockedInput

Struct PreparedClockedInput 

pub struct PreparedClockedInput { /* private fields */ }
Expand description

Control-prepared worker conversion from raw capture to a graph-rate queue. Matching 1..64 channel counts, 8000..192000 nominal integer rates, existing clock/sinc bounds and 1..65536 fixed frames apply. Output scratch<=16MiB is additional to converter/internal queues and source/destination ring memory. Construction/drop allocate off callbacks. Pumping uses no heap/locks/I/O; worker pacing, queue priming, thread ownership and endpoint shutdown are explicit. No physical clock alignment, universal drift stability or deadline guarantee.

Implementations§

§

impl PreparedClockedInput

pub fn new( consumer: AudioConsumer, producer: AudioProducer, input_rate: u32, output_rate: u32, options: ClockedDuplexOptions, ) -> Result<Self, ClockedDuplexError>

Construct outside active callbacks, retaining one raw consumer and one converted producer. Options.clock.capacity_frames matches the raw ring; target occupancy governs priming, not destination publication. Nominal rates are explicit, without inferred device/graph configuration or events.

pub fn pump(&mut self) -> ClockedInputProgress

Convert one fixed block only after the prior suffix has been published. Full/partial destination queues retain exact frames without advancing sinc/ controller/capture state again. Priming and shortage produce intentional zeros under the existing clocked-duplex policy. No waiting or device I/O.

pub fn statistics(&self) -> OutputStatistics

Relaxed independent converter counters; converted blocks include priming zeros. Pending publication makes no additional converter callback.

pub fn clock_statistics(&self) -> ClockedDuplexStatistics

Raw queue plus prefetched occupancy/controller correction, sampled during conversion; not a coherent hardware timestamp or measured stream delay.

Auto Trait Implementations§

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<S, T> Duplex<S> for Twhere T: FromSample<S> + ToSample<S>,

§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

impl<F, T> IntoSample<T> for Fwhere T: FromSample<F>,

§

fn into_sample(self) -> T

§

impl<T> Same for T

§

type Output = T

Should always be Self
§

impl<T, U> ToSample<U> for Twhere U: FromSample<T>,

§

fn to_sample_(self) -> U

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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.
§

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

Performs the conversion.