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

Unified Diff: remoting/host/capture_scheduler.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: done 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/capture_scheduler.cc » ('j') | remoting/host/capture_scheduler.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/capture_scheduler.h
diff --git a/remoting/host/capture_scheduler.h b/remoting/host/capture_scheduler.h
new file mode 100644
index 0000000000000000000000000000000000000000..df05d40e57eb7a886fef73066c17a666e7a8acae
--- /dev/null
+++ b/remoting/host/capture_scheduler.h
@@ -0,0 +1,41 @@
+// 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 determine the recoring rate of ScreenRecorder.
Wez 2011/10/25 00:05:38 typo: recoring
Alpha Left Google 2011/10/31 18:47:24 Done.
+// This class gathers history of time spent on encode and capture to
+// determine the delay for next recoding cycle.
Wez 2011/10/25 00:05:38 typo: recoding nit: Please word this more clearly;
Alpha Left Google 2011/10/31 18:47:24 Done.
+// The algorithm also takes into account number of processors in the
+// system and current system load.
+
+#ifndef REMOTING_HOST_CAPTURE_SCHEDULER_H_
+#define REMOTING_HOST_CAPTURE_SCHEDULER_H_
+
+#include "base/time.h"
+#include "remoting/base/running_average.h"
+
+namespace remoting {
+
+class CaptureScheduler {
+ public:
+ CaptureScheduler();
+ ~CaptureScheduler();
+
+ // Determine the time delay from current time to perform next capture.
+ base::TimeDelta NextCaptureDelay();
+
+ // Recording time spend on capturing and encoding.
Wez 2011/10/25 00:05:38 typos: Recording->Record, spend->spent.
Alpha Left Google 2011/10/31 18:47:24 Done.
+ void RecordCaptureTime(base::TimeDelta capture_time);
+ void RecordEncodeTime(base::TimeDelta encode_time);
+
+ private:
+ int num_of_processors_;
+ RunningAverage capture_time_;
+ RunningAverage encode_time_;
+
+ DISALLOW_COPY_AND_ASSIGN(CaptureScheduler);
+};
+
+} // namespace remoting
+
+#endif // REMOTING_HOST_CAPTURE_SCHEDULER_H_
« no previous file with comments | « no previous file | remoting/host/capture_scheduler.cc » ('j') | remoting/host/capture_scheduler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698