Chromium Code Reviews| 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> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 65 const blink::WebSize& size, | 65 const blink::WebSize& size, |
| 66 double frame_rate, | 66 double frame_rate, |
| 67 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner, | 67 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner, |
| 68 blink::WebMediaStreamTrack* track); | 68 blink::WebMediaStreamTrack* track); |
| 69 | 69 |
| 70 void CreateNewFrame(const SkImage* image); | 70 void CreateNewFrame(const SkImage* image); |
| 71 void AddVideoCapturerSourceToVideoTrack( | 71 void AddVideoCapturerSourceToVideoTrack( |
| 72 scoped_ptr<media::VideoCapturerSource> source, | 72 scoped_ptr<media::VideoCapturerSource> source, |
| 73 blink::WebMediaStreamTrack* web_track); | 73 blink::WebMediaStreamTrack* web_track); |
| 74 | 74 |
| 75 // Implementation VideoCapturerSource that is owned by Blink and delegates | 75 // Implementation VideoCapturerSource that is owned by |
| 76 // the Start/Stop calls to CanvasCaptureHandler. | 76 // MediaStreamVideoCapturerSource and delegates the Start/Stop calls to |
| 77 // CanvasCaptureHandler. | |
| 77 class VideoCapturerSource; | 78 class VideoCapturerSource; |
|
mcasas
2016/03/23 17:54:30
I think this class can be just defined
in the .cc
emircan
2016/03/23 22:12:03
Done.
| |
| 78 | 79 |
| 79 // Object that does all the work of running |new_frame_callback_|. | 80 // Object that does all the work of running |new_frame_callback_|. |
| 80 // Destroyed on |frame_callback_task_runner_| after the class is destroyed. | 81 // Destroyed on |frame_callback_task_runner_| after the class is destroyed. |
| 81 class CanvasCaptureHandlerDelegate; | 82 class CanvasCaptureHandlerDelegate; |
| 82 | 83 |
| 83 media::VideoCaptureFormat capture_format_; | 84 media::VideoCaptureFormat capture_format_; |
| 84 bool ask_for_new_frame_; | 85 bool ask_for_new_frame_; |
| 85 | 86 |
| 86 const blink::WebSize size_; | 87 const blink::WebSize size_; |
| 87 gfx::Size last_size; | 88 gfx::Size last_size; |
| 88 std::vector<uint8_t> temp_data_; | 89 std::vector<uint8_t> temp_data_; |
| 89 size_t row_bytes_; | 90 size_t row_bytes_; |
| 90 SkImageInfo image_info_; | 91 SkImageInfo image_info_; |
| 91 media::VideoFramePool frame_pool_; | 92 media::VideoFramePool frame_pool_; |
| 92 | 93 |
| 93 const scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; | 94 const scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
| 94 scoped_ptr<CanvasCaptureHandlerDelegate> delegate_; | 95 scoped_ptr<CanvasCaptureHandlerDelegate> delegate_; |
| 95 | 96 |
| 96 // Bound to Main Render thread. | 97 // Bound to Main Render thread. |
| 97 base::ThreadChecker main_render_thread_checker_; | 98 base::ThreadChecker main_render_thread_checker_; |
| 98 base::WeakPtrFactory<CanvasCaptureHandler> weak_ptr_factory_; | 99 base::WeakPtrFactory<CanvasCaptureHandler> weak_ptr_factory_; |
| 99 | 100 |
| 100 DISALLOW_COPY_AND_ASSIGN(CanvasCaptureHandler); | 101 DISALLOW_COPY_AND_ASSIGN(CanvasCaptureHandler); |
| 101 }; | 102 }; |
| 102 | 103 |
| 103 } // namespace content | 104 } // namespace content |
| 104 | 105 |
| 105 #endif // CONTENT_RENDERER_MEDIA_CANVAS_CAPTURE_HANDLER_H_ | 106 #endif // CONTENT_RENDERER_MEDIA_CANVAS_CAPTURE_HANDLER_H_ |
| OLD | NEW |