@@ -183,4 +183,44 @@ typedef struct AVChannelLayout {
183
183
void * opaque ;
184
184
} AVChannelLayout ;
185
185
186
+ /**
187
+ * Audio sample formats
188
+ *
189
+ * - The data described by the sample format is always in native-endian order.
190
+ * Sample values can be expressed by native C types, hence the lack of a signed
191
+ * 24-bit sample format even though it is a common raw audio data format.
192
+ *
193
+ * - The floating-point formats are based on full volume being in the range
194
+ * [-1.0, 1.0]. Any values outside this range are beyond full volume level.
195
+ *
196
+ * - The data layout as used in av_samples_fill_arrays() and elsewhere in FFmpeg
197
+ * (such as AVFrame in libavcodec) is as follows:
198
+ *
199
+ * @par
200
+ * For planar sample formats, each audio channel is in a separate data plane,
201
+ * and linesize is the buffer size, in bytes, for a single plane. All data
202
+ * planes must be the same size. For packed sample formats, only the first data
203
+ * plane is used, and samples for each channel are interleaved. In this case,
204
+ * linesize is the buffer size, in bytes, for the 1 plane.
205
+ *
206
+ */
207
+ enum AVSampleFormat {
208
+ AV_SAMPLE_FMT_NONE = -1 ,
209
+ AV_SAMPLE_FMT_U8 , ///< unsigned 8 bits
210
+ AV_SAMPLE_FMT_S16 , ///< signed 16 bits
211
+ AV_SAMPLE_FMT_S32 , ///< signed 32 bits
212
+ AV_SAMPLE_FMT_FLT , ///< float
213
+ AV_SAMPLE_FMT_DBL , ///< double
214
+
215
+ AV_SAMPLE_FMT_U8P , ///< unsigned 8 bits, planar
216
+ AV_SAMPLE_FMT_S16P , ///< signed 16 bits, planar
217
+ AV_SAMPLE_FMT_S32P , ///< signed 32 bits, planar
218
+ AV_SAMPLE_FMT_FLTP , ///< float, planar
219
+ AV_SAMPLE_FMT_DBLP , ///< double, planar
220
+ AV_SAMPLE_FMT_S64 , ///< signed 64 bits
221
+ AV_SAMPLE_FMT_S64P , ///< signed 64 bits, planar
222
+
223
+ AV_SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if linking dynamically
224
+ };
225
+
186
226
#endif
0 commit comments