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

Unified Diff: remoting/client/decoder.h

Issue 2745006: Implement a chromoting client using X11 (Closed)
Patch Set: removed all.gyp Created 10 years, 6 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/client_util.cc ('k') | remoting/client/decoder_verbatim.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/decoder.h
diff --git a/remoting/client/decoder.h b/remoting/client/decoder.h
index d39be0740e22e3a7e7cee98d361e95a6e7e2f34c..ac2fe4da64a03ea7938f3fb7cddb8515ff2e0537 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
« no previous file with comments | « remoting/client/client_util.cc ('k') | remoting/client/decoder_verbatim.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698