diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-09 21:56:39 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-09 21:56:39 +0000 |
commit | ef0a59a6fd722a0910196c951dc676c19127a28b (patch) | |
tree | 9d90ab9227e4222fa312dadae114c8d2247028bf /remoting/client/decoder.h | |
parent | e9fdd159ffd94e3e097bd6905d84e6b564b04c2c (diff) | |
download | chromium_src-ef0a59a6fd722a0910196c951dc676c19127a28b.zip chromium_src-ef0a59a6fd722a0910196c951dc676c19127a28b.tar.gz chromium_src-ef0a59a6fd722a0910196c951dc676c19127a28b.tar.bz2 |
Implement a chromoting client using X11
Using XRender to render the chromoting client. This patch has done several things:
1. Rename chromotocol_pb to remoting
2. Defined ChromotingView as the display area of the remote view
3. Implemented X11Client as the client that uses X11 for display
4. Implemented X11View that uses XRender for drawing
5. Fixed several problems in host capturer and encoder
Review URL: http://codereview.chromium.org/2745006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49329 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/client/decoder.h')
-rw-r--r-- | remoting/client/decoder.h | 43 |
1 files changed, 13 insertions, 30 deletions
diff --git a/remoting/client/decoder.h b/remoting/client/decoder.h index d39be07..ac2fe4d 100644 --- a/remoting/client/decoder.h +++ b/remoting/client/decoder.h @@ -7,7 +7,7 @@ #include <vector> -#include "base/callback.h" +#include "base/task.h" #include "base/scoped_ptr.h" #include "gfx/rect.h" #include "media/base/video_frame.h" @@ -15,12 +15,15 @@ namespace remoting { +// TODO(hclam): Merge this with the one in remoting/host/encoder.h. +typedef std::vector<gfx::Rect> UpdatedRects; + // Defines the behavior of a decoder for decoding images received from the // host. // // Sequence of actions with a decoder is as follows: // -// 1. BeginDecode(VideoFrame) +// 1. BeginDecode(PartialDecodeDone, DecodeDone, VideoFrame) // 2. PartialDecode(HostMessage) // ... // 3. EndDecode() @@ -34,27 +37,22 @@ namespace remoting { // decoder (most likely the renderer) and the decoder. class Decoder { public: - typedef std::vector<gfx::Rect> UpdatedRects; - typedef Callback2<scoped_refptr<media::VideoFrame>, UpdatedRects>::Type - PartialDecodeDoneCallback; - typedef Callback1<scoped_refptr<media::VideoFrame> >::Type - DecodeDoneCallback; - - Decoder(PartialDecodeDoneCallback* partial_decode_done_callback, - DecodeDoneCallback* decode_done_callback) - : partial_decode_done_(partial_decode_done_callback), - decode_done_(decode_done_callback) { - } virtual ~Decoder() { } // Tell the decoder to use |frame| as a target to write the decoded image // for the coming update stream. + // If decode is partially done and |frame| can be read, |partial_decode_done| + // is called and |update_rects| contains the updated regions. + // If decode is completed |decode_done| is called. // Return true if the decoder can writes output to |frame| and accept // the codec format. // TODO(hclam): Provide more information when calling this function. - virtual bool BeginDecode(scoped_refptr<media::VideoFrame> frame) = 0; + virtual bool BeginDecode(scoped_refptr<media::VideoFrame> frame, + UpdatedRects* updated_rects, + Task* partial_decode_done, + Task* decode_done) = 0; // Give a HostMessage that contains the update stream packet that contains // the encoded data to the decoder. @@ -62,7 +60,7 @@ class Decoder { // If the decoder has written something into |frame|, // |partial_decode_done_| is called with |frame| and updated regions. // Return true if the decoder can accept |message| and decode it. - virtual bool PartialDecode(chromotocol_pb::HostMessage* message) = 0; + virtual bool PartialDecode(HostMessage* message) = 0; // Notify the decoder that we have received the last update stream packet. // If the decoding of the update stream has completed |decode_done_| is @@ -70,21 +68,6 @@ class Decoder { // If the update stream is not received fully and this method is called the // decoder should also call |decode_done_| as soon as possible. virtual void EndDecode() = 0; - - protected: - PartialDecodeDoneCallback* partial_decode_done() { - return partial_decode_done_.get(); - } - - DecodeDoneCallback* decode_done() { - return decode_done_.get(); - } - - private: - scoped_ptr<PartialDecodeDoneCallback> partial_decode_done_; - scoped_ptr<DecodeDoneCallback> decode_done_; - - DISALLOW_COPY_AND_ASSIGN(Decoder); }; } // namespace remoting |