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

Unified Diff: webkit/media/webmediaplayer_proxy.cc

Issue 12262058: Revert r180578, r180591, and r180604 from 1410 branch. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1410/src/
Patch Set: Created 7 years, 10 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 | « 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
===================================================================
--- webkit/media/webmediaplayer_proxy.cc (revision 182591)
+++ webkit/media/webmediaplayer_proxy.cc (working copy)
@@ -34,11 +34,8 @@
Detach();
}
-void WebMediaPlayerProxy::FrameReady(
- const scoped_refptr<media::VideoFrame>& frame) {
+void WebMediaPlayerProxy::Repaint() {
base::AutoLock auto_lock(lock_);
- current_frame_ = frame;
-
if (outstanding_repaints_ < kMaxOutstandingRepaints) {
++outstanding_repaints_;
@@ -51,11 +48,12 @@
const gfx::Rect& dest_rect,
uint8_t alpha) {
DCHECK(render_loop_->BelongsToCurrentThread());
-
- // 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);
+ 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);
+ }
}
bool WebMediaPlayerProxy::HasSingleOrigin() {
@@ -82,6 +80,7 @@
DCHECK(render_loop_->BelongsToCurrentThread());
webmediaplayer_ = NULL;
data_source_ = NULL;
+ frame_provider_ = NULL;
}
void WebMediaPlayerProxy::RepaintTask() {
@@ -98,8 +97,14 @@
void WebMediaPlayerProxy::GetCurrentFrame(
scoped_refptr<media::VideoFrame>* frame_out) {
- base::AutoLock auto_lock(lock_);
- *frame_out = current_frame_;
+ if (frame_provider_)
+ frame_provider_->GetCurrentFrame(frame_out);
}
+void WebMediaPlayerProxy::PutCurrentFrame(
+ scoped_refptr<media::VideoFrame> frame) {
+ if (frame_provider_)
+ frame_provider_->PutCurrentFrame(frame);
+}
+
} // namespace webkit_media
« no previous file with comments | « webkit/media/webmediaplayer_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698