|
|
@@ -25,26 +25,36 @@ |
|
|
#include "attributes.h" |
|
|
#include "attributes.h" |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Audio Sample Formats |
|
|
|
|
|
|
|
|
* @addtogroup lavu_audio |
|
|
|
|
|
* @{ |
|
|
* |
|
|
* |
|
|
* @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. |
|
|
|
|
|
|
|
|
* @defgroup lavu_sampfmts Audio sample formats |
|
|
* |
|
|
* |
|
|
* @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. |
|
|
|
|
|
|
|
|
* Audio sample format enumeration and related convenience functions. |
|
|
|
|
|
* @{ |
|
|
* |
|
|
* |
|
|
* @par |
|
|
|
|
|
* The data layout as used in av_samples_fill_arrays() and elsewhere in FFmpeg |
|
|
|
|
|
* (such as AVFrame in libavcodec) is as follows: |
|
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 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, |
|
|
* 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 |
|
|
* 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 |
|
|
* 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, |
|
|
* plane is used, and samples for each channel are interleaved. In this case, |
|
|
* linesize is the buffer size, in bytes, for the 1 plane. |
|
|
* linesize is the buffer size, in bytes, for the 1 plane. |
|
|
|
|
|
* |
|
|
*/ |
|
|
*/ |
|
|
enum AVSampleFormat { |
|
|
enum AVSampleFormat { |
|
|
AV_SAMPLE_FMT_NONE = -1, |
|
|
AV_SAMPLE_FMT_NONE = -1, |
|
|
@@ -157,6 +167,15 @@ int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt); |
|
|
int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples, |
|
|
int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples, |
|
|
enum AVSampleFormat sample_fmt, int align); |
|
|
enum AVSampleFormat sample_fmt, int align); |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @} |
|
|
|
|
|
* |
|
|
|
|
|
* @defgroup lavu_sampmanip Samples manipulation |
|
|
|
|
|
* |
|
|
|
|
|
* Functions that manipulate audio samples |
|
|
|
|
|
* @{ |
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Fill plane data pointers and linesize for samples with sample |
|
|
* Fill plane data pointers and linesize for samples with sample |
|
|
* format sample_fmt. |
|
|
* format sample_fmt. |
|
|
@@ -253,4 +272,8 @@ int av_samples_copy(uint8_t **dst, uint8_t * const *src, int dst_offset, |
|
|
int av_samples_set_silence(uint8_t **audio_data, int offset, int nb_samples, |
|
|
int av_samples_set_silence(uint8_t **audio_data, int offset, int nb_samples, |
|
|
int nb_channels, enum AVSampleFormat sample_fmt); |
|
|
int nb_channels, enum AVSampleFormat sample_fmt); |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @} |
|
|
|
|
|
* @} |
|
|
|
|
|
*/ |
|
|
#endif /* AVUTIL_SAMPLEFMT_H */ |
|
|
#endif /* AVUTIL_SAMPLEFMT_H */ |