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

Unified Diff: remoting/protocol/webrtc_frame_scheduler.h

Issue 1908203002: Adapt encoder behavior to target bitrate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unnecessary code 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/protocol/webrtc_connection_to_client.cc ('k') | remoting/protocol/webrtc_frame_scheduler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/webrtc_frame_scheduler.h
diff --git a/remoting/protocol/webrtc_frame_scheduler.h b/remoting/protocol/webrtc_frame_scheduler.h
index 7888c652213b69536e42f70d2542ecc7edbc54e6..0dbddaab35874ae0aeca00c46f234b984dd6dbed 100644
--- a/remoting/protocol/webrtc_frame_scheduler.h
+++ b/remoting/protocol/webrtc_frame_scheduler.h
@@ -54,19 +54,29 @@ class WebRtcFrameScheduler : public webrtc::DesktopCapturer::Callback {
static std::unique_ptr<VideoPacket> EncodeFrame(
VideoEncoder* encoder,
std::unique_ptr<webrtc::DesktopFrame> frame,
- bool key_frame_request);
+ uint32_t target_bitrate,
+ bool key_frame_request,
+ int64_t capture_time_ms);
void OnFrameEncoded(std::unique_ptr<VideoPacket> packet);
void SetKeyFrameRequest();
bool ClearAndGetKeyFrameRequest();
+ void SetTargetBitrate(int bitrate);
- // Protects |key_frame_request_|.
+ // Protects |key_frame_request_| and |target_bitrate_kbps_|.
base::Lock lock_;
bool key_frame_request_ = false;
+ uint32_t target_bitrate_kbps_;
+ int last_quantizer_;
bool capture_pending_ = false;
bool encode_pending_ = false;
+ // Last time capture was completed.
+ base::TimeTicks last_capture_completed_ticks_;
+ // Last time capture was started.
+ base::TimeTicks last_capture_started_ticks_;
+
webrtc::DesktopSize frame_size_;
webrtc::DesktopVector frame_dpi_;
VideoStream::SizeCallback size_callback_;
@@ -87,7 +97,6 @@ class WebRtcFrameScheduler : public webrtc::DesktopCapturer::Callback {
std::unique_ptr<VideoEncoder> encoder_;
base::ThreadChecker thread_checker_;
- base::TimeTicks last_capture_ticks_;
base::WeakPtrFactory<WebRtcFrameScheduler> weak_factory_;
« no previous file with comments | « remoting/protocol/webrtc_connection_to_client.cc ('k') | remoting/protocol/webrtc_frame_scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698