Chromium Code Reviews| OLD | NEW |
|---|---|
| (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_CAPTURE_SCHEDULER_H_ | |
| 6 #define REMOTING_PROTOCOL_WEBRTC_CAPTURE_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 capture schedulers. | |
| 16 class WebrtcCaptureScheduler { | |
| 17 public: | |
| 18 WebrtcCaptureScheduler() {} | |
| 19 virtual ~WebrtcCaptureScheduler() {} | |
| 20 | |
| 21 // Starts the scheduler. |capture_callback| will be called whenever a new | |
| 22 // frame should be captured. | |
| 23 virtual void Start(const base::Closure& capture_callback) = 0; | |
| 24 | |
| 25 // Pauses the scheduler. | |
|
Irfan
2016/09/14 20:01:29
Pauses/Resumes ?
Sergey Ulanov
2016/09/16 00:02:47
Done.
| |
| 26 virtual void Pause(bool pause) = 0; | |
| 27 | |
| 28 // Requests a key frame. | |
| 29 virtual void SetKeyFrameRequest() = 0; | |
| 30 | |
| 31 // Sets network bitrate estimate. | |
| 32 virtual void SetTargetBitrate(int bitrate_kbps) = 0; | |
| 33 | |
| 34 // Called after |frame| has been captured to get encoding parameters for the | |
| 35 // frame. Returns false is the frame should be dropped (e.g. when there are | |
|
Irfan
2016/09/14 20:01:29
Returns false if
Sergey Ulanov
2016/09/16 00:02:47
Done.
| |
| 36 // no changed), true otherwise. | |
| 37 virtual bool GetEncoderFrameParams( | |
|
Irfan
2016/09/14 20:01:29
It is a bit strange to me that encoder params are
Sergey Ulanov
2016/09/16 00:02:47
The idea here is that frame scheduling logic shoul
Irfan
2016/09/16 17:21:19
sgtm
| |
| 38 const webrtc::DesktopFrame& frame, | |
| 39 WebrtcVideoEncoder::FrameParams* params_out) = 0; | |
| 40 | |
| 41 // Called after a frame has been encoded and passed to the sender. | |
| 42 virtual void OnFrameEncoded( | |
|
Irfan
2016/09/14 20:01:29
I may be imagining, but did you recently add abili
Sergey Ulanov
2016/09/16 00:02:47
I was planning to do that, but haven't actually im
| |
| 43 const WebrtcVideoEncoder::EncodedFrame& encoded_frame, | |
| 44 const webrtc::EncodedImageCallback::Result& send_result) = 0; | |
| 45 }; | |
| 46 | |
| 47 } // namespace protocol | |
| 48 } // namespace remoting | |
| 49 | |
| 50 #endif // REMOTING_PROTOCOL_WEBRTC_CAPTURE_SCHEDULER_H_ | |
| OLD | NEW |