Bug 830247 - Make sure NEON version of some libraries gets built. r=jesup
authorGian-Carlo Pascutto <gpascutto@mozilla.com>
Wed, 27 Feb 2013 15:44:42 +0100
changeset 123158 055d662405a53cfab51143f69356c22fdf2c6a32
parent 123157 ddd9cd9685bf2cc2a52195a510b8567856d35cda
child 123159 3c89126b87dea2f866a111b17582b126d863bd25
push id24373
push userryanvm@gmail.com
push dateThu, 28 Feb 2013 01:36:21 +0000
treeherdermozilla-central@8cb9d6981978 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs830247
milestone22.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 830247 - Make sure NEON version of some libraries gets built. r=jesup
media/libvpx/Makefile.in
media/webrtc/shared_libs.mk
media/webrtc/trunk/tools/gyp/pylib/gyp/generator/mozmake.py
media/webrtc/trunk/webrtc/build/arm_neon.gypi
media/webrtc/trunk/webrtc/build/common.gypi
media/webrtc/trunk/webrtc/modules/audio_device/android/audio_device_opensles_android.cc
media/webrtc/trunk/webrtc/modules/audio_device/android/audio_device_opensles_android.h
media/webrtc/trunk/webrtc/modules/audio_processing/audio_processing.gypi
media/webrtc/webrtc_config.gypi
--- a/media/libvpx/Makefile.in
+++ b/media/libvpx/Makefile.in
@@ -280,21 +280,21 @@ ifdef VPX_ARM_ASM
 ifeq ($(OS_TARGET),Android)
 
 # Older versions of the Android NDK don't pre-define anything to indicate the
 # OS they're on, so do it for them.
 DEFINES += -D__linux__
 
 # For cpu-features.h
 LOCAL_INCLUDES += -I$(ANDROID_NDK)/sources/android/cpufeatures
+ifndef MOZ_WEBRTC
 # For cpu-features.c
 VPATH += $(ANDROID_NDK)/sources/android/cpufeatures
-
 CSRCS += cpu-features.c
-
+endif
 endif
 
 CSRCS += \
   arm_cpudetect.c \
   arm_systemdependent.c \
   bilinearfilter_arm.c \
   dequantize_arm.c \
   filter_arm.c \
--- a/media/webrtc/shared_libs.mk
+++ b/media/webrtc/shared_libs.mk
@@ -41,22 +41,29 @@ WEBRTC_LIBS = \
 # if we're on an intel arch, we want SSE2 optimizations
 ifneq (,$(INTEL_ARCHITECTURE))
 WEBRTC_LIBS += \
   $(call EXPAND_LIBNAME_PATH,video_processing_sse2,$(DEPTH)/media/webrtc/trunk/webrtc/modules/modules_video_processing_sse2) \
   $(call EXPAND_LIBNAME_PATH,audio_processing_sse2,$(DEPTH)/media/webrtc/trunk/webrtc/modules/modules_audio_processing_sse2) \
   $(NULL)
 endif
 
+ifeq ($(CPU_ARCH), arm)
+# extra ARM libs
+WEBRTC_LIBS += \
+  $(call EXPAND_LIBNAME_PATH,cpu_features_android,$(DEPTH)/media/webrtc/trunk/webrtc/system_wrappers/source/system_wrappers_cpu_features_android) \
+  $(NULL)
 # neon for ARM
 ifeq ($(HAVE_ARM_NEON),1)
 WEBRTC_LIBS += \
-  $(call EXPAND_LIBNAME_PATH,aecm_neon,$(DEPTH)/media/webrtc/trunk/webrtc/modules/modules_aecm_neon) \
+  $(call EXPAND_LIBNAME_PATH,signal_processing_neon,$(DEPTH)/media/webrtc/trunk/webrtc/common_audio/common_audio_signal_processing_neon) \
+  $(call EXPAND_LIBNAME_PATH,audio_processing_neon,$(DEPTH)/media/webrtc/trunk/webrtc/modules/modules_audio_processing_neon) \
   $(NULL)
 endif
+endif
 
 
 # If you enable one of these codecs in webrtc_config.gypi, you'll need to re-add the
 # relevant library from this list:
 #
 #  $(call EXPAND_LIBNAME_PATH,G722,$(DEPTH)/media/webrtc/trunk/webrtc/modules/modules_G722) \
 #  $(call EXPAND_LIBNAME_PATH,iLBC,$(DEPTH)/media/webrtc/trunk/webrtc/modules/modules_iLBC) \
 #  $(call EXPAND_LIBNAME_PATH,iSAC,$(DEPTH)/media/webrtc/trunk/webrtc/modules/modules_iSAC) \
--- a/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/mozmake.py
+++ b/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/mozmake.py
@@ -50,21 +50,23 @@ COMMON_MK = """# This file was generated
 ifndef COMMON_MK_INCLUDED
 COMMON_MK_INCLUDED := 1
 
 ifdef MOZ_DEBUG
 CFLAGS += $(CPPFLAGS_Debug) $(CFLAGS_Debug)
 CXXFLAGS += $(CPPFLAGS_Debug) $(CXXFLAGS_Debug)
 DEFINES += $(DEFINES_Debug)
 LOCAL_INCLUDES += $(INCLUDES_Debug)
+ASFLAGS += $(ASFLAGS_Debug)
 else # non-MOZ_DEBUG
 CFLAGS += $(CPPFLAGS_Release) $(CFLAGS_Release)
 CXXFLAGS += $(CPPFLAGS_Release) $(CXXFLAGS_Release)
 DEFINES += $(DEFINES_Release)
 LOCAL_INCLUDES += $(INCLUDES_Release)
+ASFLAGS += $(ASFLAGS_Release)
 endif
 
 ifeq (WINNT,$(OS_TARGET))
 # These get set via VC project file settings for normal GYP builds.
 DEFINES += -DUNICODE -D_UNICODE
 LOCAL_INCLUDES += -I"$(MOZ_DIRECTX_SDK_PATH)/include"
 endif
 
@@ -161,16 +163,20 @@ def WriteCommonMk(path, build_files, scr
                          'commandline': ' '.join(commandline)})
 
 def striplib(name):
   "Strip lib prefixes from library names."
   if name[:3] == 'lib':
     return name[3:]
   return name
 
+AS_EXTENSIONS = set([
+  '.s',
+  '.S'
+])
 CPLUSPLUS_EXTENSIONS = set([
   '.cc',
   '.cpp',
   '.cxx'
 ])
 COMPILABLE_EXTENSIONS = set([
   '.c',
   '.s',
@@ -315,22 +321,25 @@ class MakefileGenerator(object):
 #        data['CFLAGS_%s' % configname] = cflags_c
 #      cflags_cc = config.get('cflags_cc')
 #      if cflags_cc:
 #        data['CXXFLAGS_%s' % configname] = cflags_cc
 # we need to keep pkg-config flags however
       cflags_mozilla = config.get('cflags_mozilla')
       if cflags_mozilla:
         data['CPPFLAGS_%s' % configname] = cflags_mozilla
+      asflags_mozilla = config.get('asflags_mozilla')
+      if asflags_mozilla:
+        data['ASFLAGS_%s' % configname] = asflags_mozilla
     sources = {
       'CPPSRCS': {'exts': CPLUSPLUS_EXTENSIONS, 'files': []},
       'CSRCS': {'exts': ['.c'], 'files': []},
       'CMSRCS': {'exts': ['.m'], 'files': []},
       'CMMSRCS': {'exts': ['.mm'], 'files': []},
-      'ASFILES': {'exts': ['.s'], 'files': []},
+      'SSRCS': {'exts': AS_EXTENSIONS, 'files': []},
       }
     copy_srcs = []
     for s in spec.get('sources', []):
       if not Compilable(s):
         continue
 
       # Special-case absolute paths, they'll get copied into the objdir
       # for compiling.
--- a/media/webrtc/trunk/webrtc/build/arm_neon.gypi
+++ b/media/webrtc/trunk/webrtc/build/arm_neon.gypi
@@ -29,9 +29,24 @@
   'cflags': [
     '-mfpu=neon',
     '-flax-vector-conversions',
   ],
   'cflags_mozilla': [
     '-mfpu=neon',
     '-flax-vector-conversions',
   ],
+  'asflags!': [
+    '-mfpu=vfpv3-d16',
+  ],
+  'asflags_mozilla!': [
+    '-mfpu=vfpv3-d16',
+  ],
+  'asflags': [
+    '-mfpu=neon',
+    '-flax-vector-conversions',
+  ],
+  'asflags_mozilla': [
+    '-mfpu=neon',
+    '-flax-vector-conversions',
+  ],
+
 }
--- a/media/webrtc/trunk/webrtc/build/common.gypi
+++ b/media/webrtc/trunk/webrtc/build/common.gypi
@@ -197,19 +197,19 @@
         'defines': [
           'WEBRTC_ARCH_ARM',
         ],
         'conditions': [
           ['armv7==1', {
             'defines': ['WEBRTC_ARCH_ARM_V7',],
             'conditions': [
               ['arm_neon==1', {
-                'defines': ['WEBRTC_ARCH_ARM_NEON',],
-              }, {
-                'defines': ['WEBRTC_DETECT_ARM_NEON',],
+                'defines': ['WEBRTC_ARCH_ARM_NEON',
+                            'WEBRTC_BUILD_NEON_LIBS',
+                            'WEBRTC_DETECT_ARM_NEON'],
               }],
             ],
           }],
         ],
       }],
       ['OS=="ios"', {
         'defines': [
           'WEBRTC_MAC',
--- a/media/webrtc/trunk/webrtc/modules/audio_device/android/audio_device_opensles_android.cc
+++ b/media/webrtc/trunk/webrtc/modules/audio_device/android/audio_device_opensles_android.cc
@@ -59,16 +59,17 @@ AudioDeviceAndroidOpenSLES::AudioDeviceA
       is_playing_(false),
       is_rec_initialized_(false),
       is_play_initialized_(false),
       is_mic_initialized_(false),
       is_speaker_initialized_(false),
       playout_delay_(0),
       recording_delay_(0),
       agc_enabled_(false),
+      rec_thread_(NULL),
       rec_timer_(*EventWrapper::Create()),
       mic_sampling_rate_(N_REC_SAMPLES_PER_SEC * 1000),
       speaker_sampling_rate_(N_PLAY_SAMPLES_PER_SEC * 1000),
       max_speaker_vol_(0),
       min_speaker_vol_(0),
       loundspeaker_on_(false) {
   WEBRTC_OPENSL_TRACE(kTraceMemory, kTraceAudioDevice, id, "%s created",
                       __FUNCTION__);
@@ -1391,17 +1392,17 @@ void AudioDeviceAndroidOpenSLES::Recorde
     // TODO(leozwang): OpenSL ES doesn't support AudioRecorder
     // volume control now, add it when it's ready.
   }
 }
 
 void AudioDeviceAndroidOpenSLES::CheckErr(SLresult res) {
   if (res != SL_RESULT_SUCCESS) {
     WEBRTC_OPENSL_TRACE(kTraceError, kTraceAudioDevice, id_,
-                        "  AudioDeviceAndroidOpenSLES::CheckErr(%d)", res);
+                        "  AudioDeviceAndroidOpenSLES::CheckErr(%lu)", res);
     exit(-1);
   }
 }
 
 void AudioDeviceAndroidOpenSLES::UpdatePlayoutDelay(
     WebRtc_UWord32 nSamplePlayed) {
   // TODO(leozwang): Add accurate delay estimat.
   playout_delay_ = (N_PLAY_QUEUE_BUFFERS - 0.5) * 10 +
--- a/media/webrtc/trunk/webrtc/modules/audio_device/android/audio_device_opensles_android.h
+++ b/media/webrtc/trunk/webrtc/modules/audio_device/android/audio_device_opensles_android.h
@@ -46,17 +46,17 @@ const WebRtc_UWord32 REC_MAX_TEMP_BUF_SI
 
 const WebRtc_UWord32 PLAY_MAX_TEMP_BUF_SIZE_PER_10ms =
     N_PLAY_CHANNELS * PLAY_BUF_SIZE_IN_SAMPLES * sizeof(int16_t);
 
 // Number of the buffers in playout queue
 const WebRtc_UWord16 N_PLAY_QUEUE_BUFFERS = 8;
 // Number of buffers in recording queue
 // TODO(xian): Reduce the numbers of buffers to improve the latency.
-const WebRtc_UWord16 N_REC_QUEUE_BUFFERS = 8;
+const WebRtc_UWord16 N_REC_QUEUE_BUFFERS = 16;
 // Some values returned from getMinBufferSize
 // (Nexus S playout  72ms, recording 64ms)
 // (Galaxy,         167ms,           44ms)
 // (Nexus 7,         72ms,           48ms)
 // (Xoom             92ms,           40ms)
 
 class ThreadWrapper;
 
--- a/media/webrtc/trunk/webrtc/modules/audio_processing/audio_processing.gypi
+++ b/media/webrtc/trunk/webrtc/modules/audio_processing/audio_processing.gypi
@@ -172,21 +172,24 @@
           'ns/nsx_core_neon.c',
         ],
         'conditions': [
           ['OS=="android"', {
             'dependencies': [
               'audio_processing_offsets',
             ],
             # TODO(kma): port this block from Android into other build systems.
-            'sources': [
+	    #
+	    # We disable the ASM source, because our gyp->Makefile translator
+	    # does not support the build steps to get the asm offsets.
+            'sources!': [
               'aecm/aecm_core_neon.S',
               'ns/nsx_core_neon.S',
             ],
-            'sources!': [
+            'sources': [
               'aecm/aecm_core_neon.c',
               'ns/nsx_core_neon.c',
             ],
             'includes!': ['../../build/arm_neon.gypi',],
           }],
         ],
       }],
       'conditions': [
--- a/media/webrtc/webrtc_config.gypi
+++ b/media/webrtc/webrtc_config.gypi
@@ -11,16 +11,17 @@
     'build_with_mozilla': 1,
     'build_with_chromium': 0,
     # basic stuff for everything
     '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
     'use_system_libjpeg': 0,
     'use_system_libvpx': 0,
     'build_libjpeg': 0,
     'build_libvpx': 0,
 
 # (for vp8) chromium sets to 0 also
     'use_temporal_layers': 0,