| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 // Make sure that the device contexts match the screen configuration. | 49 // Make sure that the device contexts match the screen configuration. |
| 50 void PrepareCaptureResources(); | 50 void PrepareCaptureResources(); |
| 51 | 51 |
| 52 // Captures the current screen contents into the current buffer. Returns true | 52 // Captures the current screen contents into the current buffer. Returns true |
| 53 // if succeeded. | 53 // if succeeded. |
| 54 bool CaptureImage(); | 54 bool CaptureImage(); |
| 55 | 55 |
| 56 // Capture the current cursor shape. | 56 // Capture the current cursor shape. |
| 57 void CaptureCursor(); | 57 void CaptureCursor(); |
| 58 | 58 |
| 59 Callback* callback_ = nullptr; | 59 Callback* callback_; |
| 60 std::unique_ptr<SharedMemoryFactory> shared_memory_factory_; | 60 std::unique_ptr<SharedMemoryFactory> shared_memory_factory_; |
| 61 ScreenId current_screen_id_ = kFullDesktopScreenId; | 61 ScreenId current_screen_id_; |
| 62 std::wstring current_device_key_; | 62 std::wstring current_device_key_; |
| 63 | 63 |
| 64 // A thread-safe list of invalid rectangles, and the size of the most | 64 // A thread-safe list of invalid rectangles, and the size of the most |
| 65 // recently captured screen. | 65 // recently captured screen. |
| 66 ScreenCapturerHelper helper_; | 66 ScreenCapturerHelper helper_; |
| 67 | 67 |
| 68 ScopedThreadDesktop desktop_; | 68 ScopedThreadDesktop desktop_; |
| 69 | 69 |
| 70 // GDI resources used for screen capture. | 70 // GDI resources used for screen capture. |
| 71 HDC desktop_dc_ = NULL; | 71 HDC desktop_dc_; |
| 72 HDC memory_dc_ = NULL; | 72 HDC memory_dc_; |
| 73 | 73 |
| 74 // Queue of the frames buffers. | 74 // Queue of the frames buffers. |
| 75 ScreenCaptureFrameQueue<SharedDesktopFrame> queue_; | 75 ScreenCaptureFrameQueue<SharedDesktopFrame> queue_; |
| 76 | 76 |
| 77 // Rectangle describing the bounds of the desktop device context, relative to | 77 // Rectangle describing the bounds of the desktop device context, relative to |
| 78 // the primary display's top-left. | 78 // the primary display's top-left. |
| 79 DesktopRect desktop_dc_rect_; | 79 DesktopRect desktop_dc_rect_; |
| 80 | 80 |
| 81 // Class to calculate the difference between two screen bitmaps. | 81 // Class to calculate the difference between two screen bitmaps. |
| 82 std::unique_ptr<Differ> differ_; | 82 std::unique_ptr<Differ> differ_; |
| 83 | 83 |
| 84 HMODULE dwmapi_library_ = NULL; | 84 HMODULE dwmapi_library_; |
| 85 DwmEnableCompositionFunc composition_func_ = nullptr; | 85 DwmEnableCompositionFunc composition_func_; |
| 86 | 86 |
| 87 // Used to suppress duplicate logging of SetThreadExecutionState errors. | 87 // Used to suppress duplicate logging of SetThreadExecutionState errors. |
| 88 bool set_thread_execution_state_failed_ = false; | 88 bool set_thread_execution_state_failed_; |
| 89 | 89 |
| 90 RTC_DISALLOW_COPY_AND_ASSIGN(ScreenCapturerWinGdi); | 90 RTC_DISALLOW_COPY_AND_ASSIGN(ScreenCapturerWinGdi); |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 } // namespace webrtc | 93 } // namespace webrtc |
| 94 | 94 |
| 95 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_SCREEN_CAPTURER_WIN_GDI_H_ | 95 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_SCREEN_CAPTURER_WIN_GDI_H_ |
| OLD | NEW |