2014-04-05 07:12:32 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <libavcodec/avcodec.h>
|
|
|
|
|
|
|
|
/* LIBAVCODEC_VERSION_CHECK checks for the right version of libav and FFmpeg
|
|
|
|
* a is the major version
|
|
|
|
* b and c the minor and micro versions of libav
|
|
|
|
* d and e the minor and micro versions of FFmpeg */
|
2019-06-22 22:13:45 -07:00
|
|
|
#define LIBAVCODEC_VERSION_CHECK(a, b, c, d, e) \
|
|
|
|
((LIBAVCODEC_VERSION_MICRO < 100 && \
|
|
|
|
LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(a, b, c)) || \
|
|
|
|
(LIBAVCODEC_VERSION_MICRO >= 100 && \
|
|
|
|
LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(a, d, e)))
|
2014-04-05 07:12:32 -07:00
|
|
|
|
|
|
|
#if !LIBAVCODEC_VERSION_CHECK(54, 28, 0, 59, 100)
|
2019-06-22 22:13:45 -07:00
|
|
|
#define avcodec_free_frame av_freep
|
2014-04-05 07:12:32 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if LIBAVCODEC_VERSION_INT < 0x371c01
|
2019-06-22 22:13:45 -07:00
|
|
|
#define av_frame_alloc avcodec_alloc_frame
|
|
|
|
#define av_frame_unref avcodec_get_frame_defaults
|
|
|
|
#define av_frame_free avcodec_free_frame
|
2014-04-05 07:12:32 -07:00
|
|
|
#endif
|
|
|
|
|
2016-04-08 23:42:36 -07:00
|
|
|
#if LIBAVCODEC_VERSION_MAJOR >= 57
|
|
|
|
#define av_free_packet av_packet_unref
|
|
|
|
#endif
|
2017-10-29 15:50:01 -07:00
|
|
|
|
|
|
|
#if LIBAVCODEC_VERSION_MAJOR >= 58
|
|
|
|
#define CODEC_CAP_TRUNC AV_CODEC_CAP_TRUNCATED
|
|
|
|
#define CODEC_FLAG_TRUNC AV_CODEC_FLAG_TRUNCATED
|
|
|
|
#define CODEC_FLAG_GLOBAL_H AV_CODEC_FLAG_GLOBAL_HEADER
|
|
|
|
#else
|
|
|
|
#define CODEC_CAP_TRUNC CODEC_CAP_TRUNCATED
|
|
|
|
#define CODEC_FLAG_TRUNC CODEC_FLAG_TRUNCATED
|
|
|
|
#define CODEC_FLAG_GLOBAL_H CODEC_FLAG_GLOBAL_HEADER
|
|
|
|
#endif
|