OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef REMOTING_CLIENT_DECODER_VERBATIM_H_ | 5 #ifndef REMOTING_CLIENT_DECODER_VERBATIM_H_ |
6 #define REMOTING_CLIENT_DECODER_VERBATIM_H_ | 6 #define REMOTING_CLIENT_DECODER_VERBATIM_H_ |
7 | 7 |
8 #include "remoting/client/decoder.h" | 8 #include "remoting/client/decoder.h" |
9 | 9 |
10 namespace remoting { | 10 namespace remoting { |
11 | 11 |
12 class DecoderVerbatim : public Decoder { | 12 class DecoderVerbatim : public Decoder { |
13 public: | 13 public: |
14 DecoderVerbatim(); | 14 DecoderVerbatim(); |
15 | 15 |
16 // Decoder implementations. | 16 // Decoder implementations. |
17 virtual bool BeginDecode(scoped_refptr<media::VideoFrame> frame, | 17 virtual bool BeginDecode(scoped_refptr<media::VideoFrame> frame, |
18 UpdatedRects* update_rects, | 18 UpdatedRects* update_rects, |
19 Task* partial_decode_done, | 19 Task* partial_decode_done, |
20 Task* decode_done); | 20 Task* decode_done); |
21 virtual bool PartialDecode(HostMessage* message); | 21 virtual bool PartialDecode(HostMessage* message); |
22 virtual void EndDecode(); | 22 virtual void EndDecode(); |
23 | 23 |
24 private: | 24 private: |
| 25 bool HandleBeginRect(HostMessage* message); |
| 26 bool HandleRectData(HostMessage* message); |
| 27 bool HandleEndRect(HostMessage* message); |
| 28 |
| 29 // The internal state of the decoder. |
| 30 State state_; |
| 31 |
| 32 // Keeps track of the updating rect. |
| 33 int rect_x_; |
| 34 int rect_y_; |
| 35 int rect_width_; |
| 36 int rect_height_; |
| 37 int bytes_per_pixel_; |
| 38 |
25 // Tasks to call when decode is done. | 39 // Tasks to call when decode is done. |
26 scoped_ptr<Task> partial_decode_done_; | 40 scoped_ptr<Task> partial_decode_done_; |
27 scoped_ptr<Task> decode_done_; | 41 scoped_ptr<Task> decode_done_; |
28 | 42 |
29 // The video frame to write to. | 43 // The video frame to write to. |
30 scoped_refptr<media::VideoFrame> frame_; | 44 scoped_refptr<media::VideoFrame> frame_; |
31 UpdatedRects* updated_rects_; | 45 UpdatedRects* updated_rects_; |
32 | 46 |
33 // True if we should reverse the rows when copying data into the target | 47 // True if we should reverse the rows when copying data into the target |
34 // frame buffer. | 48 // frame buffer. |
35 bool reverse_rows_; | 49 bool reverse_rows_; |
36 | 50 |
37 DISALLOW_COPY_AND_ASSIGN(DecoderVerbatim); | 51 DISALLOW_COPY_AND_ASSIGN(DecoderVerbatim); |
38 }; | 52 }; |
39 | 53 |
40 } // namespace remoting | 54 } // namespace remoting |
41 | 55 |
42 #endif // REMOTING_CLIENT_DECODER_VERBATIM_H_ | 56 #endif // REMOTING_CLIENT_DECODER_VERBATIM_H_ |
OLD | NEW |