00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00026 #ifndef SWR_H
00027 #define SWR_H
00028
00029 #include <inttypes.h>
00030 #include "libavutil/samplefmt.h"
00031
00032 #define LIBSWRESAMPLE_VERSION_MAJOR 0
00033 #define LIBSWRESAMPLE_VERSION_MINOR 6
00034 #define LIBSWRESAMPLE_VERSION_MICRO 100
00035
00036 #define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \
00037 LIBSWRESAMPLE_VERSION_MINOR, \
00038 LIBSWRESAMPLE_VERSION_MICRO)
00039
00040 #define SWR_CH_MAX 16
00041
00042 #define SWR_FLAG_RESAMPLE 1
00043 //TODO use int resample ?
00044
00045
00046
00047 struct SwrContext;
00048
00058 struct SwrContext *swr_alloc(void);
00059
00065 int swr_init(struct SwrContext *s);
00066
00087 struct SwrContext *swr_alloc_set_opts(struct SwrContext *s,
00088 int64_t out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate,
00089 int64_t in_ch_layout, enum AVSampleFormat in_sample_fmt, int in_sample_rate,
00090 int log_offset, void *log_ctx);
00091
00095 void swr_free(struct SwrContext **s);
00096
00111 int swr_convert(struct SwrContext *s, uint8_t *out[SWR_CH_MAX], int out_count,
00112 const uint8_t *in [SWR_CH_MAX], int in_count);
00113
00117 int swr_set_compensation(struct SwrContext *s, int sample_delta, int compensation_distance);
00118
00127 int swr_set_channel_mapping(struct SwrContext *s, const int *channel_map);
00128
00132 unsigned swresample_version(void);
00133
00137 const char *swresample_configuration(void);
00138
00142 const char *swresample_license(void);
00143
00144 #endif