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

Unified Diff: media/blink/video_frame_compositor.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/blink/video_frame_compositor.h ('k') | no next file » | 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 3cf2a1cb22d85b54c9f9e6859097e5ac3693c4c7..690c60785f23a7d2fcdecbf3ffeeda8c6e268bc0 100644
--- a/media/blink/video_frame_compositor.cc
+++ b/media/blink/video_frame_compositor.cc
@@ -132,15 +132,17 @@ void VideoFrameCompositor::Stop() {
}
void VideoFrameCompositor::PaintSingleFrame(
- const scoped_refptr<VideoFrame>& frame) {
+ const scoped_refptr<VideoFrame>& frame,
+ bool repaint_duplicate_frame) {
if (!compositor_task_runner_->BelongsToCurrentThread()) {
compositor_task_runner_->PostTask(
- FROM_HERE, base::Bind(&VideoFrameCompositor::PaintSingleFrame,
- base::Unretained(this), frame));
+ FROM_HERE,
+ base::Bind(&VideoFrameCompositor::PaintSingleFrame,
+ base::Unretained(this), frame, repaint_duplicate_frame));
return;
}
- if (ProcessNewFrame(frame) && client_)
+ if (ProcessNewFrame(frame, repaint_duplicate_frame) && client_)
client_->DidReceiveFrame();
}
@@ -178,10 +180,11 @@ base::TimeDelta VideoFrameCompositor::GetCurrentFrameTimestamp() const {
}
bool VideoFrameCompositor::ProcessNewFrame(
- const scoped_refptr<VideoFrame>& frame) {
+ const scoped_refptr<VideoFrame>& frame,
+ bool repaint_duplicate_frame) {
DCHECK(compositor_task_runner_->BelongsToCurrentThread());
- if (frame == current_frame_)
+ if (!repaint_duplicate_frame && frame == current_frame_)
return false;
// Set the flag indicating that the current frame is unrendered, if we get a
@@ -223,7 +226,8 @@ bool VideoFrameCompositor::CallRender(base::TimeTicks deadline_min,
}
const bool new_frame = ProcessNewFrame(
- callback_->Render(deadline_min, deadline_max, background_rendering));
+ callback_->Render(deadline_min, deadline_max, background_rendering),
+ false);
// We may create a new frame here with background rendering, but the provider
// has no way of knowing that a new frame had been processed, so keep track of
« no previous file with comments | « media/blink/video_frame_compositor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698