Go to the documentation of this file.
21 #ifndef SWRESAMPLE_SWRESAMPLE_H
22 #define SWRESAMPLE_SWRESAMPLE_H
129 #ifndef HAVE_AV_CONFIG_H
143 #define SWR_FLAG_RESAMPLE 1
144 //TODO use int resample ?
262 int log_offset,
void *
log_ctx);
315 const uint8_t *
const *
in ,
int in_count);
397 double center_mix_level,
double surround_mix_level,
@ SWR_DITHER_TRIANGULAR_HIGHPASS
@ SWR_DITHER_NS_LOW_SHIBATA
int in_sample_rate
input sample rate
@ SWR_DITHER_NS_IMPROVED_E_WEIGHTED
int swr_set_compensation(struct SwrContext *s, int sample_delta, int compensation_distance)
Activate resampling compensation ("soft" compensation).
@ SWR_DITHER_NS_MODIFIED_E_WEIGHTED
filter_frame For filters that do not use the this method is called when a frame is pushed to the filter s input It can be called at any time except in a reentrant way If the input frame is enough to produce output
This structure describes decoded (raw) audio or video data.
SwrDitherType
Dithering algorithms.
int out_sample_rate
output sample rate
AVChannelLayout out_ch_layout
output channel layout
int swr_set_channel_mapping(struct SwrContext *s, const int *channel_map)
Set a customized input channel mapping.
int matrix_encoding
matrixed stereo encoding
int swr_set_matrix(struct SwrContext *s, const double *matrix, int stride)
Set a customized remix matrix.
@ SWR_ENGINE_SOXR
SoX Resampler.
@ SWR_FILTER_TYPE_BLACKMAN_NUTTALL
Blackman Nuttall windowed sinc.
enum AVSampleFormat out_sample_fmt
output sample format
int swr_is_initialized(struct SwrContext *s)
Check whether an swr context has been initialized or not.
@ SWR_FILTER_TYPE_KAISER
Kaiser windowed sinc.
int64_t swr_next_pts(struct SwrContext *s, int64_t pts)
Convert the next timestamp from input to output timestamps are in 1/(in_sample_rate * out_sample_rate...
int swr_convert(struct SwrContext *s, uint8_t *const *out, int out_count, const uint8_t *const *in, int in_count)
Convert audio.
int64_t swr_get_delay(struct SwrContext *s, int64_t base)
Gets the delay the next input sample will experience relative to the next output sample.
@ SWR_DITHER_NB
not part of API/ABI
int swr_inject_silence(struct SwrContext *s, int count)
Injects the specified number of silence samples.
int swr_init(struct SwrContext *s)
Initialize context after user parameters have been set.
float lfe_mix_level
LFE mixing level.
struct SwrContext * swr_alloc(void)
Allocate SwrContext.
@ SWR_DITHER_NS
not part of API/ABI
static const uint8_t channel_map[8][8]
@ SWR_ENGINE_NB
not part of API/ABI
The libswresample context.
int swr_build_matrix2(const AVChannelLayout *in_layout, const AVChannelLayout *out_layout, double center_mix_level, double surround_mix_level, double lfe_mix_level, double maxval, double rematrix_volume, double *matrix, ptrdiff_t stride, enum AVMatrixEncoding matrix_encoding, void *log_context)
Generate a channel mixing matrix.
AVChannelLayout in_ch_layout
input channel layout
Describe the class of an AVClass context structure.
SwrFilterType
Resampling Filter Types.
const AVClass * swr_get_class(void)
Get the AVClass for SwrContext.
const char * swresample_license(void)
Return the swr license.
void * log_ctx
parent logging context
int swr_alloc_set_opts2(struct SwrContext **ps, const AVChannelLayout *out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate, const AVChannelLayout *in_ch_layout, enum AVSampleFormat in_sample_fmt, int in_sample_rate, int log_offset, void *log_ctx)
Allocate SwrContext if needed and set/reset common parameters.
int swr_convert_frame(SwrContext *swr, AVFrame *output, const AVFrame *input)
Convert the samples in the input AVFrame and write them to the output AVFrame.
An AVChannelLayout holds information about the channel layout of audio data.
int swr_drop_output(struct SwrContext *s, int count)
Drops the specified number of output samples.
@ SWR_FILTER_TYPE_CUBIC
Cubic.
void swr_free(struct SwrContext **s)
Free the given SwrContext and set the pointer to NULL.
@ SWR_ENGINE_SWR
SW Resampler.
and forward the test the status of outputs and forward it to the corresponding return FFERROR_NOT_READY If the filters stores internally one or a few frame for some input
SwrEngine
Resampling Engines.
int swr_config_frame(SwrContext *swr, const AVFrame *out, const AVFrame *in)
Configure or reconfigure the SwrContext using the information provided by the AVFrames.
AVSampleFormat
Audio sample formats.
float rematrix_volume
rematrixing volume coefficient
enum AVSampleFormat in_sample_fmt
input sample format
@ SWR_DITHER_NS_HIGH_SHIBATA
int swr_get_out_samples(struct SwrContext *s, int in_samples)
Find an upper bound on the number of samples that the next swr_convert call will output,...
AudioData in
input audio data
void swr_close(struct SwrContext *s)
Closes the context so that swr_is_initialized() returns 0.
const char * swresample_configuration(void)
Return the swr build-time configuration.
@ SWR_DITHER_NS_F_WEIGHTED
unsigned swresample_version(void)
Return the LIBSWRESAMPLE_VERSION_INT constant.