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, int64_t out_ch_layout, AVSampleFormat out_sample_fmt, int out_sample_rate, int64_t 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_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, AVFrame* out_frame, AVFrame* in_frame)

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

swr_convert
int swr_convert(SwrContext* s, uint8_t** out_b, int out_count, uint8_t** in_b, int in_count)

Convert audio.

swr_convert_frame
int swr_convert_frame(SwrContext* swr, AVFrame* output, 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
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
int64_t swr_get_delay(SwrContext* s, int64_t 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
int64_t swr_next_pts(SwrContext* s, int64_t 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, 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, double* matrix, int stride)

Set a customized remix matrix.

swresample_configuration
char* swresample_configuration()

Return the swr build-time configuration.

swresample_license
char* swresample_license()

Return the swr license.

swresample_version
uint swresample_version()

Return the @ref LIBSWRESAMPLE_VERSION_INT constant.

Manifest constants

SWR_CH_MAX
enum SWR_CH_MAX;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
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