Gnash  0.8.11dev
ffmpegHeaders.h
Go to the documentation of this file.
1 // ffmpegHeaders.h - hide braindamage required to support ffmpeg includes in a single file
2 //
3 // Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012
4 // Free Software Foundation, Inc.
5 //
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 3 of the License, or
9 // (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 
20 #ifndef GNASH_MEDIA_FFMPEG_HEADERS_H
21 #define GNASH_MEDIA_FFMPEG_HEADERS_H
22 
23 #ifdef HAVE_CONFIG_H
24 #include "gnashconfig.h"
25 #endif
26 
28 #ifndef __STDC_CONSTANT_MACROS
29 # define __STDC_CONSTANT_MACROS
30 #endif
31 
32 // This is for compatibility with braindamaged versions of ffmpeg
33 #if !defined INT64_C
34 #if defined __WORDSIZE && __WORDSIZE == 64
35 #define INT64_C(c) c ## L
36 #else
37 #define INT64_C(c) c ## LL
38 #endif
39 #endif
40 
41 #define MAX_AUDIO_FRAME_SIZE 192000
42 
43 #ifdef HAVE_FFMPEG_AVCODEC_H
44 extern "C" {
45 # include <ffmpeg/avcodec.h>
46 }
47 #endif
48 
49 #ifdef HAVE_LIBAVCODEC_AVCODEC_H
50 extern "C" {
51 # include <libavcodec/avcodec.h>
52 }
53 #endif
54 
55 #ifdef HAVE_FFMPEG_AVFORMAT_H
56 extern "C" {
57 #include <ffmpeg/avformat.h>
58 }
59 #endif
60 
61 #ifdef HAVE_LIBAVFORMAT_AVFORMAT_H
62 extern "C" {
63 #include <libavformat/avformat.h>
64 }
65 #endif
66 
67 
68 #ifdef HAVE_SWSCALE_H
69 extern "C" {
70 #include <swscale.h>
71 }
72 #endif
73 
74 #ifdef HAVE_FFMPEG_SWSCALE_H
75 extern "C" {
76 #include <ffmpeg/swscale.h>
77 }
78 #define HAVE_SWSCALE_H 1
79 #endif
80 
81 #ifdef HAVE_LIBSWSCALE_SWSCALE_H
82 extern "C" {
83 #include <libswscale/swscale.h>
84 }
85 #define HAVE_SWSCALE_H 1
86 #endif
87 
88 #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(52,94,1)
89 #define AV_SAMPLE_FMT_NONE SAMPLE_FMT_NONE
90 #define AV_SAMPLE_FMT_U8 SAMPLE_FMT_U8
91 #define AV_SAMPLE_FMT_S16 SAMPLE_FMT_S16
92 #define AV_SAMPLE_FMT_S32 SAMPLE_FMT_S32
93 #define AV_SAMPLE_FMT_FLT SAMPLE_FMT_FLT
94 #define AV_SAMPLE_FMT_DBL SAMPLE_FMT_DBL
95 
96 #define AVSampleFormat SampleFormat
97 #endif
98 
99 #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,18,102)
100 #define CODECID AVCodecID
101 #else
102 #define CODECID CodecID
103 #endif
104 
105 #ifdef HAVE_SWRESAMPLE_H
106 extern "C" {
107 #include <swresample.h>
108 }
109 #endif
110 
111 #ifdef HAVE_FFMPEG_SWRESAMPLE_H
112 extern "C" {
113 #include <ffmpeg/swresample.h>
114 }
115 #define HAVE_SWRESAMPLE_H 1
116 #endif
117 
118 #ifdef HAVE_LIBSWRESAMPLE_SWRESAMPLE_H
119 extern "C" {
120 #include <libswresample/swresample.h>
121 }
122 #define HAVE_SWRESAMPLE_H 1
123 #endif
124 
125 #ifdef HAVE_AVRESAMPLE_H
126 extern "C" {
127 #include <avresample.h>
128 }
129 #endif
130 
131 #ifdef HAVE_LIBAV_AVRESAMPLE_H
132 extern "C" {
133 #include <libav/avresample.h>
134 }
135 #define HAVE_AVRESAMPLE_H 1
136 #endif
137 
138 #ifdef HAVE_LIBAVRESAMPLE_AVRESAMPLE_H
139 extern "C" {
140 #include <libavresample/avresample.h>
141 }
142 #define HAVE_AVRESAMPLE_H 1
143 #endif
144 
145 #ifdef HAVE_LIBAVUTIL_OPT_H
146 extern "C" {
147 #include <libavutil/opt.h>
148 }
149 #endif
150 
151 #endif // GNASH_MEDIA_FFMPEG_HEADERS_H