| 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 #include "remoting/host/video_scheduler.h" | 5 #include "remoting/host/video_scheduler.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 } | 158 } |
| 159 | 159 |
| 160 VideoScheduler::~VideoScheduler() { | 160 VideoScheduler::~VideoScheduler() { |
| 161 } | 161 } |
| 162 | 162 |
| 163 // Capturer thread ------------------------------------------------------------- | 163 // Capturer thread ------------------------------------------------------------- |
| 164 | 164 |
| 165 void VideoScheduler::StartOnCaptureThread() { | 165 void VideoScheduler::StartOnCaptureThread() { |
| 166 DCHECK(capture_task_runner_->BelongsToCurrentThread()); | 166 DCHECK(capture_task_runner_->BelongsToCurrentThread()); |
| 167 | 167 |
| 168 // Start the capturer and let it notify us if cursor shape changes. | 168 // Start the capturer and let it notify us of cursor shape changes. |
| 169 capturer_->Start(this); | 169 capturer_->Start(this); |
| 170 | 170 |
| 171 capture_timer_.reset(new base::OneShotTimer<VideoScheduler>()); | 171 capture_timer_.reset(new base::OneShotTimer<VideoScheduler>()); |
| 172 | 172 |
| 173 // Capture first frame immedately. | 173 // Capture first frame immedately. |
| 174 CaptureNextFrame(); | 174 CaptureNextFrame(); |
| 175 } | 175 } |
| 176 | 176 |
| 177 void VideoScheduler::StopOnCaptureThread() { | 177 void VideoScheduler::StopOnCaptureThread() { |
| 178 DCHECK(capture_task_runner_->BelongsToCurrentThread()); | 178 DCHECK(capture_task_runner_->BelongsToCurrentThread()); |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 | 328 |
| 329 // This is posted by StopOnCaptureThread, so we know that by the time we | 329 // This is posted by StopOnCaptureThread, so we know that by the time we |
| 330 // process it there are no more encode tasks queued. Pass |capturer_| for | 330 // process it there are no more encode tasks queued. Pass |capturer_| for |
| 331 // deletion on the thread that created it. | 331 // deletion on the thread that created it. |
| 332 network_task_runner_->PostTask( | 332 network_task_runner_->PostTask( |
| 333 FROM_HERE, base::Bind(&VideoScheduler::StopOnNetworkThread, this, | 333 FROM_HERE, base::Bind(&VideoScheduler::StopOnNetworkThread, this, |
| 334 base::Passed(&capturer))); | 334 base::Passed(&capturer))); |
| 335 } | 335 } |
| 336 | 336 |
| 337 } // namespace remoting | 337 } // namespace remoting |
| OLD | NEW |