| 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 #include "webrtc/modules/desktop_capture/screen_capturer.h" | 22 #include "webrtc/modules/desktop_capture/screen_capturer.h" |
| 23 #include "webrtc/modules/desktop_capture/screen_capturer_helper.h" | 23 #include "webrtc/modules/desktop_capture/screen_capturer_helper.h" |
| 24 #include "webrtc/modules/desktop_capture/shared_desktop_frame.h" | 24 #include "webrtc/modules/desktop_capture/shared_desktop_frame.h" |
| 25 #include "webrtc/modules/desktop_capture/win/scoped_thread_desktop.h" | 25 #include "webrtc/modules/desktop_capture/win/scoped_thread_desktop.h" |
| 26 #include "webrtc/system_wrappers/include/atomic32.h" | 26 #include "webrtc/system_wrappers/include/atomic32.h" |
| 27 | 27 |
| 28 namespace webrtc { | 28 namespace webrtc { |
| 29 | 29 |
| 30 class DesktopFrame; | 30 class DesktopFrame; |
| 31 class DesktopRect; | 31 class DesktopRect; |
| 32 class Differ; | |
| 33 | 32 |
| 34 // Captures the screen using the Magnification API to support window exclusion. | 33 // Captures the screen using the Magnification API to support window exclusion. |
| 35 // Each capturer must run on a dedicated thread because it uses thread local | 34 // Each capturer must run on a dedicated thread because it uses thread local |
| 36 // storage for redirecting the library callback. Also the thread must have a UI | 35 // storage for redirecting the library callback. Also the thread must have a UI |
| 37 // message loop to handle the window messages for the magnifier window. | 36 // message loop to handle the window messages for the magnifier window. |
| 38 class ScreenCapturerWinMagnifier : public ScreenCapturer { | 37 class ScreenCapturerWinMagnifier : public ScreenCapturer { |
| 39 public: | 38 public: |
| 40 // |fallback_capturer| will be used to capture the screen if a non-primary | 39 // |fallback_capturer| will be used to capture the screen if a non-primary |
| 41 // screen is being captured, or the OS does not support Magnification API, or | 40 // screen is being captured, or the OS does not support Magnification API, or |
| 42 // the magnifier capturer fails (e.g. in Windows8 Metro mode). | 41 // the magnifier capturer fails (e.g. in Windows8 Metro mode). |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 bool fallback_capturer_started_ = false; | 108 bool fallback_capturer_started_ = false; |
| 110 Callback* callback_ = nullptr; | 109 Callback* callback_ = nullptr; |
| 111 std::unique_ptr<SharedMemoryFactory> shared_memory_factory_; | 110 std::unique_ptr<SharedMemoryFactory> shared_memory_factory_; |
| 112 ScreenId current_screen_id_ = kFullDesktopScreenId; | 111 ScreenId current_screen_id_ = kFullDesktopScreenId; |
| 113 std::wstring current_device_key_; | 112 std::wstring current_device_key_; |
| 114 HWND excluded_window_ = NULL; | 113 HWND excluded_window_ = NULL; |
| 115 | 114 |
| 116 // Queue of the frames buffers. | 115 // Queue of the frames buffers. |
| 117 ScreenCaptureFrameQueue<SharedDesktopFrame> queue_; | 116 ScreenCaptureFrameQueue<SharedDesktopFrame> queue_; |
| 118 | 117 |
| 119 // Class to calculate the difference between two screen bitmaps. | |
| 120 std::unique_ptr<Differ> differ_; | |
| 121 | |
| 122 ScopedThreadDesktop desktop_; | 118 ScopedThreadDesktop desktop_; |
| 123 | 119 |
| 124 // Used for getting the screen dpi. | 120 // Used for getting the screen dpi. |
| 125 HDC desktop_dc_ = NULL; | 121 HDC desktop_dc_ = NULL; |
| 126 | 122 |
| 127 HMODULE mag_lib_handle_ = NULL; | 123 HMODULE mag_lib_handle_ = NULL; |
| 128 MagInitializeFunc mag_initialize_func_ = nullptr; | 124 MagInitializeFunc mag_initialize_func_ = nullptr; |
| 129 MagUninitializeFunc mag_uninitialize_func_ = nullptr; | 125 MagUninitializeFunc mag_uninitialize_func_ = nullptr; |
| 130 MagSetWindowSourceFunc set_window_source_func_ = nullptr; | 126 MagSetWindowSourceFunc set_window_source_func_ = nullptr; |
| 131 MagSetWindowFilterListFunc set_window_filter_list_func_ = nullptr; | 127 MagSetWindowFilterListFunc set_window_filter_list_func_ = nullptr; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 142 // True if the last OnMagImageScalingCallback was called and handled | 138 // True if the last OnMagImageScalingCallback was called and handled |
| 143 // successfully. Reset at the beginning of each CaptureImage call. | 139 // successfully. Reset at the beginning of each CaptureImage call. |
| 144 bool magnifier_capture_succeeded_ = true; | 140 bool magnifier_capture_succeeded_ = true; |
| 145 | 141 |
| 146 RTC_DISALLOW_COPY_AND_ASSIGN(ScreenCapturerWinMagnifier); | 142 RTC_DISALLOW_COPY_AND_ASSIGN(ScreenCapturerWinMagnifier); |
| 147 }; | 143 }; |
| 148 | 144 |
| 149 } // namespace webrtc | 145 } // namespace webrtc |
| 150 | 146 |
| 151 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_SCREEN_CAPTURER_WIN_MAGNIFIER_H_ | 147 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_SCREEN_CAPTURER_WIN_MAGNIFIER_H_ |
| OLD | NEW |