| 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 "media/capture/video/fake_video_capture_device.h" | 5 #include "device/capture/video/fake_video_capture_device.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/location.h" | 12 #include "base/location.h" |
| 13 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
| 14 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
| 15 #include "base/threading/thread_task_runner_handle.h" | 15 #include "base/threading/thread_task_runner_handle.h" |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 // Don't accumulate any debt if we are lagging behind - just post the next | 297 // Don't accumulate any debt if we are lagging behind - just post the next |
| 298 // frame immediately and continue as normal. | 298 // frame immediately and continue as normal. |
| 299 const base::TimeTicks next_execution_time = | 299 const base::TimeTicks next_execution_time = |
| 300 std::max(current_time, expected_execution_time + frame_interval); | 300 std::max(current_time, expected_execution_time + frame_interval); |
| 301 const base::TimeDelta delay = next_execution_time - current_time; | 301 const base::TimeDelta delay = next_execution_time - current_time; |
| 302 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( | 302 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
| 303 FROM_HERE, base::Bind(next_capture, next_execution_time), delay); | 303 FROM_HERE, base::Bind(next_capture, next_execution_time), delay); |
| 304 } | 304 } |
| 305 | 305 |
| 306 } // namespace media | 306 } // namespace media |
| OLD | NEW |