Chromium Code Reviews| Index: media/audio/audio_manager_base.cc |
| diff --git a/media/audio/audio_manager_base.cc b/media/audio/audio_manager_base.cc |
| index ebf1d3617ad6064ae45ad53780b9b90ba1124d8b..2c671ccca28888f2ab7f9d745a47b290d929e90e 100644 |
| --- a/media/audio/audio_manager_base.cc |
| +++ b/media/audio/audio_manager_base.cc |
| @@ -18,19 +18,31 @@ |
| #include "media/audio/fake_audio_output_stream.h" |
| #include "media/base/media_switches.h" |
| +#if defined(OS_LINUX) |
| +#include "base/lazy_instance.h" |
| +#endif |
| + |
| namespace media { |
| -static const int kStreamCloseDelaySeconds = 5; |
| +namespace { |
| + |
| +#if defined(OS_LINUX) |
| +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
|
| +#endif |
| + |
| +const int kStreamCloseDelaySeconds = 5; |
| // Default maximum number of output streams that can be open simultaneously |
| // for all platforms. |
| -static const int kDefaultMaxOutputStreams = 16; |
| +const int kDefaultMaxOutputStreams = 16; |
| // Default maximum number of input streams that can be open simultaneously |
| // for all platforms. |
| -static const int kDefaultMaxInputStreams = 16; |
| +const int kDefaultMaxInputStreams = 16; |
| + |
| +const int kMaxInputChannels = 3; |
| -static const int kMaxInputChannels = 3; |
| +} // namespace |
| const char AudioManagerBase::kDefaultDeviceName[] = "Default"; |
| const char AudioManagerBase::kDefaultDeviceId[] = "default"; |
| @@ -38,6 +50,18 @@ const char AudioManagerBase::kCommunicationsDeviceId[] = "communications"; |
| const char AudioManagerBase::kCommunicationsDeviceName[] = "Communications"; |
| const char AudioManagerBase::kLoopbackInputDeviceId[] = "loopback"; |
| +#if defined(OS_LINUX) |
| +// static |
| +void AudioManagerBase::SetGlobalAppName(const std::string& app_name) { |
| + g_app_name.Get() = app_name; |
| +} |
| + |
| +// static |
| +const std::string& AudioManagerBase::GetGlobalAppName() { |
| + return g_app_name.Get(); |
| +} |
| +#endif |
| + |
| struct AudioManagerBase::DispatcherParams { |
| DispatcherParams(const AudioParameters& input, |
| const AudioParameters& output, |