diff options
author | Uwe Klotz <uklotz@mixxx.org> | 2019-07-03 22:43:50 +0200 |
---|---|---|
committer | Uwe Klotz <uklotz@mixxx.org> | 2019-07-03 23:53:02 +0200 |
commit | 5cf2f26fedee7cbed2ee5aa1d525a0192b29c5ed (patch) | |
tree | 9ac70e43d15600625d2acbc25410d8c3730542b2 /build/features.py | |
parent | 2d7392a8e44aa92bfd2fd5f04b3b04da5b83b420 (diff) |
Replace SoundSourceFFmpeg with new implementation for FFmpeg 4.x
Diffstat (limited to 'build/features.py')
-rw-r--r-- | build/features.py | 101 |
1 files changed, 5 insertions, 96 deletions
diff --git a/build/features.py b/build/features.py index 84bd76e418..7f4e5efee5 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,98 +758,7 @@ 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) - - 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 ' - '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 ' - 'check your operating system packages.') - - # Needed to build new FFmpeg - build.env.Append(CCFLAGS='-D__STDC_CONSTANT_MACROS') - build.env.Append(CCFLAGS='-D__STDC_LIMIT_MACROS') - build.env.Append(CCFLAGS='-D__STDC_FORMAT_MACROS') - - # Grabs the libs and cflags for FFmpeg - build.env.ParseConfig('pkg-config libavcodec --silence-errors \ - --cflags --libs') - build.env.ParseConfig('pkg-config libavformat --silence-errors \ - --cflags --libs') - build.env.ParseConfig('pkg-config libavutil --silence-errors \ - --cflags --libs') - - build.env.Append(CPPDEFINES='__FFMPEGFILE__') - 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')) - - 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'] - - -class FFmpeg4(Feature): - def description(self): - return "FFmpeg 4.x support" - - def enabled(self, build): - build.flags['ffmpeg4'] = util.get_flags(build.env, 'ffmpeg4', 0) - if int(build.flags['ffmpeg4']): - return True - return False - - def add_options(self, build, vars): - vars.Add('ffmpeg4', 'Set to 1 to enable FFmpeg 4.x support', 0) + vars.Add('ffmpeg', 'Set to 1 to enable FFmpeg 4.x support', 0) def configure(self, build, conf): if not self.enabled(build): @@ -887,7 +796,7 @@ class FFmpeg4(Feature): build.env.ParseConfig('pkg-config libavutil --silence-errors \ --cflags --libs') - build.env.Append(CPPDEFINES='__FFMPEG4__') + build.env.Append(CPPDEFINES='__FFMPEG__') self.status = "Enabled" else: @@ -895,7 +804,7 @@ class FFmpeg4(Feature): 'for your platform') def sources(self, build): - return ['src/sources/soundsourceffmpeg4.cpp'] + return ['src/sources/soundsourceffmpeg.cpp'] class Optimize(Feature): |