| 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/browser/renderer_host/media/audio_input_device_manager.h" | 5 #include "content/browser/renderer_host/media/audio_input_device_manager.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 } | 135 } |
| 136 } | 136 } |
| 137 #endif | 137 #endif |
| 138 | 138 |
| 139 void AudioInputDeviceManager::OpenOnDeviceThread( | 139 void AudioInputDeviceManager::OpenOnDeviceThread( |
| 140 int session_id, const StreamDeviceInfo& info) { | 140 int session_id, const StreamDeviceInfo& info) { |
| 141 SCOPED_UMA_HISTOGRAM_TIMER( | 141 SCOPED_UMA_HISTOGRAM_TIMER( |
| 142 "Media.AudioInputDeviceManager.OpenOnDeviceThreadTime"); | 142 "Media.AudioInputDeviceManager.OpenOnDeviceThreadTime"); |
| 143 DCHECK(IsOnDeviceThread()); | 143 DCHECK(IsOnDeviceThread()); |
| 144 | 144 |
| 145 StreamDeviceInfo out(info.device.type, info.device.name, info.device.id, | 145 StreamDeviceInfo out(info.device.type, info.device.name, info.device.id, 0, 0, |
| 146 info.device.group_id, 0, 0, 0); | 146 0); |
| 147 out.session_id = session_id; | 147 out.session_id = session_id; |
| 148 | 148 |
| 149 MediaStreamDevice::AudioDeviceParameters& input_params = out.device.input; | 149 MediaStreamDevice::AudioDeviceParameters& input_params = out.device.input; |
| 150 | 150 |
| 151 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 151 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 152 switches::kUseFakeDeviceForMediaStream)) { | 152 switches::kUseFakeDeviceForMediaStream)) { |
| 153 // Don't need to query the hardware information if using fake device. | 153 // Don't need to query the hardware information if using fake device. |
| 154 input_params.sample_rate = 44100; | 154 input_params.sample_rate = 44100; |
| 155 input_params.channel_layout = media::CHANNEL_LAYOUT_STEREO; | 155 input_params.channel_layout = media::CHANNEL_LAYOUT_STEREO; |
| 156 } else { | 156 } else { |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 #if defined(OS_CHROMEOS) | 224 #if defined(OS_CHROMEOS) |
| 225 void AudioInputDeviceManager::SetKeyboardMicStreamActiveOnUIThread( | 225 void AudioInputDeviceManager::SetKeyboardMicStreamActiveOnUIThread( |
| 226 bool active) { | 226 bool active) { |
| 227 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 227 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 228 chromeos::CrasAudioHandler::Get()->SetKeyboardMicActive(active); | 228 chromeos::CrasAudioHandler::Get()->SetKeyboardMicActive(active); |
| 229 } | 229 } |
| 230 #endif | 230 #endif |
| 231 | 231 |
| 232 | 232 |
| 233 } // namespace content | 233 } // namespace content |
| OLD | NEW |