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 15
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 #if LIBSWRESAMPLE_VERSION_MAJOR < 1
00041 #define SWR_CH_MAX 32
00042 #endif
00043
00044 #define SWR_FLAG_RESAMPLE 1
00045 //TODO use int resample ?
00046
00047
00048 enum SwrDitherType {
00049 SWR_DITHER_NONE = 0,
00050 SWR_DITHER_RECTANGULAR,
00051 SWR_DITHER_TRIANGULAR,
00052 SWR_DITHER_TRIANGULAR_HIGHPASS,
00053 SWR_DITHER_NB,
00054 };
00055
00056 typedef struct SwrContext SwrContext;
00057
00064 const AVClass *swr_get_class(void);
00065
00075 struct SwrContext *swr_alloc(void);
00076
00082 int swr_init(struct SwrContext *s);
00083
00104 struct SwrContext *swr_alloc_set_opts(struct SwrContext *s,
00105 int64_t out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate,
00106 int64_t in_ch_layout, enum AVSampleFormat in_sample_fmt, int in_sample_rate,
00107 int log_offset, void *log_ctx);
00108
00112 void swr_free(struct SwrContext **s);
00113
00132 int swr_convert(struct SwrContext *s, uint8_t **out, int out_count,
00133 const uint8_t **in , int in_count);
00134
00148 int64_t swr_next_pts(struct SwrContext *s, int64_t pts);
00149
00153 int swr_set_compensation(struct SwrContext *s, int sample_delta, int compensation_distance);
00154
00163 int swr_set_channel_mapping(struct SwrContext *s, const int *channel_map);
00164
00174 int swr_set_matrix(struct SwrContext *s, const double *matrix, int stride);
00175
00179 int swr_drop_output(struct SwrContext *s, int count);
00180
00184 int swr_inject_silence(struct SwrContext *s, int count);
00185
00202 int64_t swr_get_delay(struct SwrContext *s, int64_t base);
00203
00207 unsigned swresample_version(void);
00208
00212 const char *swresample_configuration(void);
00213
00217 const char *swresample_license(void);
00218
00219 #endif