Go to the documentation of this file.
77 int in_ch_count, out_ch_count;
78 char in_layout_string[256];
79 char out_layout_string[256];
84 int out_sample_nb =
size;
101 out_sample_nb = bytestream2_get_le32(&gbc);
103 flags64 = bytestream2_get_le64(&gbc);
113 fprintf(stderr,
"%s %d %s -> %s %d %s\n",
120 fprintf(stderr,
"Failed swr_alloc_set_opts2()\n");
125 fprintf(stderr,
"Failed swr_init()\n");
132 if (in_sample_nb > 1000*1000 || out_sample_nb > 1000*1000)
146 count =
swr_convert(swr, aout, out_sample_nb, (
const uint8_t **)ain, in_sample_nb);
void av_force_cpu_flags(int arg)
Disables cpu detection and forces the specified flags.
@ AV_SAMPLE_FMT_FLTP
float, planar
#define AV_CHANNEL_LAYOUT_STEREO
int in_sample_rate
input sample rate
int av_samples_fill_arrays(uint8_t **audio_data, int *linesize, const uint8_t *buf, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align)
Fill plane data pointers and linesize for samples with sample format sample_fmt.
#define AV_CHANNEL_LAYOUT_2_2
int out_sample_rate
output sample rate
@ AV_SAMPLE_FMT_S32P
signed 32 bits, planar
AVChannelLayout out_ch_layout
output channel layout
int nb_channels
Number of channels in this layout.
#define AV_CHANNEL_LAYOUT_7POINT1_WIDE
enum AVSampleFormat out_sample_fmt
output sample format
#define AV_CHANNEL_LAYOUT_SURROUND
int attribute_align_arg swr_convert(struct SwrContext *s, uint8_t *const *out_arg, int out_count, const uint8_t *const *in_arg, int in_count)
Convert audio.
#define FF_ARRAY_ELEMS(a)
av_cold int swr_init(struct SwrContext *s)
Initialize context after user parameters have been set.
int av_channel_layout_describe(const AVChannelLayout *channel_layout, char *buf, size_t buf_size)
Get a human-readable string describing the channel layout properties.
#define AV_CHANNEL_LAYOUT_4POINT0
#define AV_CHANNEL_LAYOUT_7POINT1
#define AV_CHANNEL_LAYOUT_5POINT0_BACK
const char * av_get_sample_fmt_name(enum AVSampleFormat sample_fmt)
Return the name of sample_fmt, or NULL if sample_fmt is not recognized.
The libswresample context.
AVChannelLayout in_ch_layout
input channel layout
#define AV_CHANNEL_LAYOUT_22POINT2
#define AV_CHANNEL_LAYOUT_5POINT1POINT2_BACK
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.
@ AV_SAMPLE_FMT_U8P
unsigned 8 bits, planar
An AVChannelLayout holds information about the channel layout of audio data.
av_cold void swr_free(SwrContext **ss)
Free the given SwrContext and set the pointer to NULL.
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
@ AV_SAMPLE_FMT_S16P
signed 16 bits, planar
int av_get_bytes_per_sample(enum AVSampleFormat sample_fmt)
Return number of bytes per sample.
#define AV_CHANNEL_LAYOUT_QUAD
@ AV_SAMPLE_FMT_U8
unsigned 8 bits
AVSampleFormat
Audio sample formats.
@ AV_SAMPLE_FMT_S16
signed 16 bits
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
enum AVSampleFormat in_sample_fmt
input sample format
#define AV_CHANNEL_LAYOUT_7POINT0
#define AV_CHANNEL_LAYOUT_2_1
@ AV_SAMPLE_FMT_DBLP
double, planar
int av_channel_layout_copy(AVChannelLayout *dst, const AVChannelLayout *src)
Make a copy of a channel layout.
#define AV_CHANNEL_LAYOUT_MONO
#define AV_CHANNEL_LAYOUT_5POINT1_BACK
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
#define AV_CHANNEL_LAYOUT_5POINT0
@ AV_SAMPLE_FMT_DBL
double
#define AV_CHANNEL_LAYOUT_5POINT1
@ AV_SAMPLE_FMT_S32
signed 32 bits
static const AVChannelLayout layouts[]