LMMS
Loading...
Searching...
No Matches
ffcompat.h
Go to the documentation of this file.
1/* ffmpeg compatibility wrappers
2 *
3 * Copyright 2012,2013 Robin Gareus <robin@gareus.org>
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to deal
7 * in the Software without restriction, including without limitation the rights
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 * copies of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
11 *
12 * 1. Redistributions of source code must retain the above copyright notice, this
13 * list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright notice,
15 * this list of conditions and the following disclaimer in the documentation
16 * and/or other materials provided with the distribution.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
22 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29#ifndef FFCOMPAT_H
30#define FFCOMPAT_H
31
32#include <libavcodec/avcodec.h>
33#include <libavformat/avformat.h>
34#include <libavutil/avutil.h>
35
36#ifndef AVCODEC_MAX_AUDIO_FRAME_SIZE
37#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000
38#endif
39
40#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(50, 0, 0)
41#define AVMEDIA_TYPE_AUDIO CODEC_TYPE_AUDIO
42#endif
43
44#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53, 2, 0)
45static inline int avformat_open_input(AVFormatContext **ps, const char *filename, void *fmt, void **options)
46{
47 return av_open_input_file(ps, filename, NULL, 0, NULL);
48}
49#endif /* avformat < 53.2.0 */
50
51#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(53, 5, 0)
52static inline AVCodecContext *
53avcodec_alloc_context3(AVCodec *codec __attribute__((unused)))
54{
55 return avcodec_alloc_context();
56}
57
58static inline AVStream *
59avformat_new_stream(AVFormatContext *s, AVCodec *c) {
60 return av_new_stream(s,0);
61}
62
63static inline int
64avcodec_get_context_defaults3(AVCodecContext *s, AVCodec *codec)
65{
66 avcodec_get_context_defaults(s);
67 return 0;
68}
69
70#endif /* < 53.5.0 */
71
72#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(53, 5, 6)
73static inline int
74avcodec_open2(AVCodecContext *avctx, AVCodec *codec, void **options __attribute__((unused)))
75{
76 return avcodec_open(avctx, codec);
77}
78#endif /* <= 53.5.6 */
79
80#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53, 5, 0)
81static inline int
82avformat_find_stream_info(AVFormatContext *ic, void **options)
83{
84 return av_find_stream_info(ic);
85}
86
87static inline void
88avformat_close_input(AVFormatContext **s)
89{
90 av_close_input_file(*s);
91}
92
93#endif /* < 53.5.0 */
94
95#endif /* FFCOMPAT_H */
#define NULL
Definition CarlaBridgeFormat.cpp:30
__attribute__((naked, target("arm")))
Definition asm-nseel-arm-gcc.c:66
unsigned s
Definition inflate.c:1555
static char filename[]
Definition features.c:5
return c
Definition crypt.c:175
fmt[0]
Definition fileio.c:2503
int ic
Definition match.c:170