Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(811)

Unified Diff: media/audio/audio_manager_base.cc

Issue 1317033006: Linux: Do not use a hard coded app name for PulseAudio output. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix chromeos Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/audio/audio_manager_base.h ('k') | media/audio/pulse/pulse_output.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « media/audio/audio_manager_base.h ('k') | media/audio/pulse/pulse_output.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698