| 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 22 matching lines...) Expand all Loading... |
| 33 using pulse::WaitForOperationCompletion; | 33 using pulse::WaitForOperationCompletion; |
| 34 | 34 |
| 35 // Maximum number of output streams that can be open simultaneously. | 35 // Maximum number of output streams that can be open simultaneously. |
| 36 static const int kMaxOutputStreams = 50; | 36 static const int kMaxOutputStreams = 50; |
| 37 | 37 |
| 38 // Define bounds for the output buffer size. | 38 // Define bounds for the output buffer size. |
| 39 static const int kMinimumOutputBufferSize = 512; | 39 static const int kMinimumOutputBufferSize = 512; |
| 40 static const int kMaximumOutputBufferSize = 8192; | 40 static const int kMaximumOutputBufferSize = 8192; |
| 41 | 41 |
| 42 // Default input buffer size. | 42 // Default input buffer size. |
| 43 static const int kDefaultInputBufferSize = 1024; | 43 static const int kDefaultInputBufferSize = 512; |
| 44 | 44 |
| 45 static const base::FilePath::CharType kPulseLib[] = | 45 static const base::FilePath::CharType kPulseLib[] = |
| 46 FILE_PATH_LITERAL("libpulse.so.0"); | 46 FILE_PATH_LITERAL("libpulse.so.0"); |
| 47 | 47 |
| 48 // static | 48 // static |
| 49 AudioManager* AudioManagerPulse::Create(AudioLogFactory* audio_log_factory) { | 49 AudioManager* AudioManagerPulse::Create(AudioLogFactory* audio_log_factory) { |
| 50 scoped_ptr<AudioManagerPulse> ret(new AudioManagerPulse(audio_log_factory)); | 50 scoped_ptr<AudioManagerPulse> ret(new AudioManagerPulse(audio_log_factory)); |
| 51 if (ret->Init()) | 51 if (ret->Init()) |
| 52 return ret.release(); | 52 return ret.release(); |
| 53 | 53 |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 void AudioManagerPulse::SampleRateInfoCallback(pa_context* context, | 336 void AudioManagerPulse::SampleRateInfoCallback(pa_context* context, |
| 337 const pa_server_info* info, | 337 const pa_server_info* info, |
| 338 void* user_data) { | 338 void* user_data) { |
| 339 AudioManagerPulse* manager = reinterpret_cast<AudioManagerPulse*>(user_data); | 339 AudioManagerPulse* manager = reinterpret_cast<AudioManagerPulse*>(user_data); |
| 340 | 340 |
| 341 manager->native_input_sample_rate_ = info->sample_spec.rate; | 341 manager->native_input_sample_rate_ = info->sample_spec.rate; |
| 342 pa_threaded_mainloop_signal(manager->input_mainloop_, 0); | 342 pa_threaded_mainloop_signal(manager->input_mainloop_, 0); |
| 343 } | 343 } |
| 344 | 344 |
| 345 } // namespace media | 345 } // namespace media |
| OLD | NEW |