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(); |
} |