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

Unified Diff: webkit/media/webmediaplayer_proxy.cc

Issue 12096081: Replace VideoRendererBase Get/PutCurrentFrame() with a VideoFrame-containing callback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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
« webkit/media/webmediaplayer_impl.cc ('K') | « webkit/media/webmediaplayer_proxy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/media/webmediaplayer_proxy.cc
diff --git a/webkit/media/webmediaplayer_proxy.cc b/webkit/media/webmediaplayer_proxy.cc
index 3f604b3bd7f9831b28be318ad843edf470b24891..04a32e95b9d0db3f5a11e539e3ef9263c819dd5c 100644
--- a/webkit/media/webmediaplayer_proxy.cc
+++ b/webkit/media/webmediaplayer_proxy.cc
@@ -34,8 +34,11 @@ WebMediaPlayerProxy::~WebMediaPlayerProxy() {
Detach();
}
-void WebMediaPlayerProxy::Repaint() {
+void WebMediaPlayerProxy::FrameReady(
+ const scoped_refptr<media::VideoFrame>& frame) {
base::AutoLock auto_lock(lock_);
+ current_frame_ = frame;
acolwell GONE FROM CHROMIUM 2013/02/01 00:24:34 I think you need more code in here to track droppe
scherkus (not reviewing) 2013/02/01 22:45:25 As discussed offline, I added back the frame dropp
+
if (outstanding_repaints_ < kMaxOutstandingRepaints) {
++outstanding_repaints_;
@@ -48,12 +51,11 @@ void WebMediaPlayerProxy::Paint(SkCanvas* canvas,
const gfx::Rect& dest_rect,
uint8_t alpha) {
DCHECK(render_loop_->BelongsToCurrentThread());
- if (frame_provider_) {
- scoped_refptr<media::VideoFrame> video_frame;
- frame_provider_->GetCurrentFrame(&video_frame);
- video_renderer_.Paint(video_frame, canvas, dest_rect, alpha);
- frame_provider_->PutCurrentFrame(video_frame);
- }
+
+ // Use GetCurrentFrame() to avoid locking while painting in software.
+ scoped_refptr<media::VideoFrame> video_frame;
+ GetCurrentFrame(&video_frame);
+ video_renderer_.Paint(video_frame, canvas, dest_rect, alpha);
}
bool WebMediaPlayerProxy::HasSingleOrigin() {
@@ -97,14 +99,8 @@ void WebMediaPlayerProxy::RepaintTask() {
void WebMediaPlayerProxy::GetCurrentFrame(
scoped_refptr<media::VideoFrame>* frame_out) {
- if (frame_provider_)
- frame_provider_->GetCurrentFrame(frame_out);
-}
-
-void WebMediaPlayerProxy::PutCurrentFrame(
- scoped_refptr<media::VideoFrame> frame) {
- if (frame_provider_)
- frame_provider_->PutCurrentFrame(frame);
+ base::AutoLock auto_lock(lock_);
+ *frame_out = current_frame_;
}
} // namespace webkit_media
« webkit/media/webmediaplayer_impl.cc ('K') | « webkit/media/webmediaplayer_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698