OLD | NEW |
| (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_BASE_ENCODER_ZLIB_H_ | |
6 #define REMOTING_BASE_ENCODER_ZLIB_H_ | |
7 | |
8 #include "remoting/base/encoder.h" | |
9 | |
10 #include "gfx/rect.h" | |
11 | |
12 namespace remoting { | |
13 | |
14 class CompressorZlib; | |
15 class UpdateStreamPacket; | |
16 | |
17 // EncoderZlib implements an Encoder using Zlib for compression. | |
18 class EncoderZlib : public Encoder { | |
19 public: | |
20 EncoderZlib(); | |
21 EncoderZlib(int packet_size); | |
22 | |
23 virtual ~EncoderZlib(); | |
24 | |
25 virtual void Encode(scoped_refptr<CaptureData> capture_data, | |
26 bool key_frame, | |
27 DataAvailableCallback* data_available_callback); | |
28 | |
29 private: | |
30 // Encode a single dirty rect using compressor. | |
31 void EncodeRect(CompressorZlib* compressor, const gfx::Rect& rect, | |
32 size_t rect_index); | |
33 | |
34 // Marks a packets as the first in a series of rectangle updates. | |
35 void PrepareUpdateStart(const gfx::Rect& rect, VideoPacket* packet); | |
36 | |
37 // Retrieves a pointer to the output buffer in |update| used for storing the | |
38 // encoded rectangle data. Will resize the buffer to |size|. | |
39 uint8* GetOutputBuffer(VideoPacket* packet, size_t size); | |
40 | |
41 // Submit |message| to |callback_|. | |
42 void SubmitMessage(VideoPacket* packet, size_t rect_index); | |
43 | |
44 scoped_refptr<CaptureData> capture_data_; | |
45 scoped_ptr<DataAvailableCallback> callback_; | |
46 //size_t current_rect_; | |
47 int packet_size_; | |
48 }; | |
49 | |
50 } // namespace remoting | |
51 | |
52 #endif // REMOTING_BASE_ENCODER_ZLIB_H_ | |
OLD | NEW |