summaryrefslogtreecommitdiff
path: root/voice_engine/voice_engine_impl.cc
diff options
context:
space:
mode:
authorhenrike@webrtc.org <henrike@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d>2013-12-11 21:42:44 +0000
committerhenrike@webrtc.org <henrike@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d>2013-12-11 21:42:44 +0000
commit27f08414780932bbd4bd0fa2bbf759787b9c2e03 (patch)
treebf6f08b6cda20b6c82b6e77385dec4357bb2bc8d /voice_engine/voice_engine_impl.cc
parent6bf67db1cf563aa7eb24decea69a0a5a349b022f (diff)
downloadwebrtc-27f08414780932bbd4bd0fa2bbf759787b9c2e03.tar.gz
Enables mixing and matching Java and native audio. It is used for getting best of both worlds capabilities (AEC and low latency).
BUG=N/A R=fischman@webrtc.org, niklas.enbom@webrtc.org Review URL: https://webrtc-codereview.appspot.com/4189004 git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@5270 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'voice_engine/voice_engine_impl.cc')
-rw-r--r--voice_engine/voice_engine_impl.cc22
1 files changed, 9 insertions, 13 deletions
diff --git a/voice_engine/voice_engine_impl.cc b/voice_engine/voice_engine_impl.cc
index 4af15f9a..038609ca 100644
--- a/voice_engine/voice_engine_impl.cc
+++ b/voice_engine/voice_engine_impl.cc
@@ -9,11 +9,11 @@
*/
#if defined(WEBRTC_ANDROID)
-#if defined(WEBRTC_ANDROID_OPENSLES)
-#include "webrtc/modules/audio_device/android/audio_manager_jni.h"
-#else
-#include "webrtc/modules/audio_device/android/audio_device_jni_android.h"
-#endif
+#include "webrtc/modules/audio_device/android/audio_device_template.h"
+#include "webrtc/modules/audio_device/android/audio_record_jni.h"
+#include "webrtc/modules/audio_device/android/audio_track_jni.h"
+#include "webrtc/modules/audio_device/android/opensles_input.h"
+#include "webrtc/modules/audio_device/android/opensles_output.h"
#endif
#include "webrtc/modules/audio_coding/main/interface/audio_coding_module.h"
@@ -149,15 +149,11 @@ int VoiceEngine::SetAndroidObjects(void* javaVM, void* env, void* context)
{
#ifdef WEBRTC_ANDROID
#ifdef WEBRTC_ANDROID_OPENSLES
- if (javaVM && env && context) {
- AudioManagerJni::SetAndroidAudioDeviceObjects(javaVM, env, context);
- } else {
- AudioManagerJni::ClearAndroidAudioDeviceObjects();
- }
- return 0;
+ return AudioDeviceTemplate<OpenSlesInput, OpenSlesOutput>::
+ SetAndroidAudioDeviceObjects(javaVM, env, context);
#else
- return AudioDeviceAndroidJni::SetAndroidAudioDeviceObjects(
- javaVM, env, context);
+ return AudioDeviceTemplate<AudioRecordJni, AudioTrackJni>::
+ SetAndroidAudioDeviceObjects(javaVM, env, context);
#endif
#else
return -1;