Gentoo Archives: gentoo-dev

From: Alexis Ballier <aballier@g.o>
To: gentoo-dev@l.g.o
Cc: phajdan.jr@g.o
Subject: Re: [gentoo-dev] Chromium system ffmpeg
Date: Mon, 21 Jan 2013 10:48:36
Message-Id: 20130121074823.37d9fa49@gentoo.org
In Reply to: Re: [gentoo-dev] Chromium system ffmpeg by "Paweł Hajdan
1 On Sun, 20 Jan 2013 10:08:27 -0800
2 ""Paweł Hajdan, Jr."" <phajdan.jr@g.o> wrote:
3
4 > On 1/20/13 1:46 AM, Luca Barbato wrote:
5 > > On 19/01/13 20:10, "Paweł Hajdan, Jr." wrote:
6 > >> have a way to more simply exclude code that requires CODEC_ID_OPUS.
7 > >
8 > > Exclude in chrome or in libavcodec?
9 > >
10 > > The latter is a matter of adding --disable-decoder=opus and/or not
11 > > --enable-libopus in the configure.
12 >
13 > Exclude in chrome, in case old ffmpeg/libav does not support it.
14
15
16 yes in this case you need some #if VERSION < foo conditions (git blame
17 & cie are your friends to obtain the version in which it appeared). it
18 becomes messy when you realize minor/micro versions within ffmpeg and
19 libav are not at all the same.
20
21 vlc has some macro for this:
22
23 http://git.videolan.org/?p=vlc.git;a=blob;f=modules/codec/avcodec/avcodec.h;h=8c8dd20ed3400527cab84265f4442bf06eb06f8d;hb=HEAD
24
25 /* LIBAVCODEC_VERSION_CHECK checks for the right version of libav and
26 FFmpeg 282 * a is the major version
27 * b and c the minor and micro versions of libav
28 * d and e the minor and micro versions of FFmpeg */
29 #define LIBAVCODEC_VERSION_CHECK( a, b, c, d, e ) \
30 (LIBAVCODEC_VERSION_MICRO < 100 && LIBAVCODEC_VERSION_INT >=
31 AV_VERSION_INT( a, b, c ) ) || \
32 (LIBAVCODEC_VERSION_MICRO >= 100 && LIBAVCODEC_VERSION_INT >=
33 AV_VERSION_INT( a, d, e ) )
34
35
36 _MICRO is >= 100 in ffmpeg so that you can distinguish between the two.
37
38
39 Another option could be to check for the enum member at configure
40 time.
41
42
43 Alexis.