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