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

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

Issue 256723003: Enable keyboard mic for WebRTC if supported on the device. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 5 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 e47beeada9599414a4b77d88ab07eb3457584baf..3568f1a43996d51a131c02ad516d543d56c8839f 100644
--- a/content/renderer/media/webrtc_audio_capturer.cc
+++ b/content/renderer/media/webrtc_audio_capturer.cc
@@ -172,6 +172,21 @@ bool WebRtcAudioCapturer::Initialize() {
media::ChannelLayout channel_layout = static_cast<media::ChannelLayout>(
device_info_.device.input.channel_layout);
+
+ // If the KEYBOARD_MIC effect is set, change the layout to the corresponding
+ // layout that includes the keyboard mic.
+ if (device_info_.device.input.effects &
+ media::AudioParameters::KEYBOARD_MIC) {
+ 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