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 "media/capture/video/fake_video_capture_device.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 |
7 #include <algorithm> | 9 #include <algorithm> |
8 | 10 |
9 #include "base/bind.h" | 11 #include "base/bind.h" |
10 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
11 #include "media/audio/fake_audio_input_stream.h" | 13 #include "media/audio/fake_audio_input_stream.h" |
12 #include "media/base/video_frame.h" | 14 #include "media/base/video_frame.h" |
13 #include "third_party/skia/include/core/SkBitmap.h" | 15 #include "third_party/skia/include/core/SkBitmap.h" |
14 #include "third_party/skia/include/core/SkCanvas.h" | 16 #include "third_party/skia/include/core/SkCanvas.h" |
15 #include "third_party/skia/include/core/SkPaint.h" | 17 #include "third_party/skia/include/core/SkPaint.h" |
16 | 18 |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 // Don't accumulate any debt if we are lagging behind - just post the next | 244 // Don't accumulate any debt if we are lagging behind - just post the next |
243 // frame immediately and continue as normal. | 245 // frame immediately and continue as normal. |
244 const base::TimeTicks next_execution_time = | 246 const base::TimeTicks next_execution_time = |
245 std::max(current_time, expected_execution_time + frame_interval); | 247 std::max(current_time, expected_execution_time + frame_interval); |
246 const base::TimeDelta delay = next_execution_time - current_time; | 248 const base::TimeDelta delay = next_execution_time - current_time; |
247 base::MessageLoop::current()->PostDelayedTask( | 249 base::MessageLoop::current()->PostDelayedTask( |
248 FROM_HERE, base::Bind(next_capture, next_execution_time), delay); | 250 FROM_HERE, base::Bind(next_capture, next_execution_time), delay); |
249 } | 251 } |
250 | 252 |
251 } // namespace media | 253 } // namespace media |
OLD | NEW |