23#include <libswresample/swresample.h>
44 JAMI_ERR() <<
"Unable to allocate resampler context";
45 throw std::bad_alloc();
70 if (
out->ch_layout.nb_channels == 2) {
101 std::swap(swrCtx_,
swrCtx);
105 std::string
msg =
"Failed to initialize resampler context";
107 throw std::runtime_error(
msg);
122 if (initCount_ > 1) {
123 JAMI_ERROR(
"Infinite loop detected in audio resampler, please open an issue on https://git.jami.net");
124 throw std::runtime_error(
"Resampler");
128 }
else if (
ret < 0) {
138std::unique_ptr<AudioFrame>
142 &&
in->pointer()->ch_layout.nb_channels == (
int) format.
nb_channels
144 return std::move(
in);
146 auto output = std::make_unique<AudioFrame>(format);
152std::shared_ptr<AudioFrame>
159 if (
inPtr ==
nullptr) {
166 return std::move(
in);
169 auto output = std::make_shared<AudioFrame>(format);
int resample(const AVFrame *input, AVFrame *output)
Resample a frame.
#define JAMI_ERROR(formatstr,...)
void emitSignal(Args... args)