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

Unified Diff: media/renderers/audio_renderer_impl.cc

Issue 2552493002: [Media] Record time it takes to start rendering audio and video (Closed)
Patch Set: Audio and video first render times Created 4 years 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
Index: media/renderers/audio_renderer_impl.cc
diff --git a/media/renderers/audio_renderer_impl.cc b/media/renderers/audio_renderer_impl.cc
index 4899be0a4b98470bf59c19947695bf431bb11610..41aae18b179b0ccf3f07bbee9ec02f54a6bbdcbb 100644
--- a/media/renderers/audio_renderer_impl.cc
+++ b/media/renderers/audio_renderer_impl.cc
@@ -14,6 +14,7 @@
#include "base/callback_helpers.h"
#include "base/command_line.h"
#include "base/logging.h"
+#include "base/metrics/histogram_macros.h"
#include "base/power_monitor/power_monitor.h"
#include "base/single_thread_task_runner.h"
#include "base/time/default_tick_clock.h"
@@ -172,6 +173,7 @@ void AudioRendererImpl::SetMediaTime(base::TimeDelta time) {
start_timestamp_ = time;
ended_timestamp_ = kInfiniteDuration;
last_render_time_ = stop_rendering_time_ = base::TimeTicks();
+ start_rendering_time_ = tick_clock_->NowTicks();
first_packet_timestamp_ = kNoTimestamp;
audio_clock_.reset(new AudioClock(time, audio_parameters_.sample_rate()));
}
@@ -777,6 +779,13 @@ int AudioRendererImpl::Render(base::TimeDelta delay,
stop_rendering_time_ = base::TimeTicks();
}
+ if (!start_rendering_time_.is_null()) {
+ UMA_HISTOGRAM_MEDIUM_TIMES(
+ "Media.Audio.FirstRenderTime",
+ tick_clock_->NowTicks() - start_rendering_time_);
+ start_rendering_time_ = base::TimeTicks();
+ }
+
// Ensure Stop() hasn't destroyed our |algorithm_| on the pipeline thread.
if (!algorithm_) {
audio_clock_->WroteAudio(0, frames_requested, frames_delayed,

Powered by Google App Engine
This is Rietveld 408576698