OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
14 #include "base/scoped_ptr.h" | |
15 #include "base/time.h" | 14 #include "base/time.h" |
16 #include "base/timer.h" | 15 #include "base/timer.h" |
17 #include "remoting/base/encoder.h" | 16 #include "remoting/base/encoder.h" |
18 #include "remoting/host/capturer.h" | 17 #include "remoting/host/capturer.h" |
19 #include "remoting/proto/video.pb.h" | 18 #include "remoting/proto/video.pb.h" |
20 | 19 |
21 namespace remoting { | 20 namespace remoting { |
22 | 21 |
23 namespace protocol { | 22 namespace protocol { |
24 class ConnectionToClient; | 23 class ConnectionToClient; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 96 |
98 // Add a connection to this recording session. | 97 // Add a connection to this recording session. |
99 void AddConnection(scoped_refptr<protocol::ConnectionToClient> connection); | 98 void AddConnection(scoped_refptr<protocol::ConnectionToClient> connection); |
100 | 99 |
101 // Remove a connection from receiving screen updates. | 100 // Remove a connection from receiving screen updates. |
102 void RemoveConnection(scoped_refptr<protocol::ConnectionToClient> connection); | 101 void RemoveConnection(scoped_refptr<protocol::ConnectionToClient> connection); |
103 | 102 |
104 // Remove all connections. | 103 // Remove all connections. |
105 void RemoveAllConnections(); | 104 void RemoveAllConnections(); |
106 | 105 |
| 106 // Update the sequence number for tracing performance. |
| 107 void UpdateSequenceNumber(int64 sequence_number); |
| 108 |
107 private: | 109 private: |
108 // Getters for capturer and encoder. | 110 // Getters for capturer and encoder. |
109 Capturer* capturer(); | 111 Capturer* capturer(); |
110 Encoder* encoder(); | 112 Encoder* encoder(); |
111 | 113 |
112 // Capturer thread ---------------------------------------------------------- | 114 // Capturer thread ---------------------------------------------------------- |
113 | 115 |
114 void DoStart(); | 116 void DoStart(); |
115 void DoStop(Task* done_task); | 117 void DoStop(Task* done_task); |
116 void DoCompleteStop(Task* done_task); | 118 void DoCompleteStop(Task* done_task); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 | 197 |
196 // Number of captures to perform every second. Written on the capture thread. | 198 // Number of captures to perform every second. Written on the capture thread. |
197 double max_rate_; | 199 double max_rate_; |
198 | 200 |
199 // Time when capture is started. | 201 // Time when capture is started. |
200 base::Time capture_start_time_; | 202 base::Time capture_start_time_; |
201 | 203 |
202 // Time when encode is started. | 204 // Time when encode is started. |
203 base::Time encode_start_time_; | 205 base::Time encode_start_time_; |
204 | 206 |
| 207 // This is a number updated by client to trace performance. |
| 208 int64 sequence_number_; |
| 209 |
205 DISALLOW_COPY_AND_ASSIGN(ScreenRecorder); | 210 DISALLOW_COPY_AND_ASSIGN(ScreenRecorder); |
206 }; | 211 }; |
207 | 212 |
208 } // namespace remoting | 213 } // namespace remoting |
209 | 214 |
210 #endif // REMOTING_HOST_SCREEN_RECORDER_H_ | 215 #endif // REMOTING_HOST_SCREEN_RECORDER_H_ |
OLD | NEW |