diff options
author | solb@chromium.org <solb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-04 02:46:50 +0000 |
---|---|---|
committer | solb@chromium.org <solb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-04 02:46:50 +0000 |
commit | fbc08aa288ecf9ffba63e229a3017dfddda5a28f (patch) | |
tree | 29630834ba0d81f24e5c888238d8b3822d1b74b3 /remoting/client/rectangle_update_decoder.cc | |
parent | c84c6afb54cfbc9c7ad21a455c195870005be760 (diff) | |
download | chromium_src-fbc08aa288ecf9ffba63e229a3017dfddda5a28f.zip chromium_src-fbc08aa288ecf9ffba63e229a3017dfddda5a28f.tar.gz chromium_src-fbc08aa288ecf9ffba63e229a3017dfddda5a28f.tar.bz2 |
Abstract PPAPI's ImageData behind webrtc::DesktopFrame interface
This abstracts away RectangleUpdateDecoder's direct use of the the former class. It will ease the development of non--Web app client implementations.
BUG=255309
TBR=brettw (third_party/webrtc dependency)
Review URL: https://chromiumcodereview.appspot.com/18233015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@210113 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/client/rectangle_update_decoder.cc')
-rw-r--r-- | remoting/client/rectangle_update_decoder.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/remoting/client/rectangle_update_decoder.cc b/remoting/client/rectangle_update_decoder.cc index 6c2f61b..3e93446 100644 --- a/remoting/client/rectangle_update_decoder.cc +++ b/remoting/client/rectangle_update_decoder.cc @@ -10,13 +10,13 @@ #include "base/location.h" #include "base/logging.h" #include "base/single_thread_task_runner.h" -#include "ppapi/cpp/image_data.h" #include "remoting/base/util.h" #include "remoting/codec/video_decoder.h" #include "remoting/codec/video_decoder_verbatim.h" #include "remoting/codec/video_decoder_vp8.h" #include "remoting/client/frame_consumer.h" #include "remoting/protocol/session_config.h" +#include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" using base::Passed; using remoting::protocol::ChannelConfig; @@ -123,10 +123,10 @@ void RectangleUpdateDecoder::DoPaint() { return; // Draw the invalidated region to the buffer. - pp::ImageData* buffer = buffers_.front(); + webrtc::DesktopFrame* buffer = buffers_.front(); SkRegion output_region; decoder_->RenderFrame(view_size_, clip_area_, - reinterpret_cast<uint8*>(buffer->data()), + buffer->data(), buffer->stride(), &output_region); @@ -154,7 +154,7 @@ void RectangleUpdateDecoder::RequestReturnBuffers(const base::Closure& done) { done.Run(); } -void RectangleUpdateDecoder::DrawBuffer(pp::ImageData* buffer) { +void RectangleUpdateDecoder::DrawBuffer(webrtc::DesktopFrame* buffer) { if (!decode_task_runner_->BelongsToCurrentThread()) { decode_task_runner_->PostTask( FROM_HERE, base::Bind(&RectangleUpdateDecoder::DrawBuffer, @@ -206,11 +206,10 @@ void RectangleUpdateDecoder::SetOutputSizeAndClip(const SkISize& view_size, // Return buffers that are smaller than needed to the consumer for // reuse/reallocation. - std::list<pp::ImageData*>::iterator i = buffers_.begin(); + std::list<webrtc::DesktopFrame*>::iterator i = buffers_.begin(); while (i != buffers_.end()) { - pp::Size buffer_size = (*i)->size(); - if (buffer_size.width() < clip_area_.width() || - buffer_size.height() < clip_area_.height()) { + if ((*i)->size().width() < clip_area_.width() || + (*i)->size().height() < clip_area_.height()) { consumer_->ReturnBuffer(*i); i = buffers_.erase(i); } else { |