OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 public: | 77 public: |
78 | 78 |
79 // Construct a ScreenRecorder. Message loops and threads are provided. | 79 // Construct a ScreenRecorder. Message loops and threads are provided. |
80 // This object does not own capturer but owns encoder. | 80 // This object does not own capturer but owns encoder. |
81 ScreenRecorder(MessageLoop* capture_loop, | 81 ScreenRecorder(MessageLoop* capture_loop, |
82 MessageLoop* encode_loop, | 82 MessageLoop* encode_loop, |
83 base::MessageLoopProxy* network_loop, | 83 base::MessageLoopProxy* network_loop, |
84 Capturer* capturer, | 84 Capturer* capturer, |
85 Encoder* encoder); | 85 Encoder* encoder); |
86 | 86 |
87 virtual ~ScreenRecorder(); | |
88 | |
89 // Start recording. | 87 // Start recording. |
90 void Start(); | 88 void Start(); |
91 | 89 |
92 // Stop the recording session. |done_task| is executed when recording is fully | 90 // Stop the recording session. |done_task| is executed when recording is fully |
93 // stopped. This object cannot be used again after |task| is executed. | 91 // stopped. This object cannot be used again after |task| is executed. |
94 void Stop(const base::Closure& done_task); | 92 void Stop(const base::Closure& done_task); |
95 | 93 |
96 // Add a connection to this recording session. | 94 // Add a connection to this recording session. |
97 void AddConnection(protocol::ConnectionToClient* connection); | 95 void AddConnection(protocol::ConnectionToClient* connection); |
98 | 96 |
99 // Remove a connection from receiving screen updates. | 97 // Remove a connection from receiving screen updates. |
100 void RemoveConnection(protocol::ConnectionToClient* connection); | 98 void RemoveConnection(protocol::ConnectionToClient* connection); |
101 | 99 |
102 // Remove all connections. | 100 // Remove all connections. |
103 void RemoveAllConnections(); | 101 void RemoveAllConnections(); |
104 | 102 |
105 // Update the sequence number for tracing performance. | 103 // Update the sequence number for tracing performance. |
106 void UpdateSequenceNumber(int64 sequence_number); | 104 void UpdateSequenceNumber(int64 sequence_number); |
107 | 105 |
108 private: | 106 private: |
| 107 friend class base::RefCountedThreadSafe<ScreenRecorder>; |
| 108 virtual ~ScreenRecorder(); |
| 109 |
109 // Getters for capturer and encoder. | 110 // Getters for capturer and encoder. |
110 Capturer* capturer(); | 111 Capturer* capturer(); |
111 Encoder* encoder(); | 112 Encoder* encoder(); |
112 | 113 |
113 bool is_recording(); | 114 bool is_recording(); |
114 | 115 |
115 // Capturer thread ---------------------------------------------------------- | 116 // Capturer thread ---------------------------------------------------------- |
116 | 117 |
117 void DoStart(); | 118 void DoStart(); |
118 void DoSetMaxRate(double max_rate); | 119 void DoSetMaxRate(double max_rate); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 | 197 |
197 // An object to schedule capturing. | 198 // An object to schedule capturing. |
198 CaptureScheduler scheduler_; | 199 CaptureScheduler scheduler_; |
199 | 200 |
200 DISALLOW_COPY_AND_ASSIGN(ScreenRecorder); | 201 DISALLOW_COPY_AND_ASSIGN(ScreenRecorder); |
201 }; | 202 }; |
202 | 203 |
203 } // namespace remoting | 204 } // namespace remoting |
204 | 205 |
205 #endif // REMOTING_HOST_SCREEN_RECORDER_H_ | 206 #endif // REMOTING_HOST_SCREEN_RECORDER_H_ |
OLD | NEW |