OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 // whole screen and crops the video frame to the window area when the captured | 22 // whole screen and crops the video frame to the window area when the captured |
23 // window is on top. | 23 // window is on top. |
24 class CroppingWindowCapturer : public WindowCapturer, | 24 class CroppingWindowCapturer : public WindowCapturer, |
25 public DesktopCapturer::Callback { | 25 public DesktopCapturer::Callback { |
26 public: | 26 public: |
27 static WindowCapturer* Create(const DesktopCaptureOptions& options); | 27 static WindowCapturer* Create(const DesktopCaptureOptions& options); |
28 virtual ~CroppingWindowCapturer(); | 28 virtual ~CroppingWindowCapturer(); |
29 | 29 |
30 // DesktopCapturer implementation. | 30 // DesktopCapturer implementation. |
31 void Start(DesktopCapturer::Callback* callback) override; | 31 void Start(DesktopCapturer::Callback* callback) override; |
| 32 void SetSharedMemoryFactory( |
| 33 rtc::scoped_ptr<SharedMemoryFactory> shared_memory_factory) override; |
32 void Capture(const DesktopRegion& region) override; | 34 void Capture(const DesktopRegion& region) override; |
33 void SetExcludedWindow(WindowId window) override; | 35 void SetExcludedWindow(WindowId window) override; |
34 | 36 |
35 // WindowCapturer implementation. | 37 // WindowCapturer implementation. |
36 bool GetWindowList(WindowList* windows) override; | 38 bool GetWindowList(WindowList* windows) override; |
37 bool SelectWindow(WindowId id) override; | 39 bool SelectWindow(WindowId id) override; |
38 bool BringSelectedWindowToFront() override; | 40 bool BringSelectedWindowToFront() override; |
39 | 41 |
40 // DesktopCapturer::Callback implementation, passed to |screen_capturer_| to | 42 // DesktopCapturer::Callback implementation, passed to |screen_capturer_| to |
41 // intercept the capture result. | 43 // intercept the capture result. |
42 SharedMemory* CreateSharedMemory(size_t size) override; | |
43 void OnCaptureCompleted(DesktopFrame* frame) override; | 44 void OnCaptureCompleted(DesktopFrame* frame) override; |
44 | 45 |
45 protected: | 46 protected: |
46 explicit CroppingWindowCapturer(const DesktopCaptureOptions& options); | 47 explicit CroppingWindowCapturer(const DesktopCaptureOptions& options); |
47 | 48 |
48 // The platform implementation should override these methods. | 49 // The platform implementation should override these methods. |
49 | 50 |
50 // Returns true if it is OK to capture the whole screen and crop to the | 51 // Returns true if it is OK to capture the whole screen and crop to the |
51 // selected window, i.e. the selected window is opaque, rectangular, and not | 52 // selected window, i.e. the selected window is opaque, rectangular, and not |
52 // occluded. | 53 // occluded. |
(...skipping 12 matching lines...) Expand all Loading... |
65 rtc::scoped_ptr<WindowCapturer> window_capturer_; | 66 rtc::scoped_ptr<WindowCapturer> window_capturer_; |
66 rtc::scoped_ptr<ScreenCapturer> screen_capturer_; | 67 rtc::scoped_ptr<ScreenCapturer> screen_capturer_; |
67 WindowId selected_window_; | 68 WindowId selected_window_; |
68 WindowId excluded_window_; | 69 WindowId excluded_window_; |
69 }; | 70 }; |
70 | 71 |
71 } // namespace webrtc | 72 } // namespace webrtc |
72 | 73 |
73 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_CROPPING_WINDOW_CAPTURER_H_ | 74 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_CROPPING_WINDOW_CAPTURER_H_ |
74 | 75 |
OLD | NEW |