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_CANVAS_CAPTURE_HANDLER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_CANVAS_CAPTURE_HANDLER_H_ |
6 #define CONTENT_RENDERER_MEDIA_CANVAS_CAPTURE_HANDLER_H_ | 6 #define CONTENT_RENDERER_MEDIA_CANVAS_CAPTURE_HANDLER_H_ |
7 | 7 |
| 8 #include <stddef.h> |
| 9 #include <stdint.h> |
| 10 |
8 #include "base/macros.h" | 11 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
11 #include "base/threading/thread_checker.h" | 14 #include "base/threading/thread_checker.h" |
12 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
13 #include "media/base/video_capturer_source.h" | 16 #include "media/base/video_capturer_source.h" |
14 #include "media/base/video_frame_pool.h" | 17 #include "media/base/video_frame_pool.h" |
15 #include "third_party/WebKit/public/platform/WebCanvasCaptureHandler.h" | 18 #include "third_party/WebKit/public/platform/WebCanvasCaptureHandler.h" |
16 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" | 19 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" |
17 #include "third_party/WebKit/public/platform/WebSize.h" | 20 #include "third_party/WebKit/public/platform/WebSize.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 69 |
67 // Object that does all the work of running |new_frame_callback_|. | 70 // Object that does all the work of running |new_frame_callback_|. |
68 // Destroyed on |io_task_runner_| after the class is destroyed. | 71 // Destroyed on |io_task_runner_| after the class is destroyed. |
69 class CanvasCaptureHandlerDelegate; | 72 class CanvasCaptureHandlerDelegate; |
70 | 73 |
71 media::VideoCaptureFormat capture_format_; | 74 media::VideoCaptureFormat capture_format_; |
72 bool ask_for_new_frame_; | 75 bool ask_for_new_frame_; |
73 | 76 |
74 const blink::WebSize size_; | 77 const blink::WebSize size_; |
75 gfx::Size last_size; | 78 gfx::Size last_size; |
76 std::vector<uint8> temp_data_; | 79 std::vector<uint8_t> temp_data_; |
77 size_t row_bytes_; | 80 size_t row_bytes_; |
78 SkImageInfo image_info_; | 81 SkImageInfo image_info_; |
79 media::VideoFramePool frame_pool_; | 82 media::VideoFramePool frame_pool_; |
80 | 83 |
81 const scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; | 84 const scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
82 scoped_ptr<CanvasCaptureHandlerDelegate> delegate_; | 85 scoped_ptr<CanvasCaptureHandlerDelegate> delegate_; |
83 // Bound to the main render thread. | 86 // Bound to the main render thread. |
84 base::ThreadChecker thread_checker_; | 87 base::ThreadChecker thread_checker_; |
85 base::WeakPtrFactory<CanvasCaptureHandler> weak_ptr_factory_; | 88 base::WeakPtrFactory<CanvasCaptureHandler> weak_ptr_factory_; |
86 | 89 |
87 DISALLOW_COPY_AND_ASSIGN(CanvasCaptureHandler); | 90 DISALLOW_COPY_AND_ASSIGN(CanvasCaptureHandler); |
88 }; | 91 }; |
89 | 92 |
90 } // namespace content | 93 } // namespace content |
91 | 94 |
92 #endif // CONTENT_RENDERER_MEDIA_CANVAS_CAPTURE_HANDLER_H_ | 95 #endif // CONTENT_RENDERER_MEDIA_CANVAS_CAPTURE_HANDLER_H_ |
OLD | NEW |