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

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: moved some of the constraints code to MediaAudioConstraints class, and hope it makes the code more … Created 6 years, 8 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 482d25f1114b2479baabcda0d4fb930c4e5ba944..1548fd123b9c4a11984845a63a1943cc33a62f26 100644
--- a/content/renderer/media/webrtc_audio_capturer.cc
+++ b/content/renderer/media/webrtc_audio_capturer.cc
@@ -163,6 +163,13 @@ bool WebRtcAudioCapturer::Initialize() {
return true;
}
+ MediaAudioConstraints audio_constraints(constraints_,
+ device_info_.device.input.effects);
+ if (!audio_constraints.IsValid()) {
no longer working on chromium 2014/04/11 16:47:05 Per, after thinking a bit more, I am not sure if w
perkj_chrome 2014/04/14 12:15:19 If they are mandatory, we should fail. But if that
+ DLOG(ERROR) << "Constraints contain invalid mandatory keys";
+ 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;
@@ -220,8 +227,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),
@@ -320,8 +326,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