-
Notifications
You must be signed in to change notification settings - Fork 51
/
common.hpp
64 lines (52 loc) · 1.51 KB
/
common.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef _AV_TRANSCODER_COMMON_HPP_
#define _AV_TRANSCODER_COMMON_HPP_
#define AVTRANSCODER_VERSION_MAJOR 0
#define AVTRANSCODER_VERSION_MINOR 15
#define AVTRANSCODER_VERSION_MICRO 0
#include <AvTranscoder/system.hpp>
extern "C" {
#ifndef __STDC_CONSTANT_MACROS
#define __STDC_CONSTANT_MACROS
#endif
#ifndef INT64_C
#define INT64_C(c) (c##LL)
#define UINT64_C(c) (c##ULL)
#endif
#include <libavcodec/version.h>
#include <libavutil/rational.h>
}
#include <string>
#ifdef SWIG
#define AvExport
#else
#if defined(__WINDOWS__)
#define AvExport __declspec(dllexport)
#elif defined(__GNUC__) // Add compiler definition here...
#if __GNUC__ - 0 > 3 || (__GNUC__ - 0 == 3 && __GNUC_MINOR__ - 0 > 2)
#define AvExport __attribute__((visibility("default")))
#else
#define AvExport
#warning "AvExport not set because of a too old gcc version. The plug-in may not compile with the option -fvisible=hidden."
#endif
#else
#error "AvExport not defined for this compiler..."
#endif
#endif
#ifndef SWIG
#if LIBAVCODEC_VERSION_MAJOR < 54
#define AVPixelFormat PixelFormat
#define AV_PIX_FMT_NONE PIX_FMT_NONE
#define AVCodecID CodecID
#define AV_CODEC_ID_NONE CODEC_ID_NONE
#endif
#endif
#include <AvTranscoder/log.hpp>
namespace avtranscoder
{
typedef AVRational Rational;
/// Register all the codecs and formats which are enabled at configuration time.
void AvExport preloadCodecsAndFormats();
/// Get the string description corresponding to the error code provided by ffmpeg/libav
std::string AvExport getDescriptionFromErrorCode(const int code);
}
#endif