World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
swresample.h
См. документацию.
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 
122 #include <stdint.h>
124 #include "libavutil/frame.h"
125 #include "libavutil/samplefmt.h"
126 
127 #include "libswresample/version.h"
128 
136 #define SWR_FLAG_RESAMPLE 1
137 //TODO use int resample ?
138 //long term TODO can we enable this dynamically?
139 
146 
156 };
157 
159 enum SwrEngine {
163 };
164 
170 };
171 
182 typedef struct SwrContext SwrContext;
183 
191 const AVClass *swr_get_class(void);
192 
207 struct SwrContext *swr_alloc(void);
208 
219 int swr_init(struct SwrContext *s);
220 
228 int swr_is_initialized(struct SwrContext *s);
229 
250 struct SwrContext *swr_alloc_set_opts(struct SwrContext *s,
251  int64_t out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate,
252  int64_t in_ch_layout, enum AVSampleFormat in_sample_fmt, int in_sample_rate,
253  int log_offset, void *log_ctx);
254 
267 void swr_free(struct SwrContext **s);
268 
279 void swr_close(struct SwrContext *s);
280 
306 int swr_convert(struct SwrContext *s, uint8_t **out, int out_count,
307  const uint8_t **in , int in_count);
308 
326 int64_t swr_next_pts(struct SwrContext *s, int64_t pts);
327 
353 int swr_set_compensation(struct SwrContext *s, int sample_delta, int compensation_distance);
354 
363 int swr_set_channel_mapping(struct SwrContext *s, const int *channel_map);
364 
388 int swr_build_matrix(uint64_t in_layout, uint64_t out_layout,
389  double center_mix_level, double surround_mix_level,
390  double lfe_mix_level, double rematrix_maxval,
391  double rematrix_volume, double *matrix,
392  int stride, enum AVMatrixEncoding matrix_encoding,
393  void *log_ctx);
394 
404 int swr_set_matrix(struct SwrContext *s, const double *matrix, int stride);
405 
424 int swr_drop_output(struct SwrContext *s, int count);
425 
437 int swr_inject_silence(struct SwrContext *s, int count);
438 
463 int64_t swr_get_delay(struct SwrContext *s, int64_t base);
464 
481 int swr_get_out_samples(struct SwrContext *s, int in_samples);
482 
498 unsigned swresample_version(void);
499 
505 const char *swresample_configuration(void);
506 
512 const char *swresample_license(void);
513 
556  AVFrame *output, const AVFrame *input);
557 
572 int swr_config_frame(SwrContext *swr, const AVFrame *out, const AVFrame *in);
573 
579 #endif /* SWRESAMPLE_SWRESAMPLE_H */
SWR_DITHER_TRIANGULAR_HIGHPASS
@ SWR_DITHER_TRIANGULAR_HIGHPASS
Definition: swresample.h:145
s
GLdouble s
Definition: SDL_opengl.h:2063
SWR_DITHER_NS_LOW_SHIBATA
@ SWR_DITHER_NS_LOW_SHIBATA
Definition: swresample.h:153
SWR_DITHER_NS_IMPROVED_E_WEIGHTED
@ SWR_DITHER_NS_IMPROVED_E_WEIGHTED
Definition: swresample.h:151
swr_set_compensation
int swr_set_compensation(struct SwrContext *s, int sample_delta, int compensation_distance)
SWR_DITHER_NS_MODIFIED_E_WEIGHTED
@ SWR_DITHER_NS_MODIFIED_E_WEIGHTED
Definition: swresample.h:150
in
GLuint in
Definition: SDL_opengl_glext.h:7943
SwrDitherType
SwrDitherType
Definition: swresample.h:141
swr_set_channel_mapping
int swr_set_channel_mapping(struct SwrContext *s, const int *channel_map)
count
GLuint GLuint GLsizei count
Definition: SDL_opengl.h:1571
swr_set_matrix
int swr_set_matrix(struct SwrContext *s, const double *matrix, int stride)
SWR_ENGINE_SOXR
@ SWR_ENGINE_SOXR
Definition: swresample.h:161
SWR_FILTER_TYPE_BLACKMAN_NUTTALL
@ SWR_FILTER_TYPE_BLACKMAN_NUTTALL
Definition: swresample.h:168
int64_t
__int64 int64_t
Definition: alext.h:31
swr_is_initialized
int swr_is_initialized(struct SwrContext *s)
samplefmt.h
input
GLenum GLenum GLenum input
Definition: SDL_opengl_glext.h:9377
SWR_FILTER_TYPE_KAISER
@ SWR_FILTER_TYPE_KAISER
Definition: swresample.h:169
uint64_t
unsigned __int64 uint64_t
Definition: alext.h:32
swr_next_pts
int64_t swr_next_pts(struct SwrContext *s, int64_t pts)
swr_get_delay
int64_t swr_get_delay(struct SwrContext *s, int64_t base)
SWR_DITHER_NB
@ SWR_DITHER_NB
not part of API/ABI
Definition: swresample.h:155
swr_inject_silence
int swr_inject_silence(struct SwrContext *s, int count)
swr_init
int swr_init(struct SwrContext *s)
swr_alloc
struct SwrContext * swr_alloc(void)
SWR_DITHER_NS
@ SWR_DITHER_NS
not part of API/ABI
Definition: swresample.h:147
SWR_ENGINE_NB
@ SWR_ENGINE_NB
not part of API/ABI
Definition: swresample.h:162
swr_alloc_set_opts
struct SwrContext * swr_alloc_set_opts(struct SwrContext *s, int64_t out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate, int64_t in_ch_layout, enum AVSampleFormat in_sample_fmt, int in_sample_rate, int log_offset, void *log_ctx)
AVMatrixEncoding
AVMatrixEncoding
Definition: channel_layout.h:114
SwrFilterType
SwrFilterType
Definition: swresample.h:166
swr_get_class
const AVClass * swr_get_class(void)
swresample_license
const char * swresample_license(void)
stride
EGLImageKHR EGLint EGLint EGLint * stride
Definition: SDL_egl.h:1497
SWR_DITHER_NONE
@ SWR_DITHER_NONE
Definition: swresample.h:142
SWR_DITHER_TRIANGULAR
@ SWR_DITHER_TRIANGULAR
Definition: swresample.h:144
swr_convert_frame
int swr_convert_frame(SwrContext *swr, AVFrame *output, const AVFrame *input)
SwrContext
struct SwrContext SwrContext
Definition: swresample.h:182
swr_drop_output
int swr_drop_output(struct SwrContext *s, int count)
SWR_FILTER_TYPE_CUBIC
@ SWR_FILTER_TYPE_CUBIC
Definition: swresample.h:167
swr_free
void swr_free(struct SwrContext **s)
swr_convert
int swr_convert(struct SwrContext *s, uint8_t **out, int out_count, const uint8_t **in, int in_count)
AVClass
Definition: log.h:67
frame.h
SWR_ENGINE_SWR
@ SWR_ENGINE_SWR
Definition: swresample.h:160
SwrEngine
SwrEngine
Definition: swresample.h:159
swr_config_frame
int swr_config_frame(SwrContext *swr, const AVFrame *out, const AVFrame *in)
uint8_t
unsigned __int8 uint8_t
Definition: SDL_config.h:35
AVSampleFormat
AVSampleFormat
Definition: samplefmt.h:58
channel_layout.h
SWR_DITHER_NS_SHIBATA
@ SWR_DITHER_NS_SHIBATA
Definition: swresample.h:152
SWR_DITHER_NS_HIGH_SHIBATA
@ SWR_DITHER_NS_HIGH_SHIBATA
Definition: swresample.h:154
swr_get_out_samples
int swr_get_out_samples(struct SwrContext *s, int in_samples)
matrix
GLuint GLenum matrix
Definition: SDL_opengl_glext.h:9999
SWR_DITHER_NS_LIPSHITZ
@ SWR_DITHER_NS_LIPSHITZ
Definition: swresample.h:148
swr_close
void swr_close(struct SwrContext *s)
swresample_configuration
const char * swresample_configuration(void)
swr_build_matrix
int swr_build_matrix(uint64_t in_layout, uint64_t out_layout, double center_mix_level, double surround_mix_level, double lfe_mix_level, double rematrix_maxval, double rematrix_volume, double *matrix, int stride, enum AVMatrixEncoding matrix_encoding, void *log_ctx)
AVFrame
Definition: frame.h:295
SWR_DITHER_NS_F_WEIGHTED
@ SWR_DITHER_NS_F_WEIGHTED
Definition: swresample.h:149
version.h
swresample_version
unsigned swresample_version(void)
SWR_DITHER_RECTANGULAR
@ SWR_DITHER_RECTANGULAR
Definition: swresample.h:143