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_ENCODER_ZLIB_H_ | 5 #ifndef REMOTING_BASE_ENCODER_ZLIB_H_ |
6 #define REMOTING_BASE_ENCODER_ZLIB_H_ | 6 #define REMOTING_BASE_ENCODER_ZLIB_H_ |
7 | 7 |
8 #include "remoting/base/encoder.h" | 8 #include "remoting/base/encoder.h" |
9 | 9 |
| 10 #include "gfx/rect.h" |
| 11 |
10 namespace remoting { | 12 namespace remoting { |
11 | 13 |
12 class CompressorZlib; | 14 class CompressorZlib; |
13 class UpdateStreamPacket; | 15 class UpdateStreamPacket; |
14 | 16 |
15 // EncoderZlib implements an Encoder using Zlib for compression. | 17 // EncoderZlib implements an Encoder using Zlib for compression. |
16 class EncoderZlib : public Encoder { | 18 class EncoderZlib : public Encoder { |
17 public: | 19 public: |
18 EncoderZlib(); | 20 EncoderZlib(); |
19 EncoderZlib(int packet_size); | 21 EncoderZlib(int packet_size); |
20 | 22 |
21 virtual ~EncoderZlib() {} | 23 virtual ~EncoderZlib() {} |
22 | 24 |
23 virtual void Encode(scoped_refptr<CaptureData> capture_data, | 25 virtual void Encode(scoped_refptr<CaptureData> capture_data, |
24 bool key_frame, | 26 bool key_frame, |
25 DataAvailableCallback* data_available_callback); | 27 DataAvailableCallback* data_available_callback); |
26 | 28 |
27 private: | 29 private: |
28 // Encode a single dirty rect using compressor. | 30 // Encode a single dirty rect using compressor. |
29 void EncodeRect(CompressorZlib* compressor); | 31 void EncodeRect(CompressorZlib* compressor, const gfx::Rect& rect, |
| 32 size_t rect_index); |
30 | 33 |
31 // Create a new HostMessage with the right flag and attributes. The message | 34 // Create a new HostMessage with the right flag and attributes. The message |
32 // can be used immediately for output of encoding. | 35 // can be used immediately for output of encoding. |
33 HostMessage* PrepareMessage(bool new_rect); | 36 HostMessage* PrepareMessage(const gfx::Rect* rect); |
34 | 37 |
35 // Submit |message| to |callback_|. | 38 // Submit |message| to |callback_|. |
36 void SubmitMessage(HostMessage* message); | 39 void SubmitMessage(HostMessage* message, size_t rect_index); |
37 | 40 |
38 scoped_refptr<CaptureData> capture_data_; | 41 scoped_refptr<CaptureData> capture_data_; |
39 scoped_ptr<DataAvailableCallback> callback_; | 42 scoped_ptr<DataAvailableCallback> callback_; |
40 size_t current_rect_; | 43 //size_t current_rect_; |
41 int packet_size_; | 44 int packet_size_; |
42 }; | 45 }; |
43 | 46 |
44 } // namespace remoting | 47 } // namespace remoting |
45 | 48 |
46 #endif // REMOTING_BASE_ENCODER_ZLIB_H_ | 49 #endif // REMOTING_BASE_ENCODER_ZLIB_H_ |
OLD | NEW |