Bug 1385258 - Use dummy audio device with WebRTC on Linux. r?dminor draft
authorPaul Adenot <paul@paul.cx>
Fri, 28 Jul 2017 15:04:58 +0200
changeset 617488 099c488030d6ff6fe78e2d0fbc550542223d5042
parent 617486 11ca5c5a45181af1b935e51dea7b0c015cd3d965
child 639816 903617d5d349985316811f3823d325c89f886888
push id71051
push userpaul@paul.cx
push dateFri, 28 Jul 2017 13:08:32 +0000
reviewersdminor
bugs1385258
milestone56.0a1
Bug 1385258 - Use dummy audio device with WebRTC on Linux. r?dminor MozReview-Commit-ID: CN1IKhvtp2w
build/gyp.mozbuild
media/webrtc/trunk/webrtc/modules/audio_device/audio_device.gypi
--- a/build/gyp.mozbuild
+++ b/build/gyp.mozbuild
@@ -16,17 +16,17 @@ gyp_vars.update({
     'build_with_chromium': 0,
     # 10.9 once we move to TC cross-compiles - bug 1270217
     'mac_sdk_min': '10.7',
     'mac_deployment_target': '10.7',
     'use_official_google_api_keys': 0,
     'have_clock_monotonic': 1 if CONFIG['HAVE_CLOCK_MONOTONIC'] else 0,
     'have_ethtool_cmd_speed_hi': 1 if CONFIG['MOZ_WEBRTC_HAVE_ETHTOOL_SPEED_HI'] else 0,
     'include_alsa_audio': 0,
-    'include_pulse_audio': 1 if CONFIG['MOZ_PULSEAUDIO'] else 0,
+    'include_pulse_audio': 0,
     # basic stuff for everything
     'include_internal_video_render': 0,
     'clang': 1 if CONFIG['CLANG_CXX'] else 0,
     'clang_use_chrome_plugins': 0,
     'enable_protobuf': 0,
     'include_tests': 0,
     'enable_android_opensl': 1,
     'enable_android_opensl_output': 0,
--- a/media/webrtc/trunk/webrtc/modules/audio_device/audio_device.gypi
+++ b/media/webrtc/trunk/webrtc/modules/audio_device/audio_device.gypi
@@ -40,16 +40,20 @@
         'audio_device_generic.h',
         'audio_device_config.h',
         'dummy/audio_device_dummy.cc',
         'dummy/audio_device_dummy.h',
         'dummy/file_audio_device.cc',
         'dummy/file_audio_device.h',
         'fine_audio_buffer.cc',
         'fine_audio_buffer.h',
+        # Those are needed on every platform to plumb back the output audio to
+        # the AEC.
+        'opensl/single_rw_fifo.cc',
+        'opensl/single_rw_fifo.h'
       ],
       'conditions': [
         ['build_with_mozilla==1', {
           'cflags_mozilla': [
             '$(NSPR_CFLAGS)',
           ],
         }],
         ['hardware_aec_ns==1', {
@@ -58,18 +62,20 @@
           ],
         }],
         ['include_sndio_audio==1', {
           'include_dirs': [
             'sndio',
           ],
         }], # include_sndio_audio==1
         ['OS=="linux" or include_alsa_audio==1 or include_pulse_audio==1', {
-          'include_dirs': [
-            'linux',
+           # On Linux, we tell webrtc to use a dummy audio device, since we use
+           # cubeb for everything.
+          'defines': [
+            'WEBRTC_DUMMY_AUDIO_BUILD',
           ],
         }], # OS=="linux" or include_alsa_audio==1 or include_pulse_audio==1
         ['OS=="ios"', {
           'include_dirs': [
             'ios',
           ],
         }], # OS==ios
         ['OS=="mac"', {
@@ -104,20 +110,17 @@
             # Don't link these into Chrome since they contain static data.
             'dummy/file_audio_device_factory.cc',
             'dummy/file_audio_device_factory.h',
           ],
         }],
         ['include_internal_audio_device==1', {
           'sources': [
             'audio_device_impl.cc',
-            'audio_device_impl.h',
-            # used externally for getUserMedia
-            'opensl/single_rw_fifo.cc',
-            'opensl/single_rw_fifo.h',
+            'audio_device_impl.h'
           ],
           'conditions': [
             ['use_dummy_audio_file_devices==1', {
               'defines': [
                'WEBRTC_DUMMY_FILE_DEVICES',
               ],
             }, { # use_dummy_audio_file_devices==0, so use a platform device.
               'conditions': [