Commit 65f6394d authored by Lambros Lambrou's avatar Lambros Lambrou Committed by Commit Bot

[remoting host] Rate-limit capturer to 30FPS

For WebRTC-enabled connections, ensure capturer is not scheduled more
often than 30FPS, to limit CPU usage.

Bug: 816727
Change-Id: If2efd9de0749848f209fad7ed1926be108f402c3
Reviewed-on: https://chromium-review.googlesource.com/940449Reviewed-by: default avatarZijie He <zijiehe@chromium.org>
Commit-Queue: Lambros Lambrou <lambroslambrou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#539957}
parent 2376c7e7
......@@ -272,6 +272,11 @@ void WebrtcFrameSchedulerSimple::ScheduleNextFrame() {
kTargetFrameInterval -
estimated_next_frame_cost;
target_capture_time = std::max(target_capture_time, ideal_capture_time);
// Ensure that the capture rate is capped by kTargetFrameInterval, to avoid
// excessive CPU usage by the capturer.
target_capture_time = std::max(
target_capture_time, last_capture_started_time_ + kTargetFrameInterval);
}
target_capture_time = std::max(target_capture_time, now);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment