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_DECOMPRESSOR_H_ | |
6 #define REMOTING_BASE_DECOMPRESSOR_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 | |
10 namespace remoting { | |
11 | |
12 // An object to decompress data losslessly. This is used in pair with | |
13 // a compressor. | |
14 // | |
15 // Note that a decompressor can only be used on one stream during its | |
16 // lifetime. This object should be destroyed after use. | |
17 class Decompressor { | |
18 public: | |
19 virtual ~Decompressor() {} | |
20 | |
21 // Resets all the internal state so the decompressor behaves as if it was | |
22 // just created. | |
23 virtual void Reset() = 0; | |
24 | |
25 // Decompress |input_data| with |input_size| bytes. | |
26 // | |
27 // |output_data| is provided by the caller and |output_size| is the | |
28 // size of |output_data|. |output_size| must be greater than 0. | |
29 // | |
30 // Decompressed data is written to |output_data|. |consumed| will | |
31 // contain the number of bytes consumed from the input. |written| | |
32 // contains the number of bytes written to output. | |
33 // | |
34 // Returns true if this method needs to be called again because | |
35 // there is more bytes to be decompressed or more input data is | |
36 // needed. | |
37 virtual bool Process(const uint8* input_data, int input_size, | |
38 uint8* output_data, int output_size, | |
39 int* consumed, int* written) = 0; | |
40 }; | |
41 | |
42 } // namespace remoting | |
43 | |
44 #endif // REMOTING_BASE_DECOMPRESSOR_H_ | |
OLD | NEW |