Chromium Code Reviews| 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" | 10 #include "media/base/data_buffer.h" |
| 11 | 11 |
| 12 namespace media { | 12 namespace media { |
| 13 class DataBuffer; | 13 class DataBuffer; |
|
Wez
2013/01/25 00:51:21
nit: I don't think we need this here?
Sergey Ulanov
2013/01/25 02:33:45
Done.
| |
| 14 class ScreenCaptureData; | |
| 14 } | 15 } |
| 15 | 16 |
| 16 namespace remoting { | 17 namespace remoting { |
| 17 | 18 |
| 18 class CaptureData; | |
| 19 class VideoPacket; | 19 class VideoPacket; |
| 20 | 20 |
| 21 // A class to perform the task of encoding a continous stream of | 21 // A class to perform the task of encoding a continous stream of |
| 22 // images. | 22 // images. |
| 23 // This class operates asynchronously to enable maximum throughput. | 23 // This class operates asynchronously to enable maximum throughput. |
| 24 class VideoEncoder { | 24 class VideoEncoder { |
| 25 public: | 25 public: |
| 26 | 26 |
| 27 // DataAvailableCallback is called one or more times, for each chunk the | 27 // DataAvailableCallback is called one or more times, for each chunk the |
| 28 // underlying video encoder generates. | 28 // underlying video encoder generates. |
| 29 typedef base::Callback<void(scoped_ptr<VideoPacket>)> DataAvailableCallback; | 29 typedef base::Callback<void(scoped_ptr<VideoPacket>)> DataAvailableCallback; |
| 30 | 30 |
| 31 virtual ~VideoEncoder() {} | 31 virtual ~VideoEncoder() {} |
| 32 | 32 |
| 33 // Encode an image stored in |capture_data|. | 33 // Encode an image stored in |capture_data|. |
| 34 // | 34 // |
| 35 // If |key_frame| is true, the encoder should not reference | 35 // If |key_frame| is true, the encoder should not reference |
| 36 // previous encode and encode the full frame. | 36 // previous encode and encode the full frame. |
| 37 // | 37 // |
| 38 // When encoded data is available, partial or full |data_available_callback| | 38 // When encoded data is available, partial or full |data_available_callback| |
| 39 // is called. | 39 // is called. |
| 40 virtual void Encode(scoped_refptr<CaptureData> capture_data, | 40 virtual void Encode(scoped_refptr<media::ScreenCaptureData> capture_data, |
| 41 bool key_frame, | 41 bool key_frame, |
| 42 const DataAvailableCallback& data_available_callback) = 0; | 42 const DataAvailableCallback& data_available_callback) = 0; |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 } // namespace remoting | 45 } // namespace remoting |
| 46 | 46 |
| 47 #endif // REMOTING_CODEC_VIDEO_ENCODER_H_ | 47 #endif // REMOTING_CODEC_VIDEO_ENCODER_H_ |
| OLD | NEW |