Index: remoting/client/frame_consumer_proxy.cc |
diff --git a/remoting/client/frame_consumer_proxy.cc b/remoting/client/frame_consumer_proxy.cc |
index 65b84ed70b13e9468376f9175a4570c8f83af4aa..47bc9cd3023a254788f26707f53b2273dc4f90cf 100644 |
--- a/remoting/client/frame_consumer_proxy.cc |
+++ b/remoting/client/frame_consumer_proxy.cc |
@@ -6,59 +6,60 @@ |
#include "base/bind.h" |
#include "base/message_loop.h" |
+#include "ppapi/cpp/image_data.h" |
namespace remoting { |
FrameConsumerProxy::FrameConsumerProxy( |
- FrameConsumer* frame_consumer, |
base::MessageLoopProxy* frame_consumer_message_loop) |
- : frame_consumer_(frame_consumer), |
+ : frame_consumer_(NULL), |
frame_consumer_message_loop_(frame_consumer_message_loop) { |
} |
FrameConsumerProxy::~FrameConsumerProxy() { |
} |
-void FrameConsumerProxy::AllocateFrame( |
- media::VideoFrame::Format format, |
- const SkISize& size, |
- scoped_refptr<media::VideoFrame>* frame_out, |
- const base::Closure& done) { |
+void FrameConsumerProxy::ApplyBuffer(const SkISize& view_size, |
+ const SkIRect& clip_area, |
+ pp::ImageData* buffer, |
+ const SkRegion& region) { |
if (!frame_consumer_message_loop_->BelongsToCurrentThread()) { |
frame_consumer_message_loop_->PostTask(FROM_HERE, base::Bind( |
- &FrameConsumerProxy::AllocateFrame, this, format, size, frame_out, |
- done)); |
+ &FrameConsumerProxy::ApplyBuffer, this, |
+ view_size, clip_area, buffer, region)); |
return; |
} |
- if (frame_consumer_) { |
- frame_consumer_->AllocateFrame(format, size, frame_out, done); |
- } |
+ if (frame_consumer_) |
+ frame_consumer_->ApplyBuffer(view_size, clip_area, buffer, region); |
} |
-void FrameConsumerProxy::ReleaseFrame(media::VideoFrame* frame) { |
+void FrameConsumerProxy::ReturnBuffer(pp::ImageData* buffer) { |
if (!frame_consumer_message_loop_->BelongsToCurrentThread()) { |
frame_consumer_message_loop_->PostTask(FROM_HERE, base::Bind( |
- &FrameConsumerProxy::ReleaseFrame, this, make_scoped_refptr(frame))); |
+ &FrameConsumerProxy::ReturnBuffer, this, buffer)); |
return; |
} |
if (frame_consumer_) |
- frame_consumer_->ReleaseFrame(frame); |
+ frame_consumer_->ReturnBuffer(buffer); |
} |
-void FrameConsumerProxy::OnPartialFrameOutput(media::VideoFrame* frame, |
- SkRegion* region, |
- const base::Closure& done) { |
+void FrameConsumerProxy::SetSourceSize(const SkISize& source_size) { |
if (!frame_consumer_message_loop_->BelongsToCurrentThread()) { |
frame_consumer_message_loop_->PostTask(FROM_HERE, base::Bind( |
- &FrameConsumerProxy::OnPartialFrameOutput, this, |
- make_scoped_refptr(frame), region, done)); |
+ &FrameConsumerProxy::SetSourceSize, this, source_size)); |
return; |
} |
if (frame_consumer_) |
- frame_consumer_->OnPartialFrameOutput(frame, region, done); |
+ frame_consumer_->SetSourceSize(source_size); |
+} |
+ |
+void FrameConsumerProxy::Attach(FrameConsumer* frame_consumer) { |
+ DCHECK(frame_consumer_message_loop_->BelongsToCurrentThread()); |
+ DCHECK(frame_consumer_ == NULL); |
+ frame_consumer_ = frame_consumer; |
} |
void FrameConsumerProxy::Detach() { |