OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef REMOTING_BASE_ENCODER_VERBATIM_H_ | 5 #ifndef REMOTING_BASE_ENCODER_VERBATIM_H_ |
6 #define REMOTING_BASE_ENCODER_VERBATIM_H_ | 6 #define REMOTING_BASE_ENCODER_VERBATIM_H_ |
7 | 7 |
8 #include "remoting/base/encoder.h" | 8 #include "remoting/base/encoder.h" |
9 | 9 |
10 #include "gfx/rect.h" | 10 #include "gfx/rect.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 virtual void Encode(scoped_refptr<CaptureData> capture_data, | 25 virtual void Encode(scoped_refptr<CaptureData> capture_data, |
26 bool key_frame, | 26 bool key_frame, |
27 DataAvailableCallback* data_available_callback); | 27 DataAvailableCallback* data_available_callback); |
28 | 28 |
29 private: | 29 private: |
30 // Encode a single dirty rect. | 30 // Encode a single dirty rect. |
31 void EncodeRect(const gfx::Rect& rect, size_t rect_index); | 31 void EncodeRect(const gfx::Rect& rect, size_t rect_index); |
32 | 32 |
33 // Marks a packets as the first in a series of rectangle updates. | 33 // Marks a packets as the first in a series of rectangle updates. |
34 void PrepareUpdateStart(const gfx::Rect& rect, | 34 void PrepareUpdateStart(const gfx::Rect& rect, VideoPacket* packet); |
35 RectangleUpdatePacket* update); | |
36 | 35 |
37 // Retrieves a pointer to the output buffer in |update| used for storing the | 36 // Retrieves a pointer to the output buffer in |update| used for storing the |
38 // encoded rectangle data. Will resize the buffer to |size|. | 37 // encoded rectangle data. Will resize the buffer to |size|. |
39 uint8* GetOutputBuffer(RectangleUpdatePacket* update, size_t size); | 38 uint8* GetOutputBuffer(VideoPacket* packet, size_t size); |
40 | 39 |
41 // Submit |message| to |callback_|. | 40 // Submit |message| to |callback_|. |
42 void SubmitMessage(ChromotingHostMessage* message, size_t rect_index); | 41 void SubmitMessage(VideoPacket* packet, size_t rect_index); |
43 | 42 |
44 scoped_refptr<CaptureData> capture_data_; | 43 scoped_refptr<CaptureData> capture_data_; |
45 scoped_ptr<DataAvailableCallback> callback_; | 44 scoped_ptr<DataAvailableCallback> callback_; |
46 int packet_size_; | 45 int packet_size_; |
47 }; | 46 }; |
48 | 47 |
49 } // namespace remoting | 48 } // namespace remoting |
50 | 49 |
51 #endif // REMOTING_BASE_ENCODER_VERBATIM_H_ | 50 #endif // REMOTING_BASE_ENCODER_VERBATIM_H_ |
OLD | NEW |