chromecast: Hide some private variable from settings
[vlc.git] / modules / codec / avcodec / avcommon_compat.h
blob8f9c12081cf8524424d4611822a69a3a16cf1f05
1 /*****************************************************************************
2 * avcodec.h: decoder and encoder using libavcodec
3 *****************************************************************************
4 * Copyright (C) 2001-2013 VLC authors and VideoLAN
5 * $Id$
7 * Authors: Laurent Aimar <fenrir@via.ecp.fr>
8 * Jean-Baptiste Kempf <jb@videolan.org>
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU Lesser General Public License as published by
12 * the Free Software Foundation; either version 2.1 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with this program; if not, write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
25 #ifndef AVCOMMON_COMPAT_H
26 #define AVCOMMON_COMPAT_H 1
28 #define AVPROVIDER(lib) ((lib##_VERSION_MICRO < 100) ? "libav" : "ffmpeg")
30 #ifdef HAVE_LIBAVCODEC_AVCODEC_H
31 #include <libavcodec/avcodec.h>
33 /* LIBAVCODEC_VERSION_CHECK checks for the right version of libav and FFmpeg
34 * a is the major version
35 * b and c the minor and micro versions of libav
36 * d and e the minor and micro versions of FFmpeg */
37 #define LIBAVCODEC_VERSION_CHECK( a, b, c, d, e ) \
38 ( (LIBAVCODEC_VERSION_MICRO < 100 && LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( a, b, c ) ) || \
39 (LIBAVCODEC_VERSION_MICRO >= 100 && LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( a, d, e ) ) )
41 #ifndef AV_CODEC_FLAG_OUTPUT_CORRUPT
42 # define AV_CODEC_FLAG_OUTPUT_CORRUPT CODEC_FLAG_OUTPUT_CORRUPT
43 #endif
44 #ifndef AV_CODEC_FLAG_GRAY
45 # define AV_CODEC_FLAG_GRAY CODEC_FLAG_GRAY
46 #endif
47 #ifndef AV_CODEC_FLAG_DR1
48 # define AV_CODEC_FLAG_DR1 CODEC_FLAG_DR1
49 #endif
50 #ifndef AV_CODEC_FLAG_DELAY
51 # define AV_CODEC_FLAG_DELAY CODEC_FLAG_DELAY
52 #endif
53 #ifndef AV_CODEC_FLAG2_FAST
54 # define AV_CODEC_FLAG2_FAST CODEC_FLAG2_FAST
55 #endif
56 #ifndef FF_INPUT_BUFFER_PADDING_SIZE
57 # define FF_INPUT_BUFFER_PADDING_SIZE AV_INPUT_BUFFER_PADDING_SIZE
58 #endif
59 #ifndef AV_CODEC_FLAG_INTERLACED_DCT
60 # define AV_CODEC_FLAG_INTERLACED_DCT CODEC_FLAG_INTERLACED_DCT
61 #endif
62 #ifndef AV_CODEC_FLAG_INTERLACED_ME
63 # define AV_CODEC_FLAG_INTERLACED_ME CODEC_FLAG_INTERLACED_ME
64 #endif
65 #ifndef AV_CODEC_FLAG_GLOBAL_HEADER
66 # define AV_CODEC_FLAG_GLOBAL_HEADER CODEC_FLAG_GLOBAL_HEADER
67 #endif
68 #ifndef AV_CODEC_FLAG_LOW_DELAY
69 # define AV_CODEC_FLAG_LOW_DELAY CODEC_FLAG_LOW_DELAY
70 #endif
71 #ifndef AV_CODEC_CAP_SMALL_LAST_FRAME
72 # define AV_CODEC_CAP_SMALL_LAST_FRAME CODEC_CAP_SMALL_LAST_FRAME
73 #endif
74 #ifndef AV_INPUT_BUFFER_MIN_SIZE
75 # define AV_INPUT_BUFFER_MIN_SIZE FF_MIN_BUFFER_SIZE
76 #endif
77 #ifndef FF_MAX_B_FRAMES
78 # define FF_MAX_B_FRAMES 16 // FIXME: remove this
79 #endif
81 #endif /* HAVE_LIBAVCODEC_AVCODEC_H */
83 #ifdef HAVE_LIBAVUTIL_AVUTIL_H
84 # include <libavutil/avutil.h>
86 /* LIBAVUTIL_VERSION_CHECK checks for the right version of libav and FFmpeg
87 * a is the major version
88 * b and c the minor and micro versions of libav
89 * d and e the minor and micro versions of FFmpeg */
90 #define LIBAVUTIL_VERSION_CHECK( a, b, c, d, e ) \
91 ( (LIBAVUTIL_VERSION_MICRO < 100 && LIBAVUTIL_VERSION_INT >= AV_VERSION_INT( a, b, c ) ) || \
92 (LIBAVUTIL_VERSION_MICRO >= 100 && LIBAVUTIL_VERSION_INT >= AV_VERSION_INT( a, d, e ) ) )
94 #if !LIBAVUTIL_VERSION_CHECK( 52, 11, 0, 32, 100 )
95 # define AV_PIX_FMT_FLAG_HWACCEL PIX_FMT_HWACCEL
96 #endif
98 #endif /* HAVE_LIBAVUTIL_AVUTIL_H */
100 #if LIBAVUTIL_VERSION_MAJOR >= 55
101 # define FF_API_AUDIOCONVERT 1
102 #endif
104 /* libavutil/pixfmt.h */
105 #ifndef PixelFormat
106 # define PixelFormat AVPixelFormat
107 #endif
109 #ifdef HAVE_LIBAVFORMAT_AVFORMAT_H
110 # include <libavformat/avformat.h>
112 #define LIBAVFORMAT_VERSION_CHECK( a, b, c, d, e ) \
113 ( (LIBAVFORMAT_VERSION_MICRO < 100 && LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT( a, b, c ) ) || \
114 (LIBAVFORMAT_VERSION_MICRO >= 100 && LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT( a, d, e ) ) )
116 #endif
118 #endif