Index: webrtc/modules/audio_device/android/audio_record_jni.cc |
diff --git a/webrtc/modules/audio_device/android/audio_record_jni.cc b/webrtc/modules/audio_device/android/audio_record_jni.cc |
index dbebd3f40d371307beff1487c7ac82918a165b74..8f43e4370b93dfbdf033188e1342f8c34677021d 100644 |
--- a/webrtc/modules/audio_device/android/audio_record_jni.cc |
+++ b/webrtc/modules/audio_device/android/audio_record_jni.cc |
@@ -30,11 +30,15 @@ namespace webrtc { |
AudioRecordJni::JavaAudioRecord::JavaAudioRecord( |
NativeRegistration* native_reg, rtc::scoped_ptr<GlobalRef> audio_record) |
: audio_record_(audio_record.Pass()), |
- init_recording_(native_reg->GetMethodId("InitRecording", "(II)I")), |
- start_recording_(native_reg->GetMethodId("StartRecording", "()Z")), |
- stop_recording_(native_reg->GetMethodId("StopRecording", "()Z")), |
+ init_recording_(native_reg->GetMethodId("initRecording", "(II)I")), |
+ start_recording_(native_reg->GetMethodId("startRecording", "()Z")), |
+ stop_recording_(native_reg->GetMethodId("stopRecording", "()Z")), |
enable_built_in_aec_(native_reg->GetMethodId( |
- "EnableBuiltInAEC", "(Z)Z")) { |
+ "enableBuiltInAEC", "(Z)Z")), |
+ enable_built_in_agc_(native_reg->GetMethodId( |
+ "enableBuiltInAGC", "(Z)Z")), |
+ enable_built_in_ns_(native_reg->GetMethodId( |
+ "enableBuiltInNS", "(Z)Z")) { |
} |
AudioRecordJni::JavaAudioRecord::~JavaAudioRecord() {} |
@@ -59,6 +63,16 @@ bool AudioRecordJni::JavaAudioRecord::EnableBuiltInAEC(bool enable) { |
static_cast<jboolean>(enable)); |
} |
+bool AudioRecordJni::JavaAudioRecord::EnableBuiltInAGC(bool enable) { |
+ return audio_record_->CallBooleanMethod(enable_built_in_agc_, |
+ static_cast<jboolean>(enable)); |
+} |
+ |
+bool AudioRecordJni::JavaAudioRecord::EnableBuiltInNS(bool enable) { |
+ return audio_record_->CallBooleanMethod(enable_built_in_ns_, |
+ static_cast<jboolean>(enable)); |
+} |
+ |
// AudioRecordJni implementation. |
AudioRecordJni::AudioRecordJni(AudioManager* audio_manager) |
: j_environment_(JVM::GetInstance()->environment()), |
@@ -186,6 +200,18 @@ int32_t AudioRecordJni::EnableBuiltInAEC(bool enable) { |
return j_audio_record_->EnableBuiltInAEC(enable) ? 0 : -1; |
} |
+int32_t AudioRecordJni::EnableBuiltInAGC(bool enable) { |
+ ALOGD("EnableBuiltInAGC%s", GetThreadInfo().c_str()); |
+ RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
+ return j_audio_record_->EnableBuiltInAGC(enable) ? 0 : -1; |
+} |
+ |
+int32_t AudioRecordJni::EnableBuiltInNS(bool enable) { |
+ ALOGD("EnableBuiltInNS%s", GetThreadInfo().c_str()); |
+ RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
+ return j_audio_record_->EnableBuiltInNS(enable) ? 0 : -1; |
+} |
+ |
void JNICALL AudioRecordJni::CacheDirectBufferAddress( |
JNIEnv* env, jobject obj, jobject byte_buffer, jlong nativeAudioRecord) { |
webrtc::AudioRecordJni* this_object = |