OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "modules/mediacapturefromelement/TimedCanvasDrawListener.h" | 5 #include "modules/mediacapturefromelement/TimedCanvasDrawListener.h" |
6 | 6 |
| 7 #include <memory> |
7 #include "third_party/skia/include/core/SkImage.h" | 8 #include "third_party/skia/include/core/SkImage.h" |
8 #include <memory> | |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 | 11 |
12 TimedCanvasDrawListener::TimedCanvasDrawListener( | 12 TimedCanvasDrawListener::TimedCanvasDrawListener( |
13 std::unique_ptr<WebCanvasCaptureHandler> handler, | 13 std::unique_ptr<WebCanvasCaptureHandler> handler, |
14 double frameRate) | 14 double frameRate) |
15 : CanvasDrawListener(std::move(handler)), | 15 : CanvasDrawListener(std::move(handler)), |
16 m_frameInterval(1 / frameRate), | 16 m_frameInterval(1 / frameRate), |
17 m_requestFrameTimer(this, | 17 m_requestFrameTimer(this, |
18 &TimedCanvasDrawListener::requestFrameTimerFired) {} | 18 &TimedCanvasDrawListener::requestFrameTimerFired) {} |
(...skipping 15 matching lines...) Expand all Loading... |
34 m_frameCaptureRequested = false; | 34 m_frameCaptureRequested = false; |
35 CanvasDrawListener::sendNewFrame(std::move(image)); | 35 CanvasDrawListener::sendNewFrame(std::move(image)); |
36 } | 36 } |
37 | 37 |
38 void TimedCanvasDrawListener::requestFrameTimerFired(TimerBase*) { | 38 void TimedCanvasDrawListener::requestFrameTimerFired(TimerBase*) { |
39 // TODO(emircan): Measure the jitter and log, see crbug.com/589974. | 39 // TODO(emircan): Measure the jitter and log, see crbug.com/589974. |
40 m_frameCaptureRequested = true; | 40 m_frameCaptureRequested = true; |
41 } | 41 } |
42 | 42 |
43 } // namespace blink | 43 } // namespace blink |
OLD | NEW |