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_VIDEO_SCHEDULER_H_ | 5 #ifndef REMOTING_HOST_VIDEO_SCHEDULER_H_ |
6 #define REMOTING_HOST_VIDEO_SCHEDULER_H_ | 6 #define REMOTING_HOST_VIDEO_SCHEDULER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 // Send updated cursor shape to client. | 148 // Send updated cursor shape to client. |
149 void SendCursorShape(scoped_ptr<protocol::CursorShapeInfo> cursor_shape); | 149 void SendCursorShape(scoped_ptr<protocol::CursorShapeInfo> cursor_shape); |
150 | 150 |
151 // Encoder thread ----------------------------------------------------------- | 151 // Encoder thread ----------------------------------------------------------- |
152 | 152 |
153 // Encode a frame, passing generated VideoPackets to SendVideoPacket(). | 153 // Encode a frame, passing generated VideoPackets to SendVideoPacket(). |
154 void EncodeFrame(scoped_refptr<CaptureData> capture_data); | 154 void EncodeFrame(scoped_refptr<CaptureData> capture_data); |
155 | 155 |
156 void EncodedDataAvailableCallback(scoped_ptr<VideoPacket> packet); | 156 void EncodedDataAvailableCallback(scoped_ptr<VideoPacket> packet); |
157 | 157 |
| 158 // Used to synchronize capture and encode thread teardown, notifying the |
| 159 // network thread when done. |
| 160 void StopOnEncodeThread(const base::Closure& done_task); |
| 161 |
158 // Task runners used by this class. | 162 // Task runners used by this class. |
159 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner_; | 163 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner_; |
160 scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner_; | 164 scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner_; |
161 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; | 165 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; |
162 | 166 |
163 // Used to capture frames. Always accessed on the capture thread. | 167 // Used to capture frames. Always accessed on the capture thread. |
164 VideoFrameCapturer* capturer_; | 168 VideoFrameCapturer* capturer_; |
165 | 169 |
166 // Used to encode captured frames. Always accessed on the encode thread. | 170 // Used to encode captured frames. Always accessed on the encode thread. |
167 scoped_ptr<VideoEncoder> encoder_; | 171 scoped_ptr<VideoEncoder> encoder_; |
(...skipping 20 matching lines...) Expand all Loading... |
188 | 192 |
189 // An object to schedule capturing. | 193 // An object to schedule capturing. |
190 CaptureScheduler scheduler_; | 194 CaptureScheduler scheduler_; |
191 | 195 |
192 DISALLOW_COPY_AND_ASSIGN(VideoScheduler); | 196 DISALLOW_COPY_AND_ASSIGN(VideoScheduler); |
193 }; | 197 }; |
194 | 198 |
195 } // namespace remoting | 199 } // namespace remoting |
196 | 200 |
197 #endif // REMOTING_HOST_VIDEO_SCHEDULER_H_ | 201 #endif // REMOTING_HOST_VIDEO_SCHEDULER_H_ |
OLD | NEW |