36#if LIBAVUTIL_VERSION_MAJOR < 56
40 auto side_data = av_frame_new_side_data(frame, type, 0);
43 side_data->data = side_data->buf->data;
44 side_data->size = side_data->buf->size;
51namespace libav_utils {
58 if (codec->sample_fmts)
60 for (
auto it = codec->sample_fmts; *
it != -1; ++
it) {
86#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 9, 100)
91 auto mutex =
reinterpret_cast<std::mutex**
>(data);
96 *mutex =
new std::mutex;
97 }
catch (
const std::bad_alloc&
e) {
155 if (
line[idx] < 0x08 || (
line[idx] > 0x0D &&
line[idx] < 0x20))
199#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58, 9, 100)
204#if LIBAVFILTER_VERSION_INT < AV_VERSION_INT(7, 13, 100)
208#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 9, 100)
236 for (
unsigned i = 0;
i <
desc.nb_components; ++
i)
283 JAMI_ERR() <<
"Failed to blacken frame";
293 frame->ch_layout.nb_channels,
296 JAMI_ERR() <<
"Failed to fill frame with silence";
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)
bool is_yuv_planar(const AVPixFmtDescriptor &desc)
std::string getError(int err)
static void setAvLogLevel()
static constexpr const char * AVLOGLEVEL
void emitSignal(Args... args)