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 | 18 |
19 namespace cc { | 19 namespace cc { |
20 | 20 |
21 class CopyOutputResult; | 21 class CopyOutputResult; |
22 | 22 |
23 } // namespace cc | 23 } // namespace cc |
24 | 24 |
| 25 namespace display_compositor { |
| 26 class ReadbackYUVInterface; |
| 27 } |
| 28 |
25 namespace content { | 29 namespace content { |
26 | 30 |
27 class PowerSaveBlocker; | 31 class PowerSaveBlocker; |
28 class ReadbackYUVInterface; | |
29 | 32 |
30 class AuraWindowCaptureMachine | 33 class AuraWindowCaptureMachine |
31 : public media::VideoCaptureMachine, | 34 : public media::VideoCaptureMachine, |
32 public aura::WindowObserver, | 35 public aura::WindowObserver, |
33 public ui::CompositorObserver { | 36 public ui::CompositorObserver { |
34 public: | 37 public: |
35 AuraWindowCaptureMachine(); | 38 AuraWindowCaptureMachine(); |
36 ~AuraWindowCaptureMachine() override; | 39 ~AuraWindowCaptureMachine() override; |
37 | 40 |
38 // VideoCaptureMachine overrides. | 41 // VideoCaptureMachine overrides. |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 // Whether screen capturing or window capture. | 110 // Whether screen capturing or window capture. |
108 bool screen_capture_; | 111 bool screen_capture_; |
109 | 112 |
110 // Makes all the decisions about which frames to copy, and how. | 113 // Makes all the decisions about which frames to copy, and how. |
111 scoped_refptr<media::ThreadSafeCaptureOracle> oracle_proxy_; | 114 scoped_refptr<media::ThreadSafeCaptureOracle> oracle_proxy_; |
112 | 115 |
113 // The capture parameters for this capture. | 116 // The capture parameters for this capture. |
114 media::VideoCaptureParams capture_params_; | 117 media::VideoCaptureParams capture_params_; |
115 | 118 |
116 // YUV readback pipeline. | 119 // YUV readback pipeline. |
117 std::unique_ptr<content::ReadbackYUVInterface> yuv_readback_pipeline_; | 120 std::unique_ptr<display_compositor::ReadbackYUVInterface> |
| 121 yuv_readback_pipeline_; |
118 | 122 |
119 // Renders mouse cursor on frame. | 123 // Renders mouse cursor on frame. |
120 std::unique_ptr<content::CursorRendererAura> cursor_renderer_; | 124 std::unique_ptr<content::CursorRendererAura> cursor_renderer_; |
121 | 125 |
122 // TODO(jiayl): Remove power_save_blocker_ when there is an API to keep the | 126 // TODO(jiayl): Remove power_save_blocker_ when there is an API to keep the |
123 // screen from sleeping for the drive-by web. | 127 // screen from sleeping for the drive-by web. |
124 std::unique_ptr<PowerSaveBlocker> power_save_blocker_; | 128 std::unique_ptr<PowerSaveBlocker> power_save_blocker_; |
125 | 129 |
126 // WeakPtrs are used for the asynchronous capture callbacks passed to external | 130 // WeakPtrs are used for the asynchronous capture callbacks passed to external |
127 // modules. They are only valid on the UI thread and become invalidated | 131 // modules. They are only valid on the UI thread and become invalidated |
128 // immediately when InternalStop() is called to ensure that no more captured | 132 // immediately when InternalStop() is called to ensure that no more captured |
129 // frames will be delivered to the client. | 133 // frames will be delivered to the client. |
130 base::WeakPtrFactory<AuraWindowCaptureMachine> weak_factory_; | 134 base::WeakPtrFactory<AuraWindowCaptureMachine> weak_factory_; |
131 | 135 |
132 DISALLOW_COPY_AND_ASSIGN(AuraWindowCaptureMachine); | 136 DISALLOW_COPY_AND_ASSIGN(AuraWindowCaptureMachine); |
133 }; | 137 }; |
134 | 138 |
135 } // namespace content | 139 } // namespace content |
136 | 140 |
137 #endif // CONTENT_BROWSER_MEDIA_CAPTURE_AURA_WINDOW_CAPTURE_MACHINE_H_ | 141 #endif // CONTENT_BROWSER_MEDIA_CAPTURE_AURA_WINDOW_CAPTURE_MACHINE_H_ |
OLD | NEW |