Skip to main content

ChannelMappingTable

Struct ChannelMappingTable 

Source
pub struct ChannelMappingTable {
    pub stream_count: u8,
    pub coupled_count: u8,
    pub mapping: Vec<u8>,
}
Expand description

The §5.1.1 channel-mapping table: how the N coded streams (the first M of which are stereo) combine into the stream’s C output channels.

For mapping family 0 this is synthesized from the RFC-pinned defaults (the on-wire header omits the table entirely); for families ≥ 1 it is read from the header bytes following the mapping-family octet.

Fields§

§stream_count: u8

N — total number of coded Opus streams in each Ogg packet (§5.1.1 item 1). Always ≥ 1.

§coupled_count: u8

M — number of those streams decoded as stereo (§5.1.1 item 2). The first M streams are stereo; the remaining N − M are mono.

§mapping: Vec<u8>

One index per output channel (§5.1.1 item 3). mapping[c] selects the decoded channel feeding output channel c:

  • index < 2*M → stereo stream index/2, left channel if even else right.
  • 2*M ≤ index < 255 → mono stream index − M.
  • index == 255 → pure silence.

Implementations§

Source§

impl ChannelMappingTable

Source

pub fn decoded_channels(&self) -> u16

Total decoded channel count M + N (RFC 7845 §5.1.1 item 2). This is the number of distinct decoder channels the streams produce before the Self::mapping selects output channels.

Source

pub fn output_channels(&self) -> u8

The output channel count C — the length of Self::mapping.

Trait Implementations§

Source§

impl Clone for ChannelMappingTable

Source§

fn clone(&self) -> ChannelMappingTable

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 ChannelMappingTable

Source§

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

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

impl Eq for ChannelMappingTable

Source§

impl PartialEq for ChannelMappingTable

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ChannelMappingTable

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 = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.