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 device_info.device.group_id = |
| 185 audio_manager_->GetGroupIDInput(device_info.device.id); |
| 186 } |
183 | 187 |
184 // Return the device list through the listener by posting a task on | 188 // Return the device list through the listener by posting a task on |
185 // IO thread since MediaStreamManager handles the callback asynchronously. | 189 // IO thread since MediaStreamManager handles the callback asynchronously. |
186 BrowserThread::PostTask( | 190 BrowserThread::PostTask( |
187 BrowserThread::IO, | 191 BrowserThread::IO, |
188 FROM_HERE, | 192 FROM_HERE, |
189 base::Bind(&AudioInputDeviceManager::DevicesEnumeratedOnIOThread, | 193 base::Bind(&AudioInputDeviceManager::DevicesEnumeratedOnIOThread, |
190 this, stream_type, base::Passed(&devices))); | 194 this, stream_type, base::Passed(&devices))); |
191 } | 195 } |
192 | 196 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 #if defined(OS_CHROMEOS) | 304 #if defined(OS_CHROMEOS) |
301 void AudioInputDeviceManager::SetKeyboardMicStreamActiveOnUIThread( | 305 void AudioInputDeviceManager::SetKeyboardMicStreamActiveOnUIThread( |
302 bool active) { | 306 bool active) { |
303 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 307 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
304 chromeos::CrasAudioHandler::Get()->SetKeyboardMicActive(active); | 308 chromeos::CrasAudioHandler::Get()->SetKeyboardMicActive(active); |
305 } | 309 } |
306 #endif | 310 #endif |
307 | 311 |
308 | 312 |
309 } // namespace content | 313 } // namespace content |
OLD | NEW |