OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef REMOTING_HOST_CHROMEOS_AURA_DESKTOP_CAPTURER_H_ | |
6 #define REMOTING_HOST_CHROMEOS_AURA_DESKTOP_CAPTURER_H_ | |
7 | |
8 #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h" | |
9 #include "ui/aura/window.h" | |
10 | |
11 namespace cc { | |
12 class CopyOutputResult; | |
13 } // namespace | |
14 | |
15 namespace remoting { | |
16 | |
17 // A webrtc::DesktopCapturer that captures pixels from the root window of the | |
18 // Aura Shell. | |
19 class AuraDesktopCapturer : public webrtc::DesktopCapturer { | |
20 public: | |
21 AuraDesktopCapturer(); | |
22 virtual ~AuraDesktopCapturer(); | |
23 | |
24 // webrtc::DesktopCapturer implementation. | |
25 virtual void Start(webrtc::DesktopCapturer::Callback* callback) OVERRIDE; | |
26 | |
27 // Captures the next frame. In Aura, this is implemented by requesting the | |
28 // layer and its substree to be rendered to a given data structure. |region| | |
29 // specifies region of the capture target that should be fresh in the | |
30 // resulting frame. Since Aura doesn't support partial capturing, the entire | |
31 // region of the captured frame will always be fresh. Pending capture | |
32 // operations are cancelled when DesktopCapturer is deleted. | |
Wez
2014/09/10 01:41:11
I'd suggest removing this comment and moving any r
kelvinp
2014/09/10 22:33:58
Done.
| |
33 virtual void Capture(const webrtc::DesktopRegion& region) OVERRIDE; | |
34 | |
35 // Sets the window to be excluded from the captured image in the future | |
36 // Capture calls. Not supported in Aura. | |
Wez
2014/09/10 01:41:11
Similarly, remove this comment; you can document i
kelvinp
2014/09/10 22:33:59
Done.
| |
37 virtual void SetExcludedWindow(webrtc::WindowId window) OVERRIDE {} | |
38 | |
39 private: | |
40 friend class AuraDesktopCapturerTest; | |
41 | |
42 // Called when a copy of the layer is captured. | |
43 void OnFrameCaptured(scoped_ptr<cc::CopyOutputResult> result); | |
44 | |
45 // Points to the callback passed to webrtc::DesktopCapturer::Start(). | |
46 webrtc::DesktopCapturer::Callback* callback_; | |
47 | |
48 // The root window of the Aura Shell. | |
49 aura::Window* desktop_window_; | |
Wez
2014/09/10 01:41:10
Where does this ever get set?
kelvinp
2014/09/10 22:33:59
Good catch. It should be set in Start, which got a
| |
50 | |
51 base::WeakPtrFactory<AuraDesktopCapturer> weak_factory_; | |
52 }; | |
Wez
2014/09/10 01:41:10
DISALLOW_COPY_AND_ASSIGN
kelvinp
2014/09/10 22:33:58
Done.
| |
53 | |
54 } // namespace remoting | |
55 | |
56 #endif // REMOTING_HOST_CHROMEOS_AURA_DESKTOP_CAPTURER_H_ | |
OLD | NEW |