Skip to main content

MultiInputManager

Struct MultiInputManager 

Source
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

Source

pub fn new( request: CaptureRequest, native_format: Arc<Format>, max_frames_per_block: usize, ) -> Result<MultiInputManager, ManagerError>

Source

pub fn new_heterogeneous( request: CaptureRequest, per_input: Vec<(BackendId, Arc<Format>)>, block_frames: usize, max_input_frames_per_call: usize, ) -> Result<MultiInputManager, ManagerError>

Source

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>

Source

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

Source

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

Source

pub fn block_frames(&self) -> usize

Source

pub fn storage_budget(&self) -> &StorageBudget

Source

pub fn budgets(&self) -> &AggregateManagerBudgets

Source

pub fn targets(&self) -> &[CaptureTarget]

Source

pub fn last_block_metadata(&self) -> Option<MixedBlockMetadata>

Source

pub fn clear_pending_output(&self)

Source

pub fn has_pending_output(&self) -> bool

Source

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.

Source

pub fn reconfigure_targets_with_formats( &mut self, new_targets: Vec<CaptureTarget>, per_input: Vec<(BackendId, Arc<Format>)>, ) -> Result<Vec<Option<usize>>, ManagerError>

Source

pub fn acquire_pending_open(&self) -> Result<PendingOpenTicket, ManagerError>

Source

pub fn input_handles(&self) -> &[InputStatusHandle]

Source

pub fn membership_descriptor(&self) -> MembershipDescriptor

Source

pub fn attach_topology_source( &self, target_index: usize, source_id: impl Into<Arc<str>>, ) -> Result<bool, ManagerError>

Source

pub fn retire_topology_target(&self, target_index: usize) -> Vec<Arc<str>>

Source

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.

Source

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

Source

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

Source

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.

Source

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

Source

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.

Source

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

Source

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

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.