pub struct CspaMixer { /* private fields */ }Expand description
Safe-Rust software mixer (CspaMixer) executing off native acquisition threads.
Implementations§
Source§impl CspaMixer
impl CspaMixer
pub fn new( format: Arc<Format>, targets: &[CaptureTarget], config: MixerConfig, max_frames_per_block: usize, ) -> Result<CspaMixer, PlanError>
pub fn new_with_max_targets( format: Arc<Format>, targets: &[CaptureTarget], config: MixerConfig, max_frames_per_block: usize, max_targets: usize, ) -> Result<CspaMixer, PlanError>
pub fn format(&self) -> &Arc<Format> ⓘ
pub fn config(&self) -> &MixerConfig
pub fn segment(&self) -> u64
pub fn membership_version(&self) -> u64
Sourcepub fn reconfigure_targets(
&mut self,
new_targets: &[CaptureTarget],
) -> Result<&[Option<usize>], PlanError>
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.
pub fn membership_descriptor(&self) -> MembershipDescriptor
pub fn input_diagnostics(&self) -> Vec<InputDiagnosticSnapshot>
pub fn write_input_diagnostics(&self, out: &mut Vec<InputDiagnosticSnapshot>)
pub fn set_input_state( &mut self, index: usize, state: ParticipationState, ) -> Result<(), Reason>
pub fn queued_packets(&self, index: usize) -> usize
Sourcepub fn push_input_samples(
&mut self,
index: usize,
samples: &[f32],
frames: usize,
timestamp: Option<Stamp>,
arrival_ns: u64,
) -> Result<(), Reason>
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).
pub fn push_input_packet( &mut self, index: usize, packet: MixerInputPacket, ) -> Result<(), Reason>
Sourcepub 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>
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.
Sourcepub fn mix_block_into(
&mut self,
frames: usize,
now_ns: u64,
oldest_wait_ns: u64,
out_samples: &mut [f32],
) -> Result<(MixStepOutcome, MixedBlockMetadata), Reason>
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.