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

Side by Side Diff: media/blink/video_frame_compositor.cc

Issue 1134663005: cc: Video layers without a frame should not occlude (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add HasCurrentFrame Created 5 years, 7 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/blink/video_frame_compositor.h" 5 #include "media/blink/video_frame_compositor.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/time/default_tick_clock.h" 9 #include "base/time/default_tick_clock.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 DCHECK(compositor_task_runner_->BelongsToCurrentThread()); 117 DCHECK(compositor_task_runner_->BelongsToCurrentThread());
118 rendered_last_frame_ = true; 118 rendered_last_frame_ = true;
119 } 119 }
120 120
121 bool VideoFrameCompositor::UpdateCurrentFrame(base::TimeTicks deadline_min, 121 bool VideoFrameCompositor::UpdateCurrentFrame(base::TimeTicks deadline_min,
122 base::TimeTicks deadline_max) { 122 base::TimeTicks deadline_max) {
123 DCHECK(compositor_task_runner_->BelongsToCurrentThread()); 123 DCHECK(compositor_task_runner_->BelongsToCurrentThread());
124 return CallRender(deadline_min, deadline_max, false); 124 return CallRender(deadline_min, deadline_max, false);
125 } 125 }
126 126
127 bool VideoFrameCompositor::HasCurrentFrame() const {
128 return current_frame_;
danakj 2015/05/18 18:15:45 can you DCHECK the thread here also?
hendrikw 2015/05/18 18:33:59 Good catch, Done.
129 }
130
127 void VideoFrameCompositor::Start(RenderCallback* callback) { 131 void VideoFrameCompositor::Start(RenderCallback* callback) {
128 TRACE_EVENT0("media", "VideoFrameCompositor::Start"); 132 TRACE_EVENT0("media", "VideoFrameCompositor::Start");
129 133
130 // Called from the media thread, so acquire the callback under lock before 134 // Called from the media thread, so acquire the callback under lock before
131 // returning in case a Stop() call comes in before the PostTask is processed. 135 // returning in case a Stop() call comes in before the PostTask is processed.
132 base::AutoLock lock(lock_); 136 base::AutoLock lock(lock_);
133 DCHECK(!callback_); 137 DCHECK(!callback_);
134 callback_ = callback; 138 callback_ = callback;
135 compositor_task_runner_->PostTask( 139 compositor_task_runner_->PostTask(
136 FROM_HERE, base::Bind(&VideoFrameCompositor::OnRendererStateUpdate, 140 FROM_HERE, base::Bind(&VideoFrameCompositor::OnRendererStateUpdate,
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 last_interval_ = deadline_max - deadline_min; 250 last_interval_ = deadline_max - deadline_min;
247 251
248 // Restart the background rendering timer whether we're background rendering 252 // Restart the background rendering timer whether we're background rendering
249 // or not; in either case we should wait for |kBackgroundRenderingTimeoutMs|. 253 // or not; in either case we should wait for |kBackgroundRenderingTimeoutMs|.
250 if (background_rendering_enabled_) 254 if (background_rendering_enabled_)
251 background_rendering_timer_.Reset(); 255 background_rendering_timer_.Reset();
252 return new_frame; 256 return new_frame;
253 } 257 }
254 258
255 } // namespace media 259 } // namespace media
OLDNEW
« content/renderer/media/webmediaplayer_ms.cc ('K') | « media/blink/video_frame_compositor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698