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

Unified Diff: remoting/client/rectangle_update_decoder.h

Issue 4476003: Add VideoPacket struct for video packets. Refactor Decode interface to use it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merged Created 10 years, 1 month 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/chromoting_client.cc ('k') | remoting/client/rectangle_update_decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/rectangle_update_decoder.h
diff --git a/remoting/client/rectangle_update_decoder.h b/remoting/client/rectangle_update_decoder.h
index e6c344e48a763cb58558866a1738a84390a46acb..1eb93b500f28e303366f4eb808214cbe40da1a09 100644
--- a/remoting/client/rectangle_update_decoder.h
+++ b/remoting/client/rectangle_update_decoder.h
@@ -7,8 +7,8 @@
#include "base/scoped_ptr.h"
#include "base/task.h"
+#include "gfx/size.h"
#include "media/base/video_frame.h"
-#include "remoting/base/decoder.h" // For UpdatedRects
class MessageLoop;
@@ -19,14 +19,22 @@ class FrameConsumer;
class VideoPacketFormat;
class VideoPacket;
+namespace protocol {
+class SessionConfig;
+} // namespace protocol
+
// TODO(ajwong): Re-examine this API, especially with regards to how error
// conditions on each step are reported. Should they be CHECKs? Logs? Other?
+// TODO(sergeyu): Rename this class.
class RectangleUpdateDecoder {
public:
RectangleUpdateDecoder(MessageLoop* message_loop,
FrameConsumer* consumer);
~RectangleUpdateDecoder();
+ // Initializes decoder with the infromation from the protocol config.
+ void Initialize(const protocol::SessionConfig* config);
+
// Decodes the contents of |packet| calling OnPartialFrameOutput() in the
// regsitered as data is avaialable. DecodePacket may keep a reference to
// |packet| so the |packet| must remain alive and valid until |done| is
@@ -34,21 +42,20 @@ class RectangleUpdateDecoder {
//
// TODO(ajwong): Should packet be a const pointer to make the lifetime
// more clear?
- void DecodePacket(const VideoPacket& packet, Task* done);
+ void DecodePacket(const VideoPacket* packet, Task* done);
private:
- static bool IsValidPacket(const VideoPacket& packet);
+ void InitializeDecoder(Task* done);
- void InitializeDecoder(const VideoPacketFormat& format, Task* done);
-
- void ProcessPacketData(const VideoPacket& packet, Task* done);
+ void ProcessPacketData(const VideoPacket* packet, Task* done);
// Pointers to infrastructure objects. Not owned.
MessageLoop* message_loop_;
FrameConsumer* consumer_;
+ gfx::Size screen_size_;
+
scoped_ptr<Decoder> decoder_;
- UpdatedRects updated_rects_;
// Framebuffer for the decoder.
scoped_refptr<media::VideoFrame> frame_;
« no previous file with comments | « remoting/client/chromoting_client.cc ('k') | remoting/client/rectangle_update_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698