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

Unified Diff: remoting/host/capture_scheduler.cc

Issue 171523003: Increase framerate limit in remoting host to 30fps (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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/host/capture_scheduler.h ('k') | remoting/host/capture_scheduler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/capture_scheduler.cc
diff --git a/remoting/host/capture_scheduler.cc b/remoting/host/capture_scheduler.cc
index a4f7efbd34a75e18aee4a129df5d187a0a581bf4..c6b3be0a1d23fd87759d1cf4cddf39d7b303cb82 100644
--- a/remoting/host/capture_scheduler.cc
+++ b/remoting/host/capture_scheduler.cc
@@ -16,8 +16,8 @@ namespace {
// over.
const int kStatisticsWindow = 3;
-// The hard limit is 20fps or 50ms per recording cycle.
-const int64 kMinimumRecordingDelay = 50;
+// The hard limit is 30fps or 33ms per recording cycle.
+const int64 kDefaultMinimumIntervalMs = 33;
// Controls how much CPU time we can use for encode and capture.
// Range of this value is between 0 to 1. 0 means using 0% of of all CPUs
@@ -30,7 +30,9 @@ namespace remoting {
// We assume that the number of available cores is constant.
CaptureScheduler::CaptureScheduler()
- : num_of_processors_(base::SysInfo::NumberOfProcessors()),
+ : minimum_interval_(
+ base::TimeDelta::FromMilliseconds(kDefaultMinimumIntervalMs)),
+ num_of_processors_(base::SysInfo::NumberOfProcessors()),
capture_time_(kStatisticsWindow),
encode_time_(kStatisticsWindow) {
DCHECK(num_of_processors_);
@@ -43,13 +45,13 @@ base::TimeDelta CaptureScheduler::NextCaptureDelay() {
// Delay by an amount chosen such that if capture and encode times
// continue to follow the averages, then we'll consume the target
// fraction of CPU across all cores.
- double delay =
+ base::TimeDelta delay = base::TimeDelta::FromMilliseconds(
(capture_time_.Average() + encode_time_.Average()) /
- (kRecordingCpuConsumption * num_of_processors_);
+ (kRecordingCpuConsumption * num_of_processors_));
- if (delay < kMinimumRecordingDelay)
- return base::TimeDelta::FromMilliseconds(kMinimumRecordingDelay);
- return base::TimeDelta::FromMilliseconds(delay);
+ if (delay < minimum_interval_)
+ return minimum_interval_;
+ return delay;
}
void CaptureScheduler::RecordCaptureTime(base::TimeDelta capture_time) {
« no previous file with comments | « remoting/host/capture_scheduler.h ('k') | remoting/host/capture_scheduler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698