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 "device/wake_lock/public/interfaces/wake_lock_service.mojom.h" |
13 #include "media/capture/content/screen_capture_device_core.h" | 14 #include "media/capture/content/screen_capture_device_core.h" |
14 #include "ui/aura/window.h" | 15 #include "ui/aura/window.h" |
15 #include "ui/aura/window_observer.h" | 16 #include "ui/aura/window_observer.h" |
16 #include "ui/base/cursor/cursors_aura.h" | 17 #include "ui/base/cursor/cursors_aura.h" |
17 #include "ui/compositor/compositor.h" | 18 #include "ui/compositor/compositor.h" |
18 #include "ui/compositor/compositor_animation_observer.h" | 19 #include "ui/compositor/compositor_animation_observer.h" |
19 | 20 |
20 namespace cc { | 21 namespace cc { |
21 class CopyOutputResult; | 22 class CopyOutputResult; |
22 } // namespace cc | 23 } // namespace cc |
23 | 24 |
24 namespace device { | |
25 class PowerSaveBlocker; | |
26 } // namespace device | |
27 | |
28 namespace display_compositor { | 25 namespace display_compositor { |
29 class ReadbackYUVInterface; | 26 class ReadbackYUVInterface; |
30 } | 27 } |
31 | 28 |
32 namespace content { | 29 namespace content { |
33 | 30 |
34 class AuraWindowCaptureMachine | 31 class AuraWindowCaptureMachine |
35 : public media::VideoCaptureMachine, | 32 : public media::VideoCaptureMachine, |
36 public aura::WindowObserver, | 33 public aura::WindowObserver, |
37 public ui::CompositorAnimationObserver { | 34 public ui::CompositorAnimationObserver { |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 // The capture parameters for this capture. | 116 // The capture parameters for this capture. |
120 media::VideoCaptureParams capture_params_; | 117 media::VideoCaptureParams capture_params_; |
121 | 118 |
122 // YUV readback pipeline. | 119 // YUV readback pipeline. |
123 std::unique_ptr<display_compositor::ReadbackYUVInterface> | 120 std::unique_ptr<display_compositor::ReadbackYUVInterface> |
124 yuv_readback_pipeline_; | 121 yuv_readback_pipeline_; |
125 | 122 |
126 // Renders mouse cursor on frame. | 123 // Renders mouse cursor on frame. |
127 std::unique_ptr<content::CursorRendererAura> cursor_renderer_; | 124 std::unique_ptr<content::CursorRendererAura> cursor_renderer_; |
128 | 125 |
129 // TODO(jiayl): Remove power_save_blocker_ when there is an API to keep the | 126 device::mojom::WakeLockServicePtr wake_lock_; |
130 // screen from sleeping for the drive-by web. | |
131 std::unique_ptr<device::PowerSaveBlocker> power_save_blocker_; | |
132 | 127 |
133 // False while frame capture has been suspended. All other aspects of the | 128 // False while frame capture has been suspended. All other aspects of the |
134 // machine are maintained. | 129 // machine are maintained. |
135 bool frame_capture_active_; | 130 bool frame_capture_active_; |
136 | 131 |
137 // WeakPtrs are used for the asynchronous capture callbacks passed to external | 132 // WeakPtrs are used for the asynchronous capture callbacks passed to external |
138 // modules. They are only valid on the UI thread and become invalidated | 133 // modules. They are only valid on the UI thread and become invalidated |
139 // immediately when InternalStop() is called to ensure that no more captured | 134 // immediately when InternalStop() is called to ensure that no more captured |
140 // frames will be delivered to the client. | 135 // frames will be delivered to the client. |
141 base::WeakPtrFactory<AuraWindowCaptureMachine> weak_factory_; | 136 base::WeakPtrFactory<AuraWindowCaptureMachine> weak_factory_; |
142 | 137 |
143 DISALLOW_COPY_AND_ASSIGN(AuraWindowCaptureMachine); | 138 DISALLOW_COPY_AND_ASSIGN(AuraWindowCaptureMachine); |
144 }; | 139 }; |
145 | 140 |
146 } // namespace content | 141 } // namespace content |
147 | 142 |
148 #endif // CONTENT_BROWSER_MEDIA_CAPTURE_AURA_WINDOW_CAPTURE_MACHINE_H_ | 143 #endif // CONTENT_BROWSER_MEDIA_CAPTURE_AURA_WINDOW_CAPTURE_MACHINE_H_ |
OLD | NEW |