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
3 // found in the LICENSE file.
5 #ifndef REMOTING_CODEC_VIDEO_ENCODER_H_
6 #define REMOTING_CODEC_VIDEO_ENCODER_H_
8 #include "base/basictypes.h"
9 #include "base/callback.h"
10 #include "media/base/data_buffer.h"
13 class ScreenCaptureData
;
20 // A class to perform the task of encoding a continous stream of
22 // This class operates asynchronously to enable maximum throughput.
26 // DataAvailableCallback is called one or more times, for each chunk the
27 // underlying video encoder generates.
28 typedef base::Callback
<void(scoped_ptr
<VideoPacket
>)> DataAvailableCallback
;
30 virtual ~VideoEncoder() {}
32 // Encode an image stored in |capture_data|.
34 // If |key_frame| is true, the encoder should not reference
35 // previous encode and encode the full frame.
37 // When encoded data is available, partial or full |data_available_callback|
39 virtual void Encode(scoped_refptr
<media::ScreenCaptureData
> capture_data
,
41 const DataAvailableCallback
& data_available_callback
) = 0;
44 } // namespace remoting
46 #endif // REMOTING_CODEC_VIDEO_ENCODER_H_