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

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

Issue 598563002: Switch to keyboard mic layout for WebRTC if conditions are met. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@activate_kmic_if_layout
Patch Set: Created 6 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b65e0a957da65f074bb5638a03ab2f946d660d0a..6d6518fb142a97c750a6a1583927a6a85286a786 100644
--- a/content/renderer/media/webrtc_audio_capturer.cc
+++ b/content/renderer/media/webrtc_audio_capturer.cc
@@ -156,6 +156,24 @@ bool WebRtcAudioCapturer::Initialize() {
media::ChannelLayout channel_layout = static_cast<media::ChannelLayout>(
device_info_.device.input.channel_layout);
+
+ // If KEYBOARD_MIC effect is set, change the layout to the corresponding
+ // layout that includes the keyboard mic.
+ if (MediaStreamAudioProcessor::IsAudioTrackProcessingEnabled() &&
+ audio_constraints.GetProperty(
+ MediaAudioConstraints::kGoogExperimentalNoiseSuppression) &&
+ (device_info_.device.input.effects &
+ media::AudioParameters::KEYBOARD_MIC)) {
tommi (sloooow) - chröme 2014/09/23 17:27:00 nit: this seems like the fastest condition to be c
Henrik Grunell 2014/09/25 10:08:36 Done.
+ if (channel_layout == media::CHANNEL_LAYOUT_STEREO) {
+ channel_layout = media::CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC;
+ DVLOG(1) << "Changed stereo layout to stereo + keyboard mic layout due "
+ << "to KEYBOARD_MIC effect.";
+ } else {
+ DVLOG(1) << "KEYBOARD_MIC effect ignored, not compatible with layout "
+ << channel_layout;
+ }
+ }
+
DVLOG(1) << "Audio input hardware channel layout: " << channel_layout;
UMA_HISTOGRAM_ENUMERATION("WebRTC.AudioInputChannelLayout",
channel_layout, media::CHANNEL_LAYOUT_MAX + 1);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698