Make SetAndroidAudioDeviceObjects return 0
Description: Make SetAndroidAudioDeviceObjects return 0 so application can work with both java and opensl implementation without code change. BUG=None TEST=trybot Review URL: https://webrtc-codereview.appspot.com/817004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@2802 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -15,7 +15,9 @@
|
||||
// TODO(xians): Break out attach and detach current thread to JVM to
|
||||
// separate functions.
|
||||
|
||||
#include <android/log.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "audio_device_utility.h"
|
||||
#include "audio_device_android_jni.h"
|
||||
#include "audio_device_config.h"
|
||||
@ -44,6 +46,8 @@ WebRtc_Word32 AudioDeviceAndroidJni::SetAndroidAudioDeviceObjects(
|
||||
void* javaVM,
|
||||
void* env,
|
||||
void* context) {
|
||||
__android_log_print(ANDROID_LOG_DEBUG, "WEBRTC", "JNI:%s", __FUNCTION__);
|
||||
|
||||
// TODO(leozwang): Make this function thread-safe.
|
||||
globalJvm = reinterpret_cast<JavaVM*>(javaVM);
|
||||
|
||||
|
@ -144,9 +144,13 @@ bool VoiceEngine::Delete(VoiceEngine*& voiceEngine)
|
||||
|
||||
int VoiceEngine::SetAndroidObjects(void* javaVM, void* env, void* context)
|
||||
{
|
||||
#if defined(WEBRTC_ANDROID) && !defined(WEBRTC_ANDROID_OPENSLES)
|
||||
#ifdef WEBRTC_ANDROID
|
||||
#ifdef WEBRTC_ANDROID_OPENSLES
|
||||
return 0;
|
||||
#else
|
||||
return AudioDeviceAndroidJni::SetAndroidAudioDeviceObjects(
|
||||
javaVM, env, context);
|
||||
#endif
|
||||
#else
|
||||
return -1;
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user