00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef AVRESAMPLE_AVRESAMPLE_H
00022 #define AVRESAMPLE_AVRESAMPLE_H
00023
00029 #include "libavutil/audioconvert.h"
00030 #include "libavutil/avutil.h"
00031 #include "libavutil/dict.h"
00032 #include "libavutil/log.h"
00033
00034 #include "libavresample/version.h"
00035
00036 #define AVRESAMPLE_MAX_CHANNELS 32
00037
00038 typedef struct AVAudioResampleContext AVAudioResampleContext;
00039
00041 enum AVMixCoeffType {
00042 AV_MIX_COEFF_TYPE_Q8,
00043 AV_MIX_COEFF_TYPE_Q15,
00044 AV_MIX_COEFF_TYPE_FLT,
00045 AV_MIX_COEFF_TYPE_NB,
00046 };
00047
00049 enum AVResampleFilterType {
00050 AV_RESAMPLE_FILTER_TYPE_CUBIC,
00051 AV_RESAMPLE_FILTER_TYPE_BLACKMAN_NUTTALL,
00052 AV_RESAMPLE_FILTER_TYPE_KAISER,
00053 };
00054
00058 unsigned avresample_version(void);
00059
00064 const char *avresample_configuration(void);
00065
00069 const char *avresample_license(void);
00070
00081 const AVClass *avresample_get_class(void);
00082
00088 AVAudioResampleContext *avresample_alloc_context(void);
00089
00096 int avresample_open(AVAudioResampleContext *avr);
00097
00111 void avresample_close(AVAudioResampleContext *avr);
00112
00120 void avresample_free(AVAudioResampleContext **avr);
00121
00144 int avresample_build_matrix(uint64_t in_layout, uint64_t out_layout,
00145 double center_mix_level, double surround_mix_level,
00146 double lfe_mix_level, int normalize, double *matrix,
00147 int stride, enum AVMatrixEncoding matrix_encoding);
00148
00158 int avresample_get_matrix(AVAudioResampleContext *avr, double *matrix,
00159 int stride);
00160
00178 int avresample_set_matrix(AVAudioResampleContext *avr, const double *matrix,
00179 int stride);
00180
00195 int avresample_set_compensation(AVAudioResampleContext *avr, int sample_delta,
00196 int compensation_distance);
00197
00237 int avresample_convert(AVAudioResampleContext *avr, void **output,
00238 int out_plane_size, int out_samples, void **input,
00239 int in_plane_size, int in_samples);
00240
00254 int avresample_get_delay(AVAudioResampleContext *avr);
00255
00271 int avresample_available(AVAudioResampleContext *avr);
00272
00290 int avresample_read(AVAudioResampleContext *avr, void **output, int nb_samples);
00291
00292 #endif