#include <inttypes.h>
#include "libavutil/samplefmt.h"
Go to the source code of this file.
Defines | |
#define | LIBSWRESAMPLE_VERSION_MAJOR 0 |
#define | LIBSWRESAMPLE_VERSION_MINOR 6 |
#define | LIBSWRESAMPLE_VERSION_MICRO 100 |
#define | LIBSWRESAMPLE_VERSION_INT |
#define | SWR_CH_MAX 16 |
Maximum number of channels. | |
#define | SWR_FLAG_RESAMPLE 1 |
Force resampling even if equal sample rate. | |
Functions | |
struct SwrContext * | swr_alloc (void) |
Allocate SwrContext. | |
int | swr_init (struct SwrContext *s) |
Initialize context after user parameters have been set. | |
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) |
Allocate SwrContext if needed and set/reset common parameters. | |
void | swr_free (struct SwrContext **s) |
Free the given SwrContext and set the pointer to NULL. | |
int | swr_convert (struct SwrContext *s, uint8_t *out[SWR_CH_MAX], int out_count, const uint8_t *in[SWR_CH_MAX], int in_count) |
Convert audio. | |
int | swr_set_compensation (struct SwrContext *s, int sample_delta, int compensation_distance) |
Activate resampling compensation. | |
int | swr_set_channel_mapping (struct SwrContext *s, const int *channel_map) |
Set a customized input channel mapping. | |
unsigned | swresample_version (void) |
Return the LIBSWRESAMPLE_VERSION_INT constant. | |
const char * | swresample_configuration (void) |
Return the swr build-time configuration. | |
const char * | swresample_license (void) |
Return the swr license. |
Definition in file swresample.h.
#define LIBSWRESAMPLE_VERSION_INT |
Value:
AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \ LIBSWRESAMPLE_VERSION_MINOR, \ LIBSWRESAMPLE_VERSION_MICRO)
Definition at line 36 of file swresample.h.
Referenced by swresample_version().
#define LIBSWRESAMPLE_VERSION_MAJOR 0 |
Definition at line 32 of file swresample.h.
#define LIBSWRESAMPLE_VERSION_MICRO 100 |
#define LIBSWRESAMPLE_VERSION_MINOR 6 |
Definition at line 33 of file swresample.h.
#define SWR_CH_MAX 16 |
Maximum number of channels.
Definition at line 40 of file swresample.h.
Referenced by config_props(), main(), query_formats(), sane_layout(), and swri_rematrix_init().
#define SWR_FLAG_RESAMPLE 1 |
Force resampling even if equal sample rate.
Definition at line 42 of file swresample.h.
Referenced by do_audio_out(), swr_init(), and swr_set_compensation().
struct SwrContext* swr_alloc | ( | void | ) | [read] |
Allocate SwrContext.
If you use this function you will need to set the parameters (manually or with swr_alloc_set_opts()) before calling swr_init().
Definition at line 97 of file swresample.c.
Referenced by 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 | |||
) | [read] |
Allocate SwrContext if needed and set/reset common parameters.
This function does not require s to be allocated with swr_alloc(). On the other hand, swr_alloc() can use swr_alloc_set_opts() to set the parameters on the allocated context.
s | Swr context, can be NULL | |
out_ch_layout | output channel layout (AV_CH_LAYOUT_*) | |
out_sample_fmt | output sample format (AV_SAMPLE_FMT_*). | |
out_sample_rate | output sample rate (frequency in Hz) | |
in_ch_layout | input channel layout (AV_CH_LAYOUT_*) | |
in_sample_fmt | input sample format (AV_SAMPLE_FMT_*). | |
in_sample_rate | input sample rate (frequency in Hz) | |
log_offset | logging level offset | |
log_ctx | parent logging context, can be NULL |
Definition at line 106 of file swresample.c.
Referenced by audio_decode_frame(), config_props(), do_audio_out(), and main().
int swr_convert | ( | struct SwrContext * | s, | |
uint8_t * | out[SWR_CH_MAX], | |||
int | out_count, | |||
const uint8_t * | in[SWR_CH_MAX], | |||
int | in_count | |||
) |
Convert audio.
in and in_count can be set to 0 to flush the last few samples out at the end.
s | allocated Swr context, with parameters set | |
out | output buffers, only the first one need be set in case of packed audio | |
out_count | amount of space available for output in samples per channel | |
in | input buffers, only the first one need to be set in case of packed audio | |
in_count | number of input samples available in one channel |
Definition at line 416 of file swresample.c.
Referenced by audio_decode_frame(), do_audio_out(), filter_samples_channel_mapping(), and main().
void swr_free | ( | struct SwrContext ** | s | ) |
Free the given SwrContext and set the pointer to NULL.
Definition at line 135 of file swresample.c.
Referenced by audio_decode_frame(), do_audio_out(), stream_component_close(), transcode(), and uninit().
int swr_init | ( | struct SwrContext * | s | ) |
Initialize context after user parameters have been set.
Definition at line 151 of file swresample.c.
Referenced by audio_decode_frame(), config_props(), do_audio_out(), main(), and swr_set_compensation().
int swr_set_channel_mapping | ( | struct SwrContext * | s, | |
const int * | channel_map | |||
) |
Set a customized input channel mapping.
s | allocated Swr context, not yet initialized | |
channel_map | customized input channel mapping (array of channel indexes, -1 for a muted channel) |
Definition at line 90 of file swresample.c.
Referenced by config_props(), and do_audio_out().
int swr_set_compensation | ( | struct SwrContext * | s, | |
int | sample_delta, | |||
int | compensation_distance | |||
) |
Activate resampling compensation.
Definition at line 248 of file resample.c.
Referenced by audio_decode_frame(), and do_audio_out().
const char* swresample_configuration | ( | void | ) |
const char* swresample_license | ( | void | ) |
unsigned swresample_version | ( | void | ) |