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

Unified Diff: media/renderers/video_renderer_impl.cc

Issue 2552493002: [Media] Record time it takes to start rendering audio and video (Closed)
Patch Set: 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
« no previous file with comments | « media/renderers/video_renderer_impl.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/renderers/video_renderer_impl.cc
diff --git a/media/renderers/video_renderer_impl.cc b/media/renderers/video_renderer_impl.cc
index 2c13377bd0519218571104f9a3559dbc8932ca14..be64506762d8743b4ae2beab0569d10b8f29ca9b 100644
--- a/media/renderers/video_renderer_impl.cc
+++ b/media/renderers/video_renderer_impl.cc
@@ -210,6 +210,10 @@ scoped_refptr<VideoFrame> VideoRendererImpl::Render(
if (!background_rendering && !was_background_rendering_)
frames_dropped_ += frames_dropped;
UpdateStats_Locked();
+
+ if (was_background_rendering_ && !background_rendering)
+ shown_timestamp_ = tick_clock_->NowTicks();
DaleCurtis 2016/12/03 01:26:34 Does this actually capture what you want? When vid
whywhat 2016/12/06 22:01:12 That seems to be the right place to detect when th
DaleCurtis 2016/12/06 23:26:58 This isn't called until playback starts. It's okay
whywhat 2016/12/08 00:23:17 Hm, seems like we'd be better off using the time_c
DaleCurtis 2016/12/08 19:04:46 I don't follow your suggestion? Are you suggesting
+
was_background_rendering_ = background_rendering;
// Always post this task, it will acquire new frames if necessary and since it
@@ -422,6 +426,12 @@ void VideoRendererImpl::FrameReady(VideoFrameStream::Status status,
first_frame->natural_size());
sink_->PaintSingleFrame(first_frame);
painted_first_frame_ = true;
+
+ if (!shown_timestamp_.is_null()) {
+ UMA_HISTOGRAM_MEDIUM_TIMES("Media.Video.TimeFromShownToFirstFrame",
+ tick_clock_->NowTicks() - shown_timestamp_);
+ shown_timestamp_ = base::TimeTicks();
+ }
}
}
« no previous file with comments | « media/renderers/video_renderer_impl.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698