00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef AVUTIL_SAMPLEFMT_H
00020 #define AVUTIL_SAMPLEFMT_H
00021
00022 #include <stdint.h>
00023
00024 #include "avutil.h"
00025 #include "attributes.h"
00026
00049 enum AVSampleFormat {
00050 AV_SAMPLE_FMT_NONE = -1,
00051 AV_SAMPLE_FMT_U8,
00052 AV_SAMPLE_FMT_S16,
00053 AV_SAMPLE_FMT_S32,
00054 AV_SAMPLE_FMT_FLT,
00055 AV_SAMPLE_FMT_DBL,
00056
00057 AV_SAMPLE_FMT_U8P,
00058 AV_SAMPLE_FMT_S16P,
00059 AV_SAMPLE_FMT_S32P,
00060 AV_SAMPLE_FMT_FLTP,
00061 AV_SAMPLE_FMT_DBLP,
00062
00063 AV_SAMPLE_FMT_NB
00064 };
00065
00070 const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt);
00071
00076 enum AVSampleFormat av_get_sample_fmt(const char *name);
00077
00084 enum AVSampleFormat av_get_alt_sample_fmt(enum AVSampleFormat sample_fmt, int planar);
00085
00095 enum AVSampleFormat av_get_packed_sample_fmt(enum AVSampleFormat sample_fmt);
00096
00106 enum AVSampleFormat av_get_planar_sample_fmt(enum AVSampleFormat sample_fmt);
00107
00120 char *av_get_sample_fmt_string(char *buf, int buf_size, enum AVSampleFormat sample_fmt);
00121
00122 #if FF_API_GET_BITS_PER_SAMPLE_FMT
00123
00126 attribute_deprecated
00127 int av_get_bits_per_sample_fmt(enum AVSampleFormat sample_fmt);
00128 #endif
00129
00137 int av_get_bytes_per_sample(enum AVSampleFormat sample_fmt);
00138
00145 int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt);
00146
00157 int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
00158 enum AVSampleFormat sample_fmt, int align);
00159
00190 int av_samples_fill_arrays(uint8_t **audio_data, int *linesize,
00191 const uint8_t *buf,
00192 int nb_channels, int nb_samples,
00193 enum AVSampleFormat sample_fmt, int align);
00194
00213 int av_samples_alloc(uint8_t **audio_data, int *linesize, int nb_channels,
00214 int nb_samples, enum AVSampleFormat sample_fmt, int align);
00215
00227 int av_samples_copy(uint8_t **dst, uint8_t * const *src, int dst_offset,
00228 int src_offset, int nb_samples, int nb_channels,
00229 enum AVSampleFormat sample_fmt);
00230
00240 int av_samples_set_silence(uint8_t **audio_data, int offset, int nb_samples,
00241 int nb_channels, enum AVSampleFormat sample_fmt);
00242
00243 #endif