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

Unified Diff: trunk/src/media/audio/android/audio_manager_android.cc

Issue 110303003: Revert 240548 "Enable platform echo cancellation through the Aud..." (Closed) Base URL: svn://svn.chromium.org/chrome/
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 side-by-side diff with in-line comments
Download patch
Index: trunk/src/media/audio/android/audio_manager_android.cc
===================================================================
--- trunk/src/media/audio/android/audio_manager_android.cc (revision 240588)
+++ trunk/src/media/audio/android/audio_manager_android.cc (working copy)
@@ -11,7 +11,6 @@
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
#include "jni/AudioManagerAndroid_jni.h"
-#include "media/audio/android/audio_record_input.h"
#include "media/audio/android/opensles_input.h"
#include "media/audio/android/opensles_output.h"
#include "media/audio/audio_manager.h"
@@ -104,22 +103,18 @@
AudioParameters AudioManagerAndroid::GetInputStreamParameters(
const std::string& device_id) {
- JNIEnv* env = AttachCurrentThread();
// Use mono as preferred number of input channels on Android to save
// resources. Using mono also avoids a driver issue seen on Samsung
// Galaxy S3 and S4 devices. See http://crbug.com/256851 for details.
ChannelLayout channel_layout = CHANNEL_LAYOUT_MONO;
int buffer_size = Java_AudioManagerAndroid_getMinInputFrameSize(
- env, GetNativeOutputSampleRate(),
+ base::android::AttachCurrentThread(), GetNativeOutputSampleRate(),
ChannelLayoutToChannelCount(channel_layout));
- int effects = AudioParameters::NO_EFFECTS;
- effects |= Java_AudioManagerAndroid_shouldUseAcousticEchoCanceler(env) ?
- AudioParameters::ECHO_CANCELLER : AudioParameters::NO_EFFECTS;
- AudioParameters params(
- AudioParameters::AUDIO_PCM_LOW_LATENCY, channel_layout, 0,
+
+ return AudioParameters(
+ AudioParameters::AUDIO_PCM_LOW_LATENCY, channel_layout,
GetNativeOutputSampleRate(), 16,
- buffer_size <= 0 ? kDefaultInputBufferSize : buffer_size, effects);
- return params;
+ buffer_size <= 0 ? kDefaultInputBufferSize : buffer_size);
}
AudioOutputStream* AudioManagerAndroid::MakeAudioOutputStream(
@@ -194,20 +189,6 @@
// device, i.e., this selection does also switch the output device.
// All input and output streams will be affected by the device selection.
SetAudioDevice(device_id);
-
- if (params.effects() != AudioParameters::NO_EFFECTS) {
- // Platform effects can only be enabled through the AudioRecord path.
- // An effect should only have been requested here if recommended by
- // AudioManagerAndroid.shouldUse<Effect>.
- //
- // Creating this class requires Jelly Bean, which is already guaranteed by
- // shouldUse<Effect>. Only DCHECK on that condition to allow tests to use
- // the effect settings as a way to select the input path.
- DCHECK_GE(base::android::BuildInfo::GetInstance()->sdk_int(), 16);
- DVLOG(1) << "Creating AudioRecordInputStream";
- return new AudioRecordInputStream(this, params);
- }
- DVLOG(1) << "Creating OpenSLESInputStream";
return new OpenSLESInputStream(this, params);
}
@@ -249,7 +230,7 @@
return AudioParameters(
AudioParameters::AUDIO_PCM_LOW_LATENCY, channel_layout, input_channels,
- sample_rate, bits_per_sample, buffer_size, AudioParameters::NO_EFFECTS);
+ sample_rate, bits_per_sample, buffer_size);
}
// static
« no previous file with comments | « trunk/src/media/audio/android/audio_manager_android.h ('k') | trunk/src/media/audio/android/audio_record_input.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698