Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: media/audio/android/audio_record_input.cc

Issue 115413002: Enable platform echo cancellation through the AudioRecord path. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/audio/android/audio_record_input.h ('k') | media/audio/audio_parameters.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « media/audio/android/audio_record_input.h ('k') | media/audio/audio_parameters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698