Bug 783733 - Wire up the jack cubeb backend in the build system. r=glandium
authorDamien Zammit <damien@zamaudio.com>
Mon, 18 Jul 2016 13:28:39 +0200
changeset 305318 4ab76338931e0e3f80c43f1922cb4670e5322f13
parent 305317 2026686ebec18d7cbcb9a495926c06d7abab5d7d
child 305319 1333efcac5064aeb246e977676df99ac2428c0ec
push id79550
push userpaul@paul.cx
push dateMon, 18 Jul 2016 11:28:49 +0000
treeherdermozilla-inbound@4ab76338931e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs783733
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 783733 - Wire up the jack cubeb backend in the build system. r=glandium It's disabled by default for now. MozReview-Commit-ID: CPrJQ07n26t
config/system-headers
media/libcubeb/src/moz.build
toolkit/moz.configure
--- a/config/system-headers
+++ b/config/system-headers
@@ -552,16 +552,20 @@ intshcut.h
 inttypes.h
 iodef.h
 io.h
 IOKit/IOKitLib.h
 IOKit/IOMessage.h
 IOKit/pwr_mgt/IOPMLib.h
 iomanip
 iostream.h
+#if MOZ_JACK==1
+jack/jack.h
+jack/statistics.h
+#endif
 JavaControl.h
 JavaEmbedding/JavaControl.h
 JavaVM/jni.h
 JManager.h
 JNIEnvTests.h
 jni.h
 #if MOZ_SYSTEM_JPEG==1
 jpeglib.h
--- a/media/libcubeb/src/moz.build
+++ b/media/libcubeb/src/moz.build
@@ -14,25 +14,38 @@ SOURCES += [
 ]
 
 if CONFIG['MOZ_ALSA']:
     SOURCES += [
         'cubeb_alsa.c',
     ]
     DEFINES['USE_ALSA'] = True
 
+if CONFIG['MOZ_PULSEAUDIO'] or CONFIG['MOZ_JACK']:
+    SOURCES += [
+        'cubeb_resampler.cpp',
+    ]
+
 if CONFIG['MOZ_PULSEAUDIO']:
     SOURCES += [
         'cubeb_pulse.c',
-        'cubeb_resampler.cpp' # for tests
     ]
     DEFINES['USE_PULSE'] = True
     if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
         DEFINES['DISABLE_LIBPULSE_DLOPEN'] = True
 
+if CONFIG['MOZ_JACK']:
+    SOURCES += [
+        'cubeb_jack.cpp',
+    ]
+    USE_LIBS += [
+        'speex',
+    ]
+    DEFINES['USE_JACK'] = True
+
 if CONFIG['OS_ARCH'] == 'OpenBSD':
     SOURCES += [
         'cubeb_sndio.c',
     ]
     DEFINES['USE_SNDIO'] = True
 
 if CONFIG['OS_TARGET'] == 'Darwin':
     SOURCES += [
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -63,16 +63,29 @@ def dmd(value):
 
 set_config('MOZ_DMD', dmd)
 set_define('MOZ_DMD', dmd)
 add_old_configure_assignment('MOZ_DMD', dmd)
 imply_option('--enable-profiling', dmd)
 imply_option('--enable-jemalloc', dmd)
 imply_option('--enable-replace-malloc', dmd)
 
+# JACK cubeb backend
+# ==============================================================
+option('--enable-jack', env='MOZ_JACK',
+       help='Enable JACK audio backend.')
+
+@depends('--enable-jack')
+def jack(value):
+    if value:
+        return True
+
+set_config('MOZ_JACK', jack)
+set_define('MOZ_JACK', jack)
+
 # Javascript engine
 # ==============================================================
 include('../js/moz.configure')
 
 
 # L10N
 # ==============================================================
 option('--with-l10n-base', nargs=1, env='L10NBASEDIR',