Chromium Code Reviews| Index: remoting/host/screen_recorder.h |
| diff --git a/remoting/host/screen_recorder.h b/remoting/host/screen_recorder.h |
| index 3a844eb248b9af68352cea64ac5a0551641ed6ea..a436eaad6859380ea69d475a2a6fafa400073a56 100644 |
| --- a/remoting/host/screen_recorder.h |
| +++ b/remoting/host/screen_recorder.h |
| @@ -76,8 +76,9 @@ class ScreenRecorder : public base::RefCountedThreadSafe<ScreenRecorder> { |
| // Start recording. |
| void Start(); |
| - // Pause the recording session. |
| - void Pause(); |
| + // Stop the recording session. |task| is executed when recording is fully |
| + // stopped. This object cannot be used again after |task| is executed. |
| + void Stop(Task* task); |
|
Sergey Ulanov
2011/01/20 19:14:17
I think we should call it |done_task|, or |done|,
Alpha Left Google
2011/01/20 19:32:08
Done.
|
| // 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 |
| @@ -103,7 +104,8 @@ class ScreenRecorder : public base::RefCountedThreadSafe<ScreenRecorder> { |
| // Capturer thread ---------------------------------------------------------- |
| void DoStart(); |
| - void DoPause(); |
| + void DoStop(Task* task); |
| + void DoCompleteStop(Task* task); |
| void DoSetMaxRate(double max_rate); |
| @@ -112,7 +114,7 @@ class ScreenRecorder : public base::RefCountedThreadSafe<ScreenRecorder> { |
| void DoCapture(); |
| void CaptureDoneCallback(scoped_refptr<CaptureData> capture_data); |
| - void DoFinishSend(); |
| + void DoFinishOneRecording(); |
| // Network thread ----------------------------------------------------------- |
| @@ -127,16 +129,22 @@ class ScreenRecorder : public base::RefCountedThreadSafe<ScreenRecorder> { |
| void DoRemoveClient(scoped_refptr<protocol::ConnectionToClient> connection); |
| void DoRemoveAllClients(); |
| + // Signal network thread to cease activities. |
| + void DoStopOnNetworkThread(Task* task); |
| + |
| // Callback for the last packet in one update. Deletes |packet| and |
| // schedules next screen capture. |
| - void OnFrameSent(VideoPacket* packet); |
| + void FrameSentCallback(VideoPacket* packet); |
| // Encoder thread ----------------------------------------------------------- |
| void DoEncode(scoped_refptr<CaptureData> capture_data); |
| - // EncodeDataAvailableTask takes ownership of |packet|. |
| - void EncodeDataAvailableTask(VideoPacket* packet); |
| + // Perform stop operations on encode thread. |
| + void DoStopOnEncodeThread(Task* task); |
| + |
| + // EncodedDataAvailableCallback takes ownership of |packet|. |
| + void EncodedDataAvailableCallback(VideoPacket* packet); |
| void SendVideoPacket(VideoPacket* packet); |
| // Message loops used by this class. |
| @@ -160,9 +168,12 @@ class ScreenRecorder : public base::RefCountedThreadSafe<ScreenRecorder> { |
| ConnectionToClientList; |
| ConnectionToClientList connections_; |
| - // The following members are accessed on the capture thread. |
| + // Flag that indicates recording has been started. |
| bool started_; |
| + // Flag that indicates network is being stopped. |
| + bool network_stopped_; |
| + |
| // Timer that calls DoCapture. |
| base::RepeatingTimer<ScreenRecorder> capture_timer_; |