Chromium Code Reviews| 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); |