Chromium Code Reviews| 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 |