- av_get_alt_sample_fmt
AVSampleFormat av_get_alt_sample_fmt(AVSampleFormat sample_fmt, int planar)
Return the planar<->packed alternative form of the given sample format, or
AV_SAMPLE_FMT_NONE on error. If the passed sample_fmt is already in the
requested planar/packed format, the format returned is the same as the
input.
- av_get_bits_per_sample_fmt
deprecated int av_get_bits_per_sample_fmt(AVSampleFormat sample_fmt)
@deprecated Use av_get_bytes_per_sample() instead.
- av_get_bytes_per_sample
int av_get_bytes_per_sample(AVSampleFormat sample_fmt)
Return number of bytes per sample.
- av_get_packed_sample_fmt
AVSampleFormat av_get_packed_sample_fmt(AVSampleFormat sample_fmt)
Get the packed alternative form of the given sample format.
- av_get_planar_sample_fmt
AVSampleFormat av_get_planar_sample_fmt(AVSampleFormat sample_fmt)
Get the planar alternative form of the given sample format.
- av_get_sample_fmt
AVSampleFormat av_get_sample_fmt(char* name)
Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE
on error.
- av_get_sample_fmt_name
char* av_get_sample_fmt_name(AVSampleFormat sample_fmt)
Return the name of sample_fmt, or NULL if sample_fmt is not
recognized.
- av_get_sample_fmt_string
char* av_get_sample_fmt_string(char* buf, int buf_size, AVSampleFormat sample_fmt)
Generate a string corresponding to the sample format with
sample_fmt, or a header if sample_fmt is negative.
- av_sample_fmt_is_planar
int av_sample_fmt_is_planar(AVSampleFormat sample_fmt)
Check if the sample format is planar.
- av_samples_alloc
int av_samples_alloc(ubyte** audio_data, int* linesize, int nb_channels, int nb_samples, AVSampleFormat sample_fmt, int alignment)
Allocate a samples buffer for nb_samples samples, and fill data pointers and
linesize accordingly.
The allocated samples buffer can be freed by using av_freep(&audio_data[0])
- av_samples_copy
int av_samples_copy(ubyte** dst, uint** src, int dst_offset, int src_offset, int nb_samples, int nb_channels, AVSampleFormat sample_fmt)
Copy samples from src to dst.
- av_samples_fill_arrays
int av_samples_fill_arrays(uint** audio_data, int* linesize, uint* buf, int nb_channels, int nb_samples, AVSampleFormat sample_fmt, int alignment)
Fill channel data pointers and linesize for samples with sample
format sample_fmt.
- av_samples_get_buffer_size
int av_samples_get_buffer_size(int* linesize, int nb_channels, int nb_samples, AVSampleFormat sample_fmt, int alignment)
Get the required buffer size for the given audio parameters.
- av_samples_set_silence
int av_samples_set_silence(ubyte** audio_data, int offset, int nb_samples, int nb_channels, AVSampleFormat sample_fmt)
Fill an audio buffer with silence.
Audio Sample Formats
@par 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.
@par 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.
@par The data layout as used in av_samples_fill_arrays() and elsewhere in Libav (such as AVFrame in libavcodec) is as follows:
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.