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> | 14 #include <memory> |
15 | 15 |
16 #include "webrtc/modules/desktop_capture/screen_capturer.h" | 16 #include "webrtc/modules/desktop_capture/screen_capturer.h" |
17 | 17 |
18 #include <windows.h> | 18 #include <windows.h> |
19 | 19 |
20 #include "webrtc/base/scoped_ptr.h" | 20 #include "webrtc/base/scoped_ptr.h" |
21 #include "webrtc/modules/desktop_capture/screen_capture_frame_queue.h" | 21 #include "webrtc/modules/desktop_capture/screen_capture_frame_queue.h" |
22 #include "webrtc/modules/desktop_capture/screen_capturer_helper.h" | 22 #include "webrtc/modules/desktop_capture/screen_capturer_helper.h" |
23 #include "webrtc/modules/desktop_capture/shared_desktop_frame.h" | |
24 #include "webrtc/modules/desktop_capture/win/scoped_thread_desktop.h" | 23 #include "webrtc/modules/desktop_capture/win/scoped_thread_desktop.h" |
25 | 24 |
26 namespace webrtc { | 25 namespace webrtc { |
27 | 26 |
28 class Differ; | 27 class Differ; |
29 | 28 |
30 // ScreenCapturerWinGdi captures 32bit RGB using GDI. | 29 // ScreenCapturerWinGdi captures 32bit RGB using GDI. |
31 // | 30 // |
32 // ScreenCapturerWinGdi is double-buffered as required by ScreenCapturer. | 31 // ScreenCapturerWinGdi is double-buffered as required by ScreenCapturer. |
33 class ScreenCapturerWinGdi : public ScreenCapturer { | 32 class ScreenCapturerWinGdi : public ScreenCapturer { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // recently captured screen. | 64 // recently captured screen. |
66 ScreenCapturerHelper helper_; | 65 ScreenCapturerHelper helper_; |
67 | 66 |
68 ScopedThreadDesktop desktop_; | 67 ScopedThreadDesktop desktop_; |
69 | 68 |
70 // GDI resources used for screen capture. | 69 // GDI resources used for screen capture. |
71 HDC desktop_dc_; | 70 HDC desktop_dc_; |
72 HDC memory_dc_; | 71 HDC memory_dc_; |
73 | 72 |
74 // Queue of the frames buffers. | 73 // Queue of the frames buffers. |
75 ScreenCaptureFrameQueue<SharedDesktopFrame> queue_; | 74 ScreenCaptureFrameQueue queue_; |
76 | 75 |
77 // Rectangle describing the bounds of the desktop device context, relative to | 76 // Rectangle describing the bounds of the desktop device context, relative to |
78 // the primary display's top-left. | 77 // the primary display's top-left. |
79 DesktopRect desktop_dc_rect_; | 78 DesktopRect desktop_dc_rect_; |
80 | 79 |
81 // Class to calculate the difference between two screen bitmaps. | 80 // Class to calculate the difference between two screen bitmaps. |
82 std::unique_ptr<Differ> differ_; | 81 std::unique_ptr<Differ> differ_; |
83 | 82 |
84 HMODULE dwmapi_library_; | 83 HMODULE dwmapi_library_; |
85 DwmEnableCompositionFunc composition_func_; | 84 DwmEnableCompositionFunc composition_func_; |
86 | 85 |
87 // Used to suppress duplicate logging of SetThreadExecutionState errors. | 86 // Used to suppress duplicate logging of SetThreadExecutionState errors. |
88 bool set_thread_execution_state_failed_; | 87 bool set_thread_execution_state_failed_; |
89 | 88 |
90 RTC_DISALLOW_COPY_AND_ASSIGN(ScreenCapturerWinGdi); | 89 RTC_DISALLOW_COPY_AND_ASSIGN(ScreenCapturerWinGdi); |
91 }; | 90 }; |
92 | 91 |
93 } // namespace webrtc | 92 } // namespace webrtc |
94 | 93 |
95 #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 |