Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(840)

Side by Side Diff: remoting/codec/video_encoder.h

Issue 1923573006: Implement a dummy host to do capturing and analysis only. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 11
12 #include "remoting/protocol/session_config.h"
joedow 2016/04/28 22:53:54 I think you can forward declare SessionConfig sinc
Hzj_jie 2016/05/03 19:07:05 Done.
13
12 namespace webrtc { 14 namespace webrtc {
13 class DesktopFrame; 15 class DesktopFrame;
14 } // namespace webrtc 16 } // namespace webrtc
15 17
16 namespace remoting { 18 namespace remoting {
17 19
18 class VideoPacket; 20 class VideoPacket;
19 21
20 // A class to perform the task of encoding a continuous stream of images. The 22 // A class to perform the task of encoding a continuous stream of images. The
21 // interface is asynchronous to enable maximum throughput. 23 // interface is asynchronous to enable maximum throughput.
22 class VideoEncoder { 24 class VideoEncoder {
23 public: 25 public:
24 enum Flags { REQUEST_KEY_FRAME = 1 << 0 }; 26 enum Flags { REQUEST_KEY_FRAME = 1 << 0 };
25 virtual ~VideoEncoder() {} 27 virtual ~VideoEncoder() {}
26 28
27 // Request that the encoder provide lossless encoding, or color, if possible. 29 // Request that the encoder provide lossless encoding, or color, if possible.
28 virtual void SetLosslessEncode(bool want_lossless) {} 30 virtual void SetLosslessEncode(bool want_lossless) {}
29 virtual void SetLosslessColor(bool want_lossless) {} 31 virtual void SetLosslessColor(bool want_lossless) {}
30 32
31 // Encode an image stored in |frame|. If |frame.updated_region()| is empty 33 // Encode an image stored in |frame|. If |frame.updated_region()| is empty
32 // then the encoder may return a packet (e.g. to top-off previously-encoded 34 // then the encoder may return a packet (e.g. to top-off previously-encoded
33 // portions of the frame to higher quality) or return nullptr to indicate that 35 // portions of the frame to higher quality) or return nullptr to indicate that
34 // there is no work to do. 36 // there is no work to do.
35 virtual std::unique_ptr<VideoPacket> Encode(const webrtc::DesktopFrame& frame, 37 virtual std::unique_ptr<VideoPacket> Encode(const webrtc::DesktopFrame& frame,
36 uint32_t flags) = 0; 38 uint32_t flags) = 0;
39
40 static std::unique_ptr<VideoEncoder> Create(
41 const protocol::SessionConfig& config);
37 }; 42 };
38 43
39 } // namespace remoting 44 } // namespace remoting
40 45
41 #endif // REMOTING_CODEC_VIDEO_ENCODER_H_ 46 #endif // REMOTING_CODEC_VIDEO_ENCODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698