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)); |
28 } | 29 } |
29 | 30 |
30 AudioRecordInputStream::~AudioRecordInputStream() { | 31 AudioRecordInputStream::~AudioRecordInputStream() { |
31 DVLOG(2) << __PRETTY_FUNCTION__; | 32 DVLOG(2) << __PRETTY_FUNCTION__; |
32 DCHECK(thread_checker_.CalledOnValidThread()); | 33 DCHECK(thread_checker_.CalledOnValidThread()); |
33 } | 34 } |
34 | 35 |
35 void AudioRecordInputStream::CacheDirectBufferAddress(JNIEnv* env, jobject obj, | 36 void AudioRecordInputStream::CacheDirectBufferAddress(JNIEnv* env, jobject obj, |
36 jobject byte_buffer) { | 37 jobject byte_buffer) { |
37 DCHECK(thread_checker_.CalledOnValidThread()); | 38 DCHECK(thread_checker_.CalledOnValidThread()); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 void AudioRecordInputStream::SetAutomaticGainControl(bool enabled) { | 122 void AudioRecordInputStream::SetAutomaticGainControl(bool enabled) { |
122 NOTIMPLEMENTED(); | 123 NOTIMPLEMENTED(); |
123 } | 124 } |
124 | 125 |
125 bool AudioRecordInputStream::GetAutomaticGainControl() { | 126 bool AudioRecordInputStream::GetAutomaticGainControl() { |
126 NOTIMPLEMENTED(); | 127 NOTIMPLEMENTED(); |
127 return false; | 128 return false; |
128 } | 129 } |
129 | 130 |
130 } // namespace media | 131 } // namespace media |
OLD | NEW |