31#if LIBAVUTIL_VERSION_MAJOR < 56
35 auto side_data = av_frame_new_side_data(frame, type, 0);
38 side_data->data = side_data->buf->data;
39 side_data->size = side_data->buf->size;
46namespace libav_utils {
51 if (codec->sample_fmts)
53 for (
const auto*
it = codec->sample_fmts; *
it != -1; ++
it) {
77#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 9, 100)
82 auto mutex =
reinterpret_cast<std::mutex**
>(data);
87 *mutex =
new std::mutex;
88 }
catch (
const std::bad_alloc&
e) {
146 if (
line[idx] < 0x08 || (
line[idx] > 0x0D &&
line[idx] < 0x20))
190#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58, 9, 100)
195#if LIBAVFILTER_VERSION_INT < AV_VERSION_INT(7, 13, 100)
199#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 9, 100)
227 for (
unsigned i = 0;
i <
desc.nb_components; ++
i)
269 JAMI_ERR() <<
"Failed to blacken frame";
279 frame->ch_layout.nb_channels,
282 JAMI_ERR() <<
"Failed to fill frame with silence";
289 static_cast<unsigned>(
frame->ch_layout.nb_channels),
AVFrameSideData * av_frame_new_side_data_from_buf(AVFrame *frame, enum AVFrameSideDataType type, AVBufferRef *buf)
void av_buffer_unref(AVBufferRef **buf)
static std::once_flag already_called
AVSampleFormat choose_sample_fmt(const AVCodec *codec, const AVSampleFormat *preferred_formats, int preferred_formats_count)
void fillWithBlack(AVFrame *frame)
const char * getDictValue(const AVDictionary *d, const std::string &key, int flags)
void setDictValue(AVDictionary **d, const std::string &key, const std::string &value, int flags)
AVSampleFormat choose_sample_fmt_default(const AVCodec *codec, AVSampleFormat defaultFormat)
void fillWithSilence(AVFrame *frame)
AudioFormat getFormat(const AVFrame *frame)
bool is_yuv_planar(const AVPixFmtDescriptor &desc)
std::string getError(int err)
static void setAvLogLevel()
static constexpr const char * AVLOGLEVEL
void emitSignal(Args... args)