| 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 |
| 11 #include <memory> | 11 #include <memory> |
| 12 | 12 |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/threading/thread_checker.h" | 15 #include "base/threading/thread_checker.h" |
| 16 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
| 17 #include "media/base/video_capturer_source.h" | 17 #include "media/base/video_capturer_source.h" |
| 18 #include "media/base/video_frame_pool.h" | 18 #include "media/base/video_frame_pool.h" |
| 19 #include "third_party/WebKit/public/platform/WebCanvasCaptureHandler.h" | 19 #include "third_party/WebKit/public/platform/WebCanvasCaptureHandler.h" |
| 20 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" | 20 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" |
| 21 #include "third_party/WebKit/public/platform/WebSize.h" | 21 #include "third_party/WebKit/public/platform/WebSize.h" |
| 22 #include "third_party/skia/include/core/SkImage.h" | 22 #include "third_party/skia/include/core/SkImageInfo.h" |
| 23 |
| 24 class SkImage; |
| 23 | 25 |
| 24 namespace content { | 26 namespace content { |
| 25 | 27 |
| 26 // CanvasCaptureHandler acts as the link between Blink side HTMLCanvasElement | 28 // CanvasCaptureHandler acts as the link between Blink side HTMLCanvasElement |
| 27 // and Chrome side VideoCapturerSource. It is responsible for handling | 29 // and Chrome side VideoCapturerSource. It is responsible for handling |
| 28 // SkImage instances sent from the Blink side, convert them to | 30 // SkImage instances sent from the Blink side, convert them to |
| 29 // media::VideoFrame and plug them to the MediaStreamTrack. | 31 // media::VideoFrame and plug them to the MediaStreamTrack. |
| 30 // CanvasCaptureHandler instance is owned by a blink::CanvasDrawListener which | 32 // CanvasCaptureHandler instance is owned by a blink::CanvasDrawListener which |
| 31 // is owned by a CanvasCaptureMediaStreamTrack. | 33 // is owned by a CanvasCaptureMediaStreamTrack. |
| 32 // All methods are called on the same thread as construction and destruction, | 34 // All methods are called on the same thread as construction and destruction, |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 // Bound to Main Render thread. | 98 // Bound to Main Render thread. |
| 97 base::ThreadChecker main_render_thread_checker_; | 99 base::ThreadChecker main_render_thread_checker_; |
| 98 base::WeakPtrFactory<CanvasCaptureHandler> weak_ptr_factory_; | 100 base::WeakPtrFactory<CanvasCaptureHandler> weak_ptr_factory_; |
| 99 | 101 |
| 100 DISALLOW_COPY_AND_ASSIGN(CanvasCaptureHandler); | 102 DISALLOW_COPY_AND_ASSIGN(CanvasCaptureHandler); |
| 101 }; | 103 }; |
| 102 | 104 |
| 103 } // namespace content | 105 } // namespace content |
| 104 | 106 |
| 105 #endif // CONTENT_RENDERER_MEDIA_CANVAS_CAPTURE_HANDLER_H_ | 107 #endif // CONTENT_RENDERER_MEDIA_CANVAS_CAPTURE_HANDLER_H_ |
| OLD | NEW |