00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef SWRESAMPLE_SWRESAMPLE_H
00022 #define SWRESAMPLE_SWRESAMPLE_H
00023
00096 #include <stdint.h>
00097 #include "libavutil/samplefmt.h"
00098
00099 #include "libswresample/version.h"
00100
00101 #if LIBSWRESAMPLE_VERSION_MAJOR < 1
00102 #define SWR_CH_MAX 32
00103 #endif
00104
00105 #define SWR_FLAG_RESAMPLE 1
00106 //TODO use int resample ?
00107
00108
00109 enum SwrDitherType {
00110 SWR_DITHER_NONE = 0,
00111 SWR_DITHER_RECTANGULAR,
00112 SWR_DITHER_TRIANGULAR,
00113 SWR_DITHER_TRIANGULAR_HIGHPASS,
00114 SWR_DITHER_NB,
00115 };
00116
00118 enum SwrEngine {
00119 SWR_ENGINE_SWR,
00120 SWR_ENGINE_SOXR,
00121 SWR_ENGINE_NB,
00122 };
00123
00125 enum SwrFilterType {
00126 SWR_FILTER_TYPE_CUBIC,
00127 SWR_FILTER_TYPE_BLACKMAN_NUTTALL,
00128 SWR_FILTER_TYPE_KAISER,
00129 };
00130
00131 typedef struct SwrContext SwrContext;
00132
00139 const AVClass *swr_get_class(void);
00140
00150 struct SwrContext *swr_alloc(void);
00151
00157 int swr_init(struct SwrContext *s);
00158
00179 struct SwrContext *swr_alloc_set_opts(struct SwrContext *s,
00180 int64_t out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate,
00181 int64_t in_ch_layout, enum AVSampleFormat in_sample_fmt, int in_sample_rate,
00182 int log_offset, void *log_ctx);
00183
00187 void swr_free(struct SwrContext **s);
00188
00207 int swr_convert(struct SwrContext *s, uint8_t **out, int out_count,
00208 const uint8_t **in , int in_count);
00209
00223 int64_t swr_next_pts(struct SwrContext *s, int64_t pts);
00224
00228 int swr_set_compensation(struct SwrContext *s, int sample_delta, int compensation_distance);
00229
00238 int swr_set_channel_mapping(struct SwrContext *s, const int *channel_map);
00239
00249 int swr_set_matrix(struct SwrContext *s, const double *matrix, int stride);
00250
00254 int swr_drop_output(struct SwrContext *s, int count);
00255
00259 int swr_inject_silence(struct SwrContext *s, int count);
00260
00281 int64_t swr_get_delay(struct SwrContext *s, int64_t base);
00282
00286 unsigned swresample_version(void);
00287
00291 const char *swresample_configuration(void);
00292
00296 const char *swresample_license(void);
00297
00302 #endif