From 7c5f0c80b8b96e67442504c3a5624177f79f16f0 Mon Sep 17 00:00:00 2001 From: Randell Jesup Date: Wed, 2 Apr 2014 13:58:19 -0400 Subject: [PATCH] Bug 694814: Patch 2: modifications to webrtc.org single_rw_fifo r=glandium,ted --- media/webrtc/moz.build | 3 +++ .../audio_device/android/single_rw_fifo.cc | 7 ++++++ .../modules/audio_device/audio_device.gypi | 25 ++++++++++--------- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/media/webrtc/moz.build b/media/webrtc/moz.build index a97725bd408b..baf13a2e63cf 100644 --- a/media/webrtc/moz.build +++ b/media/webrtc/moz.build @@ -14,8 +14,11 @@ webrtc_non_unified_sources = [ 'trunk/webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_filter.c', # Because of name clash in the kDampFilter variable 'trunk/webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_filter_c.c', # Because of name clash in the kDampFilter variable 'trunk/webrtc/modules/audio_coding/neteq4/audio_vector.cc', # Because of explicit template specializations + 'trunk/webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc', # Because of LATE() + 'trunk/webrtc/modules/audio_device/linux/audio_mixer_manager_pulse_linux.cc',# Because of LATE() 'trunk/webrtc/modules/audio_device/opensl/opensles_input.cc', # Because of name clash in the kOption variable 'trunk/webrtc/modules/audio_device/opensl/opensles_output.cc', # Because of name clash in the kOption variable + 'trunk/webrtc/modules/audio_device/opensl/single_rw_fifo.cc', # Because of name clash with #define FF 'trunk/webrtc/modules/audio_device/win/audio_device_core_win.cc', # Because of ordering assumptions in strsafe.h 'trunk/webrtc/modules/audio_processing/aec/aec_core.c', # Because of name clash in the ComfortNoise function 'trunk/webrtc/modules/audio_processing/aecm/aecm_core.c', # Because of name clash in the ComfortNoise function diff --git a/media/webrtc/trunk/webrtc/modules/audio_device/android/single_rw_fifo.cc b/media/webrtc/trunk/webrtc/modules/audio_device/android/single_rw_fifo.cc index 6d2a243d1c07..6e35da28b827 100644 --- a/media/webrtc/trunk/webrtc/modules/audio_device/android/single_rw_fifo.cc +++ b/media/webrtc/trunk/webrtc/modules/audio_device/android/single_rw_fifo.cc @@ -9,6 +9,9 @@ */ #include "webrtc/modules/audio_device/android/single_rw_fifo.h" +#if defined(_MSC_VER) +#include +#endif static int UpdatePos(int pos, int capacity) { return (pos + 1) % capacity; @@ -19,7 +22,11 @@ namespace webrtc { namespace subtle { inline void MemoryBarrier() { +#if defined(_MSC_VER) + ::MemoryBarrier(); +#else __sync_synchronize(); +#endif } } // namespace subtle 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 be57a2996a5f..cebb982c8b03 100644 --- a/media/webrtc/trunk/webrtc/modules/audio_device/audio_device.gypi +++ b/media/webrtc/trunk/webrtc/modules/audio_device/audio_device.gypi @@ -123,16 +123,19 @@ 'win/audio_device_utility_win.h', 'win/audio_mixer_manager_win.cc', 'win/audio_mixer_manager_win.h', + # used externally for getUserMedia + 'opensl/single_rw_fifo.cc', + 'opensl/single_rw_fifo.h', ], 'conditions': [ ['OS=="android"', { - 'sources': [ + 'sources': [ 'opensl/audio_manager_jni.cc', 'opensl/audio_manager_jni.h', - 'android/audio_device_jni_android.cc', - 'android/audio_device_jni_android.h', + 'android/audio_device_jni_android.cc', + 'android/audio_device_jni_android.h', ], - }], + }], ['OS=="android" or moz_widget_toolkit_gonk==1', { 'link_settings': { 'libraries': [ @@ -154,17 +157,15 @@ 'opensl/opensles_input.cc', 'opensl/opensles_input.h', 'opensl/opensles_output.h', - 'opensl/single_rw_fifo.cc', - 'opensl/single_rw_fifo.h', - 'shared/audio_device_utility_shared.cc', - 'shared/audio_device_utility_shared.h', + 'shared/audio_device_utility_shared.cc', + 'shared/audio_device_utility_shared.h', ], }, { 'sources': [ - 'shared/audio_device_utility_shared.cc', - 'shared/audio_device_utility_shared.h', - 'android/audio_device_jni_android.cc', - 'android/audio_device_jni_android.h', + 'shared/audio_device_utility_shared.cc', + 'shared/audio_device_utility_shared.h', + 'android/audio_device_jni_android.cc', + 'android/audio_device_jni_android.h', ], }], ['enable_android_opensl_output==1', {