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

Side by Side Diff: remoting/protocol/webrtc_frame_scheduler.h

Issue 2335923002: Add WebrtcCaptureScheduler interface. (Closed)
Patch Set: include <algorithm> 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
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_PROTOCOL_WEBRTC_FRAME_SCHEDULER_H_
6 #define REMOTING_PROTOCOL_WEBRTC_FRAME_SCHEDULER_H_
7
8 #include "base/callback_forward.h"
9 #include "remoting/codec/webrtc_video_encoder.h"
10 #include "third_party/webrtc/video_encoder.h"
11
12 namespace remoting {
13 namespace protocol {
14
15 // An abstract interface for frame schedulers, which are responsible for
16 // scheduling when video frames are captured and for defining encoding
17 // parameters for each frame.
18 class WebrtcFrameScheduler {
19 public:
20 WebrtcFrameScheduler() {}
21 virtual ~WebrtcFrameScheduler() {}
22
23 // Starts the scheduler. |capture_callback| will be called whenever a new
24 // frame should be captured.
25 virtual void Start(const base::Closure& capture_callback) = 0;
26
27 // Pause and resumes the scheduler.
28 virtual void Pause(bool pause) = 0;
29
30 // Requests a key frame.
31 virtual void SetKeyFrameRequest() = 0;
32
33 // Sets network bitrate estimate.
34 virtual void SetTargetBitrate(int bitrate_kbps) = 0;
35
36 // Called after |frame| has been captured to get encoding parameters for the
37 // frame. Returns false if the frame should be dropped (e.g. when there are
38 // no changed), true otherwise.
39 virtual bool GetEncoderFrameParams(
40 const webrtc::DesktopFrame& frame,
41 WebrtcVideoEncoder::FrameParams* params_out) = 0;
42
43 // Called after a frame has been encoded and passed to the sender.
44 virtual void OnFrameEncoded(
45 const WebrtcVideoEncoder::EncodedFrame& encoded_frame,
46 const webrtc::EncodedImageCallback::Result& send_result) = 0;
47 };
48
49 } // namespace protocol
50 } // namespace remoting
51
52 #endif // REMOTING_PROTOCOL_WEBRTC_FRAME_SCHEDULER_H_
OLDNEW
« no previous file with comments | « remoting/protocol/webrtc_dummy_video_encoder.cc ('k') | remoting/protocol/webrtc_frame_scheduler_simple.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698