| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "media/audio/android/audio_record_input.h" | 5 #include "media/audio/android/audio_record_input.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "jni/AudioRecordInput_jni.h" | 8 #include "jni/AudioRecordInput_jni.h" |
| 9 #include "media/audio/android/audio_manager_android.h" | 9 #include "media/audio/android/audio_manager_android.h" |
| 10 | 10 |
| 11 namespace media { | 11 namespace media { |
| 12 | 12 |
| 13 AudioRecordInputStream::AudioRecordInputStream( | 13 AudioRecordInputStream::AudioRecordInputStream( |
| 14 AudioManagerAndroid* audio_manager, const AudioParameters& params) | 14 AudioManagerAndroid* audio_manager, const AudioParameters& params) |
| 15 : audio_manager_(audio_manager), | 15 : audio_manager_(audio_manager), |
| 16 callback_(NULL), | 16 callback_(NULL), |
| 17 direct_buffer_address_(NULL) { | 17 direct_buffer_address_(NULL) { |
| 18 DVLOG(2) << __PRETTY_FUNCTION__; | 18 DVLOG(2) << __PRETTY_FUNCTION__; |
| 19 DCHECK(params.IsValid()); | 19 DCHECK(params.IsValid()); |
| 20 j_audio_record_.Reset( | 20 j_audio_record_.Reset( |
| 21 Java_AudioRecordInput_createAudioRecordInput( | 21 Java_AudioRecordInput_createAudioRecordInput( |
| 22 base::android::AttachCurrentThread(), | 22 base::android::AttachCurrentThread(), |
| 23 reinterpret_cast<intptr_t>(this), | 23 reinterpret_cast<intptr_t>(this), |
| 24 params.sample_rate(), | 24 params.sample_rate(), |
| 25 params.channels(), | 25 params.channels(), |
| 26 params.bits_per_sample(), | 26 params.bits_per_sample(), |
| 27 params.GetBytesPerBuffer(), | 27 params.GetBytesPerBuffer())); |
| 28 params.effects() & AudioParameters::ECHO_CANCELLER)); | |
| 29 } | 28 } |
| 30 | 29 |
| 31 AudioRecordInputStream::~AudioRecordInputStream() { | 30 AudioRecordInputStream::~AudioRecordInputStream() { |
| 32 DVLOG(2) << __PRETTY_FUNCTION__; | 31 DVLOG(2) << __PRETTY_FUNCTION__; |
| 33 DCHECK(thread_checker_.CalledOnValidThread()); | 32 DCHECK(thread_checker_.CalledOnValidThread()); |
| 34 } | 33 } |
| 35 | 34 |
| 36 void AudioRecordInputStream::CacheDirectBufferAddress(JNIEnv* env, jobject obj, | 35 void AudioRecordInputStream::CacheDirectBufferAddress(JNIEnv* env, jobject obj, |
| 37 jobject byte_buffer) { | 36 jobject byte_buffer) { |
| 38 DCHECK(thread_checker_.CalledOnValidThread()); | 37 DCHECK(thread_checker_.CalledOnValidThread()); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 void AudioRecordInputStream::SetAutomaticGainControl(bool enabled) { | 121 void AudioRecordInputStream::SetAutomaticGainControl(bool enabled) { |
| 123 NOTIMPLEMENTED(); | 122 NOTIMPLEMENTED(); |
| 124 } | 123 } |
| 125 | 124 |
| 126 bool AudioRecordInputStream::GetAutomaticGainControl() { | 125 bool AudioRecordInputStream::GetAutomaticGainControl() { |
| 127 NOTIMPLEMENTED(); | 126 NOTIMPLEMENTED(); |
| 128 return false; | 127 return false; |
| 129 } | 128 } |
| 130 | 129 |
| 131 } // namespace media | 130 } // namespace media |
| OLD | NEW |