ffmpeg.libswresample.swresample

Undocumented in source.

Members

Enums

SwrDitherType
enum SwrDitherType

Dithering algorithms

SwrEngine
enum SwrEngine

Resampling Engines

SwrFilterType
enum SwrFilterType

Resampling Filter Types

Functions

swr_alloc
SwrContext* swr_alloc()

Allocate SwrContext.

swr_alloc_set_opts
SwrContext* swr_alloc_set_opts(SwrContext* s, long out_ch_layout, AVSampleFormat out_sample_fmt, int out_sample_rate, long in_ch_layout, AVSampleFormat in_sample_fmt, int in_sample_rate, int log_offset, void* log_ctx)

Allocate SwrContext if needed and set/reset common parameters.

swr_build_matrix
int swr_build_matrix(ulong in_layout, ulong out_layout, double center_mix_level, double surround_mix_level, double lfe_mix_level, double rematrix_maxval, double rematrix_volume, double* matrix, int stride, AVMatrixEncoding matrix_encoding, void* log_ctx)

Generate a channel mixing matrix.

swr_close
void swr_close(SwrContext* s)

Closes the context so that swr_is_initialized() returns 0.

swr_config_frame
int swr_config_frame(SwrContext* swr, const(AVFrame)* out_, const(AVFrame)* in_)

Configure or reconfigure the SwrContext using the information provided by the AVFrames.

swr_convert
int swr_convert(SwrContext* s, ubyte** out_, int out_count, const(ubyte*)* in_, int in_count)

Convert audio.

swr_convert_frame
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.

swr_drop_output
int swr_drop_output(SwrContext* s, int count)

Drops the specified number of output samples.

swr_free
void swr_free(SwrContext** s)

Free the given SwrContext and set the pointer to NULL.

swr_get_class
const(AVClass)* swr_get_class()

Get the AVClass for SwrContext. It can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options.

swr_get_delay
long swr_get_delay(SwrContext* s, long base)

Gets the delay the next input sample will experience relative to the next output sample.

swr_get_out_samples
int swr_get_out_samples(SwrContext* s, int in_samples)

Find an upper bound on the number of samples that the next swr_convert call will output, if called with in_samples of input samples. This depends on the internal state, and anything changing the internal state (like further swr_convert() calls) will may change the number of samples swr_get_out_samples() returns for the same number of input samples.

swr_init
int swr_init(SwrContext* s)

Initialize context after user parameters have been set. @note The context must be configured using the AVOption API.

swr_inject_silence
int swr_inject_silence(SwrContext* s, int count)

Injects the specified number of silence samples.

swr_is_initialized
int swr_is_initialized(SwrContext* s)

Check whether an swr context has been initialized or not.

swr_next_pts
long swr_next_pts(SwrContext* s, long pts)

Convert the next timestamp from input to output timestamps are in 1/(in_sample_rate * out_sample_rate) units.

swr_set_channel_mapping
int swr_set_channel_mapping(SwrContext* s, const(int)* channel_map)

Set a customized input channel mapping.

swr_set_compensation
int swr_set_compensation(SwrContext* s, int sample_delta, int compensation_distance)

Activate resampling compensation ("soft" compensation). This function is internally called when needed in swr_next_pts().

swr_set_matrix
int swr_set_matrix(SwrContext* s, const(double)* matrix, int stride)

Set a customized remix matrix.

swresample_configuration
const(char)* swresample_configuration()

Return the swr build-time configuration.

swresample_license
const(char)* swresample_license()

Return the swr license.

swresample_version
uint swresample_version()

Return the @ref LIBSWRESAMPLE_VERSION_INT constant.

Manifest constants

SWR_FLAG_RESAMPLE
enum SWR_FLAG_RESAMPLE;

* @name Option constants * These constants are used for the @ref avoptions interface for lswr. * @{ * *////< Force resampling even if equal sample rat

Structs

SwrContext
struct SwrContext

The libswresample context. Unlike libavcodec and libavformat, this structure is opaque. This means that if you would like to set options, you must use the @ref avoptions API and cannot directly set values to members of the structure.

Meta