| 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 18 matching lines...) Expand all Loading... |
| 29 // kMagnifierWindowClass has to be "Magnifier" according to the Magnification | 29 // kMagnifierWindowClass has to be "Magnifier" according to the Magnification |
| 30 // API. The other strings can be anything. | 30 // API. The other strings can be anything. |
| 31 static LPCTSTR kMagnifierHostClass = L"ScreenCapturerWinMagnifierHost"; | 31 static LPCTSTR kMagnifierHostClass = L"ScreenCapturerWinMagnifierHost"; |
| 32 static LPCTSTR kHostWindowName = L"MagnifierHost"; | 32 static LPCTSTR kHostWindowName = L"MagnifierHost"; |
| 33 static LPCTSTR kMagnifierWindowClass = L"Magnifier"; | 33 static LPCTSTR kMagnifierWindowClass = L"Magnifier"; |
| 34 static LPCTSTR kMagnifierWindowName = L"MagnifierWindow"; | 34 static LPCTSTR kMagnifierWindowName = L"MagnifierWindow"; |
| 35 | 35 |
| 36 Atomic32 ScreenCapturerWinMagnifier::tls_index_(TLS_OUT_OF_INDEXES); | 36 Atomic32 ScreenCapturerWinMagnifier::tls_index_(TLS_OUT_OF_INDEXES); |
| 37 | 37 |
| 38 ScreenCapturerWinMagnifier::ScreenCapturerWinMagnifier( | 38 ScreenCapturerWinMagnifier::ScreenCapturerWinMagnifier( |
| 39 std::unique_ptr<ScreenCapturer> fallback_capturer) | 39 std::unique_ptr<DesktopCapturer> fallback_capturer) |
| 40 : fallback_capturer_(std::move(fallback_capturer)) {} | 40 : fallback_capturer_(std::move(fallback_capturer)) {} |
| 41 | 41 |
| 42 ScreenCapturerWinMagnifier::~ScreenCapturerWinMagnifier() { | 42 ScreenCapturerWinMagnifier::~ScreenCapturerWinMagnifier() { |
| 43 // DestroyWindow must be called before MagUninitialize. magnifier_window_ is | 43 // DestroyWindow must be called before MagUninitialize. magnifier_window_ is |
| 44 // destroyed automatically when host_window_ is destroyed. | 44 // destroyed automatically when host_window_ is destroyed. |
| 45 if (host_window_) | 45 if (host_window_) |
| 46 DestroyWindow(host_window_); | 46 DestroyWindow(host_window_); |
| 47 | 47 |
| 48 if (magnifier_initialized_) | 48 if (magnifier_initialized_) |
| 49 mag_uninitialize_func_(); | 49 mag_uninitialize_func_(); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 | 132 |
| 133 bool ScreenCapturerWinMagnifier::SelectScreen(ScreenId id) { | 133 bool ScreenCapturerWinMagnifier::SelectScreen(ScreenId id) { |
| 134 bool valid = IsScreenValid(id, ¤t_device_key_); | 134 bool valid = IsScreenValid(id, ¤t_device_key_); |
| 135 | 135 |
| 136 // Set current_screen_id_ even if the fallback capturer is being used, so we | 136 // Set current_screen_id_ even if the fallback capturer is being used, so we |
| 137 // can switch back to the magnifier when possible. | 137 // can switch back to the magnifier when possible. |
| 138 if (valid) | 138 if (valid) |
| 139 current_screen_id_ = id; | 139 current_screen_id_ = id; |
| 140 | 140 |
| 141 if (fallback_capturer_started_) | 141 if (fallback_capturer_started_) |
| 142 fallback_capturer_->SelectScreen(id); | 142 fallback_capturer_->SelectSource(id); |
| 143 | 143 |
| 144 return valid; | 144 return valid; |
| 145 } | 145 } |
| 146 | 146 |
| 147 void ScreenCapturerWinMagnifier::SetExcludedWindow(WindowId excluded_window) { | 147 void ScreenCapturerWinMagnifier::SetExcludedWindow(WindowId excluded_window) { |
| 148 excluded_window_ = (HWND)excluded_window; | 148 excluded_window_ = (HWND)excluded_window; |
| 149 if (excluded_window_ && magnifier_initialized_) { | 149 if (excluded_window_ && magnifier_initialized_) { |
| 150 set_window_filter_list_func_( | 150 set_window_filter_list_func_( |
| 151 magnifier_window_, MW_FILTERMODE_EXCLUDE, 1, &excluded_window_); | 151 magnifier_window_, MW_FILTERMODE_EXCLUDE, 1, &excluded_window_); |
| 152 } | 152 } |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 queue_.ReplaceCurrentFrame(SharedDesktopFrame::Wrap(std::move(frame))); | 375 queue_.ReplaceCurrentFrame(SharedDesktopFrame::Wrap(std::move(frame))); |
| 376 } | 376 } |
| 377 } | 377 } |
| 378 | 378 |
| 379 void ScreenCapturerWinMagnifier::StartFallbackCapturer() { | 379 void ScreenCapturerWinMagnifier::StartFallbackCapturer() { |
| 380 RTC_DCHECK(fallback_capturer_); | 380 RTC_DCHECK(fallback_capturer_); |
| 381 if (!fallback_capturer_started_) { | 381 if (!fallback_capturer_started_) { |
| 382 fallback_capturer_started_ = true; | 382 fallback_capturer_started_ = true; |
| 383 | 383 |
| 384 fallback_capturer_->Start(callback_); | 384 fallback_capturer_->Start(callback_); |
| 385 fallback_capturer_->SelectScreen(current_screen_id_); | 385 fallback_capturer_->SelectSource(current_screen_id_); |
| 386 } | 386 } |
| 387 } | 387 } |
| 388 | 388 |
| 389 } // namespace webrtc | 389 } // namespace webrtc |
| OLD | NEW |