pub struct ChannelLayout(/* private fields */);Expand description
A set of speaker positions; ascending bit order is the interleave order.
Implementations§
Source§impl ChannelLayout
impl ChannelLayout
Sourcepub const MONO: ChannelLayout
pub const MONO: ChannelLayout
Mono: front center only.
Sourcepub const STEREO: ChannelLayout
pub const STEREO: ChannelLayout
Stereo: front left + right.
Sourcepub const SURROUND_5_1: ChannelLayout
pub const SURROUND_5_1: ChannelLayout
5.1 (back): FL FR FC LFE BL BR.
Sourcepub const SURROUND_7_1: ChannelLayout
pub const SURROUND_7_1: ChannelLayout
7.1: FL FR FC LFE BL BR SL SR.
Sourcepub const fn of(positions: &[ChannelPosition]) -> Self
pub const fn of(positions: &[ChannelPosition]) -> Self
Layout from a set of positions.
Sourcepub const fn default_for(channels: u8) -> Option<Self>
pub const fn default_for(channels: u8) -> Option<Self>
The conventional layout for a channel count (the ffmpeg default-layout
table, which the decode path emits): mono, stereo, 2.1, 4.0, 5.0, 5.1,
6.1, 7.1. None for 0 or > 8 channels.
pub const fn contains(self, position: ChannelPosition) -> bool
Sourcepub const fn index_of(self, position: ChannelPosition) -> Option<usize>
pub const fn index_of(self, position: ChannelPosition) -> Option<usize>
The interleaved channel index of position (its rank among the set
bits), or None if the layout lacks it.
Sourcepub fn positions(self) -> impl Iterator<Item = ChannelPosition>
pub fn positions(self) -> impl Iterator<Item = ChannelPosition>
The positions in interleave order.
Trait Implementations§
Source§impl Clone for ChannelLayout
impl Clone for ChannelLayout
Source§fn clone(&self) -> ChannelLayout
fn clone(&self) -> ChannelLayout
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ChannelLayout
Source§impl Debug for ChannelLayout
impl Debug for ChannelLayout
impl Eq for ChannelLayout
Source§impl PartialEq for ChannelLayout
impl PartialEq for ChannelLayout
impl StructuralPartialEq for ChannelLayout
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