Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/audio_manager_base.h" | 5 #include "media/audio/audio_manager_base.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| 11 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
| 12 #include "base/thread_task_runner_handle.h" | 12 #include "base/thread_task_runner_handle.h" |
| 13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
| 14 #include "media/audio/audio_output_dispatcher_impl.h" | 14 #include "media/audio/audio_output_dispatcher_impl.h" |
| 15 #include "media/audio/audio_output_proxy.h" | 15 #include "media/audio/audio_output_proxy.h" |
| 16 #include "media/audio/audio_output_resampler.h" | 16 #include "media/audio/audio_output_resampler.h" |
| 17 #include "media/audio/fake_audio_input_stream.h" | 17 #include "media/audio/fake_audio_input_stream.h" |
| 18 #include "media/audio/fake_audio_output_stream.h" | 18 #include "media/audio/fake_audio_output_stream.h" |
| 19 #include "media/base/media_switches.h" | 19 #include "media/base/media_switches.h" |
| 20 | 20 |
| 21 #if defined(OS_LINUX) | |
| 22 #include "base/lazy_instance.h" | |
| 23 #endif | |
| 24 | |
| 21 namespace media { | 25 namespace media { |
| 22 | 26 |
| 23 static const int kStreamCloseDelaySeconds = 5; | 27 namespace { |
| 28 | |
| 29 #if defined(OS_LINUX) | |
| 30 base::LazyInstance<std::string>::Leaky g_app_name; | |
|
DaleCurtis
2015/09/02 02:38:21
Can this string just go in the existing audio_mana
| |
| 31 #endif | |
| 32 | |
| 33 const int kStreamCloseDelaySeconds = 5; | |
| 24 | 34 |
| 25 // Default maximum number of output streams that can be open simultaneously | 35 // Default maximum number of output streams that can be open simultaneously |
| 26 // for all platforms. | 36 // for all platforms. |
| 27 static const int kDefaultMaxOutputStreams = 16; | 37 const int kDefaultMaxOutputStreams = 16; |
| 28 | 38 |
| 29 // Default maximum number of input streams that can be open simultaneously | 39 // Default maximum number of input streams that can be open simultaneously |
| 30 // for all platforms. | 40 // for all platforms. |
| 31 static const int kDefaultMaxInputStreams = 16; | 41 const int kDefaultMaxInputStreams = 16; |
| 32 | 42 |
| 33 static const int kMaxInputChannels = 3; | 43 const int kMaxInputChannels = 3; |
| 44 | |
| 45 } // namespace | |
| 34 | 46 |
| 35 const char AudioManagerBase::kDefaultDeviceName[] = "Default"; | 47 const char AudioManagerBase::kDefaultDeviceName[] = "Default"; |
| 36 const char AudioManagerBase::kDefaultDeviceId[] = "default"; | 48 const char AudioManagerBase::kDefaultDeviceId[] = "default"; |
| 37 const char AudioManagerBase::kCommunicationsDeviceId[] = "communications"; | 49 const char AudioManagerBase::kCommunicationsDeviceId[] = "communications"; |
| 38 const char AudioManagerBase::kCommunicationsDeviceName[] = "Communications"; | 50 const char AudioManagerBase::kCommunicationsDeviceName[] = "Communications"; |
| 39 const char AudioManagerBase::kLoopbackInputDeviceId[] = "loopback"; | 51 const char AudioManagerBase::kLoopbackInputDeviceId[] = "loopback"; |
| 40 | 52 |
| 53 #if defined(OS_LINUX) | |
| 54 // static | |
| 55 void AudioManagerBase::SetGlobalAppName(const std::string& app_name) { | |
| 56 g_app_name.Get() = app_name; | |
| 57 } | |
| 58 | |
| 59 // static | |
| 60 const std::string& AudioManagerBase::GetGlobalAppName() { | |
| 61 return g_app_name.Get(); | |
| 62 } | |
| 63 #endif | |
| 64 | |
| 41 struct AudioManagerBase::DispatcherParams { | 65 struct AudioManagerBase::DispatcherParams { |
| 42 DispatcherParams(const AudioParameters& input, | 66 DispatcherParams(const AudioParameters& input, |
| 43 const AudioParameters& output, | 67 const AudioParameters& output, |
| 44 const std::string& output_device_id) | 68 const std::string& output_device_id) |
| 45 : input_params(input), | 69 : input_params(input), |
| 46 output_params(output), | 70 output_params(output), |
| 47 output_device_id(output_device_id) {} | 71 output_device_id(output_device_id) {} |
| 48 ~DispatcherParams() {} | 72 ~DispatcherParams() {} |
| 49 | 73 |
| 50 const AudioParameters input_params; | 74 const AudioParameters input_params; |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 413 scoped_ptr<AudioLog> AudioManagerBase::CreateAudioLog( | 437 scoped_ptr<AudioLog> AudioManagerBase::CreateAudioLog( |
| 414 AudioLogFactory::AudioComponent component) { | 438 AudioLogFactory::AudioComponent component) { |
| 415 return audio_log_factory_->CreateAudioLog(component); | 439 return audio_log_factory_->CreateAudioLog(component); |
| 416 } | 440 } |
| 417 | 441 |
| 418 void AudioManagerBase::SetHasKeyboardMic() { | 442 void AudioManagerBase::SetHasKeyboardMic() { |
| 419 NOTREACHED(); | 443 NOTREACHED(); |
| 420 } | 444 } |
| 421 | 445 |
| 422 } // namespace media | 446 } // namespace media |
| OLD | NEW |