diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-18 03:26:53 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-18 03:26:53 +0000 |
commit | 2149befbff640e5a050bb50acdbbfd95501ab9b1 (patch) | |
tree | 6c60699960b23fdbf4d0f17fd3d83dc394156f44 /remoting/codec/video_encoder_verbatim.h | |
parent | fb03b64b14315feaf008e89bc3abeb0b0c2576c4 (diff) | |
download | chromium_src-2149befbff640e5a050bb50acdbbfd95501ab9b1.zip chromium_src-2149befbff640e5a050bb50acdbbfd95501ab9b1.tar.gz chromium_src-2149befbff640e5a050bb50acdbbfd95501ab9b1.tar.bz2 |
Remove ZLib codec support from chromoting host and client.
We were not using ZLIB codec anyway, so there is no reason to keep it around.
Review URL: https://chromiumcodereview.appspot.com/11195029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162635 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/codec/video_encoder_verbatim.h')
-rw-r--r-- | remoting/codec/video_encoder_verbatim.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/remoting/codec/video_encoder_verbatim.h b/remoting/codec/video_encoder_verbatim.h new file mode 100644 index 0000000..02c5814 --- /dev/null +++ b/remoting/codec/video_encoder_verbatim.h @@ -0,0 +1,56 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef REMOTING_CODEC_VIDEO_ENCODER_VERBATIM_H_ +#define REMOTING_CODEC_VIDEO_ENCODER_VERBATIM_H_ + +#include "remoting/codec/video_encoder.h" +#include "remoting/proto/video.pb.h" +#include "third_party/skia/include/core/SkRect.h" + +namespace remoting { + +// VideoEncoderVerbatim implements a VideoEncoder that sends image data as a +// sequence of RGB values, without compression. +class VideoEncoderVerbatim : public VideoEncoder { + public: + VideoEncoderVerbatim(); + virtual ~VideoEncoderVerbatim(); + + // Sets maximum size of data in video packets. Used by unittests. + void SetMaxPacketSize(int size); + + // VideoEncoder interface. + virtual void Encode( + scoped_refptr<CaptureData> capture_data, + bool key_frame, + const DataAvailableCallback& data_available_callback) OVERRIDE; + + private: + // Encode a single dirty |rect|. + void EncodeRect(const SkIRect& rect, bool last); + + // Initializes first packet in a sequence of video packets to update screen + // rectangle |rect|. + void PrepareUpdateStart(const SkIRect& rect, VideoPacket* packet); + + // Allocates a buffer of the specified |size| inside |packet| and returns the + // pointer to it. + uint8* GetOutputBuffer(VideoPacket* packet, size_t size); + + // Submit |packet| to |callback_|. + void SubmitMessage(VideoPacket* packet, size_t rect_index); + + scoped_refptr<CaptureData> capture_data_; + DataAvailableCallback callback_; + + // The most recent screen size. + SkISize screen_size_; + + int max_packet_size_; +}; + +} // namespace remoting + +#endif // REMOTING_CODEC_VIDEO_ENCODER_VERBATIM_H_ |