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_BROWSER_MEDIA_CAPTURE_AURA_WINDOW_CAPTURE_MACHINE_H_ | 5 #ifndef CONTENT_BROWSER_MEDIA_CAPTURE_AURA_WINDOW_CAPTURE_MACHINE_H_ |
6 #define CONTENT_BROWSER_MEDIA_CAPTURE_AURA_WINDOW_CAPTURE_MACHINE_H_ | 6 #define CONTENT_BROWSER_MEDIA_CAPTURE_AURA_WINDOW_CAPTURE_MACHINE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "content/browser/media/capture/cursor_renderer_aura.h" | 12 #include "content/browser/media/capture/cursor_renderer_aura.h" |
13 #include "media/capture/content/screen_capture_device_core.h" | 13 #include "media/capture/content/screen_capture_device_core.h" |
14 #include "ui/aura/window.h" | 14 #include "ui/aura/window.h" |
15 #include "ui/aura/window_observer.h" | 15 #include "ui/aura/window_observer.h" |
16 #include "ui/base/cursor/cursors_aura.h" | 16 #include "ui/base/cursor/cursors_aura.h" |
17 #include "ui/compositor/compositor.h" | 17 #include "ui/compositor/compositor.h" |
18 #include "ui/compositor/compositor_animation_observer.h" | 18 #include "ui/compositor/compositor_animation_observer.h" |
19 | 19 |
20 namespace cc { | 20 namespace cc { |
| 21 class CopyOutputResult; |
| 22 } // namespace cc |
21 | 23 |
22 class CopyOutputResult; | 24 namespace device { |
23 | 25 class PowerSaveBlocker; |
24 } // namespace cc | 26 } // namespace device |
25 | 27 |
26 namespace display_compositor { | 28 namespace display_compositor { |
27 class ReadbackYUVInterface; | 29 class ReadbackYUVInterface; |
28 } | 30 } |
29 | 31 |
30 namespace content { | 32 namespace content { |
31 | 33 |
32 class PowerSaveBlocker; | |
33 | |
34 class AuraWindowCaptureMachine | 34 class AuraWindowCaptureMachine |
35 : public media::VideoCaptureMachine, | 35 : public media::VideoCaptureMachine, |
36 public aura::WindowObserver, | 36 public aura::WindowObserver, |
37 public ui::CompositorAnimationObserver { | 37 public ui::CompositorAnimationObserver { |
38 public: | 38 public: |
39 AuraWindowCaptureMachine(); | 39 AuraWindowCaptureMachine(); |
40 ~AuraWindowCaptureMachine() override; | 40 ~AuraWindowCaptureMachine() override; |
41 | 41 |
42 // VideoCaptureMachine overrides. | 42 // VideoCaptureMachine overrides. |
43 void Start(const scoped_refptr<media::ThreadSafeCaptureOracle>& oracle_proxy, | 43 void Start(const scoped_refptr<media::ThreadSafeCaptureOracle>& oracle_proxy, |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 | 117 |
118 // YUV readback pipeline. | 118 // YUV readback pipeline. |
119 std::unique_ptr<display_compositor::ReadbackYUVInterface> | 119 std::unique_ptr<display_compositor::ReadbackYUVInterface> |
120 yuv_readback_pipeline_; | 120 yuv_readback_pipeline_; |
121 | 121 |
122 // Renders mouse cursor on frame. | 122 // Renders mouse cursor on frame. |
123 std::unique_ptr<content::CursorRendererAura> cursor_renderer_; | 123 std::unique_ptr<content::CursorRendererAura> cursor_renderer_; |
124 | 124 |
125 // TODO(jiayl): Remove power_save_blocker_ when there is an API to keep the | 125 // TODO(jiayl): Remove power_save_blocker_ when there is an API to keep the |
126 // screen from sleeping for the drive-by web. | 126 // screen from sleeping for the drive-by web. |
127 std::unique_ptr<PowerSaveBlocker> power_save_blocker_; | 127 std::unique_ptr<device::PowerSaveBlocker> power_save_blocker_; |
128 | 128 |
129 // WeakPtrs are used for the asynchronous capture callbacks passed to external | 129 // WeakPtrs are used for the asynchronous capture callbacks passed to external |
130 // modules. They are only valid on the UI thread and become invalidated | 130 // modules. They are only valid on the UI thread and become invalidated |
131 // immediately when InternalStop() is called to ensure that no more captured | 131 // immediately when InternalStop() is called to ensure that no more captured |
132 // frames will be delivered to the client. | 132 // frames will be delivered to the client. |
133 base::WeakPtrFactory<AuraWindowCaptureMachine> weak_factory_; | 133 base::WeakPtrFactory<AuraWindowCaptureMachine> weak_factory_; |
134 | 134 |
135 DISALLOW_COPY_AND_ASSIGN(AuraWindowCaptureMachine); | 135 DISALLOW_COPY_AND_ASSIGN(AuraWindowCaptureMachine); |
136 }; | 136 }; |
137 | 137 |
138 } // namespace content | 138 } // namespace content |
139 | 139 |
140 #endif // CONTENT_BROWSER_MEDIA_CAPTURE_AURA_WINDOW_CAPTURE_MACHINE_H_ | 140 #endif // CONTENT_BROWSER_MEDIA_CAPTURE_AURA_WINDOW_CAPTURE_MACHINE_H_ |
OLD | NEW |