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/pulse/audio_manager_pulse.h" | 5 #include "media/audio/pulse/audio_manager_pulse.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/environment.h" | 8 #include "base/environment.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 operation = pa_context_get_source_info_list( | 105 operation = pa_context_get_source_info_list( |
106 input_context_, InputDevicesInfoCallback, this); | 106 input_context_, InputDevicesInfoCallback, this); |
107 } else { | 107 } else { |
108 operation = pa_context_get_sink_info_list( | 108 operation = pa_context_get_sink_info_list( |
109 input_context_, OutputDevicesInfoCallback, this); | 109 input_context_, OutputDevicesInfoCallback, this); |
110 } | 110 } |
111 WaitForOperationCompletion(input_mainloop_, operation); | 111 WaitForOperationCompletion(input_mainloop_, operation); |
112 | 112 |
113 // Prepend the default device if the list is not empty. | 113 // Prepend the default device if the list is not empty. |
114 if (!device_names->empty()) { | 114 if (!device_names->empty()) { |
115 device_names->push_front( | 115 device_names->push_front(AudioDeviceName( |
116 AudioDeviceName(AudioManagerBase::kDefaultDeviceName, | 116 GetDefaultDeviceName(), AudioManagerBase::kDefaultDeviceId)); |
117 AudioManagerBase::kDefaultDeviceId)); | |
118 } | 117 } |
119 } | 118 } |
120 | 119 |
121 void AudioManagerPulse::GetAudioInputDeviceNames( | 120 void AudioManagerPulse::GetAudioInputDeviceNames( |
122 AudioDeviceNames* device_names) { | 121 AudioDeviceNames* device_names) { |
123 GetAudioDeviceNames(true, device_names); | 122 GetAudioDeviceNames(true, device_names); |
124 } | 123 } |
125 | 124 |
126 void AudioManagerPulse::GetAudioOutputDeviceNames( | 125 void AudioManagerPulse::GetAudioOutputDeviceNames( |
127 AudioDeviceNames* device_names) { | 126 AudioDeviceNames* device_names) { |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 void AudioManagerPulse::SampleRateInfoCallback(pa_context* context, | 331 void AudioManagerPulse::SampleRateInfoCallback(pa_context* context, |
333 const pa_server_info* info, | 332 const pa_server_info* info, |
334 void* user_data) { | 333 void* user_data) { |
335 AudioManagerPulse* manager = reinterpret_cast<AudioManagerPulse*>(user_data); | 334 AudioManagerPulse* manager = reinterpret_cast<AudioManagerPulse*>(user_data); |
336 | 335 |
337 manager->native_input_sample_rate_ = info->sample_spec.rate; | 336 manager->native_input_sample_rate_ = info->sample_spec.rate; |
338 pa_threaded_mainloop_signal(manager->input_mainloop_, 0); | 337 pa_threaded_mainloop_signal(manager->input_mainloop_, 0); |
339 } | 338 } |
340 | 339 |
341 } // namespace media | 340 } // namespace media |
OLD | NEW |