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

Side by Side Diff: media/base/null_video_sink.cc

Issue 2239163002: Add "repaint" option to PaintSingleFrame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@media_player_simplified
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « media/base/null_video_sink.h ('k') | media/base/null_video_sink_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/base/null_video_sink.h" 5 #include "media/base/null_video_sink.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 if (delay < base::TimeDelta()) 81 if (delay < base::TimeDelta())
82 delay += interval_ * (-delay / interval_ + 1); 82 delay += interval_ * (-delay / interval_ + 1);
83 current_render_time_ = now + delay; 83 current_render_time_ = now + delay;
84 last_now_ = now; 84 last_now_ = now;
85 } 85 }
86 86
87 task_runner_->PostDelayedTask(FROM_HERE, cancelable_worker_.callback(), 87 task_runner_->PostDelayedTask(FROM_HERE, cancelable_worker_.callback(),
88 delay); 88 delay);
89 } 89 }
90 90
91 void NullVideoSink::PaintSingleFrame(const scoped_refptr<VideoFrame>& frame) { 91 void NullVideoSink::PaintSingleFrame(const scoped_refptr<VideoFrame>& frame,
92 if (frame == last_frame_) 92 bool repaint_duplicate_frame) {
93 if (!repaint_duplicate_frame && frame == last_frame_)
93 return; 94 return;
94 last_frame_ = frame; 95 last_frame_ = frame;
95 new_frame_cb_.Run(frame); 96 new_frame_cb_.Run(frame);
96 } 97 }
97 98
98 } // namespace media 99 } // namespace media
OLDNEW
« no previous file with comments | « media/base/null_video_sink.h ('k') | media/base/null_video_sink_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698