pub struct MultiInputManager { /* private fields */ }Expand description
Multi-input Manager orchestrating CspaMixer, per-input InputNormalizer + FrameReblocker,
optional OutputConverter, StorageBudget-backed out_pool + remainder slicing, aggregate
budgets, caller-owned overlap, and status-only diagnostic input handles.
Implementations§
Source§impl MultiInputManager
impl MultiInputManager
pub fn new( request: CaptureRequest, native_format: Arc<Format>, max_frames_per_block: usize, ) -> Result<MultiInputManager, ManagerError>
pub fn new_heterogeneous( request: CaptureRequest, per_input: Vec<(BackendId, Arc<Format>)>, block_frames: usize, max_input_frames_per_call: usize, ) -> Result<MultiInputManager, ManagerError>
pub fn new_heterogeneous_with_budget( request: CaptureRequest, per_input: Vec<(BackendId, Arc<Format>)>, block_frames: usize, max_input_frames_per_call: usize, existing_budget: StorageBudget, ) -> Result<MultiInputManager, ManagerError>
pub fn working_format(&self) -> &Arc<Format> ⓘ
pub fn output_format(&self) -> &Arc<Format> ⓘ
pub fn block_frames(&self) -> usize
pub fn storage_budget(&self) -> &StorageBudget
pub fn budgets(&self) -> &AggregateManagerBudgets
pub fn targets(&self) -> &[CaptureTarget]
pub fn last_block_metadata(&self) -> Option<MixedBlockMetadata>
pub fn clear_pending_output(&self)
pub fn has_pending_output(&self) -> bool
Sourcepub fn reconfigure_targets(
&mut self,
new_targets: Vec<CaptureTarget>,
) -> Result<Vec<Option<usize>>, ManagerError>
pub fn reconfigure_targets( &mut self, new_targets: Vec<CaptureTarget>, ) -> Result<Vec<Option<usize>>, ManagerError>
Reconfigure active targets in CspaMixer, preserving queued packets and
participation state for retained targets while initializing newly added targets in Starting.
Returns the old slot index for each retained new slot, or None for newly added slots.
pub fn reconfigure_targets_with_formats( &mut self, new_targets: Vec<CaptureTarget>, per_input: Vec<(BackendId, Arc<Format>)>, ) -> Result<Vec<Option<usize>>, ManagerError>
pub fn acquire_pending_open(&self) -> Result<PendingOpenTicket, ManagerError>
pub fn input_handles(&self) -> &[InputStatusHandle]
pub fn membership_descriptor(&self) -> MembershipDescriptor
pub fn attach_topology_source( &self, target_index: usize, source_id: impl Into<Arc<str>>, ) -> Result<bool, ManagerError>
pub fn retire_topology_target(&self, target_index: usize) -> Vec<Arc<str>>
Sourcepub fn push_raw_input_bytes(
&self,
input_index: usize,
raw_bytes: &[u8],
timestamp: Option<Stamp>,
now_ns: u64,
) -> Result<usize, Reason>
pub fn push_raw_input_bytes( &self, input_index: usize, raw_bytes: &[u8], timestamp: Option<Stamp>, now_ns: u64, ) -> Result<usize, Reason>
Normalize raw input PCM bytes (I16/I24/I32/F32, Mono/Stereo, any supported rate),
reblock into exact block_frames chunks, apply sample-exact cross-clock slip/repeat drift
compensation, and enqueue into CspaMixer with 0 steady-state heap allocations.
pub fn push_input_packet( &self, input_index: usize, packet: MixerInputPacket, ) -> Result<(), Reason>
pub fn set_input_state( &self, input_index: usize, state: ParticipationState, ) -> Result<(), Reason>
Sourcepub fn poll_mix_bytes(
&self,
frames: usize,
now_ns: u64,
oldest_wait_ns: u64,
out_bytes: &mut Vec<u8>,
) -> Result<(MixStepOutcome, MixedBlockMetadata), ReadError>
pub fn poll_mix_bytes( &self, frames: usize, now_ns: u64, oldest_wait_ns: u64, out_bytes: &mut Vec<u8>, ) -> Result<(MixStepOutcome, MixedBlockMetadata), ReadError>
Pull one mixed (and optionally converted) block into out_bytes under exclusive one-reader arbitration.
Sourcepub fn try_pop_pending_owned(
&self,
requested_frames: usize,
) -> Result<Option<(ReadResult, MixedBlockMetadata)>, ReadError>
pub fn try_pop_pending_owned( &self, requested_frames: usize, ) -> Result<Option<(ReadResult, MixedBlockMetadata)>, ReadError>
Drain any previously buffered remainder frames (pending_out_slice or pending_out_bytes)
into an owned ReadResult using self.out_pool (StorageBudget-accounted).
Sourcepub fn try_pop_pending_into(
&self,
dst: &mut [u8],
requested_frames: usize,
) -> Result<Option<(ReadResult, MixedBlockMetadata)>, ReadError>
pub fn try_pop_pending_into( &self, dst: &mut [u8], requested_frames: usize, ) -> Result<Option<(ReadResult, MixedBlockMetadata)>, ReadError>
Drain any previously buffered remainder frames into caller dst with 0 heap allocations.
Sourcepub fn read_mixed_owned(
&self,
requested_frames: usize,
now_ns: u64,
oldest_wait_ns: u64,
) -> Result<(ReadResult, MixedBlockMetadata), ReadError>
pub fn read_mixed_owned( &self, requested_frames: usize, now_ns: u64, oldest_wait_ns: u64, ) -> Result<(ReadResult, MixedBlockMetadata), ReadError>
Mix one block_frames quantum (unless remainder frames are already pending) and return up
to requested_frames as an owned Pool-backed ReadResult (StorageBudget-charged).
Sourcepub fn read_mixed_into(
&self,
dst: &mut [u8],
requested_frames: usize,
now_ns: u64,
oldest_wait_ns: u64,
) -> Result<(ReadResult, MixedBlockMetadata), ReadError>
pub fn read_mixed_into( &self, dst: &mut [u8], requested_frames: usize, now_ns: u64, oldest_wait_ns: u64, ) -> Result<(ReadResult, MixedBlockMetadata), ReadError>
Mix one block_frames quantum (unless remainder bytes are already pending) directly into
caller dst with 0 steady-state heap allocations (pending_out_bytes remainder slicing).