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

Unified Diff: media/blink/video_frame_compositor.cc

Issue 2552493002: [Media] Record time it takes to start rendering audio and video (Closed)
Patch Set: Accessing VFC directly from WMPI Created 3 years, 12 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
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..831c71c2cded6f587a9e72817a2c89149f4ed21c 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::SetShownTimestamp(base::TimeTicks when) {
+ DCHECK(compositor_task_runner_->BelongsToCurrentThread());
+ last_shown_ = when;
+}
+
bool VideoFrameCompositor::ProcessNewFrame(
const scoped_refptr<VideoFrame>& frame,
bool repaint_duplicate_frame) {
@@ -203,6 +209,14 @@ bool VideoFrameCompositor::ProcessNewFrame(
rendered_last_frame_ = false;
current_frame_ = frame;
+
+ if (!last_shown_.is_null()) {
+ base::TimeDelta time_to_first_frame = base::TimeTicks::Now() - last_shown_;
+ UMA_HISTOGRAM_TIMES("Media.Video.TimeFromShownToFirstFrame",
+ time_to_first_frame);
+ last_shown_ = base::TimeTicks();
+ }
+
return true;
}

Powered by Google App Engine
This is Rietveld 408576698