#[repr(transparent)]pub struct AVSampleFormat(pub i32);
Expand description
Audio sample formats used in FFmpeg’s AVSampleFormat
enumeration.
The sample format defines how audio samples are stored in memory, including:
- Bit depth (8-bit, 16-bit, 32-bit, 64-bit)
- Signed vs Unsigned (U8 is unsigned, others are signed)
- Floating-point vs Integer
- Packed vs Planar (Planar formats store each channel separately)
See the official FFmpeg documentation: https://ffmpeg.org/doxygen/trunk/samplefmt_8h.html
Tuple Fields§
§0: i32
Implementations§
Source§impl AVSampleFormat
impl AVSampleFormat
Sourcepub const None: Self
pub const None: Self
No sample format specified or unknown format.
Corresponds to AV_SAMPLE_FMT_NONE
.
Sourcepub const U8: Self
pub const U8: Self
Unsigned 8-bit PCM format (0 to 255 range).
- Binary representation:
0bxxxxxxxx
(8 bits) - Range:
[0, 255]
- Stored as:
u8
- Interleaved
Corresponds to
AV_SAMPLE_FMT_U8
.
Sourcepub const S16: Self
pub const S16: Self
Signed 16-bit PCM format.
- Binary representation:
0bxxxxxxxxxxxxxxxx
(16 bits) - Range:
[-32,768, 32,767]
- Stored as:
i16
- Interleaved
Corresponds to
AV_SAMPLE_FMT_S16
.
Sourcepub const S32: Self
pub const S32: Self
Signed 32-bit PCM format.
- Binary representation:
0bxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
(32 bits) - Range:
[-2^31, 2^31-1]
- Stored as:
i32
- Interleaved
Corresponds to
AV_SAMPLE_FMT_S32
.
Sourcepub const Flt: Self
pub const Flt: Self
32-bit Floating-point PCM format.
- Binary representation: IEEE-754 32-bit float
- Range:
[-1.0, 1.0]
(normalized) - Stored as:
f32
- Interleaved
Corresponds to
AV_SAMPLE_FMT_FLT
.
Sourcepub const Dbl: Self
pub const Dbl: Self
64-bit Floating-point PCM format.
- Binary representation: IEEE-754 64-bit float
- Range:
[-1.0, 1.0]
(normalized) - Stored as:
f64
- Interleaved
Corresponds to
AV_SAMPLE_FMT_Dbl
.
Sourcepub const U8p: Self
pub const U8p: Self
Planar Unsigned 8-bit PCM format.
- Binary representation:
0bxxxxxxxx
(8 bits) - Range:
[0, 255]
- Stored as:
u8
- Planar (separate channel planes)
Corresponds to
AV_SAMPLE_FMT_U8P
.
Sourcepub const S16p: Self
pub const S16p: Self
Planar Signed 16-bit PCM format.
- Binary representation:
0bxxxxxxxxxxxxxxxx
(16 bits) - Range:
[-32,768, 32,767]
- Stored as:
i16
- Planar (separate channel planes)
Corresponds to
AV_SAMPLE_FMT_S16P
.
Sourcepub const S32p: Self
pub const S32p: Self
Planar Signed 32-bit PCM format.
- Binary representation:
0bxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
(32 bits) - Range:
[-2^31, 2^31-1]
- Stored as:
i32
- Planar (separate channel planes)
Corresponds to
AV_SAMPLE_FMT_S32P
.
Sourcepub const Fltp: Self
pub const Fltp: Self
Planar 32-bit Floating-point PCM format.
- Binary representation: IEEE-754 32-bit float
- Range:
[-1.0, 1.0]
(normalized) - Stored as:
f32
- Planar (separate channel planes)
Corresponds to
AV_SAMPLE_FMT_FLTP
.
Sourcepub const Dblp: Self
pub const Dblp: Self
Planar 64-bit Floating-point PCM format.
- Binary representation: IEEE-754 64-bit float
- Range:
[-1.0, 1.0]
(normalized) - Stored as:
f64
- Planar (separate channel planes)
Corresponds to
AV_SAMPLE_FMT_DBLP
.
Sourcepub const S64: Self
pub const S64: Self
Signed 64-bit PCM format.
- Binary representation:
0bxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
- Range:
[-2^63, 2^63-1]
- Stored as:
i64
- Interleaved
Corresponds to
AV_SAMPLE_FMT_S64
.
Trait Implementations§
Source§impl Clone for AVSampleFormat
impl Clone for AVSampleFormat
Source§fn clone(&self) -> AVSampleFormat
fn clone(&self) -> AVSampleFormat
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for AVSampleFormat
impl Debug for AVSampleFormat
Source§impl From<AVSampleFormat> for i32
impl From<AVSampleFormat> for i32
Source§fn from(value: AVSampleFormat) -> Self
fn from(value: AVSampleFormat) -> Self
Converts to this type from the input type.
Source§impl From<AVSampleFormat> for u32
impl From<AVSampleFormat> for u32
Source§fn from(value: AVSampleFormat) -> Self
fn from(value: AVSampleFormat) -> Self
Converts to this type from the input type.
Source§impl From<i32> for AVSampleFormat
impl From<i32> for AVSampleFormat
Source§impl From<u32> for AVSampleFormat
impl From<u32> for AVSampleFormat
Source§impl Hash for AVSampleFormat
impl Hash for AVSampleFormat
Source§impl Ord for AVSampleFormat
impl Ord for AVSampleFormat
Source§fn cmp(&self, other: &AVSampleFormat) -> Ordering
fn cmp(&self, other: &AVSampleFormat) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq<i32> for AVSampleFormat
impl PartialEq<i32> for AVSampleFormat
Source§impl PartialEq for AVSampleFormat
impl PartialEq for AVSampleFormat
Source§impl PartialOrd for AVSampleFormat
impl PartialOrd for AVSampleFormat
impl Copy for AVSampleFormat
impl Eq for AVSampleFormat
impl StructuralPartialEq for AVSampleFormat
Auto Trait Implementations§
impl Freeze for AVSampleFormat
impl RefUnwindSafe for AVSampleFormat
impl Send for AVSampleFormat
impl Sync for AVSampleFormat
impl Unpin for AVSampleFormat
impl UnwindSafe for AVSampleFormat
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