Chromium Code Reviews| Index: remoting/base/encoder_row_based.h |
| diff --git a/remoting/base/encoder_verbatim.h b/remoting/base/encoder_row_based.h |
| similarity index 58% |
| rename from remoting/base/encoder_verbatim.h |
| rename to remoting/base/encoder_row_based.h |
| index 81d109d1f7e0ac1af7091ebf77aa03fd4a2d24da..aee658d152c934b72e047d1315523f5c70ce9703 100644 |
| --- a/remoting/base/encoder_verbatim.h |
| +++ b/remoting/base/encoder_row_based.h |
| @@ -2,32 +2,38 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef REMOTING_BASE_ENCODER_VERBATIM_H_ |
| -#define REMOTING_BASE_ENCODER_VERBATIM_H_ |
| +#ifndef REMOTING_BASE_ENCODER_ROW_BASED_H_ |
| +#define REMOTING_BASE_ENCODER_ROW_BASED_H_ |
| #include "remoting/base/encoder.h" |
| +#include "remoting/proto/video.pb.h" |
| #include "gfx/rect.h" |
| namespace remoting { |
| +class Compressor; |
| class UpdateStreamPacket; |
| -// EncoderVerbatim implements Encoder and simply copies input to the output |
| -// buffer verbatim. |
| -class EncoderVerbatim : public Encoder { |
| +// EncoderRowBased implements an Encoder using zlib or verbatim |
| +// compression. |
| +class EncoderRowBased : public Encoder { |
|
Alpha Left Google
2010/12/02 19:39:55
Add comments about the compressor used here. Also
Sergey Ulanov
2010/12/03 00:17:21
Done.
|
| public: |
| - EncoderVerbatim(); |
| - EncoderVerbatim(int packet_size); |
| + static EncoderRowBased* CreateZlibEncoder(); |
| + static EncoderRowBased* CreateVerbatimEncoder(); |
| - virtual ~EncoderVerbatim() {} |
| + virtual ~EncoderRowBased(); |
| virtual void Encode(scoped_refptr<CaptureData> capture_data, |
| bool key_frame, |
| DataAvailableCallback* data_available_callback); |
| private: |
| - // Encode a single dirty rect. |
| + EncoderRowBased(Compressor* compressor, VideoPacketFormat::Encoding encoding); |
| + EncoderRowBased(Compressor* compressor, VideoPacketFormat::Encoding encoding, |
| + int packet_size); |
| + |
| + // Encode a single dirty rect using compressor. |
| void EncodeRect(const gfx::Rect& rect, size_t rect_index); |
| // Marks a packets as the first in a series of rectangle updates. |
|
garykac
2010/12/02 19:51:31
Not part of your CL, but this should be "Marks a p
Sergey Ulanov
2010/12/03 00:17:21
Done.
|
| @@ -40,11 +46,17 @@ class EncoderVerbatim : public Encoder { |
| // Submit |message| to |callback_|. |
| void SubmitMessage(VideoPacket* packet, size_t rect_index); |
| + // The encoding of the incoming stream. |
| + VideoPacketFormat::Encoding encoding_; |
| + |
| + scoped_ptr<Compressor> compressor_; |
| + |
| scoped_refptr<CaptureData> capture_data_; |
| scoped_ptr<DataAvailableCallback> callback_; |
| + |
| int packet_size_; |
| }; |
| } // namespace remoting |
| -#endif // REMOTING_BASE_ENCODER_VERBATIM_H_ |
| +#endif // REMOTING_BASE_ENCODER_ROW_BASED_H_ |