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

Side by Side Diff: content/renderer/media/webrtc_audio_capturer.cc

Issue 197453002: Support 3 channels for audio input. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | media/audio/audio_input_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/media/webrtc_audio_capturer.h" 5 #include "content/renderer/media/webrtc_audio_capturer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 } 166 }
167 167
168 media::ChannelLayout channel_layout = static_cast<media::ChannelLayout>( 168 media::ChannelLayout channel_layout = static_cast<media::ChannelLayout>(
169 device_info_.device.input.channel_layout); 169 device_info_.device.input.channel_layout);
170 DVLOG(1) << "Audio input hardware channel layout: " << channel_layout; 170 DVLOG(1) << "Audio input hardware channel layout: " << channel_layout;
171 UMA_HISTOGRAM_ENUMERATION("WebRTC.AudioInputChannelLayout", 171 UMA_HISTOGRAM_ENUMERATION("WebRTC.AudioInputChannelLayout",
172 channel_layout, media::CHANNEL_LAYOUT_MAX + 1); 172 channel_layout, media::CHANNEL_LAYOUT_MAX + 1);
173 173
174 // Verify that the reported input channel configuration is supported. 174 // Verify that the reported input channel configuration is supported.
175 if (channel_layout != media::CHANNEL_LAYOUT_MONO && 175 if (channel_layout != media::CHANNEL_LAYOUT_MONO &&
176 channel_layout != media::CHANNEL_LAYOUT_STEREO) { 176 channel_layout != media::CHANNEL_LAYOUT_STEREO &&
177 channel_layout != media::CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC) {
177 DLOG(ERROR) << channel_layout 178 DLOG(ERROR) << channel_layout
178 << " is not a supported input channel configuration."; 179 << " is not a supported input channel configuration.";
179 return false; 180 return false;
180 } 181 }
181 182
182 DVLOG(1) << "Audio input hardware sample rate: " 183 DVLOG(1) << "Audio input hardware sample rate: "
183 << device_info_.device.input.sample_rate; 184 << device_info_.device.input.sample_rate;
184 media::AudioSampleRate asr; 185 media::AudioSampleRate asr;
185 if (media::ToAudioSampleRate(device_info_.device.input.sample_rate, &asr)) { 186 if (media::ToAudioSampleRate(device_info_.device.input.sample_rate, &asr)) {
186 UMA_HISTOGRAM_ENUMERATION( 187 UMA_HISTOGRAM_ENUMERATION(
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 DCHECK(aec_dump_file.IsValid()); 615 DCHECK(aec_dump_file.IsValid());
615 audio_processor_->StartAecDump(aec_dump_file.Pass()); 616 audio_processor_->StartAecDump(aec_dump_file.Pass());
616 } 617 }
617 618
618 void WebRtcAudioCapturer::StopAecDump() { 619 void WebRtcAudioCapturer::StopAecDump() {
619 DCHECK(thread_checker_.CalledOnValidThread()); 620 DCHECK(thread_checker_.CalledOnValidThread());
620 audio_processor_->StopAecDump(); 621 audio_processor_->StopAecDump();
621 } 622 }
622 623
623 } // namespace content 624 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | media/audio/audio_input_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698