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_ZLIB_H_ | 5 #ifndef REMOTING_BASE_DECODER_ZLIB_H_ |
6 #define REMOTING_BASE_DECODER_ZLIB_H_ | 6 #define REMOTING_BASE_DECODER_ZLIB_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 DecompressorZlib; | 12 class DecompressorZlib; |
13 | 13 |
14 class DecoderZlib : public Decoder { | 14 class DecoderZlib : public Decoder { |
15 public: | 15 public: |
16 DecoderZlib(); | 16 DecoderZlib(); |
17 | 17 |
18 // Decoder implementations. | 18 // Decoder implementations. |
19 virtual bool BeginDecode(scoped_refptr<media::VideoFrame> frame, | 19 virtual bool BeginDecode(scoped_refptr<media::VideoFrame> frame, |
20 UpdatedRects* update_rects, | 20 UpdatedRects* update_rects, |
21 Task* partial_decode_done, | 21 Task* partial_decode_done, |
22 Task* decode_done); | 22 Task* decode_done); |
23 virtual bool PartialDecode(ChromotingHostMessage* message); | 23 virtual bool PartialDecode(HostMessage* message); |
24 virtual void EndDecode(); | 24 virtual void EndDecode(); |
25 | 25 |
26 // TODO(hclam): Should make this into the Decoder interface. | 26 // TODO(hclam): Should make this into the Decoder interface. |
27 void set_reverse_rows(bool reverse) { reverse_rows_ = reverse; } | 27 void set_reverse_rows(bool reverse) { reverse_rows_ = reverse; } |
28 | 28 |
29 private: | 29 private: |
30 bool HandleBeginRect(ChromotingHostMessage* message); | 30 bool HandleBeginRect(HostMessage* message); |
31 bool HandleRectData(ChromotingHostMessage* message); | 31 bool HandleRectData(HostMessage* message); |
32 bool HandleEndRect(ChromotingHostMessage* message); | 32 bool HandleEndRect(HostMessage* message); |
33 | 33 |
34 // The internal state of the decoder. | 34 // The internal state of the decoder. |
35 State state_; | 35 State state_; |
36 | 36 |
37 // Keeps track of the updating rect. | 37 // Keeps track of the updating rect. |
38 int rect_x_; | 38 int rect_x_; |
39 int rect_y_; | 39 int rect_y_; |
40 int rect_width_; | 40 int rect_width_; |
41 int rect_height_; | 41 int rect_height_; |
42 int bytes_per_pixel_; | 42 int bytes_per_pixel_; |
(...skipping 17 matching lines...) Expand all Loading... |
60 | 60 |
61 // True if we should decode the image upside down. | 61 // True if we should decode the image upside down. |
62 bool reverse_rows_; | 62 bool reverse_rows_; |
63 | 63 |
64 DISALLOW_COPY_AND_ASSIGN(DecoderZlib); | 64 DISALLOW_COPY_AND_ASSIGN(DecoderZlib); |
65 }; | 65 }; |
66 | 66 |
67 } // namespace remoting | 67 } // namespace remoting |
68 | 68 |
69 #endif // REMOTING_BASE_DECODER_ZLIB_H_ | 69 #endif // REMOTING_BASE_DECODER_ZLIB_H_ |
OLD | NEW |