From 0ad01f9408c6276c8f6fe6652b266aa86e81d8f7 Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Sat, 8 Jun 2013 12:47:31 +0200 Subject: [PATCH] Bug 844818 - Make WebRTC aware of --enable-alsa/--enable-pulseaudio. r=jesup,ted --- configure.in | 12 ++++ .../modules/audio_device/audio_device.gypi | 62 +++++++++++-------- media/webrtc/webrtc_config.gypi | 1 - 3 files changed, 49 insertions(+), 26 deletions(-) diff --git a/configure.in b/configure.in index f1111a07815..2e83433bc8c 100644 --- a/configure.in +++ b/configure.in @@ -9132,6 +9132,18 @@ if test -n "$ARM_ARCH"; then fi fi +# Keep libcubeb and audio_device backends in sync +if test -n "$MOZ_ALSA"; then + EXTRA_GYP_DEFINES="$EXTRA_GYP_DEFINES -D include_alsa_audio=1" +else + EXTRA_GYP_DEFINES="$EXTRA_GYP_DEFINES -D include_alsa_audio=0" +fi +if test -n "$MOZ_PULSEAUDIO"; then + EXTRA_GYP_DEFINES="$EXTRA_GYP_DEFINES -D include_pulse_audio=1" +else + EXTRA_GYP_DEFINES="$EXTRA_GYP_DEFINES -D include_pulse_audio=0" +fi + # Don't try to compile ssse3/sse4.1 code if toolchain doesn't support if test -z "$HAVE_TOOLCHAIN_SUPPORT_SSSE3" || test -z "$HAVE_TOOLCHAIN_SUPPORT_MSSE4_1"; then EXTRA_GYP_DEFINES="$EXTRA_GYP_DEFINES -D yuv_disable_asm=1" diff --git a/media/webrtc/trunk/webrtc/modules/audio_device/audio_device.gypi b/media/webrtc/trunk/webrtc/modules/audio_device/audio_device.gypi index 5dc16e0aaab..bdd6033bdd4 100644 --- a/media/webrtc/trunk/webrtc/modules/audio_device/audio_device.gypi +++ b/media/webrtc/trunk/webrtc/modules/audio_device/audio_device.gypi @@ -45,11 +45,15 @@ 'dummy/audio_device_utility_dummy.h', ], 'conditions': [ - ['OS=="linux"', { + ['include_alsa_audio==1 or include_pulse_audio==1', { 'include_dirs': [ 'linux', ], - }], # OS==linux + 'defines': [ + # avoid pointless rename + 'WEBRTC_LINUX', + ], + }], # include_alsa_audio==1 or include_pulse_audio==1 ['OS=="ios"', { 'include_dirs': [ 'ios', @@ -78,14 +82,8 @@ }], ['include_internal_audio_device==1', { 'sources': [ - 'linux/alsasymboltable_linux.cc', - 'linux/alsasymboltable_linux.h', - 'linux/audio_device_alsa_linux.cc', - 'linux/audio_device_alsa_linux.h', 'linux/audio_device_utility_linux.cc', 'linux/audio_device_utility_linux.h', - 'linux/audio_mixer_manager_alsa_linux.cc', - 'linux/audio_mixer_manager_alsa_linux.h', 'linux/latebindingsymboltable_linux.cc', 'linux/latebindingsymboltable_linux.h', 'ios/audio_device_ios.cc', @@ -126,28 +124,42 @@ }, }], ['OS=="linux"', { - 'defines': [ - 'LINUX_ALSA', - ], 'link_settings': { 'libraries': [ '-ldl', ], }, - 'conditions': [ - ['include_pulse_audio==1', { - 'defines': [ - 'LINUX_PULSE', - ], - 'sources': [ - 'linux/audio_device_pulse_linux.cc', - 'linux/audio_device_pulse_linux.h', - 'linux/audio_mixer_manager_pulse_linux.cc', - 'linux/audio_mixer_manager_pulse_linux.h', - 'linux/pulseaudiosymboltable_linux.cc', - 'linux/pulseaudiosymboltable_linux.h', - ], - }], + }], + ['include_alsa_audio==1', { + 'cflags_mozilla': [ + '$(MOZ_ALSA_CFLAGS)', + ], + 'defines': [ + 'LINUX_ALSA', + ], + 'sources': [ + 'linux/alsasymboltable_linux.cc', + 'linux/alsasymboltable_linux.h', + 'linux/audio_device_alsa_linux.cc', + 'linux/audio_device_alsa_linux.h', + 'linux/audio_mixer_manager_alsa_linux.cc', + 'linux/audio_mixer_manager_alsa_linux.h', + ], + }], + ['include_pulse_audio==1', { + 'cflags_mozilla': [ + '$(MOZ_PULSEAUDIO_CFLAGS)', + ], + 'defines': [ + 'LINUX_PULSE', + ], + 'sources': [ + 'linux/audio_device_pulse_linux.cc', + 'linux/audio_device_pulse_linux.h', + 'linux/audio_mixer_manager_pulse_linux.cc', + 'linux/audio_mixer_manager_pulse_linux.h', + 'linux/pulseaudiosymboltable_linux.cc', + 'linux/pulseaudiosymboltable_linux.h', ], }], ['OS=="mac" or OS=="ios"', { diff --git a/media/webrtc/webrtc_config.gypi b/media/webrtc/webrtc_config.gypi index d464265e795..af7d538843f 100644 --- a/media/webrtc/webrtc_config.gypi +++ b/media/webrtc/webrtc_config.gypi @@ -14,7 +14,6 @@ 'include_internal_video_render': 0, 'clang_use_chrome_plugins': 0, 'enable_protobuf': 0, - 'include_pulse_audio': 0, 'include_tests': 0, 'enable_android_opensl': 1, # use_system_lib* still seems to be in use in trunk/build