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 "content/renderer/media/canvas_capture_handler.h" | 5 #include "content/renderer/media/canvas_capture_handler.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/rand_util.h" | 12 #include "base/rand_util.h" |
13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
14 #include "content/public/renderer/render_thread.h" | 14 #include "content/public/renderer/render_thread.h" |
15 #include "content/renderer/media/media_stream_video_capturer_source.h" | 15 #include "content/renderer/media/media_stream_video_capturer_source.h" |
16 #include "content/renderer/media/media_stream_video_source.h" | 16 #include "content/renderer/media/media_stream_video_source.h" |
17 #include "content/renderer/media/media_stream_video_track.h" | 17 #include "content/renderer/media/media_stream_video_track.h" |
18 #include "content/renderer/media/webrtc_uma_histograms.h" | 18 #include "content/renderer/media/webrtc_uma_histograms.h" |
19 #include "content/renderer/render_thread_impl.h" | 19 #include "content/renderer/render_thread_impl.h" |
20 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" | 20 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" |
21 #include "third_party/WebKit/public/platform/WebString.h" | 21 #include "third_party/WebKit/public/platform/WebString.h" |
22 #include "third_party/libyuv/include/libyuv.h" | 22 #include "third_party/libyuv/include/libyuv.h" |
| 23 #include "third_party/skia/include/core/SkImage.h" |
23 | 24 |
24 namespace { | 25 namespace { |
25 | 26 |
26 using media::VideoFrame; | 27 using media::VideoFrame; |
27 | 28 |
28 static void CopyAlphaChannelIntoVideoFrame( | 29 static void CopyAlphaChannelIntoVideoFrame( |
29 const uint8_t* const source_data, | 30 const uint8_t* const source_data, |
30 const gfx::Size& source_size, | 31 const gfx::Size& source_size, |
31 const scoped_refptr<VideoFrame>& dest_frame) { | 32 const scoped_refptr<VideoFrame>& dest_frame) { |
32 const int dest_stride = dest_frame->stride(VideoFrame::kAPlane); | 33 const int dest_stride = dest_frame->stride(VideoFrame::kAPlane); |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 | 288 |
288 web_track->initialize(webkit_source); | 289 web_track->initialize(webkit_source); |
289 blink::WebMediaConstraints constraints; | 290 blink::WebMediaConstraints constraints; |
290 constraints.initialize(); | 291 constraints.initialize(); |
291 web_track->setTrackData(new MediaStreamVideoTrack( | 292 web_track->setTrackData(new MediaStreamVideoTrack( |
292 media_stream_source.release(), constraints, | 293 media_stream_source.release(), constraints, |
293 MediaStreamVideoSource::ConstraintsCallback(), true)); | 294 MediaStreamVideoSource::ConstraintsCallback(), true)); |
294 } | 295 } |
295 | 296 |
296 } // namespace content | 297 } // namespace content |
OLD | NEW |