File: avcodec_compat.h

package info (click to toggle)
xmms2 0.8%2Bdfsg-28
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 14,216 kB
  • sloc: ansic: 63,803; python: 15,537; cpp: 5,718; xml: 1,479; perl: 338; ruby: 243; makefile: 79; sh: 59; asm: 7
file content (54 lines) | stat: -rw-r--r-- 1,926 bytes parent folder | download | duplicates (6)
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
/** @file avcodec_compat.h
 *  Compatibility header for libavcodec backwards compatibility
 *
 *  Copyright (C) 2011-2014 XMMS2 Team
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 */

#undef ABS
#ifdef HAVE_LIBAVCODEC_AVCODEC_H
# include "libavcodec/avcodec.h"
#else
# include "avcodec.h"
#endif

/* Map avcodec_free_frame to av_freep if the former doesn't exist.
 * (This is in versions earlier than 54.28.0 (libav) or 54.59.100 (ffmpeg)) */
#if ! HAVE_AVCODEC_FREE_FRAME
# define avcodec_free_frame av_freep
#endif

/* Map av_frame_alloc, av_frame_unref, av_frame_free into their
 * deprecated versions in versions earlier than 55.28.1 */
#if LIBAVCODEC_VERSION_INT < 0x371c01
# define av_frame_alloc avcodec_alloc_frame
# define av_frame_unref avcodec_get_frame_defaults
# define av_frame_free avcodec_free_frame
#endif
/* Calling avcodec_init is not necessary after 53.04 (ffmpeg 0.9) */
#if LIBAVCODEC_VERSION_INT >= 0x350400
# define avcodec_init()
#endif

/* Map avcodec_alloc_context3 into the deprecated version
 * avcodec_alloc_context in versions earlier than 53.04 (ffmpeg 0.9) */
#if LIBAVCODEC_VERSION_INT < 0x350400
# define avcodec_alloc_context3(codec) \
    avcodec_alloc_context()
#endif

/* Map avcodec_open2 into the deprecated version
 * avcodec_open in versions earlier than 53.04 (ffmpeg 0.9) */
#if LIBAVCODEC_VERSION_INT < 0x350400
# define avcodec_open2(avctx, codec, options) \
    avcodec_open(avctx, codec)
#endif