Fix building error and rename java class name

1. Fix building error because of r2804
2. Rename java class name to WebRTCAudioDevice, so it's more meaningful
to 3rd party devleoper

BUG=None
TEST=try bots
Review URL: https://webrtc-codereview.appspot.com/821006

git-svn-id: http://webrtc.googlecode.com/svn/trunk@2815 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
leozwang@webrtc.org 2012-09-24 18:46:05 +00:00
parent 81f09d709e
commit e4ba864368
4 changed files with 14 additions and 14 deletions

View File

@ -55,7 +55,7 @@ WebRtc_Word32 AudioDeviceAndroidJni::SetAndroidAudioDeviceObjects(
globalJNIEnv = reinterpret_cast<JNIEnv*>(env);
// Get java class type (note path to class packet).
jclass javaScClassLocal = globalJNIEnv->FindClass(
"org/webrtc/voiceengine/AudioDeviceAndroid");
"org/webrtc/voiceengine/WebRTCAudioDevice");
if (!javaScClassLocal) {
WEBRTC_TRACE(kTraceError, kTraceAudioDevice, -1,
"%s: could not find java class", __FUNCTION__);

View File

@ -20,7 +20,7 @@ import android.media.AudioRecord;
import android.media.AudioTrack;
import android.util.Log;
class AudioDeviceAndroid {
class WebRTCAudioDevice {
private AudioTrack _audioTrack = null;
private AudioRecord _audioRecord = null;
@ -44,7 +44,7 @@ class AudioDeviceAndroid {
private int _bufferedPlaySamples = 0;
private int _playPosition = 0;
AudioDeviceAndroid() {
WebRTCAudioDevice() {
try {
_playBuffer = ByteBuffer.allocateDirect(2 * 480); // Max 10 ms @ 48
// kHz
@ -125,10 +125,10 @@ class AudioDeviceAndroid {
@SuppressWarnings("unused")
private int InitPlayback(int sampleRate) {
// get the minimum buffer size that can be used
int minPlayBufSize =
AudioTrack.getMinBufferSize(sampleRate,
AudioFormat.CHANNEL_CONFIGURATION_MONO,
AudioFormat.ENCODING_PCM_16BIT);
int minPlayBufSize = AudioTrack.getMinBufferSize(
sampleRate,
AudioFormat.CHANNEL_CONFIGURATION_MONO,
AudioFormat.ENCODING_PCM_16BIT);
// DoLog("min play buf size is " + minPlayBufSize);
@ -479,12 +479,12 @@ class AudioDeviceAndroid {
// ***IMPORTANT*** When the API level for honeycomb (H) has been
// decided,
// the condition should be changed to include API level 8 to H-1.
if ((android.os.Build.BRAND.equals("Samsung") || android.os.Build.BRAND
.equals("samsung")) && (8 == apiLevel)) {
if ((android.os.Build.BRAND.equals("Samsung") ||
android.os.Build.BRAND.equals("samsung")) &&
(8 == apiLevel)) {
// Set Samsung specific VoIP mode for 2.2 devices
int mode =
(startCall ? 4 /* VoIP mode */
: AudioManager.MODE_NORMAL);
// 4 is VoIP mode
int mode = (startCall ? 4 : AudioManager.MODE_NORMAL);
_audioManager.setMode(mode);
if (_audioManager.getMode() != mode) {
DoLogErr("Could not set audio mode for Samsung device");

View File

@ -26,7 +26,7 @@
],
'include_dirs': [
'include',
'<(webrtc_root)/modules/audio_device/main/source',
'<(webrtc_root)/modules/audio_device',
],
'direct_dependent_settings': {
'include_dirs': [

View File

@ -9,7 +9,7 @@
*/
#if defined(WEBRTC_ANDROID) && !defined(WEBRTC_ANDROID_OPENSLES)
#include "modules/audio_device/main/source/android/audio_device_android_jni.h"
#include "modules/audio_device/android/audio_device_android_jni.h"
#endif
#include "voice_engine_impl.h"