Enum AVSampleFormat
#[non_exhaustive]#[repr(i32)]pub enum AVSampleFormat {
Show 14 variants
AV_SAMPLE_FMT_NONE = -1,
AV_SAMPLE_FMT_U8 = 0,
AV_SAMPLE_FMT_S16 = 1,
AV_SAMPLE_FMT_S32 = 2,
AV_SAMPLE_FMT_FLT = 3,
AV_SAMPLE_FMT_DBL = 4,
AV_SAMPLE_FMT_U8P = 5,
AV_SAMPLE_FMT_S16P = 6,
AV_SAMPLE_FMT_S32P = 7,
AV_SAMPLE_FMT_FLTP = 8,
AV_SAMPLE_FMT_DBLP = 9,
AV_SAMPLE_FMT_S64 = 10,
AV_SAMPLE_FMT_S64P = 11,
AV_SAMPLE_FMT_NB = 12,
}
dep_ffmpeg
only.Expand description
Audio sample formats
-
The data described by the sample format is always in native-endian order. Sample values can be expressed by native C types, hence the lack of a signed 24-bit sample format even though it is a common raw audio data format.
-
The floating-point formats are based on full volume being in the range [-1.0, 1.0]. Any values outside this range are beyond full volume level.
-
The data layout as used in av_samples_fill_arrays() and elsewhere in FFmpeg (such as AVFrame in libavcodec) is as follows:
@par For planar sample formats, each audio channel is in a separate data plane, and linesize is the buffer size, in bytes, for a single plane. All data planes must be the same size. For packed sample formats, only the first data plane is used, and samples for each channel are interleaved. In this case, linesize is the buffer size, in bytes, for the 1 plane.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
AV_SAMPLE_FMT_NONE = -1
AV_SAMPLE_FMT_U8 = 0
< unsigned 8 bits
AV_SAMPLE_FMT_S16 = 1
< signed 16 bits
AV_SAMPLE_FMT_S32 = 2
< signed 32 bits
AV_SAMPLE_FMT_FLT = 3
< float
AV_SAMPLE_FMT_DBL = 4
< double
AV_SAMPLE_FMT_U8P = 5
< unsigned 8 bits, planar
AV_SAMPLE_FMT_S16P = 6
< signed 16 bits, planar
AV_SAMPLE_FMT_S32P = 7
< signed 32 bits, planar
AV_SAMPLE_FMT_FLTP = 8
< float, planar
AV_SAMPLE_FMT_DBLP = 9
< double, planar
AV_SAMPLE_FMT_S64 = 10
< signed 64 bits
AV_SAMPLE_FMT_S64P = 11
< signed 64 bits, planar
AV_SAMPLE_FMT_NB = 12
< Number of sample formats. DO NOT USE if linking dynamically
Trait Implementations§
§impl Clone for AVSampleFormat
impl Clone for AVSampleFormat
§fn clone(&self) -> AVSampleFormat
fn clone(&self) -> AVSampleFormat
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for AVSampleFormat
impl Debug for AVSampleFormat
§impl From<AVSampleFormat> for Sample
impl From<AVSampleFormat> for Sample
§fn from(value: AVSampleFormat) -> Sample
fn from(value: AVSampleFormat) -> Sample
§impl From<Sample> for AVSampleFormat
impl From<Sample> for AVSampleFormat
§fn from(value: Sample) -> AVSampleFormat
fn from(value: Sample) -> AVSampleFormat
§impl Hash for AVSampleFormat
impl Hash for AVSampleFormat
§impl PartialEq for AVSampleFormat
impl PartialEq 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
Source§impl<T> ByteSized for T
impl<T> ByteSized for T
Source§const BYTE_ALIGN: usize = _
const BYTE_ALIGN: usize = _
Source§fn byte_align(&self) -> usize
fn byte_align(&self) -> usize
Source§fn ptr_size_ratio(&self) -> [usize; 2]
fn ptr_size_ratio(&self) -> [usize; 2]
Source§impl<T, R> Chain<R> for Twhere
T: ?Sized,
impl<T, R> Chain<R> for Twhere
T: ?Sized,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<T> ExtAny for T
impl<T> ExtAny for T
Source§fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
TypeId
of Self
using a custom hasher.Source§fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
Source§impl<T> ExtMem for Twhere
T: ?Sized,
impl<T> ExtMem for Twhere
T: ?Sized,
Source§const NEEDS_DROP: bool = _
const NEEDS_DROP: bool = _
Source§fn mem_align_of<T>() -> usize
fn mem_align_of<T>() -> usize
Source§fn mem_align_of_val(&self) -> usize
fn mem_align_of_val(&self) -> usize
Source§fn mem_size_of<T>() -> usize
fn mem_size_of<T>() -> usize
Source§fn mem_size_of_val(&self) -> usize
fn mem_size_of_val(&self) -> usize
Source§fn mem_needs_drop(&self) -> bool
fn mem_needs_drop(&self) -> bool
true
if dropping values of this type matters. Read moreSource§fn mem_forget(self)where
Self: Sized,
fn mem_forget(self)where
Self: Sized,
self
without running its destructor. Read moreSource§fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
Source§unsafe fn mem_zeroed<T>() -> T
unsafe fn mem_zeroed<T>() -> T
unsafe_layout
only.T
represented by the all-zero byte-pattern. Read moreSource§unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe_layout
only.T
represented by the all-zero byte-pattern. Read moreSource§fn mem_as_bytes(&self) -> &[u8] ⓘ
fn mem_as_bytes(&self) -> &[u8] ⓘ
unsafe_slice
only.§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Hook for T
impl<T> Hook for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more