World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
Audio sample formats

Audio sample format enumeration and related convenience functions. Подробнее...

+ Граф связей класса Audio sample formats:

Перечисления

enum  AVSampleFormat {
  AV_SAMPLE_FMT_NONE = -1, AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32,
  AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_S16P,
  AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_DBLP, AV_SAMPLE_FMT_S64,
  AV_SAMPLE_FMT_S64P, AV_SAMPLE_FMT_NB
}
 

Функции

const char * av_get_sample_fmt_name (enum AVSampleFormat sample_fmt)
 
enum AVSampleFormat av_get_sample_fmt (const char *name)
 
enum AVSampleFormat av_get_alt_sample_fmt (enum AVSampleFormat sample_fmt, int planar)
 
enum AVSampleFormat av_get_packed_sample_fmt (enum AVSampleFormat sample_fmt)
 
enum AVSampleFormat av_get_planar_sample_fmt (enum AVSampleFormat sample_fmt)
 
char * av_get_sample_fmt_string (char *buf, int buf_size, enum AVSampleFormat sample_fmt)
 
int av_get_bytes_per_sample (enum AVSampleFormat sample_fmt)
 
int av_sample_fmt_is_planar (enum AVSampleFormat sample_fmt)
 
int av_samples_get_buffer_size (int *linesize, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align)
 

Подробное описание

Audio sample format enumeration and related convenience functions.

Перечисления

◆ AVSampleFormat

#include <C:/git/world-of-might-and-magic/lib/win32/x86/ffmpeg-4.2.2/include/libavutil/samplefmt.h>

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:
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.
Элементы перечислений
AV_SAMPLE_FMT_NONE 
AV_SAMPLE_FMT_U8 

unsigned 8 bits

AV_SAMPLE_FMT_S16 

signed 16 bits

AV_SAMPLE_FMT_S32 

signed 32 bits

AV_SAMPLE_FMT_FLT 

float

AV_SAMPLE_FMT_DBL 

double

AV_SAMPLE_FMT_U8P 

unsigned 8 bits, planar

AV_SAMPLE_FMT_S16P 

signed 16 bits, planar

AV_SAMPLE_FMT_S32P 

signed 32 bits, planar

AV_SAMPLE_FMT_FLTP 

float, planar

AV_SAMPLE_FMT_DBLP 

double, planar

AV_SAMPLE_FMT_S64 

signed 64 bits

AV_SAMPLE_FMT_S64P 

signed 64 bits, planar

AV_SAMPLE_FMT_NB 

Number of sample formats. DO NOT USE if linking dynamically.

См. определение в файле samplefmt.h строка 58

Функции

◆ av_get_sample_fmt_name()

const char* av_get_sample_fmt_name ( enum AVSampleFormat  sample_fmt)

#include <C:/git/world-of-might-and-magic/lib/win32/x86/ffmpeg-4.2.2/include/libavutil/samplefmt.h>

Return the name of sample_fmt, or NULL if sample_fmt is not recognized.

◆ av_get_sample_fmt()

enum AVSampleFormat av_get_sample_fmt ( const char *  name)

#include <C:/git/world-of-might-and-magic/lib/win32/x86/ffmpeg-4.2.2/include/libavutil/samplefmt.h>

Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE on error.

◆ av_get_alt_sample_fmt()

enum AVSampleFormat av_get_alt_sample_fmt ( enum AVSampleFormat  sample_fmt,
int  planar 
)

#include <C:/git/world-of-might-and-magic/lib/win32/x86/ffmpeg-4.2.2/include/libavutil/samplefmt.h>

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_packed_sample_fmt()

enum AVSampleFormat av_get_packed_sample_fmt ( enum AVSampleFormat  sample_fmt)

#include <C:/git/world-of-might-and-magic/lib/win32/x86/ffmpeg-4.2.2/include/libavutil/samplefmt.h>

Get the packed alternative form of the given sample format.

If the passed sample_fmt is already in packed format, the format returned is the same as the input.

Возвращает
the packed alternative form of the given sample format or AV_SAMPLE_FMT_NONE on error.

◆ av_get_planar_sample_fmt()

enum AVSampleFormat av_get_planar_sample_fmt ( enum AVSampleFormat  sample_fmt)

#include <C:/git/world-of-might-and-magic/lib/win32/x86/ffmpeg-4.2.2/include/libavutil/samplefmt.h>

Get the planar alternative form of the given sample format.

If the passed sample_fmt is already in planar format, the format returned is the same as the input.

Возвращает
the planar alternative form of the given sample format or AV_SAMPLE_FMT_NONE on error.

◆ av_get_sample_fmt_string()

char* av_get_sample_fmt_string ( char *  buf,
int  buf_size,
enum AVSampleFormat  sample_fmt 
)

#include <C:/git/world-of-might-and-magic/lib/win32/x86/ffmpeg-4.2.2/include/libavutil/samplefmt.h>

Generate a string corresponding to the sample format with sample_fmt, or a header if sample_fmt is negative.

Аргументы
bufthe buffer where to write the string
buf_sizethe size of buf
sample_fmtthe number of the sample format to print the corresponding info string, or a negative value to print the corresponding header.
Возвращает
the pointer to the filled buffer or NULL if sample_fmt is unknown or in case of other errors

◆ av_get_bytes_per_sample()

int av_get_bytes_per_sample ( enum AVSampleFormat  sample_fmt)

#include <C:/git/world-of-might-and-magic/lib/win32/x86/ffmpeg-4.2.2/include/libavutil/samplefmt.h>

Return number of bytes per sample.

Аргументы
sample_fmtthe sample format
Возвращает
number of bytes per sample or zero if unknown for the given sample format

◆ av_sample_fmt_is_planar()

int av_sample_fmt_is_planar ( enum AVSampleFormat  sample_fmt)

#include <C:/git/world-of-might-and-magic/lib/win32/x86/ffmpeg-4.2.2/include/libavutil/samplefmt.h>

Check if the sample format is planar.

Аргументы
sample_fmtthe sample format to inspect
Возвращает
1 if the sample format is planar, 0 if it is interleaved

◆ av_samples_get_buffer_size()

int av_samples_get_buffer_size ( int *  linesize,
int  nb_channels,
int  nb_samples,
enum AVSampleFormat  sample_fmt,
int  align 
)

#include <C:/git/world-of-might-and-magic/lib/win32/x86/ffmpeg-4.2.2/include/libavutil/samplefmt.h>

Get the required buffer size for the given audio parameters.

Аргументы
[out]linesizecalculated linesize, may be NULL
nb_channelsthe number of channels
nb_samplesthe number of samples in a single channel
sample_fmtthe sample format
alignbuffer size alignment (0 = default, 1 = no alignment)
Возвращает
required buffer size, or negative error code on failure
AV_SAMPLE_FMT_FLTP
@ AV_SAMPLE_FMT_FLTP
float, planar
Definition: samplefmt.h:69
AV_SAMPLE_FMT_S32P
@ AV_SAMPLE_FMT_S32P
signed 32 bits, planar
Definition: samplefmt.h:68
AV_SAMPLE_FMT_S64P
@ AV_SAMPLE_FMT_S64P
signed 64 bits, planar
Definition: samplefmt.h:72
AV_SAMPLE_FMT_NB
@ AV_SAMPLE_FMT_NB
Number of sample formats. DO NOT USE if linking dynamically.
Definition: samplefmt.h:74
AV_SAMPLE_FMT_U8P
@ AV_SAMPLE_FMT_U8P
unsigned 8 bits, planar
Definition: samplefmt.h:66
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:59
AV_SAMPLE_FMT_S16P
@ AV_SAMPLE_FMT_S16P
signed 16 bits, planar
Definition: samplefmt.h:67
AV_SAMPLE_FMT_U8
@ AV_SAMPLE_FMT_U8
unsigned 8 bits
Definition: samplefmt.h:60
AV_SAMPLE_FMT_S16
@ AV_SAMPLE_FMT_S16
signed 16 bits
Definition: samplefmt.h:61
AV_SAMPLE_FMT_DBLP
@ AV_SAMPLE_FMT_DBLP
double, planar
Definition: samplefmt.h:70
AV_SAMPLE_FMT_DBL
@ AV_SAMPLE_FMT_DBL
double
Definition: samplefmt.h:64
AV_SAMPLE_FMT_S32
@ AV_SAMPLE_FMT_S32
signed 32 bits
Definition: samplefmt.h:62
AV_SAMPLE_FMT_FLT
@ AV_SAMPLE_FMT_FLT
float
Definition: samplefmt.h:63
AV_SAMPLE_FMT_S64
@ AV_SAMPLE_FMT_S64
signed 64 bits
Definition: samplefmt.h:71