Commit 6dcca2b9 authored by Adrien Béraud's avatar Adrien Béraud

rotation: fix build with ffmpeg < 4.0

Change-Id: I975fb3844b135c7eb15357558e52f9bbfee13237
parent fb6dbb06
......@@ -39,6 +39,11 @@ extern "C" {
#include <libavutil/intreadwrite.h>
#include <libavutil/log.h>
#include <libavutil/samplefmt.h>
#if LIBAVUTIL_VERSION_MAJOR < 56
AVFrameSideData*
av_frame_new_side_data_from_buf(AVFrame* frame, enum AVFrameSideDataType type, AVBufferRef* buf);
#endif
}
#include "libav_utils.h"
......
......@@ -23,7 +23,9 @@
#include "libav_deps.h" // MUST BE INCLUDED FIRST
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "video/video_base.h"
#include "logger.h"
......@@ -36,6 +38,20 @@
#include <exception>
#include <ciso646> // fix windows compiler bug
extern "C" {
#if LIBAVUTIL_VERSION_MAJOR < 56
AVFrameSideData*
av_frame_new_side_data_from_buf(AVFrame* frame, enum AVFrameSideDataType type, AVBufferRef* buf)
{
auto side_data = av_frame_new_side_data(frame, type, 0);
av_buffer_unref(&side_data->buf);
side_data->buf = buf;
side_data->data = side_data->buf->data;
side_data->size = side_data->buf->size;
}
#endif
}
namespace ring { namespace libav_utils {
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 9, 100)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment