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 "avutil.h"
00023
00046 enum AVSampleFormat {
00047 AV_SAMPLE_FMT_NONE = -1,
00048 AV_SAMPLE_FMT_U8,
00049 AV_SAMPLE_FMT_S16,
00050 AV_SAMPLE_FMT_S32,
00051 AV_SAMPLE_FMT_FLT,
00052 AV_SAMPLE_FMT_DBL,
00053
00054 AV_SAMPLE_FMT_U8P,
00055 AV_SAMPLE_FMT_S16P,
00056 AV_SAMPLE_FMT_S32P,
00057 AV_SAMPLE_FMT_FLTP,
00058 AV_SAMPLE_FMT_DBLP,
00059
00060 AV_SAMPLE_FMT_NB
00061 };
00062
00067 const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt);
00068
00073 enum AVSampleFormat av_get_sample_fmt(const char *name);
00074
00081 enum AVSampleFormat av_get_alt_sample_fmt(enum AVSampleFormat sample_fmt, int planar);
00082
00092 enum AVSampleFormat av_get_packed_sample_fmt(enum AVSampleFormat sample_fmt);
00093
00103 enum AVSampleFormat av_get_planar_sample_fmt(enum AVSampleFormat sample_fmt);
00104
00117 char *av_get_sample_fmt_string(char *buf, int buf_size, enum AVSampleFormat sample_fmt);
00118
00119 #if FF_API_GET_BITS_PER_SAMPLE_FMT
00120
00123 attribute_deprecated
00124 int av_get_bits_per_sample_fmt(enum AVSampleFormat sample_fmt);
00125 #endif
00126
00134 int av_get_bytes_per_sample(enum AVSampleFormat sample_fmt);
00135
00142 int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt);
00143
00154 int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
00155 enum AVSampleFormat sample_fmt, int align);
00156
00181 int av_samples_fill_arrays(uint8_t **audio_data, int *linesize,
00182 const uint8_t *buf,
00183 int nb_channels, int nb_samples,
00184 enum AVSampleFormat sample_fmt, int align);
00185
00202 int av_samples_alloc(uint8_t **audio_data, int *linesize, int nb_channels,
00203 int nb_samples, enum AVSampleFormat sample_fmt, int align);
00204
00216 int av_samples_copy(uint8_t **dst, uint8_t * const *src, int dst_offset,
00217 int src_offset, int nb_samples, int nb_channels,
00218 enum AVSampleFormat sample_fmt);
00219
00229 int av_samples_set_silence(uint8_t **audio_data, int offset, int nb_samples,
00230 int nb_channels, enum AVSampleFormat sample_fmt);
00231
00232 #endif