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

Unified Diff: media/audio/linux/audio_manager_linux.cc

Issue 12310101: Enable pulse as the default IO handling in Chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added UMA histogram Created 7 years, 9 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 | « no previous file | media/audio/openbsd/audio_manager_openbsd.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/linux/audio_manager_linux.cc
diff --git a/media/audio/linux/audio_manager_linux.cc b/media/audio/linux/audio_manager_linux.cc
index 8cf8355da3c668ac4e45c7f957f4b9370d8077c4..02118af23c0c8e6f9f353302fddc01536ddf73af 100644
--- a/media/audio/linux/audio_manager_linux.cc
+++ b/media/audio/linux/audio_manager_linux.cc
@@ -7,6 +7,7 @@
#include "base/command_line.h"
#include "base/environment.h"
#include "base/logging.h"
+#include "base/metrics/histogram.h"
#include "base/nix/xdg_util.h"
#include "base/process_util.h"
#include "base/stl_util.h"
@@ -19,9 +20,7 @@
#include "media/audio/linux/alsa_input.h"
#include "media/audio/linux/alsa_output.h"
#include "media/audio/linux/alsa_wrapper.h"
-#if defined(USE_PULSEAUDIO)
#include "media/audio/pulse/audio_manager_pulse.h"
-#endif
#include "media/base/channel_layout.h"
#include "media/base/limits.h"
#include "media/base/media_switches.h"
@@ -46,6 +45,13 @@ static const char* kInvalidAudioInputDevices[] = {
"surround",
};
+enum LinuxAudioIO {
+ kPulse,
+ kAlsa,
+ kCras,
+ kAudioIOMax // Must always be last!
+};
+
// static
void AudioManagerLinux::ShowLinuxAudioInputSettings() {
scoped_ptr<base::Environment> env(base::Environment::Create());
@@ -321,18 +327,18 @@ AudioInputStream* AudioManagerLinux::MakeInputStream(
AudioManager* CreateAudioManager() {
#if defined(USE_CRAS)
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseCras)) {
+ UMA_HISTOGRAM_ENUMERATION("Media.LinuxAudioIO", kCras, kAudioIOMax);
return new AudioManagerCras();
}
#endif
-#if defined(USE_PULSEAUDIO)
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUsePulseAudio)) {
- AudioManager* manager = AudioManagerPulse::Create();
- if (manager)
- return manager;
+ AudioManager* manager = AudioManagerPulse::Create();
+ if (manager) {
+ UMA_HISTOGRAM_ENUMERATION("Media.LinuxAudioIO", kPulse, kAudioIOMax);
+ return manager;
}
-#endif
+ UMA_HISTOGRAM_ENUMERATION("Media.LinuxAudioIO", kAlsa, kAudioIOMax);
return new AudioManagerLinux();
}
« no previous file with comments | « no previous file | media/audio/openbsd/audio_manager_openbsd.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698