Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(495)

Unified Diff: remoting/codec/video_encoder_verbatim.h

Issue 11195029: Remove ZLib codec support from chromoting host and client. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/codec/video_encoder_row_based_unittest.cc ('k') | remoting/codec/video_encoder_verbatim.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/codec/video_encoder_verbatim.h
diff --git a/remoting/codec/video_encoder_verbatim.h b/remoting/codec/video_encoder_verbatim.h
new file mode 100644
index 0000000000000000000000000000000000000000..02c58145aef487f8ffd6a9d501ed4782abad75c5
--- /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_
« no previous file with comments | « remoting/codec/video_encoder_row_based_unittest.cc ('k') | remoting/codec/video_encoder_verbatim.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698