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

Unified Diff: media/filters/video_renderer_impl.cc

Issue 496723003: [Feature might be dropped] VideoPlaybackQuality.totalFrameDelay Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: NOT READY FOR REVIEW Created 6 years, 4 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/filters/video_renderer_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/video_renderer_impl.cc
diff --git a/media/filters/video_renderer_impl.cc b/media/filters/video_renderer_impl.cc
index 25099ca0f84a7a06a6761af150cc01c17f022b4d..ac21c3a4e73f81e2d07a224a47a791bee2eaa427 100644
--- a/media/filters/video_renderer_impl.cc
+++ b/media/filters/video_renderer_impl.cc
@@ -42,6 +42,7 @@ VideoRendererImpl::VideoRendererImpl(
last_painted_timestamp_(kNoTimestamp()),
frames_decoded_(0),
frames_dropped_(0),
+ frames_delay_time_(0),
is_shutting_down_(false),
weak_factory_(this) {
DCHECK(!paint_cb_.is_null());
@@ -270,6 +271,9 @@ void VideoRendererImpl::PaintNextReadyFrame_Locked() {
paint_cb_.Run(next_frame);
+ base::TimeDelta now = get_time_cb_.Run();
+ frames_delay_time_ += (now - last_painted_timestamp_).InSecondsF();
+
task_runner_->PostTask(
FROM_HERE,
base::Bind(&VideoRendererImpl::AttemptRead, weak_factory_.GetWeakPtr()));
@@ -466,10 +470,12 @@ void VideoRendererImpl::UpdateStatsAndWait_Locked(
PipelineStatistics statistics;
statistics.video_frames_decoded = frames_decoded_;
statistics.video_frames_dropped = frames_dropped_;
+ statistics.total_frame_delay = frames_delay_time_;
task_runner_->PostTask(FROM_HERE, base::Bind(statistics_cb_, statistics));
frames_decoded_ = 0;
frames_dropped_ = 0;
+ frames_delay_time_ = 0;
}
frame_available_.TimedWait(wait_duration);
« no previous file with comments | « media/filters/video_renderer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698