diff options
author | Be <be@mixxx.org> | 2019-09-14 09:14:32 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-14 09:14:32 -0500 |
commit | e1e0ac44b8691f4bc3737a7a2bfa7a69d7d2b78d (patch) | |
tree | 1cdd12ab4d55fc11ddb33e512564a2a9eb56e2a4 /build/features.py | |
parent | 2bd0b217a8a8984bc3bb9a927c82c6b2af6b4c2d (diff) | |
parent | 5a85b9a58f7ec27cb768e5fa4e4905dff9e791e6 (diff) |
Merge pull request #1356 from uklotzde/ffmpeg31
Universal SoundSource for FFmpeg 4.x
Diffstat (limited to 'build/features.py')
-rw-r--r-- | build/features.py | 69 |
1 files changed, 19 insertions, 50 deletions
diff --git a/build/features.py b/build/features.py index ff0e39f1b3..51d489060f 100644 --- a/build/features.py +++ b/build/features.py @@ -747,9 +747,9 @@ class Opus(Feature): 'src/encoder/encoderopus.cpp'] -class FFMPEG(Feature): +class FFmpeg(Feature): def description(self): - return "FFmpeg/Avconv support" + return "FFmpeg 4.x support" def enabled(self, build): build.flags['ffmpeg'] = util.get_flags(build.env, 'ffmpeg', 0) @@ -758,28 +758,27 @@ class FFMPEG(Feature): return False def add_options(self, build, vars): - vars.Add('ffmpeg', 'Set to 1 to enable FFmpeg/Avconv support \ - (supported FFmpeg 0.11-2.x and Avconv 0.8.x-11.x)', 0) + vars.Add('ffmpeg', 'Set to 1 to enable FFmpeg 4.x support', 0) def configure(self, build, conf): if not self.enabled(build): return - # Supported version are FFmpeg 0.11-2.x and Avconv 0.8.x-11.x # FFmpeg is multimedia library that can be found http://ffmpeg.org/ - # Avconv is fork of FFmpeg that is used mainly in Debian and Ubuntu - # that can be found http://libav.org if build.platform_is_linux or build.platform_is_osx \ or build.platform_is_bsd: # Check for libavcodec, libavformat - # I just randomly picked version numbers lower than mine for this - if not conf.CheckForPKG('libavcodec', '53.35.0'): - raise Exception('Missing libavcodec or it\'s too old! It can' - 'be separated from main package so check your' + if not conf.CheckForPKG('libavcodec', '58'): + raise Exception('Missing libavcodec or it\'s too old! It can ' + 'be separated from main package so check your ' 'operating system packages.') - if not conf.CheckForPKG('libavformat', '53.21.0'): - raise Exception('Missing libavformat or it\'s too old!' - 'It can be separated from main package so' + if not conf.CheckForPKG('libavformat', '58'): + raise Exception('Missing libavformat or it\'s too old! ' + 'It can be separated from main package so ' + 'check your operating system packages.') + if not conf.CheckForPKG('libswresample', '3.1'): + raise Exception('Missing libswresample or it\'s too old! ' + 'It can be separated from main package so ' 'check your operating system packages.') # Needed to build new FFmpeg @@ -788,6 +787,8 @@ class FFMPEG(Feature): build.env.Append(CCFLAGS='-D__STDC_FORMAT_MACROS') # Grabs the libs and cflags for FFmpeg + build.env.ParseConfig('pkg-config libswresample --silence-errors \ + --cflags --libs') build.env.ParseConfig('pkg-config libavcodec --silence-errors \ --cflags --libs') build.env.ParseConfig('pkg-config libavformat --silence-errors \ @@ -795,47 +796,15 @@ class FFMPEG(Feature): build.env.ParseConfig('pkg-config libavutil --silence-errors \ --cflags --libs') - build.env.Append(CPPDEFINES='__FFMPEGFILE__') + build.env.Append(CPPDEFINES='__FFMPEG__') self.status = "Enabled" else: - # aptitude install libavcodec-dev libavformat-dev liba52-0.7.4-dev - # libdts-dev - # Append some stuff to CFLAGS in Windows also - build.env.Append(CCFLAGS='-D__STDC_CONSTANT_MACROS') - build.env.Append(CCFLAGS='-D__STDC_LIMIT_MACROS') - build.env.Append(CCFLAGS='-D__STDC_FORMAT_MACROS') - - build.env.Append(LIBS='avcodec') - build.env.Append(LIBS='avformat') - build.env.Append(LIBS='avutil') - build.env.Append(LIBS='z') - build.env.Append(LIBS='swresample') - # build.env.Append(LIBS = 'a52') - # build.env.Append(LIBS = 'dts') - build.env.Append(LIBS='gsm') - # build.env.Append(LIBS = 'dc1394_control') - # build.env.Append(LIBS = 'dl') - build.env.Append(LIBS='vorbisenc') - # build.env.Append(LIBS = 'raw1394') - build.env.Append(LIBS='vorbis') - build.env.Append(LIBS='m') - build.env.Append(LIBS='ogg') - build.env.Append(CPPDEFINES='__FFMPEGFILE__') - - # Add new path for FFmpeg header files. - # Non-crosscompiled builds need this too, don't they? - if build.crosscompile and build.platform_is_windows \ - and build.toolchain_is_gnu: - build.env.Append(CPPPATH=os.path.join(build.crosscompile_root, - 'include', 'ffmpeg')) + raise Exception('Building with FFmpeg 4.x is not supported' + 'for your platform') def sources(self, build): - return ['src/sources/soundsourceffmpeg.cpp', - 'src/encoder/encoderffmpegresample.cpp', - 'src/encoder/encoderffmpegcore.cpp', - 'src/encoder/encoderffmpegmp3.cpp', - 'src/encoder/encoderffmpegvorbis.cpp'] + return ['src/sources/soundsourceffmpeg.cpp'] class Optimize(Feature): |