Gnash
0.8.11dev
libmedia
ffmpeg
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
// till Debian libav 10~beta1
100
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(55,34,1)
101
#define AV_CODEC_ID_AAC CODEC_ID_AAC
102
#define AV_CODEC_ID_ADPCM_SWF CODEC_ID_ADPCM_SWF
103
#define AV_CODEC_ID_FLASHSV CODEC_ID_FLASHSV
104
#define AV_CODEC_ID_FLV1 CODEC_ID_FLV1
105
#define AV_CODEC_ID_H264 CODEC_ID_H264
106
#define AV_CODEC_ID_MP3 CODEC_ID_MP3
107
#define AV_CODEC_ID_NELLYMOSER CODEC_ID_NELLYMOSER
108
#define AV_CODEC_ID_NONE CODEC_ID_NONE
109
#define AV_CODEC_ID_PCM_S8 CODEC_ID_PCM_S8
110
#define AV_CODEC_ID_PCM_U8 CODEC_ID_PCM_U8
111
#define AV_CODEC_ID_PCM_S16LE CODEC_ID_PCM_S16LE
112
#define AV_CODEC_ID_PCM_U16LE CODEC_ID_PCM_U16LE
113
#define AV_CODEC_ID_VP6A CODEC_ID_VP6A
114
#define AV_CODEC_ID_VP6F CODEC_ID_VP6F
115
116
#define avg_frame_rate r_frame_rate
117
#define FRAMEALLOC avcodec_alloc_frame
118
struct
FrameDeleter
119
{
120
void
operator()
(AVFrame* frame)
121
{
122
av_free(frame);
123
}
124
};
125
#else
126
#define FRAMEALLOC av_frame_alloc
127
struct
FrameDeleter
128
{
129
void
operator()
(AVFrame* frame)
130
{
131
av_frame_free(&frame);
132
}
133
};
134
#endif
135
136
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,18,102)
137
#define CODECID AVCodecID
138
#else
139
#define CODECID CodecID
140
#endif
141
142
#ifdef HAVE_SWRESAMPLE_H
143
extern
"C"
{
144
#include <swresample.h>
145
}
146
#endif
147
148
#ifdef HAVE_FFMPEG_SWRESAMPLE_H
149
extern
"C"
{
150
#include <ffmpeg/swresample.h>
151
}
152
#define HAVE_SWRESAMPLE_H 1
153
#endif
154
155
#ifdef HAVE_LIBSWRESAMPLE_SWRESAMPLE_H
156
extern
"C"
{
157
#include <libswresample/swresample.h>
158
}
159
#define HAVE_SWRESAMPLE_H 1
160
#endif
161
162
#ifdef HAVE_AVRESAMPLE_H
163
extern
"C"
{
164
#include <avresample.h>
165
}
166
#endif
167
168
#ifdef HAVE_LIBAV_AVRESAMPLE_H
169
extern
"C"
{
170
#include <libav/avresample.h>
171
}
172
#define HAVE_AVRESAMPLE_H 1
173
#endif
174
175
#ifdef HAVE_LIBAVRESAMPLE_AVRESAMPLE_H
176
extern
"C"
{
177
#include <libavresample/avresample.h>
178
}
179
#define HAVE_AVRESAMPLE_H 1
180
#endif
181
182
#ifdef HAVE_LIBAVUTIL_OPT_H
183
extern
"C"
{
184
#include <libavutil/opt.h>
185
}
186
#endif
187
188
#if LIBAVUTIL_VERSION_MAJOR < 55
189
#define AVPixelFormat PixelFormat
190
#define AV_PIX_FMT_YUV444P PIX_FMT_YUV444P
191
#define AV_PIX_FMT_YUVJ444P PIX_FMT_YUVJ444P
192
#define AV_PIX_FMT_YUV440P PIX_FMT_YUV440P
193
#define AV_PIX_FMT_YUVJ440P PIX_FMT_YUVJ440P
194
#define AV_PIX_FMT_YUV422P PIX_FMT_YUV422P
195
#define AV_PIX_FMT_YUVJ422P PIX_FMT_YUVJ422P
196
#define AV_PIX_FMT_YUV420P PIX_FMT_YUV420P
197
#define AV_PIX_FMT_YUVJ420P PIX_FMT_YUVJ420P
198
#define AV_PIX_FMT_YUV411P PIX_FMT_YUV411P
199
#define AV_PIX_FMT_YUV410P PIX_FMT_YUV410P
200
#define AV_PIX_FMT_NV12 PIX_FMT_NV12
201
#define AV_PIX_FMT_NV21 PIX_FMT_NV21
202
#define AV_PIX_FMT_YUYV422 PIX_FMT_YUYV422
203
#define AV_PIX_FMT_UYVY422 PIX_FMT_UYVY422
204
#define AV_PIX_FMT_UYYVYY411 PIX_FMT_UYYVYY411
205
#define AV_PIX_FMT_NONE PIX_FMT_NONE
206
#define AV_PIX_FMT_RGB24 PIX_FMT_RGB24
207
#define AV_PIX_FMT_RGBA PIX_FMT_RGBA
208
#define AV_PIX_FMT_VAAPI_VLD PIX_FMT_VAAPI_VLD
209
#endif
210
211
#endif // GNASH_MEDIA_FFMPEG_HEADERS_H
FrameDeleter
Definition:
ffmpegHeaders.h:128
FrameDeleter::operator()
void operator()(AVFrame *frame)
Definition:
ffmpegHeaders.h:129
gnashconfig.h
Generated by
1.8.20