Open Broadcaster Software
Free, open source software for live streaming and recording
obs-ffmpeg-compat.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <libavcodec/avcodec.h>
4
5
/* LIBAVCODEC_VERSION_CHECK checks for the right version of libav and FFmpeg
6
* a is the major version
7
* b and c the minor and micro versions of libav
8
* d and e the minor and micro versions of FFmpeg */
9
#define LIBAVCODEC_VERSION_CHECK( a, b, c, d, e ) \
10
( (LIBAVCODEC_VERSION_MICRO < 100 && LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( a, b, c ) ) || \
11
(LIBAVCODEC_VERSION_MICRO >= 100 && LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( a, d, e ) ) )
12
13
#if !LIBAVCODEC_VERSION_CHECK(54, 28, 0, 59, 100)
14
# define avcodec_free_frame av_freep
15
#endif
16
17
#if LIBAVCODEC_VERSION_INT < 0x371c01
18
# define av_frame_alloc avcodec_alloc_frame
19
# define av_frame_unref avcodec_get_frame_defaults
20
# define av_frame_free avcodec_free_frame
21
#endif
22
23
#if LIBAVCODEC_VERSION_MAJOR >= 58
24
#define CODEC_CAP_TRUNC AV_CODEC_CAP_TRUNCATED
25
#define CODEC_FLAG_TRUNC AV_CODEC_FLAG_TRUNCATED
26
#define INPUT_BUFFER_PADDING_SIZE AV_INPUT_BUFFER_PADDING_SIZE
27
#else
28
#define CODEC_CAP_TRUNC CODEC_CAP_TRUNCATED
29
#define CODEC_FLAG_TRUNC CODEC_FLAG_TRUNCATED
30
#define INPUT_BUFFER_PADDING_SIZE FF_INPUT_BUFFER_PADDING_SIZE
31
#endif
libobs
obs-ffmpeg-compat.h
Generated on Sat Mar 31 2018 11:21:00 for Open Broadcaster Software by
1.8.13