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 5
00034 #define LIBSWRESAMPLE_VERSION_MICRO 0
00035
00036 #define SWR_CH_MAX 16
00037
00038 #define SWR_FLAG_RESAMPLE 1
00039 //TODO use int resample ?
00040
00041
00042
00043 struct SwrContext;
00044
00054 struct SwrContext *swr_alloc(void);
00055
00061 int swr_init(struct SwrContext *s);
00062
00083 struct SwrContext *swr_alloc_set_opts(struct SwrContext *s,
00084 int64_t out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate,
00085 int64_t in_ch_layout, enum AVSampleFormat in_sample_fmt, int in_sample_rate,
00086 int log_offset, void *log_ctx);
00087
00091 void swr_free(struct SwrContext **s);
00092
00107 int swr_convert(struct SwrContext *s, uint8_t *out[SWR_CH_MAX], int out_count,
00108 const uint8_t *in [SWR_CH_MAX], int in_count);
00109
00113 void swr_compensate(struct SwrContext *s, int sample_delta, int compensation_distance);
00114
00123 int swr_set_channel_mapping(struct SwrContext *s, const int *channel_map);
00124
00125 #endif