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