Chromium Code Reviews| Index: remoting/host/screen_recorder.h |
| diff --git a/remoting/host/screen_recorder.h b/remoting/host/screen_recorder.h |
| index 2e341c774e07a46c725833acbcb26fb5fb4c6b66..242bb0fc564dd32293bafbc2892c797c6f2b5199 100644 |
| --- a/remoting/host/screen_recorder.h |
| +++ b/remoting/host/screen_recorder.h |
| @@ -16,6 +16,7 @@ |
| #include "base/timer.h" |
| #include "remoting/base/encoder.h" |
| #include "remoting/host/capturer.h" |
| +#include "remoting/host/recording_rate_regulator.h" |
| #include "remoting/proto/video.pb.h" |
| namespace base { |
| @@ -92,13 +93,6 @@ class ScreenRecorder : public base::RefCountedThreadSafe<ScreenRecorder> { |
| // stopped. This object cannot be used again after |task| is executed. |
| void Stop(const base::Closure& done_task); |
| - // Set the maximum capture rate. This is denoted by number of updates |
| - // in one second. The actual system may run in a slower rate than the maximum |
| - // rate due to various factors, e.g. capture speed, encode speed and network |
| - // conditions. |
| - // This method should be called before Start() is called. |
| - void SetMaxRate(double rate); |
| - |
| // Add a connection to this recording session. |
| void AddConnection(scoped_refptr<protocol::ConnectionToClient> connection); |
| @@ -189,7 +183,11 @@ class ScreenRecorder : public base::RefCountedThreadSafe<ScreenRecorder> { |
| bool encoder_stopped_; |
| // Timer that calls DoCapture. |
| - base::RepeatingTimer<ScreenRecorder> capture_timer_; |
| + base::OneShotTimer<ScreenRecorder> capture_timer_; |
| + |
| + // Maximum simutaneous recordings allowed. Note that this number |
|
Wez
2011/10/20 00:52:15
typo: "simutaneous"
Alpha Left Google
2011/10/31 18:47:24
Done.
|
| + // cannot exceed 2 at any time. |
| + int max_recordings_; |
| // Count the number of recordings (i.e. capture or encode) happening. |
| int recordings_; |
| @@ -198,9 +196,6 @@ class ScreenRecorder : public base::RefCountedThreadSafe<ScreenRecorder> { |
| // many pending frames. |
| int frame_skipped_; |
| - // Number of captures to perform every second. Written on the capture thread. |
| - double max_rate_; |
| - |
| // Time when capture is started. |
| base::Time capture_start_time_; |
| @@ -210,6 +205,9 @@ class ScreenRecorder : public base::RefCountedThreadSafe<ScreenRecorder> { |
| // This is a number updated by client to trace performance. |
| int64 sequence_number_; |
| + // An object to help throttle recording rate. |
| + RecordingRateRegulator regulator_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(ScreenRecorder); |
| }; |