OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "media/audio/cras/audio_manager_cras.h" | 5 #include "media/audio/cras/audio_manager_cras.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 return device.mic_positions; | 85 return device.mic_positions; |
86 } | 86 } |
87 } | 87 } |
88 return ""; | 88 return ""; |
89 } | 89 } |
90 | 90 |
91 // Process |device_list| that two shares the same dev_index by creating a | 91 // Process |device_list| that two shares the same dev_index by creating a |
92 // virtual device name for them. | 92 // virtual device name for them. |
93 void ProcessVirtualDeviceName(AudioDeviceNames* device_names, | 93 void ProcessVirtualDeviceName(AudioDeviceNames* device_names, |
94 const chromeos::AudioDeviceList& device_list) { | 94 const chromeos::AudioDeviceList& device_list) { |
95 DCHECK_EQ(2, device_list.size()); | 95 DCHECK_EQ(2U, device_list.size()); |
96 if (device_list[0].type == chromeos::AUDIO_TYPE_LINEOUT || | 96 if (device_list[0].type == chromeos::AUDIO_TYPE_LINEOUT || |
97 device_list[1].type == chromeos::AUDIO_TYPE_LINEOUT) { | 97 device_list[1].type == chromeos::AUDIO_TYPE_LINEOUT) { |
98 device_names->emplace_back(kHeadphoneLineOutVirtualDevice, | 98 device_names->emplace_back(kHeadphoneLineOutVirtualDevice, |
99 base::Uint64ToString(device_list[0].id)); | 99 base::Uint64ToString(device_list[0].id)); |
100 } else if (device_list[0].type == chromeos::AUDIO_TYPE_INTERNAL_SPEAKER || | 100 } else if (device_list[0].type == chromeos::AUDIO_TYPE_INTERNAL_SPEAKER || |
101 device_list[1].type == chromeos::AUDIO_TYPE_INTERNAL_SPEAKER) { | 101 device_list[1].type == chromeos::AUDIO_TYPE_INTERNAL_SPEAKER) { |
102 device_names->emplace_back(kInternalOutputVirtualDevice, | 102 device_names->emplace_back(kInternalOutputVirtualDevice, |
103 base::Uint64ToString(device_list[0].id)); | 103 base::Uint64ToString(device_list[0].id)); |
104 } else { | 104 } else { |
105 DCHECK(device_list[0].type == chromeos::AUDIO_TYPE_INTERNAL_MIC || | 105 DCHECK(device_list[0].type == chromeos::AUDIO_TYPE_INTERNAL_MIC || |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 | 363 |
364 bool AudioManagerCras::IsDefault(const std::string& device_id, bool is_input) { | 364 bool AudioManagerCras::IsDefault(const std::string& device_id, bool is_input) { |
365 AudioDeviceNames device_names; | 365 AudioDeviceNames device_names; |
366 GetAudioDeviceNamesImpl(is_input, &device_names); | 366 GetAudioDeviceNamesImpl(is_input, &device_names); |
367 DCHECK(!device_names.empty()); | 367 DCHECK(!device_names.empty()); |
368 const AudioDeviceName& device_name = device_names.front(); | 368 const AudioDeviceName& device_name = device_names.front(); |
369 return device_name.unique_id == device_id; | 369 return device_name.unique_id == device_id; |
370 } | 370 } |
371 | 371 |
372 } // namespace media | 372 } // namespace media |
OLD | NEW |