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

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

Issue 2329653002: Add WebrtcVideoEncoder interface (Closed)
Patch Set: win 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;
27 base::TimeDelta duration;
28 bool key_frame;
29 };
30
31 struct EncodedFrame {
32 webrtc::DesktopSize size;
33 std::string data;
34 bool key_frame;
35 int quantizer;
36 };
37
38 virtual ~WebrtcVideoEncoder() {}
39
40 // Encode an image stored in |frame|. If |frame.updated_region()| is empty
41 // then the encoder may return a packet (e.g. to top-off previously-encoded
42 // portions of the frame to higher quality) or return nullptr to indicate that
43 // there is no work to do.
44 virtual std::unique_ptr<EncodedFrame> Encode(
45 const webrtc::DesktopFrame& frame,
46 const FrameParams& param) = 0;
47 };
48
49 } // namespace remoting
50
51 #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