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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 channel_layout = input_params.channel_layout(); | 182 channel_layout = input_params.channel_layout(); |
183 buffer_size = | 183 buffer_size = |
184 std::min(kMaximumOutputBufferSize, | 184 std::min(kMaximumOutputBufferSize, |
185 std::max(buffer_size, input_params.frames_per_buffer())); | 185 std::max(buffer_size, input_params.frames_per_buffer())); |
186 } | 186 } |
187 | 187 |
188 int user_buffer_size = GetUserBufferSize(); | 188 int user_buffer_size = GetUserBufferSize(); |
189 if (user_buffer_size) | 189 if (user_buffer_size) |
190 buffer_size = user_buffer_size; | 190 buffer_size = user_buffer_size; |
191 | 191 |
192 return AudioParameters( | 192 return AudioParameters(AudioParameters::AUDIO_PCM_LOW_LATENCY, channel_layout, |
193 AudioParameters::AUDIO_PCM_LOW_LATENCY, channel_layout, | 193 sample_rate, bits_per_sample, buffer_size); |
194 sample_rate, bits_per_sample, buffer_size, AudioParameters::NO_EFFECTS); | |
195 } | 194 } |
196 | 195 |
197 AudioOutputStream* AudioManagerPulse::MakeOutputStream( | 196 AudioOutputStream* AudioManagerPulse::MakeOutputStream( |
198 const AudioParameters& params, | 197 const AudioParameters& params, |
199 const std::string& device_id) { | 198 const std::string& device_id) { |
200 DCHECK(!device_id.empty()); | 199 DCHECK(!device_id.empty()); |
201 return new PulseAudioOutputStream(params, device_id, this); | 200 return new PulseAudioOutputStream(params, device_id, this); |
202 } | 201 } |
203 | 202 |
204 AudioInputStream* AudioManagerPulse::MakeInputStream( | 203 AudioInputStream* AudioManagerPulse::MakeInputStream( |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 void AudioManagerPulse::SampleRateInfoCallback(pa_context* context, | 332 void AudioManagerPulse::SampleRateInfoCallback(pa_context* context, |
334 const pa_server_info* info, | 333 const pa_server_info* info, |
335 void* user_data) { | 334 void* user_data) { |
336 AudioManagerPulse* manager = reinterpret_cast<AudioManagerPulse*>(user_data); | 335 AudioManagerPulse* manager = reinterpret_cast<AudioManagerPulse*>(user_data); |
337 | 336 |
338 manager->native_input_sample_rate_ = info->sample_spec.rate; | 337 manager->native_input_sample_rate_ = info->sample_spec.rate; |
339 pa_threaded_mainloop_signal(manager->input_mainloop_, 0); | 338 pa_threaded_mainloop_signal(manager->input_mainloop_, 0); |
340 } | 339 } |
341 | 340 |
342 } // namespace media | 341 } // namespace media |
OLD | NEW |