Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // 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.
| |
| 6 // This class gathers history of time spent on encode and capture to | |
| 7 // 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.
| |
| 8 // The algorithm also takes into account number of processors in the | |
| 9 // system and current system load. | |
| 10 | |
| 11 #ifndef REMOTING_HOST_CAPTURE_SCHEDULER_H_ | |
| 12 #define REMOTING_HOST_CAPTURE_SCHEDULER_H_ | |
| 13 | |
| 14 #include "base/time.h" | |
| 15 #include "remoting/base/running_average.h" | |
| 16 | |
| 17 namespace remoting { | |
| 18 | |
| 19 class CaptureScheduler { | |
| 20 public: | |
| 21 CaptureScheduler(); | |
| 22 ~CaptureScheduler(); | |
| 23 | |
| 24 // Determine the time delay from current time to perform next capture. | |
| 25 base::TimeDelta NextCaptureDelay(); | |
| 26 | |
| 27 // 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.
| |
| 28 void RecordCaptureTime(base::TimeDelta capture_time); | |
| 29 void RecordEncodeTime(base::TimeDelta encode_time); | |
| 30 | |
| 31 private: | |
| 32 int num_of_processors_; | |
| 33 RunningAverage capture_time_; | |
| 34 RunningAverage encode_time_; | |
| 35 | |
| 36 DISALLOW_COPY_AND_ASSIGN(CaptureScheduler); | |
| 37 }; | |
| 38 | |
| 39 } // namespace remoting | |
| 40 | |
| 41 #endif // REMOTING_HOST_CAPTURE_SCHEDULER_H_ | |
| OLD | NEW |