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

Unified Diff: remoting/client/frame_consumer_proxy.cc

Issue 9331003: Improving the decoder pipeline. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Integer ScaleRect Created 8 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 | « remoting/client/frame_consumer_proxy.h ('k') | remoting/client/frame_producer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « remoting/client/frame_consumer_proxy.h ('k') | remoting/client/frame_producer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698