pub struct ChannelLayout {
pub nb_channels: usize,
pub nb_streams: usize,
pub nb_coupled_streams: usize,
pub mapping: Vec<u8>,
}Expand description
How the channels of a multistream signal map onto mono and stereo (coupled) Opus streams (RFC 7845 channel mapping).
Fields§
§nb_channels: usizeTotal output channels.
nb_streams: usizeNumber of Opus streams in each packet.
nb_coupled_streams: usizeHow many of those streams are stereo (coupled); they come first.
mapping: Vec<u8>For each output channel, the decoded channel index it takes.
Implementations§
Source§impl ChannelLayout
impl ChannelLayout
Sourcepub fn surround(channels: usize, mapping_family: i32) -> Result<Self, Error>
pub fn surround(channels: usize, mapping_family: i32) -> Result<Self, Error>
Standard layout for a channel count + mapping family (0 = mono/stereo, 1 = Vorbis surround for 1..=8 channels).
§Errors
Error::BadArg if mapping_family is not 0 or 1, or channels is out
of range for it (1–2 for family 0, 1–8 for family 1).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ChannelLayout
impl RefUnwindSafe for ChannelLayout
impl Send for ChannelLayout
impl Sync for ChannelLayout
impl Unpin for ChannelLayout
impl UnsafeUnpin for ChannelLayout
impl UnwindSafe for ChannelLayout
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more