OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 REMOTING_HOST_CHROMEOS_AURA_DESKTOP_CAPTURER_H_ | 5 #ifndef REMOTING_HOST_CHROMEOS_AURA_DESKTOP_CAPTURER_H_ |
6 #define REMOTING_HOST_CHROMEOS_AURA_DESKTOP_CAPTURER_H_ | 6 #define REMOTING_HOST_CHROMEOS_AURA_DESKTOP_CAPTURER_H_ |
7 | 7 |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h" | 9 #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h" |
10 | 10 |
11 namespace cc { | 11 namespace cc { |
12 class CopyOutputResult; | 12 class CopyOutputResult; |
13 } // namespace cc | 13 } // namespace cc |
14 | 14 |
15 namespace aura { | 15 namespace aura { |
16 class Window; | 16 class Window; |
17 } // namespace aura | 17 } // namespace aura |
18 | 18 |
19 namespace remoting { | 19 namespace remoting { |
20 | 20 |
21 // A webrtc::DesktopCapturer that captures pixels from the root window of the | 21 // A webrtc::DesktopCapturer that captures pixels from the root window of the |
22 // Aura Shell. This is implemented by requesting the layer and its substree to | 22 // Aura Shell. This is implemented by requesting the layer and its substree to |
23 // be rendered to a given data structure. Start() and Capture() must be called | 23 // be rendered to a given data structure. Start() and Capture() must be called |
24 // on the Browser UI thread. | 24 // on the Browser UI thread. |
Wez
2014/10/17 17:57:59
Update this comment?
kelvinp
2014/10/20 00:21:16
Done.
| |
25 class AuraDesktopCapturer : public webrtc::DesktopCapturer { | 25 class AuraDesktopCapturer : public webrtc::ScreenCapturer { |
Wez
2014/10/17 17:58:00
AuraScreenCapturer?
kelvinp
2014/10/20 00:21:16
Done.
| |
26 public: | 26 public: |
27 AuraDesktopCapturer(); | 27 AuraDesktopCapturer(); |
28 virtual ~AuraDesktopCapturer(); | 28 virtual ~AuraDesktopCapturer(); |
29 | 29 |
30 // webrtc::DesktopCapturer implementation. | 30 // webrtc::DesktopCapturer implementation. |
31 virtual void Start(webrtc::DesktopCapturer::Callback* callback) override; | 31 virtual void Start(webrtc::DesktopCapturer::Callback* callback) override; |
32 virtual void Capture(const webrtc::DesktopRegion& region) override; | 32 virtual void Capture(const webrtc::DesktopRegion& region) override; |
33 | 33 |
34 // webrtc::ScreenCapturer implementation. | |
35 virtual bool GetScreenList(ScreenList* screens) override; | |
36 virtual bool SelectScreen(webrtc::ScreenId id) override; | |
37 | |
34 private: | 38 private: |
35 friend class AuraDesktopCapturerTest; | 39 friend class AuraDesktopCapturerTest; |
36 | 40 |
37 // Called when a copy of the layer is captured. | 41 // Called when a copy of the layer is captured. |
38 void OnFrameCaptured(scoped_ptr<cc::CopyOutputResult> result); | 42 void OnFrameCaptured(scoped_ptr<cc::CopyOutputResult> result); |
39 | 43 |
40 // Points to the callback passed to webrtc::DesktopCapturer::Start(). | 44 // Points to the callback passed to webrtc::DesktopCapturer::Start(). |
41 webrtc::DesktopCapturer::Callback* callback_; | 45 webrtc::DesktopCapturer::Callback* callback_; |
42 | 46 |
43 // The root window of the Aura Shell. | 47 // The root window of the Aura Shell. |
44 aura::Window* desktop_window_; | 48 aura::Window* desktop_window_; |
45 | 49 |
46 base::WeakPtrFactory<AuraDesktopCapturer> weak_factory_; | 50 base::WeakPtrFactory<AuraDesktopCapturer> weak_factory_; |
47 | 51 |
48 DISALLOW_COPY_AND_ASSIGN(AuraDesktopCapturer); | 52 DISALLOW_COPY_AND_ASSIGN(AuraDesktopCapturer); |
49 }; | 53 }; |
50 | 54 |
51 } // namespace remoting | 55 } // namespace remoting |
52 | 56 |
53 #endif // REMOTING_HOST_CHROMEOS_AURA_DESKTOP_CAPTURER_H_ | 57 #endif // REMOTING_HOST_CHROMEOS_AURA_DESKTOP_CAPTURER_H_ |
OLD | NEW |