Upstreaming browser/ui/uikit_ui_util from iOS.
[chromium-blink-merge.git] / remoting / codec / video_encoder.h
blob9da447c1336f17394dd54b6d5273f81c4656f48a
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/memory/scoped_ptr.h"
10 namespace webrtc {
11 class DesktopFrame;
12 } // namespace webrtc
14 namespace remoting {
16 class VideoPacket;
18 // A class to perform the task of encoding a continuous stream of images. The
19 // interface is asynchronous to enable maximum throughput.
20 class VideoEncoder {
21 public:
22 virtual ~VideoEncoder() {}
24 // Request that the encoder provide lossless encoding, or color, if possible.
25 virtual void SetLosslessEncode(bool want_lossless) {}
26 virtual void SetLosslessColor(bool want_lossless) {}
28 // Encode an image stored in |frame|. If |frame.updated_region()| is empty
29 // then the encoder may return a packet (e.g. to top-off previously-encoded
30 // portions of the frame to higher quality) or return nullptr to indicate that
31 // there is no work to do.
32 virtual scoped_ptr<VideoPacket> Encode(const webrtc::DesktopFrame& frame) = 0;
35 } // namespace remoting
37 #endif // REMOTING_CODEC_VIDEO_ENCODER_H_