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

Unified Diff: media/filters/video_renderer_algorithm.cc

Issue 2437623004: Fix perf and paint issues with VRI::PaintSingleFrame. (Closed)
Patch Set: Address comments. Created 4 years, 2 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_algorithm.h ('k') | media/renderers/video_renderer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/video_renderer_algorithm.cc
diff --git a/media/filters/video_renderer_algorithm.cc b/media/filters/video_renderer_algorithm.cc
index 8bd7c5c1551c691d2416ab838c9730fb092d7f99..0293088337ebe4dc002c953963b06e57aa271976 100644
--- a/media/filters/video_renderer_algorithm.cc
+++ b/media/filters/video_renderer_algorithm.cc
@@ -44,14 +44,13 @@ VideoRendererAlgorithm::VideoRendererAlgorithm(
Reset();
}
-VideoRendererAlgorithm::~VideoRendererAlgorithm() {
-}
+VideoRendererAlgorithm::~VideoRendererAlgorithm() {}
scoped_refptr<VideoFrame> VideoRendererAlgorithm::Render(
base::TimeTicks deadline_min,
base::TimeTicks deadline_max,
size_t* frames_dropped) {
- DCHECK_LT(deadline_min, deadline_max);
+ DCHECK_LE(deadline_min, deadline_max);
if (frame_queue_.empty())
return nullptr;
@@ -77,14 +76,16 @@ scoped_refptr<VideoFrame> VideoRendererAlgorithm::Render(
// all frames currently in the |frame_queue_|.
UpdateFrameStatistics();
const bool have_known_duration = average_frame_duration_ > base::TimeDelta();
- if (!(was_time_moving_ && have_known_duration)) {
+ if (!was_time_moving_ || !have_known_duration || render_interval_.is_zero()) {
ReadyFrame& ready_frame = frame_queue_[last_frame_index_];
DCHECK(ready_frame.frame);
// If duration is unknown, we don't have enough frames to make a good guess
// about which frame to use, so always choose the first.
- if (was_time_moving_ && !have_known_duration)
+ if ((was_time_moving_ && !have_known_duration) ||
+ render_interval_.is_zero()) {
++ready_frame.render_count;
+ }
UpdateEffectiveFramesQueued();
return ready_frame.frame;
@@ -421,7 +422,8 @@ void VideoRendererAlgorithm::AccountForMissedIntervals(
base::TimeTicks deadline_min,
base::TimeTicks deadline_max) {
if (last_deadline_max_.is_null() || deadline_min <= last_deadline_max_ ||
- !have_rendered_frames_ || !was_time_moving_) {
+ !have_rendered_frames_ || !was_time_moving_ ||
+ render_interval_.is_zero()) {
return;
}
« no previous file with comments | « media/filters/video_renderer_algorithm.h ('k') | media/renderers/video_renderer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698