| 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/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/nix/xdg_util.h" | 10 #include "base/nix/xdg_util.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 devices_(NULL), | 44 devices_(NULL), |
| 45 native_input_sample_rate_(0), | 45 native_input_sample_rate_(0), |
| 46 native_channel_count_(0) { | 46 native_channel_count_(0) { |
| 47 DCHECK(input_mainloop_); | 47 DCHECK(input_mainloop_); |
| 48 DCHECK(input_context_); | 48 DCHECK(input_context_); |
| 49 SetMaxOutputStreamsAllowed(kMaxOutputStreams); | 49 SetMaxOutputStreamsAllowed(kMaxOutputStreams); |
| 50 } | 50 } |
| 51 | 51 |
| 52 AudioManagerPulse::~AudioManagerPulse() = default; | 52 AudioManagerPulse::~AudioManagerPulse() = default; |
| 53 | 53 |
| 54 void AudioManagerPulse::ShutdownOnAudioThread() { | 54 void AudioManagerPulse::ShutdownOnAudioThread(bool immediately) { |
| 55 AudioManagerBase::ShutdownOnAudioThread(); | 55 AudioManagerBase::ShutdownOnAudioThread(immediately); |
| 56 // The Pulse objects are the last things to be destroyed since | 56 // The Pulse objects are the last things to be destroyed since |
| 57 // AudioManagerBase::ShutdownOnAudioThread() needs them. | 57 // AudioManagerBase::ShutdownOnAudioThread() needs them. |
| 58 pulse::DestroyPulse(input_mainloop_, input_context_); | 58 pulse::DestroyPulse(input_mainloop_, input_context_); |
| 59 } | 59 } |
| 60 | 60 |
| 61 bool AudioManagerPulse::HasAudioOutputDevices() { | 61 bool AudioManagerPulse::HasAudioOutputDevices() { |
| 62 AudioDeviceNames devices; | 62 AudioDeviceNames devices; |
| 63 GetAudioOutputDeviceNames(&devices); | 63 GetAudioOutputDeviceNames(&devices); |
| 64 return !devices.empty(); | 64 return !devices.empty(); |
| 65 } | 65 } |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 const pa_server_info* info, | 248 const pa_server_info* info, |
| 249 void* user_data) { | 249 void* user_data) { |
| 250 AudioManagerPulse* manager = reinterpret_cast<AudioManagerPulse*>(user_data); | 250 AudioManagerPulse* manager = reinterpret_cast<AudioManagerPulse*>(user_data); |
| 251 | 251 |
| 252 manager->native_input_sample_rate_ = info->sample_spec.rate; | 252 manager->native_input_sample_rate_ = info->sample_spec.rate; |
| 253 manager->native_channel_count_ = info->sample_spec.channels; | 253 manager->native_channel_count_ = info->sample_spec.channels; |
| 254 pa_threaded_mainloop_signal(manager->input_mainloop_, 0); | 254 pa_threaded_mainloop_signal(manager->input_mainloop_, 0); |
| 255 } | 255 } |
| 256 | 256 |
| 257 } // namespace media | 257 } // namespace media |
| OLD | NEW |