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

Unified Diff: content/renderer/media/webrtc_audio_capturer.cc

Issue 227743004: Added a kEchoCancellation constraint to turn off the audio processing. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 6 years, 7 months 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: content/renderer/media/webrtc_audio_capturer.cc
diff --git a/content/renderer/media/webrtc_audio_capturer.cc b/content/renderer/media/webrtc_audio_capturer.cc
index c4de8e905c1a9e0446fc9210d4d6337f05b3033e..caa3606a3f3baf3314c78ba4c9f9e678cbb3d98e 100644
--- a/content/renderer/media/webrtc_audio_capturer.cc
+++ b/content/renderer/media/webrtc_audio_capturer.cc
@@ -165,6 +165,11 @@ bool WebRtcAudioCapturer::Initialize() {
return true;
}
+ MediaAudioConstraints audio_constraints(constraints_,
+ device_info_.device.input.effects);
+ if (!audio_constraints.IsValid())
+ return false;
+
media::ChannelLayout channel_layout = static_cast<media::ChannelLayout>(
device_info_.device.input.channel_layout);
DVLOG(1) << "Audio input hardware channel layout: " << channel_layout;
@@ -224,8 +229,7 @@ WebRtcAudioCapturer::WebRtcAudioCapturer(
: constraints_(constraints),
audio_processor_(
new talk_base::RefCountedObject<MediaStreamAudioProcessor>(
- constraints, device_info.device.input.effects,
- device_info.device.type, audio_device)),
+ constraints, device_info.device.input.effects, audio_device)),
running_(false),
render_view_id_(render_view_id),
device_info_(device_info),
@@ -332,8 +336,9 @@ void WebRtcAudioCapturer::SetCapturerSource(
// Notify the |audio_processor_| of the new format.
audio_processor_->OnCaptureFormatChanged(params);
- need_audio_processing_ = NeedsAudioProcessing(
- constraints_, device_info_.device.input.effects);
+ MediaAudioConstraints audio_constraints(constraints_,
+ device_info_.device.input.effects);
+ need_audio_processing_ = audio_constraints.NeedsAudioProcessing();
// Notify all tracks about the new format.
tracks_.TagAll();
}

Powered by Google App Engine
This is Rietveld 408576698