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_BASE_DECODER_VERBATIM_H_ | 5 #ifndef REMOTING_BASE_DECODER_VERBATIM_H_ |
6 #define REMOTING_BASE_DECODER_VERBATIM_H_ | 6 #define REMOTING_BASE_DECODER_VERBATIM_H_ |
7 | 7 |
8 #include "remoting/base/decoder.h" | 8 #include "remoting/base/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(ChromotingHostMessage* message); | 21 virtual bool PartialDecode(HostMessage* message); |
22 virtual void EndDecode(); | 22 virtual void EndDecode(); |
23 | 23 |
24 void set_reverse_rows(bool reverse) { reverse_rows_ = reverse; } | 24 void set_reverse_rows(bool reverse) { reverse_rows_ = reverse; } |
25 | 25 |
26 private: | 26 private: |
27 bool HandleBeginRect(ChromotingHostMessage* message); | 27 bool HandleBeginRect(HostMessage* message); |
28 bool HandleRectData(ChromotingHostMessage* message); | 28 bool HandleRectData(HostMessage* message); |
29 bool HandleEndRect(ChromotingHostMessage* message); | 29 bool HandleEndRect(HostMessage* message); |
30 | 30 |
31 // The internal state of the decoder. | 31 // The internal state of the decoder. |
32 State state_; | 32 State state_; |
33 | 33 |
34 // Keeps track of the updating rect. | 34 // Keeps track of the updating rect. |
35 int rect_x_; | 35 int rect_x_; |
36 int rect_y_; | 36 int rect_y_; |
37 int rect_width_; | 37 int rect_width_; |
38 int rect_height_; | 38 int rect_height_; |
39 int bytes_per_pixel_; | 39 int bytes_per_pixel_; |
40 | 40 |
41 // Tasks to call when decode is done. | 41 // Tasks to call when decode is done. |
42 scoped_ptr<Task> partial_decode_done_; | 42 scoped_ptr<Task> partial_decode_done_; |
43 scoped_ptr<Task> decode_done_; | 43 scoped_ptr<Task> decode_done_; |
44 | 44 |
45 // The video frame to write to. | 45 // The video frame to write to. |
46 scoped_refptr<media::VideoFrame> frame_; | 46 scoped_refptr<media::VideoFrame> frame_; |
47 UpdatedRects* updated_rects_; | 47 UpdatedRects* updated_rects_; |
48 | 48 |
49 // True if we should reverse the rows when copying data into the target | 49 // True if we should reverse the rows when copying data into the target |
50 // frame buffer. | 50 // frame buffer. |
51 bool reverse_rows_; | 51 bool reverse_rows_; |
52 | 52 |
53 DISALLOW_COPY_AND_ASSIGN(DecoderVerbatim); | 53 DISALLOW_COPY_AND_ASSIGN(DecoderVerbatim); |
54 }; | 54 }; |
55 | 55 |
56 } // namespace remoting | 56 } // namespace remoting |
57 | 57 |
58 #endif // REMOTING_BASE_DECODER_VERBATIM_H_ | 58 #endif // REMOTING_BASE_DECODER_VERBATIM_H_ |
OLD | NEW |