OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef REMOTING_CODEC_VIDEO_ENCODER_VERBATIM_H_ | |
6 #define REMOTING_CODEC_VIDEO_ENCODER_VERBATIM_H_ | |
7 | |
8 #include "remoting/codec/video_encoder.h" | |
9 #include "remoting/proto/video.pb.h" | |
10 #include "third_party/skia/include/core/SkRect.h" | |
11 | |
12 namespace remoting { | |
13 | |
14 // VideoEncoderVerbatim implements a VideoEncoder that sends image data as is | |
15 // 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.
| |
16 class VideoEncoderVerbatim : public VideoEncoder { | |
17 public: | |
18 VideoEncoderVerbatim(); | |
19 virtual ~VideoEncoderVerbatim(); | |
20 | |
21 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.
| |
22 | |
23 // VideoEncoder interface. | |
24 virtual void Encode( | |
25 scoped_refptr<CaptureData> capture_data, | |
26 bool key_frame, | |
27 const DataAvailableCallback& data_available_callback) OVERRIDE; | |
28 | |
29 private: | |
30 // Encode a single dirty rect. | |
31 void EncodeRect(const SkIRect& rect, bool last); | |
32 | |
33 // 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.
| |
34 void PrepareUpdateStart(const SkIRect& rect, VideoPacket* packet); | |
35 | |
36 // 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.
| |
37 // encoded rectangle data. Will resize the buffer to |size|. | |
38 uint8* GetOutputBuffer(VideoPacket* packet, size_t size); | |
39 | |
40 // Submit |message| to |callback_|. | |
Wez
2012/10/17 22:25:16
nit: |message| -> |packet|
Sergey Ulanov
2012/10/18 01:09:52
Done.
| |
41 void SubmitMessage(VideoPacket* packet, size_t rect_index); | |
42 | |
43 scoped_refptr<CaptureData> capture_data_; | |
44 DataAvailableCallback callback_; | |
45 | |
46 // The most recent screen size. | |
47 SkISize screen_size_; | |
48 | |
49 int packet_size_; | |
Wez
2012/10/17 22:25:16
nit: max_packet_size_
Sergey Ulanov
2012/10/18 01:09:52
Done.
| |
50 }; | |
51 | |
52 } // namespace remoting | |
53 | |
54 #endif // REMOTING_CODEC_VIDEO_ENCODER_VERBATIM_H_ | |
OLD | NEW |