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

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

Issue 2329653002: Add WebrtcVideoEncoder interface (Closed)
Patch Set: . Created 4 years, 3 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
« no previous file with comments | « remoting/codec/video_encoder_vpx_unittest.cc ('k') | remoting/codec/webrtc_video_encoder_vpx.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 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.
4
5 #ifndef REMOTING_CODEC_WEBRTC_VIDEO_ENCODER_H_
6 #define REMOTING_CODEC_WEBRTC_VIDEO_ENCODER_H_
7
8 #include <stdint.h>
9
10 #include <memory>
11
12 #include "base/time/time.h"
13 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
14
15 namespace webrtc {
16 class DesktopFrame;
17 } // namespace webrtc
18
19 namespace remoting {
20
21 // A class to perform the task of encoding a continuous stream of images. The
22 // interface is asynchronous to enable maximum throughput.
23 class WebrtcVideoEncoder {
24 public:
25 struct FrameParams {
26 int bitrate_kbps = -1;
27 base::TimeDelta duration;
28 bool clear_active_map = false;
Irfan 2016/09/12 22:55:30 It seems some of these are not used anywhere ? Can
Sergey Ulanov 2016/09/12 23:05:23 Yes. Moved these fields to the follow-up CL where
29 bool key_frame = false;
30 int vpx_min_quantizer = -1;
31 int vpx_max_quantizer = -1;
32 };
33
34 struct EncodedFrame {
35 webrtc::DesktopSize size;
36 std::string data;
37 bool key_frame;
38 int quantizer;
39 };
40
41 virtual ~WebrtcVideoEncoder() {}
42
43 // Encode an image stored in |frame|. If |frame.updated_region()| is empty
44 // then the encoder may return a packet (e.g. to top-off previously-encoded
45 // portions of the frame to higher quality) or return nullptr to indicate that
46 // there is no work to do.
47 virtual std::unique_ptr<EncodedFrame> Encode(
48 const webrtc::DesktopFrame& frame,
49 const FrameParams& param) = 0;
50 };
51
52 } // namespace remoting
53
54 #endif // REMOTING_CODEC_WEBRTC_VIDEO_ENCODER_H_
OLDNEW
« no previous file with comments | « remoting/codec/video_encoder_vpx_unittest.cc ('k') | remoting/codec/webrtc_video_encoder_vpx.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698