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

Side by Side Diff: remoting/client/rectangle_update_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, 2 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 unified diff | Download patch
« no previous file with comments | « remoting/client/frame_consumer.h ('k') | remoting/client/rectangle_update_decoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef REMOTING_CLIENT_RECTANGLE_UPDATE_DECODER_H
6 #define REMOTING_CLIENT_RECTANGLE_UPDATE_DECODER_H
7
8 #include "base/scoped_ptr.h"
9 #include "base/task.h"
10 #include "media/base/video_frame.h"
11 #include "remoting/base/decoder.h" // For UpdatedRects.
12
13 class MessageLoop;
14
15 namespace remoting {
16
17 class FrameConsumer;
18 class RectangleFormat;
19 class RectangleUpdatePacket;
20
21 // TODO(ajwong): Re-examine this API, especially with regards to how error
22 // conditions on each step are reported. Should they be CHECKs? Logs? Other?
23 class RectangleUpdateDecoder {
24 public:
25 RectangleUpdateDecoder(MessageLoop* message_loop,
26 FrameConsumer* consumer);
27 ~RectangleUpdateDecoder();
28
29 // Decodes the contents of |packet| calling OnPartialFrameOutput() in the
30 // regsitered as data is avaialable. DecodePacket may keep a reference to
31 // |packet| so the |packet| must remain alive and valid until |done| is
32 // executed.
33 //
34 // TODO(ajwong): Should packet be a const pointer to make the lifetime
35 // more clear?
36 void DecodePacket(const RectangleUpdatePacket& packet, Task* done);
37
38 private:
39 static bool IsValidPacket(const RectangleUpdatePacket& packet);
40
41 void InitializeDecoder(const RectangleFormat& format, Task* done);
42
43 void ProcessPacketData(const RectangleUpdatePacket& packet, Task* done);
44
45 // Pointers to infrastructure objects. Not owned.
46 MessageLoop* message_loop_;
47 FrameConsumer* consumer_;
48
49 scoped_ptr<Decoder> decoder_;
50 UpdatedRects updated_rects_;
51
52 // Framebuffer for the decoder.
53 scoped_refptr<media::VideoFrame> frame_;
54 };
55
56 } // namespace remoting
57
58 DISABLE_RUNNABLE_METHOD_REFCOUNT(remoting::RectangleUpdateDecoder);
59
60 #endif // REMOTING_CLIENT_RECTANGLE_UPDATE_DECODER_H
OLDNEW
« no previous file with comments | « remoting/client/frame_consumer.h ('k') | remoting/client/rectangle_update_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698