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/html_video_element_capturer_source.h" | 5 #include "content/renderer/media/html_video_element_capturer_source.h" |
6 | 6 |
7 #include "base/location.h" | 7 #include "base/location.h" |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
11 #include "base/trace_event/trace_event.h" | 11 #include "base/trace_event/trace_event.h" |
12 #include "content/public/renderer/render_thread.h" | 12 #include "content/public/renderer/render_thread.h" |
13 #include "content/renderer/media/media_stream_video_source.h" | 13 #include "content/renderer/media/media_stream_video_source.h" |
14 #include "content/renderer/media/webrtc_uma_histograms.h" | 14 #include "content/renderer/media/webrtc_uma_histograms.h" |
15 #include "media/base/limits.h" | 15 #include "media/base/limits.h" |
16 #include "media/blink/webmediaplayer_impl.h" | 16 #include "media/blink/webmediaplayer_impl.h" |
17 #include "skia/ext/platform_canvas.h" | 17 #include "skia/ext/platform_canvas.h" |
18 #include "third_party/WebKit/public/platform/WebMediaPlayer.h" | 18 #include "third_party/WebKit/public/platform/WebMediaPlayer.h" |
19 #include "third_party/WebKit/public/platform/WebRect.h" | 19 #include "third_party/WebKit/public/platform/WebRect.h" |
20 #include "third_party/WebKit/public/platform/WebSize.h" | 20 #include "third_party/WebKit/public/platform/WebSize.h" |
21 #include "third_party/libyuv/include/libyuv.h" | 21 #include "third_party/libyuv/include/libyuv.h" |
22 #include "third_party/skia/include/core/SkCanvas.h" | 22 #include "third_party/skia/include/core/SkCanvas.h" |
23 #include "third_party/skia/include/core/SkSurface.h" | 23 #include "third_party/skia/include/core/SkSurface.h" |
24 #include "third_party/skia/include/core/SkXfermode.h" | |
25 | 24 |
26 namespace { | 25 namespace { |
27 const float kMinFramesPerSecond = 1.0; | 26 const float kMinFramesPerSecond = 1.0; |
28 } // anonymous namespace | 27 } // anonymous namespace |
29 | 28 |
30 namespace content { | 29 namespace content { |
31 | 30 |
32 //static | 31 //static |
33 std::unique_ptr<HtmlVideoElementCapturerSource> | 32 std::unique_ptr<HtmlVideoElementCapturerSource> |
34 HtmlVideoElementCapturerSource::CreateFromWebMediaPlayerImpl( | 33 HtmlVideoElementCapturerSource::CreateFromWebMediaPlayerImpl( |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 next_capture_time_ = current_time; | 196 next_capture_time_ = current_time; |
198 } | 197 } |
199 // Schedule next capture. | 198 // Schedule next capture. |
200 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( | 199 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
201 FROM_HERE, base::Bind(&HtmlVideoElementCapturerSource::sendNewFrame, | 200 FROM_HERE, base::Bind(&HtmlVideoElementCapturerSource::sendNewFrame, |
202 weak_factory_.GetWeakPtr()), | 201 weak_factory_.GetWeakPtr()), |
203 next_capture_time_ - current_time); | 202 next_capture_time_ - current_time); |
204 } | 203 } |
205 | 204 |
206 } // namespace content | 205 } // namespace content |
OLD | NEW |