FFmpeg  1.2.12
swresample.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2011-2013 Michael Niedermayer (michaelni@gmx.at)
3  *
4  * This file is part of libswresample
5  *
6  * libswresample is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * libswresample is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with libswresample; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef SWRESAMPLE_SWRESAMPLE_H
22 #define SWRESAMPLE_SWRESAMPLE_H
23 
96 #include <stdint.h>
97 #include "libavutil/samplefmt.h"
98 
99 #include "libswresample/version.h"
100 
101 #if LIBSWRESAMPLE_VERSION_MAJOR < 1
102 #define SWR_CH_MAX 32
103 #endif
104 
105 #define SWR_FLAG_RESAMPLE 1
106 //TODO use int resample ?
107 //long term TODO can we enable this dynamically?
108 
114 
124 };
125 
127 enum SwrEngine {
131 };
132 
138 };
139 
140 typedef struct SwrContext SwrContext;
141 
148 const AVClass *swr_get_class(void);
149 
159 struct SwrContext *swr_alloc(void);
160 
166 int swr_init(struct SwrContext *s);
167 
188 struct SwrContext *swr_alloc_set_opts(struct SwrContext *s,
191  int log_offset, void *log_ctx);
192 
196 void swr_free(struct SwrContext **s);
197 
216 int swr_convert(struct SwrContext *s, uint8_t **out, int out_count,
217  const uint8_t **in , int in_count);
218 
232 int64_t swr_next_pts(struct SwrContext *s, int64_t pts);
233 
237 int swr_set_compensation(struct SwrContext *s, int sample_delta, int compensation_distance);
238 
247 int swr_set_channel_mapping(struct SwrContext *s, const int *channel_map);
248 
258 int swr_set_matrix(struct SwrContext *s, const double *matrix, int stride);
259 
263 int swr_drop_output(struct SwrContext *s, int count);
264 
268 int swr_inject_silence(struct SwrContext *s, int count);
269 
290 int64_t swr_get_delay(struct SwrContext *s, int64_t base);
291 
295 unsigned swresample_version(void);
296 
300 const char *swresample_configuration(void);
301 
305 const char *swresample_license(void);
306 
311 #endif /* SWRESAMPLE_SWRESAMPLE_H */