OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CODEC_VIDEO_ENCODER_H_ | 5 #ifndef REMOTING_CODEC_VIDEO_ENCODER_H_ |
6 #define REMOTING_CODEC_VIDEO_ENCODER_H_ | 6 #define REMOTING_CODEC_VIDEO_ENCODER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "media/base/data_buffer.h" | |
11 | 10 |
12 namespace media { | 11 class SkRegion; |
13 class ScreenCaptureData; | 12 |
14 } // namespace media | 13 namespace webrtc { |
14 class DesktopFrame; | |
15 } // namespace webrtc | |
15 | 16 |
16 namespace remoting { | 17 namespace remoting { |
17 | 18 |
18 class VideoPacket; | 19 class VideoPacket; |
19 | 20 |
20 // A class to perform the task of encoding a continous stream of | 21 // A class to perform the task of encoding a continuous stream of images. The |
21 // images. | 22 // interface is asynchronous to enable maximum throughput,. |
alexeypa (please no reviews)
2013/05/08 22:24:59
nit: remove the comma at the end.
Sergey Ulanov
2013/05/09 18:49:02
Done.
| |
22 // This class operates asynchronously to enable maximum throughput. | |
23 class VideoEncoder { | 23 class VideoEncoder { |
24 public: | 24 public: |
25 | 25 |
26 // DataAvailableCallback is called one or more times, for each chunk the | 26 // DataAvailableCallback is called one or more times, for each chunk the |
27 // underlying video encoder generates. | 27 // underlying video encoder generates. |
28 typedef base::Callback<void(scoped_ptr<VideoPacket>)> DataAvailableCallback; | 28 typedef base::Callback<void(scoped_ptr<VideoPacket>)> DataAvailableCallback; |
29 | 29 |
30 virtual ~VideoEncoder() {} | 30 virtual ~VideoEncoder() {} |
31 | 31 |
32 // Encode an image stored in |capture_data|. | 32 // Encode an image stored in |frame|. Doesn't take ownership of |frame|. When |
33 // | 33 // encoded data is available, partial or full |data_available_callback| is |
34 // If |key_frame| is true, the encoder should not reference | 34 // called. |
35 // previous encode and encode the full frame. | 35 virtual void Encode(const webrtc::DesktopFrame* frame, |
36 // | |
37 // When encoded data is available, partial or full |data_available_callback| | |
38 // is called. | |
39 virtual void Encode(scoped_refptr<media::ScreenCaptureData> capture_data, | |
40 bool key_frame, | |
41 const DataAvailableCallback& data_available_callback) = 0; | 36 const DataAvailableCallback& data_available_callback) = 0; |
42 }; | 37 }; |
43 | 38 |
44 } // namespace remoting | 39 } // namespace remoting |
45 | 40 |
46 #endif // REMOTING_CODEC_VIDEO_ENCODER_H_ | 41 #endif // REMOTING_CODEC_VIDEO_ENCODER_H_ |
OLD | NEW |