mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-09-20 13:08:50 +02:00
2e79d4c902
Also modifies libobs & deps/media-playback.
AV_CODEC_CAP_TRUNCATED was removed in avcodec 60 [1].
We ifdef the code depending on it to allow compilation.
[1] avcodec: remove FF_API_FLAG_TRUNCATED
3ceffe7839
Signed-off-by: pkv <pkv@obsproject.com>
36 lines
1.2 KiB
C
36 lines
1.2 KiB
C
#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 */
|
|
#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)))
|
|
|
|
#if !LIBAVCODEC_VERSION_CHECK(54, 28, 0, 59, 100)
|
|
#define avcodec_free_frame av_freep
|
|
#endif
|
|
|
|
#if LIBAVCODEC_VERSION_INT < 0x371c01
|
|
#define av_frame_alloc avcodec_alloc_frame
|
|
#define av_frame_unref avcodec_get_frame_defaults
|
|
#define av_frame_free avcodec_free_frame
|
|
#endif
|
|
|
|
#if LIBAVCODEC_VERSION_MAJOR >= 58
|
|
#if LIBAVCODEC_VERSION_MAJOR < 60
|
|
#define CODEC_CAP_TRUNC AV_CODEC_CAP_TRUNCATED
|
|
#define CODEC_FLAG_TRUNC AV_CODEC_FLAG_TRUNCATED
|
|
#endif
|
|
#define INPUT_BUFFER_PADDING_SIZE AV_INPUT_BUFFER_PADDING_SIZE
|
|
#else
|
|
#define CODEC_CAP_TRUNC CODEC_CAP_TRUNCATED
|
|
#define CODEC_FLAG_TRUNC CODEC_FLAG_TRUNCATED
|
|
#define INPUT_BUFFER_PADDING_SIZE FF_INPUT_BUFFER_PADDING_SIZE
|
|
#endif
|