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..ab7602b30a41c13f9c7b29d4957ac859fcef8acb |
--- /dev/null |
+++ b/remoting/codec/video_encoder_verbatim.h |
@@ -0,0 +1,54 @@ |
+// 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 is |
+// without compression. |
Wez
2012/10/17 22:25:16
nit: Clarify the format we mean by "verbatim", e.g
Sergey Ulanov
2012/10/18 01:09:52
Done.
|
+class VideoEncoderVerbatim : public VideoEncoder { |
+ public: |
+ VideoEncoderVerbatim(); |
+ virtual ~VideoEncoderVerbatim(); |
+ |
+ void SetMaxPacketSize(int size); |
Wez
2012/10/17 22:25:16
nit: Clarify what this is for.
Sergey Ulanov
2012/10/18 01:09:52
Done.
|
+ |
+ // 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); |
+ |
+ // Marks a packet as the first in a series of rectangle updates. |
Wez
2012/10/17 22:25:16
nit: How is |rect| used?
Sergey Ulanov
2012/10/18 01:09:52
Done.
|
+ void PrepareUpdateStart(const SkIRect& rect, VideoPacket* packet); |
+ |
+ // Retrieves a pointer to the output buffer in |update| used for storing the |
Wez
2012/10/17 22:25:16
What is |update|?
Sergey Ulanov
2012/10/18 01:09:52
That was old stale comment from row_based encoder.
|
+ // encoded rectangle data. Will resize the buffer to |size|. |
+ uint8* GetOutputBuffer(VideoPacket* packet, size_t size); |
+ |
+ // Submit |message| to |callback_|. |
Wez
2012/10/17 22:25:16
nit: |message| -> |packet|
Sergey Ulanov
2012/10/18 01:09:52
Done.
|
+ void SubmitMessage(VideoPacket* packet, size_t rect_index); |
+ |
+ scoped_refptr<CaptureData> capture_data_; |
+ DataAvailableCallback callback_; |
+ |
+ // The most recent screen size. |
+ SkISize screen_size_; |
+ |
+ int packet_size_; |
Wez
2012/10/17 22:25:16
nit: max_packet_size_
Sergey Ulanov
2012/10/18 01:09:52
Done.
|
+}; |
+ |
+} // namespace remoting |
+ |
+#endif // REMOTING_CODEC_VIDEO_ENCODER_VERBATIM_H_ |