Bug 866093 - Fix fallback paths for Android JNI Audio. r=jesup
authorGian-Carlo Pascutto <gpascutto@mozilla.com>
Thu, 02 May 2013 08:42:45 +0200
changeset 141524 80f36848bcbe1e97e8a8f7c2e1e7f12a7129b6de
parent 141523 d62ad9a19c33c521e5473575e7cbdd940aecfd01
child 141525 54c41fa92da5e4f1b48f79b2a03612c249fb2fc9
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs866093
milestone23.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 866093 - Fix fallback paths for Android JNI Audio. r=jesup
media/webrtc/trunk/webrtc/modules/audio_device/audio_device_impl.cc
media/webrtc/trunk/webrtc/voice_engine/voice_engine_impl.cc
--- a/media/webrtc/trunk/webrtc/modules/audio_device/audio_device_impl.cc
+++ b/media/webrtc/trunk/webrtc/modules/audio_device/audio_device_impl.cc
@@ -275,17 +275,18 @@ WebRtc_Word32 AudioDeviceModuleImpl::Cre
         }
     }
 
     if (ptrAudioDevice != NULL)
     {
         // Create the Android implementation of the Device Utility.
         ptrAudioDeviceUtility = new AudioDeviceUtilityAndroid(Id());
     }
-#elif defined(WEBRTC_ANDROID_OPENSLES) or defined(WEBRTC_ANDROID)
+#endif
+#if defined(WEBRTC_ANDROID_OPENSLES) or defined(WEBRTC_ANDROID)
     // Fall back to this case if on Android 2.2/OpenSLES not available.
     if (ptrAudioDevice == NULL) {
         // Create the *Android Java* implementation of the Audio Device
         if (audioLayer == kPlatformDefaultAudio)
         {
             // Create *Android JNI Audio* implementation
             ptrAudioDevice = new AudioDeviceAndroidJni(Id());
             WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "Android JNI Audio APIs will be utilized");
--- a/media/webrtc/trunk/webrtc/voice_engine/voice_engine_impl.cc
+++ b/media/webrtc/trunk/webrtc/voice_engine/voice_engine_impl.cc
@@ -3,17 +3,17 @@
  *
  *  Use of this source code is governed by a BSD-style license
  *  that can be found in the LICENSE file in the root of the source
  *  tree. An additional intellectual property rights grant can be found
  *  in the file PATENTS.  All contributing project authors may
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#if defined(WEBRTC_ANDROID) && !defined(WEBRTC_ANDROID_OPENSLES)
+#ifdef ANDROID
 #include "modules/audio_device/android/audio_device_jni_android.h"
 #endif
 
 #include "voice_engine_impl.h"
 #include "trace.h"
 
 namespace webrtc
 {
@@ -139,21 +139,17 @@ bool VoiceEngine::Delete(VoiceEngine*& v
             "%d references remain.", ref);
     }
 
     return true;
 }
 
 int VoiceEngine::SetAndroidObjects(void* javaVM, void* env, void* context)
 {
-#ifdef WEBRTC_ANDROID
-#ifdef WEBRTC_ANDROID_OPENSLES
-  return 0;
-#else
+#if defined(ANDROID) && !defined(MOZ_WIDGET_GONK)
   return AudioDeviceAndroidJni::SetAndroidAudioDeviceObjects(
       javaVM, env, context);
-#endif
 #else
   return -1;
 #endif
 }
 
 } //namespace webrtc