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

Unified Diff: media/audio/audio_output_resampler.cc

Issue 10914203: Add UMA reporting for audio hardware parameters. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Style! Created 8 years, 3 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/sample_rates.h » ('j') | media/audio/sample_rates.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_output_resampler.cc
diff --git a/media/audio/audio_output_resampler.cc b/media/audio/audio_output_resampler.cc
index e67e2771649443f2c6c494fef07940c4162ca19a..be4802a6f6d6bd420c6cfd9717a549ed41f2ac21 100644
--- a/media/audio/audio_output_resampler.cc
+++ b/media/audio/audio_output_resampler.cc
@@ -8,11 +8,13 @@
#include "base/bind_helpers.h"
#include "base/compiler_specific.h"
#include "base/message_loop.h"
+#include "base/metrics/histogram.h"
#include "base/time.h"
#include "media/audio/audio_io.h"
#include "media/audio/audio_output_dispatcher_impl.h"
#include "media/audio/audio_output_proxy.h"
#include "media/audio/audio_util.h"
+#include "media/audio/sample_rates.h"
#include "media/base/audio_pull_fifo.h"
#include "media/base/multi_channel_resampler.h"
@@ -77,6 +79,24 @@ AudioOutputResampler::AudioOutputResampler(AudioManager* audio_manager,
// we've stabilized the issues there.
dispatcher_ = new AudioOutputDispatcherImpl(
audio_manager, output_params, close_delay);
+
+ // Fake enum histogram to get exact integral buckets. Expect to never see
+ // any values over 32 and even that is huge.
+ UMA_HISTOGRAM_ENUMERATION(
+ "Media.HardwareAudioBitsPerChannel", output_params.bits_per_sample(),
+ 40);
scherkus (not reviewing) 2012/09/11 16:53:31 not worth enumifying a la sample rate?
DaleCurtis 2012/09/11 17:35:59 Copy/pasted from AudioDecoderConfig. You tell me.
+ UMA_HISTOGRAM_ENUMERATION(
+ "Media.HardwareAudioChannelLayout", output_params.channel_layout(),
scherkus (not reviewing) 2012/09/11 16:53:31 I thought we only got hardware channel *count* and
DaleCurtis 2012/09/11 17:35:59 This is all a copy paste of what's in AudioDecoder
DaleCurtis 2012/09/12 09:50:57 Done. I'm now pulling the actual hardware channel
+ CHANNEL_LAYOUT_MAX);
+ AudioSampleRate asr = media::AsAudioSampleRate(output_params.sample_rate());
+ if (asr != kUnexpectedAudioSampleRate) {
+ UMA_HISTOGRAM_ENUMERATION(
+ "Media.HardwareAudioSamplesPerSecond", asr, kUnexpectedAudioSampleRate);
+ } else {
+ UMA_HISTOGRAM_COUNTS(
+ "Media.HardwareAudioSamplesPerSecondUnexpected",
+ output_params.sample_rate());
+ }
}
AudioOutputResampler::~AudioOutputResampler() {}
« no previous file with comments | « no previous file | media/audio/sample_rates.h » ('j') | media/audio/sample_rates.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698