OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "content/renderer/image_capture/image_capture_frame_grabber.h" | 5 #include "content/renderer/image_capture/image_capture_frame_grabber.h" |
6 | 6 |
7 #include "cc/paint/paint_canvas.h" | 7 #include "cc/paint/paint_canvas.h" |
8 #include "cc/paint/paint_surface.h" | |
9 #include "media/base/bind_to_current_loop.h" | 8 #include "media/base/bind_to_current_loop.h" |
10 #include "media/base/video_frame.h" | 9 #include "media/base/video_frame.h" |
11 #include "media/base/video_util.h" | 10 #include "media/base/video_util.h" |
12 #include "skia/ext/platform_canvas.h" | 11 #include "skia/ext/platform_canvas.h" |
13 #include "third_party/WebKit/public/platform/WebCallbacks.h" | 12 #include "third_party/WebKit/public/platform/WebCallbacks.h" |
14 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" | 13 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" |
15 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" | 14 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" |
16 #include "third_party/libyuv/include/libyuv.h" | 15 #include "third_party/libyuv/include/libyuv.h" |
17 #include "third_party/skia/include/core/SkImage.h" | 16 #include "third_party/skia/include/core/SkImage.h" |
| 17 #include "third_party/skia/include/core/SkSurface.h" |
18 | 18 |
19 namespace content { | 19 namespace content { |
20 | 20 |
21 using blink::WebImageCaptureGrabFrameCallbacks; | 21 using blink::WebImageCaptureGrabFrameCallbacks; |
22 | 22 |
23 namespace { | 23 namespace { |
24 | 24 |
25 void OnError(std::unique_ptr<WebImageCaptureGrabFrameCallbacks> callbacks) { | 25 void OnError(std::unique_ptr<WebImageCaptureGrabFrameCallbacks> callbacks) { |
26 callbacks->onError(); | 26 callbacks->onError(); |
27 } | 27 } |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 155 |
156 MediaStreamVideoSink::DisconnectFromTrack(); | 156 MediaStreamVideoSink::DisconnectFromTrack(); |
157 frame_grab_in_progress_ = false; | 157 frame_grab_in_progress_ = false; |
158 if (image) | 158 if (image) |
159 callbacks.PassCallbacks()->onSuccess(image); | 159 callbacks.PassCallbacks()->onSuccess(image); |
160 else | 160 else |
161 callbacks.PassCallbacks()->onError(); | 161 callbacks.PassCallbacks()->onError(); |
162 } | 162 } |
163 | 163 |
164 } // namespace content | 164 } // namespace content |
OLD | NEW |