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

Unified Diff: media/filters/audio_renderer_impl.cc

Issue 14054019: Add Media.AudioRendererEvents histogram to measure how often OnRenderError() is called. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 7 years, 8 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 | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/audio_renderer_impl.cc
diff --git a/media/filters/audio_renderer_impl.cc b/media/filters/audio_renderer_impl.cc
index 64ec80e27d2818e739f5a8a6c3188722d1fc0e6b..fb5585fb47522625a0aa2103e7488978daf70266 100644
--- a/media/filters/audio_renderer_impl.cc
+++ b/media/filters/audio_renderer_impl.cc
@@ -14,6 +14,7 @@
#include "base/command_line.h"
#include "base/logging.h"
#include "base/message_loop_proxy.h"
+#include "base/metrics/histogram.h"
#include "media/audio/audio_util.h"
#include "media/base/audio_splicer.h"
#include "media/base/bind_to_loop.h"
@@ -25,6 +26,20 @@
namespace media {
+namespace {
+
+enum AudioRendererEvent {
+ INITIALIZED,
+ RENDER_ERROR,
+ MAX_EVENTS
+};
+
+void HistogramRendererEvent(AudioRendererEvent event) {
+ UMA_HISTOGRAM_ENUMERATION("Media.AudioRendererEvents", event, MAX_EVENTS);
+}
+
+} // namespace
+
AudioRendererImpl::AudioRendererImpl(
const scoped_refptr<base::MessageLoopProxy>& message_loop,
media::AudioRendererSink* sink,
@@ -284,6 +299,8 @@ void AudioRendererImpl::OnDecoderSelected(
state_ = kPaused;
+ HistogramRendererEvent(INITIALIZED);
+
sink_->Initialize(audio_parameters_, weak_this_);
sink_->Start();
@@ -629,6 +646,7 @@ void AudioRendererImpl::UpdateEarliestEndTime_Locked(
}
void AudioRendererImpl::OnRenderError() {
+ HistogramRendererEvent(RENDER_ERROR);
disabled_cb_.Run();
}
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698