Separate Simple Backend creation from initialization.
[chromium-blink-merge.git] / remoting / codec / video_encoder.h
blob81179c4da0862f9acb94f0abad069300d56df3d6
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"
12 namespace media {
13 class ScreenCaptureData;
14 } // namespace media
16 namespace remoting {
18 class VideoPacket;
20 // A class to perform the task of encoding a continous stream of
21 // images.
22 // This class operates asynchronously to enable maximum throughput.
23 class VideoEncoder {
24 public:
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|
38 // is called.
39 virtual void Encode(scoped_refptr<media::ScreenCaptureData> capture_data,
40 bool key_frame,
41 const DataAvailableCallback& data_available_callback) = 0;
44 } // namespace remoting
46 #endif // REMOTING_CODEC_VIDEO_ENCODER_H_