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

Unified Diff: media/blink/video_frame_compositor.cc

Issue 2552493002: [Media] Record time it takes to start rendering audio and video (Closed)
Patch Set: Shown->Foreground Created 3 years, 11 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 | « media/blink/video_frame_compositor.h ('k') | media/blink/webmediaplayer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/video_frame_compositor.cc
diff --git a/media/blink/video_frame_compositor.cc b/media/blink/video_frame_compositor.cc
index 7bc98164f8e695570d03bc76248be082cc52d2db..017bedc9ae9fc0b29b18e12c300790a24ca54f3b 100644
--- a/media/blink/video_frame_compositor.cc
+++ b/media/blink/video_frame_compositor.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/message_loop/message_loop.h"
+#include "base/metrics/histogram_macros.h"
#include "base/time/default_tick_clock.h"
#include "base/trace_event/auto_open_close_event.h"
#include "base/trace_event/trace_event.h"
@@ -188,6 +189,11 @@ base::TimeDelta VideoFrameCompositor::GetCurrentFrameTimestamp() const {
return current_frame_->timestamp();
}
+void VideoFrameCompositor::SetForegroundTime(base::TimeTicks when) {
+ DCHECK(compositor_task_runner_->BelongsToCurrentThread());
+ foreground_time_ = when;
+}
+
bool VideoFrameCompositor::ProcessNewFrame(
const scoped_refptr<VideoFrame>& frame,
bool repaint_duplicate_frame) {
@@ -203,6 +209,15 @@ bool VideoFrameCompositor::ProcessNewFrame(
rendered_last_frame_ = false;
current_frame_ = frame;
+
+ if (!foreground_time_.is_null()) {
+ base::TimeDelta time_to_first_frame =
+ base::TimeTicks::Now() - foreground_time_;
+ UMA_HISTOGRAM_TIMES("Media.Video.TimeFromForegroundToFirstFrame",
+ time_to_first_frame);
+ foreground_time_ = base::TimeTicks();
+ }
+
return true;
}
« no previous file with comments | « media/blink/video_frame_compositor.h ('k') | media/blink/webmediaplayer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698