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

Unified Diff: remoting/base/decoder.h

Issue 3335012: Add in a new FrameConsumer interface, Decode API, and a RectangleUpdateDecoder abstraction. (Closed)
Patch Set: Fix silly compile errors Created 10 years, 3 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 | « no previous file | remoting/base/protocol/chromotocol.proto » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/base/decoder.h
diff --git a/remoting/base/decoder.h b/remoting/base/decoder.h
index 75ffa03b25f4fc6ac141af1cf98a5635947a35bc..c8c77a779ee568106fbe45bb9a89cb20539eb0b3 100644
--- a/remoting/base/decoder.h
+++ b/remoting/base/decoder.h
@@ -90,6 +90,30 @@ class Decoder {
// of BeginDecode() / EndDecode().
virtual bool IsStarted() { return started_; }
+ // --- NEW API ---
+ // TODO(ajwong): This API is incorrect in the face of a streaming decode
+ // protocol like VP8. However, it breaks the layering abstraction by
+ // depending on the network packet protocol buffer type. I'm going to go
+ // forward with it as is, and then refactor again to support streaming
+ // decodes.
+
+ // Initializes the decoder to draw into the given |frame|. The |clip|
+ // specifies the region to draw into. The clip region must fit inside
+ // the dimensions of frame. Failure to do so will CHECK Fail.
+ virtual void Initialize(scoped_refptr<media::VideoFrame> frame,
+ const gfx::Rect& clip) {}
+
+ // Reset the decoder to an uninitialized state. Release all references to
+ // the initialized |frame|. Initialize() must be called before the decoder
+ // is used again.
+ virtual void Reset() {}
+
+ // Feeds more data into the decoder.
+ virtual void DecodeBytes(const std::string& encoded_bytes) {}
+
+ // Returns true if decoder is ready to accept data via ProcessRectangleData.
+ virtual bool IsReadyForData() { return false; }
+
protected:
// Every decoder will have two internal states because there are three
// kinds of messages send to PartialDecode().
« no previous file with comments | « no previous file | remoting/base/protocol/chromotocol.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698