pub struct RawSink { /* private fields */ }Expand description
Sink for passing raw interleaved f32 frames from a backend to the core.
Holds a RawProducer internally. push writes without blocking and is RT-safe
(drops data when full). This is the SPSC producer side; call push only from the backend’s
RT callback thread.
Implementations§
Source§impl RawSink
impl RawSink
Sourcepub fn new(
producer: RawProducer,
native_rate: u32,
native_channels: u16,
) -> Self
pub fn new( producer: RawProducer, native_rate: u32, native_channels: u16, ) -> Self
Create a raw-frame sink with the backend native format.
Sourcepub fn push(&mut self, interleaved: &[f32], pts_ns: i64) -> usize
pub fn push(&mut self, interleaved: &[f32], pts_ns: i64) -> usize
Send raw interleaved f32 frames without blocking.
pts_ns is a device-provided presentation timestamp. Never block;
increment the internal overflow counter and drop data when full.
PTS normalization and 20 ms chunking belong to the ingest thread. This sends only raw frames;
the raw ring carries samples only, so the wiring layer handles pts_ns separately
(backends that can provide it should do so for future frame association).
push is intended for backend RT callbacks. Custom backends must not allocate, lock, block,
or make system calls along the path that calls push.
Sourcepub fn diagnostics(&self) -> CaptureDiagnostics
pub fn diagnostics(&self) -> CaptureDiagnostics
Clone the rejection handle before entering a realtime callback.
Sourcepub fn native_rate(&self) -> u32
pub fn native_rate(&self) -> u32
Backend native sample rate (Hz).
Sourcepub fn native_channels(&self) -> u16
pub fn native_channels(&self) -> u16
Backend native channel count.
Sourcepub fn overflow_count(&self) -> u64
pub fn overflow_count(&self) -> u64
Cumulative samples dropped because the buffer was full.