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_ROW_BASED_H_ | 5 #ifndef REMOTING_BASE_ENCODER_ROW_BASED_H_ |
6 #define REMOTING_BASE_ENCODER_ROW_BASED_H_ | 6 #define REMOTING_BASE_ENCODER_ROW_BASED_H_ |
7 | 7 |
8 #include "remoting/base/encoder.h" | 8 #include "remoting/base/encoder.h" |
9 #include "remoting/proto/video.pb.h" | 9 #include "remoting/proto/video.pb.h" |
10 | 10 |
11 #include "gfx/rect.h" | 11 #include "gfx/rect.h" |
12 | 12 |
13 namespace remoting { | 13 namespace remoting { |
14 | 14 |
15 class Compressor; | 15 class Compressor; |
16 class UpdateStreamPacket; | 16 class UpdateStreamPacket; |
17 | 17 |
18 // EncoderRowBased implements an Encoder using zlib or verbatim | 18 // EncoderRowBased implements an Encoder using zlib or verbatim |
19 // compression. Zlib-based encoder must be created using | 19 // compression. Zlib-based encoder must be created using |
20 // CreateZlibEncoder(), verbatim encoder is created with | 20 // CreateZlibEncoder(), verbatim encoder is created with |
21 // CreateVerbatimEncoder(). | 21 // CreateVerbatimEncoder(). |
22 // | 22 // |
23 // Compressor is reset before encoding each rectangle, so that each | 23 // Compressor is reset before encoding each rectangle, so that each |
24 // rectangle can be decoded independently. | 24 // rectangle can be decoded independently. |
25 class EncoderRowBased : public Encoder { | 25 class EncoderRowBased : public Encoder { |
26 public: | 26 public: |
27 static EncoderRowBased* CreateZlibEncoder(); | 27 static EncoderRowBased* CreateZlibEncoder(); |
| 28 static EncoderRowBased* CreateZlibEncoder(int packet_size); |
28 static EncoderRowBased* CreateVerbatimEncoder(); | 29 static EncoderRowBased* CreateVerbatimEncoder(); |
| 30 static EncoderRowBased* CreateVerbatimEncoder(int packet_size); |
29 | 31 |
30 virtual ~EncoderRowBased(); | 32 virtual ~EncoderRowBased(); |
31 | 33 |
32 virtual void Encode(scoped_refptr<CaptureData> capture_data, | 34 virtual void Encode(scoped_refptr<CaptureData> capture_data, |
33 bool key_frame, | 35 bool key_frame, |
34 DataAvailableCallback* data_available_callback); | 36 DataAvailableCallback* data_available_callback); |
35 | 37 |
36 private: | 38 private: |
37 EncoderRowBased(Compressor* compressor, VideoPacketFormat::Encoding encoding); | 39 EncoderRowBased(Compressor* compressor, VideoPacketFormat::Encoding encoding); |
38 EncoderRowBased(Compressor* compressor, VideoPacketFormat::Encoding encoding, | 40 EncoderRowBased(Compressor* compressor, VideoPacketFormat::Encoding encoding, |
(...skipping 19 matching lines...) Expand all Loading... |
58 | 60 |
59 scoped_refptr<CaptureData> capture_data_; | 61 scoped_refptr<CaptureData> capture_data_; |
60 scoped_ptr<DataAvailableCallback> callback_; | 62 scoped_ptr<DataAvailableCallback> callback_; |
61 | 63 |
62 int packet_size_; | 64 int packet_size_; |
63 }; | 65 }; |
64 | 66 |
65 } // namespace remoting | 67 } // namespace remoting |
66 | 68 |
67 #endif // REMOTING_BASE_ENCODER_ROW_BASED_H_ | 69 #endif // REMOTING_BASE_ENCODER_ROW_BASED_H_ |
OLD | NEW |