Skip to main content

CspaMixer

Struct CspaMixer 

Source
pub struct CspaMixer { /* private fields */ }
Expand description

Safe-Rust software mixer (CspaMixer) executing off native acquisition threads.

Implementations§

Source§

impl CspaMixer

Source

pub fn new( format: Arc<Format>, targets: &[CaptureTarget], config: MixerConfig, max_frames_per_block: usize, ) -> Result<CspaMixer, PlanError>

Source

pub fn new_with_max_targets( format: Arc<Format>, targets: &[CaptureTarget], config: MixerConfig, max_frames_per_block: usize, max_targets: usize, ) -> Result<CspaMixer, PlanError>

Source

pub fn format(&self) -> &Arc<Format> ⓘ

Source

pub fn config(&self) -> &MixerConfig

Source

pub fn segment(&self) -> u64

Source

pub fn membership_version(&self) -> u64

Source

pub fn reconfigure_targets( &mut self, new_targets: &[CaptureTarget], ) -> Result<&[Option<usize>], PlanError>

Reconfigure active mixer targets in place. Matching existing targets retain their queued packets, participation state, and drift history; newly added targets start in ParticipationState::Starting. Returns a slice mapping each new target index to Some(old_slot_index) if retained or None if newly added.

Source

pub fn membership_descriptor(&self) -> MembershipDescriptor

Source

pub fn input_diagnostics(&self) -> Vec<InputDiagnosticSnapshot>

Source

pub fn write_input_diagnostics(&self, out: &mut Vec<InputDiagnosticSnapshot>)

Source

pub fn set_input_state( &mut self, index: usize, state: ParticipationState, ) -> Result<(), Reason>

Source

pub fn queued_packets(&self, index: usize) -> usize

Source

pub fn push_input_samples( &mut self, index: usize, samples: &[f32], frames: usize, timestamp: Option<Stamp>, arrival_ns: u64, ) -> Result<(), Reason>

Push samples using the slot’s preallocated recycle pool (0 heap allocations in steady state).

Source

pub fn push_input_packet( &mut self, index: usize, packet: MixerInputPacket, ) -> Result<(), Reason>

Source

pub fn apply_drift_correction( &mut self, index: usize, observed_skew_ns: u64, now_ns: u64, primary: &[f32], shifted: &[f32], out: &mut [f32], ) -> Result<bool, Reason>

Apply a 64-frame (or configured drift_crossfade_frames) linear crossfade slip/repeat correction between two buffers on input index when sustained skew exceeds drift_threshold_ns.

Source

pub fn mix_block_into( &mut self, frames: usize, now_ns: u64, oldest_wait_ns: u64, out_samples: &mut [f32], ) -> Result<(MixStepOutcome, MixedBlockMetadata), Reason>

Mix one block of frames into out_samples (frames * channels length) without steady-state allocation.

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.