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/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 audio_manager_->GetAudioInputDeviceNames(&device_names); | 173 audio_manager_->GetAudioInputDeviceNames(&device_names); |
174 } | 174 } |
175 | 175 |
176 std::unique_ptr<StreamDeviceInfoArray> devices(new StreamDeviceInfoArray()); | 176 std::unique_ptr<StreamDeviceInfoArray> devices(new StreamDeviceInfoArray()); |
177 for (media::AudioDeviceNames::iterator it = device_names.begin(); | 177 for (media::AudioDeviceNames::iterator it = device_names.begin(); |
178 it != device_names.end(); ++it) { | 178 it != device_names.end(); ++it) { |
179 // Add device information to device vector. | 179 // Add device information to device vector. |
180 devices->push_back(StreamDeviceInfo( | 180 devices->push_back(StreamDeviceInfo( |
181 stream_type, it->device_name, it->unique_id)); | 181 stream_type, it->device_name, it->unique_id)); |
182 } | 182 } |
| 183 for (StreamDeviceInfo& device_info : *devices) { |
| 184 if (IsAudioInputMediaType(device_info.device.type)) { |
| 185 device_info.device.matched_output_device_id = |
| 186 audio_manager_->GetAssociatedOutputDeviceID(device_info.device.id); |
| 187 } |
| 188 } |
183 | 189 |
184 // Return the device list through the listener by posting a task on | 190 // Return the device list through the listener by posting a task on |
185 // IO thread since MediaStreamManager handles the callback asynchronously. | 191 // IO thread since MediaStreamManager handles the callback asynchronously. |
186 BrowserThread::PostTask( | 192 BrowserThread::PostTask( |
187 BrowserThread::IO, | 193 BrowserThread::IO, |
188 FROM_HERE, | 194 FROM_HERE, |
189 base::Bind(&AudioInputDeviceManager::DevicesEnumeratedOnIOThread, | 195 base::Bind(&AudioInputDeviceManager::DevicesEnumeratedOnIOThread, |
190 this, stream_type, base::Passed(&devices))); | 196 this, stream_type, base::Passed(&devices))); |
191 } | 197 } |
192 | 198 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 #if defined(OS_CHROMEOS) | 306 #if defined(OS_CHROMEOS) |
301 void AudioInputDeviceManager::SetKeyboardMicStreamActiveOnUIThread( | 307 void AudioInputDeviceManager::SetKeyboardMicStreamActiveOnUIThread( |
302 bool active) { | 308 bool active) { |
303 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 309 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
304 chromeos::CrasAudioHandler::Get()->SetKeyboardMicActive(active); | 310 chromeos::CrasAudioHandler::Get()->SetKeyboardMicActive(active); |
305 } | 311 } |
306 #endif | 312 #endif |
307 | 313 |
308 | 314 |
309 } // namespace content | 315 } // namespace content |
OLD | NEW |