#[non_exhaustive]pub struct DecoderConfig {
pub backend: DecoderBackend,
pub byte_len_handle: Option<Arc<AtomicU64>>,
pub byte_pool: Option<BytePool>,
pub hint: Option<String>,
pub hooks: Option<SharedHooks>,
pub pcm_pool: Option<PcmPool>,
pub segment_layout: Option<Arc<dyn SegmentLayout>>,
pub gapless: bool,
pub epoch: u64,
}Expand description
Configuration for DecoderFactory.
pcm_pool / byte_pool are intentionally Option<_> — the
production discipline is to propagate one pool down the entire host
chain (player → AudioConfig → DecoderConfig). The None arm is
a last-resort fallback for unit tests that don’t care about pool
budgets and for legacy call sites that haven’t been threaded yet;
it routes to the process-global PcmPool::default() /
BytePool::default(). Don’t construct fresh PcmPool::new / BytePool::new
inside library components — that fragments the heap into many small
per-component pools and defeats recycling.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.backend: DecoderBackendWhich decoder backend to use. See DecoderBackend.
byte_len_handle: Option<Arc<AtomicU64>>Handle for dynamic byte length updates (HLS).
byte_pool: Option<BytePool>Raw byte buffer pool, propagated from the host. None falls
back to BytePool::default().
hint: Option<String>File extension hint for Symphonia probe (e.g., “mp3”, “aac”).
hooks: Option<SharedHooks>Reader-side observer hooks. Forwarded into [ComposedDecoder]
directly.
pcm_pool: Option<PcmPool>PCM buffer pool, propagated from the host. None falls back to
PcmPool::default().
segment_layout: Option<Arc<dyn SegmentLayout>>Optional segment-layout handle over the underlying source.
gapless: boolEnable gapless trim wiring through the per-backend codec.
epoch: u64Epoch counter for decoder recreation tracking.
Implementations§
Source§impl DecoderConfig
impl DecoderConfig
Sourcepub fn builder() -> DecoderConfigBuilder
pub fn builder() -> DecoderConfigBuilder
Create an instance of DecoderConfig using the builder syntax
Trait Implementations§
Source§impl Clone for DecoderConfig
impl Clone for DecoderConfig
Source§fn clone(&self) -> DecoderConfig
fn clone(&self) -> DecoderConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more