debian/tmp/usr/include/libswresample/swresample.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2011 Michael Niedermayer (michaelni@gmx.at)
00003  *
00004  * This file is part of libswresample
00005  *
00006  * libswresample is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * libswresample is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with libswresample; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
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   ///< Maximum number of channels
00041 
00042 #define SWR_FLAG_RESAMPLE 1 ///< Force resampling even if equal sample rate
00043 //TODO use int resample ?
00044 //long term TODO can we enable this dynamically?
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