Skip to content

Commit

Permalink
Merge pull request #1356 from uklotzde/ffmpeg31
Browse files Browse the repository at this point in the history
Universal SoundSource for FFmpeg 4.x
  • Loading branch information
Be-ing committed Sep 14, 2019
2 parents 2bd0b21 + 5a85b9a commit e1e0ac4
Show file tree
Hide file tree
Showing 16 changed files with 1,392 additions and 1,162 deletions.
2 changes: 1 addition & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ available_features = [features.Mad,
features.Verbose,
features.Optimize,
features.FAAD,
features.FFmpeg,
features.WavPack,
features.ModPlug,
features.TestSuite,
Expand All @@ -61,7 +62,6 @@ available_features = [features.Mad,
# "Features" of dubious quality
features.PerfTools,
features.AsmLib,
features.FFMPEG
]

build = mixxx.MixxxBuild(target, machine, build_type,
Expand Down
3 changes: 2 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ for:
- sudo apt-get -y install gdb libavformat-dev libchromaprint-dev libfaad-dev libflac-dev libid3tag0-dev libmad0-dev libmodplug-dev libmp3lame-dev libmp4v2-dev libopus-dev libopusfile-dev libportmidi-dev libprotobuf-dev libqt5opengl5-dev libqt5sql5-sqlite libqt5svg5-dev librubberband-dev libshout3-dev libsndfile1-dev libsqlite3-dev libtag1-dev libupower-glib-dev libusb-1.0-0-dev libwavpack-dev portaudio19-dev protobuf-compiler qt5-default qtscript5-dev libqt5x11extras5-dev scons qt5keychain-dev liblilv-dev libsoundtouch-dev

build_script:
- scons -j4 test=1 mad=1 faad=1 ffmpeg=1 opus=1 modplug=1 wv=1 hss1394=0 virtualize=0 debug_assertions_fatal=1 verbose=0 localecompare=1
# ffmpeg=1 requires FFmpeg 4.0, but Ubuntu 18.04 still provides only FFmpeg 3.4.x
- scons -j4 test=1 mad=1 faad=1 opus=1 modplug=1 wv=1 hss1394=0 virtualize=0 debug_assertions_fatal=1 verbose=0 localecompare=1

test_script:
- xvfb-run -- ./mixxx-test --gtest_output=xml:test_results.xml
Expand Down
69 changes: 19 additions & 50 deletions build/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,9 +747,9 @@ def sources(self, build):
'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)
Expand All @@ -758,28 +758,27 @@ def enabled(self, build):
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
Expand All @@ -788,54 +787,24 @@ def configure(self, build, conf):
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 \
--cflags --libs')
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):
Expand Down

0 comments on commit e1e0ac4

Please sign in to comment.