OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 full_screen_chrome_window_detector); | 48 full_screen_chrome_window_detector); |
49 virtual ~WindowCapturerMac(); | 49 virtual ~WindowCapturerMac(); |
50 | 50 |
51 // WindowCapturer interface. | 51 // WindowCapturer interface. |
52 bool GetWindowList(WindowList* windows) override; | 52 bool GetWindowList(WindowList* windows) override; |
53 bool SelectWindow(WindowId id) override; | 53 bool SelectWindow(WindowId id) override; |
54 bool BringSelectedWindowToFront() override; | 54 bool BringSelectedWindowToFront() override; |
55 | 55 |
56 // DesktopCapturer interface. | 56 // DesktopCapturer interface. |
57 void Start(Callback* callback) override; | 57 void Start(Callback* callback) override; |
58 void Capture(const DesktopRegion& region) override; | 58 void CaptureFrame() override; |
59 | 59 |
60 private: | 60 private: |
61 Callback* callback_ = nullptr; | 61 Callback* callback_ = nullptr; |
62 | 62 |
63 // The window being captured. | 63 // The window being captured. |
64 CGWindowID window_id_ = 0; | 64 CGWindowID window_id_ = 0; |
65 | 65 |
66 rtc::scoped_refptr<FullScreenChromeWindowDetector> | 66 rtc::scoped_refptr<FullScreenChromeWindowDetector> |
67 full_screen_chrome_window_detector_; | 67 full_screen_chrome_window_detector_; |
68 | 68 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 return result; | 169 return result; |
170 } | 170 } |
171 | 171 |
172 void WindowCapturerMac::Start(Callback* callback) { | 172 void WindowCapturerMac::Start(Callback* callback) { |
173 assert(!callback_); | 173 assert(!callback_); |
174 assert(callback); | 174 assert(callback); |
175 | 175 |
176 callback_ = callback; | 176 callback_ = callback; |
177 } | 177 } |
178 | 178 |
179 void WindowCapturerMac::Capture(const DesktopRegion& region) { | 179 void WindowCapturerMac::CaptureFrame() { |
180 if (!IsWindowValid(window_id_)) { | 180 if (!IsWindowValid(window_id_)) { |
181 callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr); | 181 callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr); |
182 return; | 182 return; |
183 } | 183 } |
184 | 184 |
185 CGWindowID on_screen_window = window_id_; | 185 CGWindowID on_screen_window = window_id_; |
186 if (full_screen_chrome_window_detector_) { | 186 if (full_screen_chrome_window_detector_) { |
187 CGWindowID full_screen_window = | 187 CGWindowID full_screen_window = |
188 full_screen_chrome_window_detector_->FindFullScreenWindow(window_id_); | 188 full_screen_chrome_window_detector_->FindFullScreenWindow(window_id_); |
189 | 189 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 } | 235 } |
236 | 236 |
237 } // namespace | 237 } // namespace |
238 | 238 |
239 // static | 239 // static |
240 WindowCapturer* WindowCapturer::Create(const DesktopCaptureOptions& options) { | 240 WindowCapturer* WindowCapturer::Create(const DesktopCaptureOptions& options) { |
241 return new WindowCapturerMac(options.full_screen_chrome_window_detector()); | 241 return new WindowCapturerMac(options.full_screen_chrome_window_detector()); |
242 } | 242 } |
243 | 243 |
244 } // namespace webrtc | 244 } // namespace webrtc |
OLD | NEW |