| 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 #ifndef CONTENT_RENDERER_MEDIA_HTML_VIDEO_ELEMENT_CAPTURER_SOURCE_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_HTML_VIDEO_ELEMENT_CAPTURER_SOURCE_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_HTML_VIDEO_ELEMENT_CAPTURER_SOURCE_H_ | 6 #define CONTENT_RENDERER_MEDIA_HTML_VIDEO_ELEMENT_CAPTURER_SOURCE_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/threading/thread_checker.h" | 10 #include "base/threading/thread_checker.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 const VideoCaptureDeliverFrameCB& new_frame_callback, | 49 const VideoCaptureDeliverFrameCB& new_frame_callback, |
| 50 const RunningCallback& running_callback) override; | 50 const RunningCallback& running_callback) override; |
| 51 void StopCapture() override; | 51 void StopCapture() override; |
| 52 | 52 |
| 53 private: | 53 private: |
| 54 // This method includes collecting data from the WebMediaPlayer and converting | 54 // This method includes collecting data from the WebMediaPlayer and converting |
| 55 // it into a format suitable for MediaStreams. | 55 // it into a format suitable for MediaStreams. |
| 56 void sendNewFrame(); | 56 void sendNewFrame(); |
| 57 | 57 |
| 58 media::VideoFramePool frame_pool_; | 58 media::VideoFramePool frame_pool_; |
| 59 skia::RefPtr<SkCanvas> canvas_; | 59 sk_sp<SkCanvas> canvas_; |
| 60 | 60 |
| 61 const base::WeakPtr<blink::WebMediaPlayer> web_media_player_; | 61 const base::WeakPtr<blink::WebMediaPlayer> web_media_player_; |
| 62 const scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; | 62 const scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
| 63 | 63 |
| 64 // These three configuration items are passed on StartCapture(); | 64 // These three configuration items are passed on StartCapture(); |
| 65 RunningCallback running_callback_; | 65 RunningCallback running_callback_; |
| 66 VideoCaptureDeliverFrameCB new_frame_callback_; | 66 VideoCaptureDeliverFrameCB new_frame_callback_; |
| 67 double capture_frame_rate_; | 67 double capture_frame_rate_; |
| 68 | 68 |
| 69 // Target time for the next frame. | 69 // Target time for the next frame. |
| 70 base::TimeTicks next_capture_time_; | 70 base::TimeTicks next_capture_time_; |
| 71 | 71 |
| 72 // Bound to the main render thread. | 72 // Bound to the main render thread. |
| 73 base::ThreadChecker thread_checker_; | 73 base::ThreadChecker thread_checker_; |
| 74 | 74 |
| 75 // Used on main render thread to schedule future capture events. | 75 // Used on main render thread to schedule future capture events. |
| 76 base::WeakPtrFactory<HtmlVideoElementCapturerSource> weak_factory_; | 76 base::WeakPtrFactory<HtmlVideoElementCapturerSource> weak_factory_; |
| 77 | 77 |
| 78 DISALLOW_COPY_AND_ASSIGN(HtmlVideoElementCapturerSource); | 78 DISALLOW_COPY_AND_ASSIGN(HtmlVideoElementCapturerSource); |
| 79 }; | 79 }; |
| 80 | 80 |
| 81 } // namespace content | 81 } // namespace content |
| 82 | 82 |
| 83 #endif // CONTENT_RENDERER_MEDIA_HTML_VIDEO_ELEMENT_CAPTURER_SOURCE_H_ | 83 #endif // CONTENT_RENDERER_MEDIA_HTML_VIDEO_ELEMENT_CAPTURER_SOURCE_H_ |
| OLD | NEW |