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 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.
| |
6 // 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.
| |
7 // capturing to determine the delay for next recoding cycle. | |
8 // 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.
| |
9 // load. For example a more capable computer will be able to run with | |
10 // a shorter recording cycle and vice versa. | |
11 | |
12 #include "base/time.h" | |
13 #include "remoting/base/running_average.h" | |
14 | |
15 namespace remoting { | |
16 | |
17 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.
| |
18 public: | |
19 RecordingRateRegulator(); | |
20 ~RecordingRateRegulator(); | |
21 | |
22 // Determine the time delay to start next recording cycle. | |
23 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.
| |
24 | |
25 // Recording time spend on capturing and encoding. | |
26 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.
| |
27 void RecordEncodeTime(int64 ms); | |
28 | |
29 private: | |
30 int num_of_processors_; | |
31 RunningAverage capture_time_; | |
32 RunningAverage encode_time_; | |
33 | |
34 DISALLOW_COPY_AND_ASSIGN(RecordingRateRegulator); | |
35 }; | |
36 | |
37 } // namespace remoting | |
OLD | NEW |