| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef REMOTING_HOST_SCREEN_RECORDER_H_ | 5 #ifndef REMOTING_HOST_SCREEN_RECORDER_H_ |
| 6 #define REMOTING_HOST_SCREEN_RECORDER_H_ | 6 #define REMOTING_HOST_SCREEN_RECORDER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 // | 63 // |
| 64 // This class has the following state variables: | 64 // This class has the following state variables: |
| 65 // |is_recording_| - If this is set to false there should be no activity on | 65 // |is_recording_| - If this is set to false there should be no activity on |
| 66 // the capture thread by this object. | 66 // the capture thread by this object. |
| 67 // |network_stopped_| - This state is to prevent activity on the network thread | 67 // |network_stopped_| - This state is to prevent activity on the network thread |
| 68 // if set to false. | 68 // if set to false. |
| 69 class ScreenRecorder : public base::RefCountedThreadSafe<ScreenRecorder> { | 69 class ScreenRecorder : public base::RefCountedThreadSafe<ScreenRecorder> { |
| 70 public: | 70 public: |
| 71 | 71 |
| 72 // Construct a ScreenRecorder. Message loops and threads are provided. | 72 // Construct a ScreenRecorder. Message loops and threads are provided. |
| 73 // This object does not own capturer but owns encoder. | 73 // This object does not own capturer and encoder. |
| 74 ScreenRecorder(MessageLoop* capture_loop, | 74 ScreenRecorder(MessageLoop* capture_loop, |
| 75 MessageLoop* encode_loop, | 75 MessageLoop* encode_loop, |
| 76 MessageLoop* network_loop, | 76 MessageLoop* network_loop, |
| 77 Capturer* capturer, | 77 Capturer* capturer, |
| 78 Encoder* encoder); | 78 Encoder* encoder); |
| 79 | 79 |
| 80 virtual ~ScreenRecorder(); | 80 virtual ~ScreenRecorder(); |
| 81 | 81 |
| 82 // Start recording. | 82 // Start recording. |
| 83 void Start(); | 83 void Start(); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 void EncodedDataAvailableCallback(VideoPacket* packet); | 153 void EncodedDataAvailableCallback(VideoPacket* packet); |
| 154 void SendVideoPacket(VideoPacket* packet); | 154 void SendVideoPacket(VideoPacket* packet); |
| 155 | 155 |
| 156 // Message loops used by this class. | 156 // Message loops used by this class. |
| 157 MessageLoop* capture_loop_; | 157 MessageLoop* capture_loop_; |
| 158 MessageLoop* encode_loop_; | 158 MessageLoop* encode_loop_; |
| 159 MessageLoop* network_loop_; | 159 MessageLoop* network_loop_; |
| 160 | 160 |
| 161 // Reference to the capturer. This member is always accessed on the capture | 161 // Reference to the capturer. This member is always accessed on the capture |
| 162 // thread. | 162 // thread. |
| 163 Capturer* capturer_; | 163 scoped_ptr<Capturer> capturer_; |
| 164 | 164 |
| 165 // Reference to the encoder. This member is always accessed on the encode | 165 // Reference to the encoder. This member is always accessed on the encode |
| 166 // thread. | 166 // thread. |
| 167 scoped_ptr<Encoder> encoder_; | 167 scoped_ptr<Encoder> encoder_; |
| 168 | 168 |
| 169 // A list of clients connected to this hosts. | 169 // A list of clients connected to this hosts. |
| 170 // This member is always accessed on the network thread. | 170 // This member is always accessed on the network thread. |
| 171 typedef std::vector<scoped_refptr<protocol::ConnectionToClient> > | 171 typedef std::vector<scoped_refptr<protocol::ConnectionToClient> > |
| 172 ConnectionToClientList; | 172 ConnectionToClientList; |
| 173 ConnectionToClientList connections_; | 173 ConnectionToClientList connections_; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 192 | 192 |
| 193 // Number of captures to perform every second. Written on the capture thread. | 193 // Number of captures to perform every second. Written on the capture thread. |
| 194 double max_rate_; | 194 double max_rate_; |
| 195 | 195 |
| 196 DISALLOW_COPY_AND_ASSIGN(ScreenRecorder); | 196 DISALLOW_COPY_AND_ASSIGN(ScreenRecorder); |
| 197 }; | 197 }; |
| 198 | 198 |
| 199 } // namespace remoting | 199 } // namespace remoting |
| 200 | 200 |
| 201 #endif // REMOTING_HOST_SCREEN_RECORDER_H_ | 201 #endif // REMOTING_HOST_SCREEN_RECORDER_H_ |
| OLD | NEW |