| OLD | NEW |
| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 if (render_view_id_ == -1) { | 145 if (render_view_id_ == -1) { |
| 146 // Return true here to allow injecting a new source via | 146 // Return true here to allow injecting a new source via |
| 147 // SetCapturerSourceForTesting() at a later state. | 147 // SetCapturerSourceForTesting() at a later state. |
| 148 return true; | 148 return true; |
| 149 } | 149 } |
| 150 | 150 |
| 151 media::ChannelLayout channel_layout = static_cast<media::ChannelLayout>( | 151 media::ChannelLayout channel_layout = static_cast<media::ChannelLayout>( |
| 152 device_info_.device.input.channel_layout); | 152 device_info_.device.input.channel_layout); |
| 153 DVLOG(1) << "Audio input hardware channel layout: " << channel_layout; | 153 DVLOG(1) << "Audio input hardware channel layout: " << channel_layout; |
| 154 UMA_HISTOGRAM_ENUMERATION("WebRTC.AudioInputChannelLayout", | 154 UMA_HISTOGRAM_ENUMERATION("WebRTC.AudioInputChannelLayout", |
| 155 channel_layout, media::CHANNEL_LAYOUT_MAX); | 155 channel_layout, |
| 156 media::CHANNEL_LAYOUT_HISTOGRAM_MAX); |
| 156 | 157 |
| 157 // Verify that the reported input channel configuration is supported. | 158 // Verify that the reported input channel configuration is supported. |
| 158 if (channel_layout != media::CHANNEL_LAYOUT_MONO && | 159 if (channel_layout != media::CHANNEL_LAYOUT_MONO && |
| 159 channel_layout != media::CHANNEL_LAYOUT_STEREO) { | 160 channel_layout != media::CHANNEL_LAYOUT_STEREO) { |
| 160 DLOG(ERROR) << channel_layout | 161 DLOG(ERROR) << channel_layout |
| 161 << " is not a supported input channel configuration."; | 162 << " is not a supported input channel configuration."; |
| 162 return false; | 163 return false; |
| 163 } | 164 } |
| 164 | 165 |
| 165 DVLOG(1) << "Audio input hardware sample rate: " | 166 DVLOG(1) << "Audio input hardware sample rate: " |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 const scoped_refptr<media::AudioCapturerSource>& source, | 582 const scoped_refptr<media::AudioCapturerSource>& source, |
| 582 media::AudioParameters params) { | 583 media::AudioParameters params) { |
| 583 // Create a new audio stream as source which uses the new source. | 584 // Create a new audio stream as source which uses the new source. |
| 584 SetCapturerSource(source, params.channel_layout(), | 585 SetCapturerSource(source, params.channel_layout(), |
| 585 static_cast<float>(params.sample_rate()), | 586 static_cast<float>(params.sample_rate()), |
| 586 params.effects(), | 587 params.effects(), |
| 587 constraints_); | 588 constraints_); |
| 588 } | 589 } |
| 589 | 590 |
| 590 } // namespace content | 591 } // namespace content |
| OLD | NEW |