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

Unified Diff: remoting/host/recording_rate_regulator.h

Issue 8342040: Gather history of capture and encode time determine next recoring delay (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: tested and removed testing code Created 9 years, 2 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 | « no previous file | remoting/host/recording_rate_regulator.cc » ('j') | remoting/host/recording_rate_regulator.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/recording_rate_regulator.h
diff --git a/remoting/host/recording_rate_regulator.h b/remoting/host/recording_rate_regulator.h
new file mode 100644
index 0000000000000000000000000000000000000000..d6b1800ed3daac91272ae0ab684d3f244bc6ade1
--- /dev/null
+++ b/remoting/host/recording_rate_regulator.h
@@ -0,0 +1,37 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// This class is used to throttle the recoring rate of ScreenRecorder.
Wez 2011/10/20 00:52:15 typo: "recoring"
Alpha Left Google 2011/10/20 14:18:20 Done.
+// In general this class gathers history of time spent on encoding and
Wez 2011/10/20 00:52:15 nit: "In general"?
Alpha Left Google 2011/10/20 14:18:20 Done.
+// capturing to determine the delay for next recoding cycle.
+// The specific algorithm is based on system configuration and/or system
Wez 2011/10/20 00:52:15 nit: That's not true, though, is it? The algorith
Alpha Left Google 2011/10/20 14:18:20 Done.
+// load. For example a more capable computer will be able to run with
+// a shorter recording cycle and vice versa.
+
+#include "base/time.h"
+#include "remoting/base/running_average.h"
+
+namespace remoting {
+
+class RecordingRateRegulator {
Sergey Ulanov 2011/10/20 00:17:00 maybe call it controller instead of regulator. I t
Wez 2011/10/20 00:52:15 Please rename this CaptureScheduler, FrameSchedule
Alpha Left Google 2011/10/20 14:18:20 Done.
+ public:
+ RecordingRateRegulator();
+ ~RecordingRateRegulator();
+
+ // Determine the time delay to start next recording cycle.
+ base::TimeDelta NextRecordingDelay();
Wez 2011/10/20 00:52:15 What is the start time for this "delay"?
Alpha Left Google 2011/10/20 14:18:20 Done.
+
+ // Recording time spend on capturing and encoding.
+ void RecordCaptureTime(int64 ms);
Sergey Ulanov 2011/10/20 00:17:00 Use TimeDelta here and in the next method.
Alpha Left Google 2011/10/20 14:18:20 Done.
+ void RecordEncodeTime(int64 ms);
+
+ private:
+ int num_of_processors_;
+ RunningAverage capture_time_;
+ RunningAverage encode_time_;
+
+ DISALLOW_COPY_AND_ASSIGN(RecordingRateRegulator);
+};
+
+} // namespace remoting
« no previous file with comments | « no previous file | remoting/host/recording_rate_regulator.cc » ('j') | remoting/host/recording_rate_regulator.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698