Skip to main content

StreamConfig

Struct StreamConfig 

Source
pub struct StreamConfig {
Show 18 fields pub object_type: u8, pub sf_index: u8, pub sample_rate: u32, pub channel_config: u8, pub pce: Option<Pce>, pub frame_length: usize, pub depends_on_core_coder: bool, pub core_coder_delay: u16, pub section_data_resilience: bool, pub scalefactor_data_resilience: bool, pub spectral_data_resilience: bool, pub ep_config: u8, pub sbr: bool, pub sbr_explicitly_absent: bool, pub ps: bool, pub ext_sample_rate: u32, pub ext_rate_signalled: bool, pub eld: Option<EldConfig>,
}
Expand description

Everything an AudioSpecificConfig says about a stream.

Fields§

§object_type: u8

The CORE audio object type (5/29 unwrapped to what they extend).

§sf_index: u8

Core samplingFrequencyIndex as used for table lookups (escaped rates are mapped to the nearest table, ISO Table 4.82).

§sample_rate: u32

Core sample rate.

§channel_config: u8§pce: Option<Pce>

Present when channel_config == 0 (and possibly also in-band).

§frame_length: usize

Samples per channel per frame of the core: 1024/960 (GA), 512/480 (LD/ELD).

§depends_on_core_coder: bool§core_coder_delay: u16§section_data_resilience: bool§scalefactor_data_resilience: bool§spectral_data_resilience: bool§ep_config: u8

epConfig (ER object types only; 0 = no error protection).

§sbr: bool

SBR explicitly signalled present (hierarchical or backward-compatible).

§sbr_explicitly_absent: bool

SBR explicitly signalled ABSENT (sbrPresentFlag = 0): implicit SBR in the fill elements must then be ignored.

§ps: bool§ext_sample_rate: u32

Output rate after SBR (equals sample_rate when there is no SBR).

§ext_rate_signalled: bool

An extension rate was signalled even though SBR presence stays implicit (a sync extension naming the core rate). If SBR then appears it runs downsampled, at this rate.

§eld: Option<EldConfig>

Implementations§

Source§

impl StreamConfig

Source

pub fn lc(object_type: u8, sample_rate: u32, channel_config: u8) -> Self

A plain AAC-LC configuration (what an ADTS header or the simple AudioSpecificConfig describes).

Source

pub fn is_er(&self) -> bool

Is this an error-resilient (ER) object type, i.e. er_raw_data_block?

Source

pub fn channels(&self) -> usize

Channels described by the configuration (0 if unknown).

Trait Implementations§

Source§

impl Clone for StreamConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StreamConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for StreamConfig

Source§

impl PartialEq for StreamConfig

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for StreamConfig

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.