| 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 |
| 11 #ifndef WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_SCREEN_CAPTURER_WIN_GDI_H_ | 11 #ifndef WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_SCREEN_CAPTURER_WIN_GDI_H_ |
| 12 #define WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_SCREEN_CAPTURER_WIN_GDI_H_ | 12 #define WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_SCREEN_CAPTURER_WIN_GDI_H_ |
| 13 | 13 |
| 14 #include <memory> |
| 15 |
| 14 #include "webrtc/modules/desktop_capture/screen_capturer.h" | 16 #include "webrtc/modules/desktop_capture/screen_capturer.h" |
| 15 | 17 |
| 16 #include <windows.h> | 18 #include <windows.h> |
| 17 | 19 |
| 18 #include "webrtc/base/scoped_ptr.h" | 20 #include "webrtc/base/scoped_ptr.h" |
| 19 #include "webrtc/modules/desktop_capture/screen_capture_frame_queue.h" | 21 #include "webrtc/modules/desktop_capture/screen_capture_frame_queue.h" |
| 20 #include "webrtc/modules/desktop_capture/screen_capturer_helper.h" | 22 #include "webrtc/modules/desktop_capture/screen_capturer_helper.h" |
| 21 #include "webrtc/modules/desktop_capture/win/scoped_thread_desktop.h" | 23 #include "webrtc/modules/desktop_capture/win/scoped_thread_desktop.h" |
| 22 | 24 |
| 23 namespace webrtc { | 25 namespace webrtc { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 47 void PrepareCaptureResources(); | 49 void PrepareCaptureResources(); |
| 48 | 50 |
| 49 // Captures the current screen contents into the current buffer. Returns true | 51 // Captures the current screen contents into the current buffer. Returns true |
| 50 // if succeeded. | 52 // if succeeded. |
| 51 bool CaptureImage(); | 53 bool CaptureImage(); |
| 52 | 54 |
| 53 // Capture the current cursor shape. | 55 // Capture the current cursor shape. |
| 54 void CaptureCursor(); | 56 void CaptureCursor(); |
| 55 | 57 |
| 56 Callback* callback_; | 58 Callback* callback_; |
| 57 rtc::scoped_ptr<SharedMemoryFactory> shared_memory_factory_; | 59 std::unique_ptr<SharedMemoryFactory> shared_memory_factory_; |
| 58 ScreenId current_screen_id_; | 60 ScreenId current_screen_id_; |
| 59 std::wstring current_device_key_; | 61 std::wstring current_device_key_; |
| 60 | 62 |
| 61 // A thread-safe list of invalid rectangles, and the size of the most | 63 // A thread-safe list of invalid rectangles, and the size of the most |
| 62 // recently captured screen. | 64 // recently captured screen. |
| 63 ScreenCapturerHelper helper_; | 65 ScreenCapturerHelper helper_; |
| 64 | 66 |
| 65 ScopedThreadDesktop desktop_; | 67 ScopedThreadDesktop desktop_; |
| 66 | 68 |
| 67 // GDI resources used for screen capture. | 69 // GDI resources used for screen capture. |
| 68 HDC desktop_dc_; | 70 HDC desktop_dc_; |
| 69 HDC memory_dc_; | 71 HDC memory_dc_; |
| 70 | 72 |
| 71 // Queue of the frames buffers. | 73 // Queue of the frames buffers. |
| 72 ScreenCaptureFrameQueue queue_; | 74 ScreenCaptureFrameQueue queue_; |
| 73 | 75 |
| 74 // Rectangle describing the bounds of the desktop device context, relative to | 76 // Rectangle describing the bounds of the desktop device context, relative to |
| 75 // the primary display's top-left. | 77 // the primary display's top-left. |
| 76 DesktopRect desktop_dc_rect_; | 78 DesktopRect desktop_dc_rect_; |
| 77 | 79 |
| 78 // Class to calculate the difference between two screen bitmaps. | 80 // Class to calculate the difference between two screen bitmaps. |
| 79 rtc::scoped_ptr<Differ> differ_; | 81 std::unique_ptr<Differ> differ_; |
| 80 | 82 |
| 81 HMODULE dwmapi_library_; | 83 HMODULE dwmapi_library_; |
| 82 DwmEnableCompositionFunc composition_func_; | 84 DwmEnableCompositionFunc composition_func_; |
| 83 | 85 |
| 84 // Used to suppress duplicate logging of SetThreadExecutionState errors. | 86 // Used to suppress duplicate logging of SetThreadExecutionState errors. |
| 85 bool set_thread_execution_state_failed_; | 87 bool set_thread_execution_state_failed_; |
| 86 | 88 |
| 87 RTC_DISALLOW_COPY_AND_ASSIGN(ScreenCapturerWinGdi); | 89 RTC_DISALLOW_COPY_AND_ASSIGN(ScreenCapturerWinGdi); |
| 88 }; | 90 }; |
| 89 | 91 |
| 90 } // namespace webrtc | 92 } // namespace webrtc |
| 91 | 93 |
| 92 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_SCREEN_CAPTURER_WIN_GDI_H_ | 94 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_SCREEN_CAPTURER_WIN_GDI_H_ |
| OLD | NEW |