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/constructormagic.h" | 20 #include "webrtc/base/constructormagic.h" |
| 21 #include "webrtc/base/scoped_ptr.h" |
21 #include "webrtc/modules/desktop_capture/screen_capture_frame_queue.h" | 22 #include "webrtc/modules/desktop_capture/screen_capture_frame_queue.h" |
22 #include "webrtc/modules/desktop_capture/screen_capturer_helper.h" | 23 #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/shared_desktop_frame.h" |
24 #include "webrtc/modules/desktop_capture/win/scoped_thread_desktop.h" | 25 #include "webrtc/modules/desktop_capture/win/scoped_thread_desktop.h" |
25 | 26 |
26 namespace webrtc { | 27 namespace webrtc { |
27 | 28 |
28 class Differ; | 29 class Differ; |
29 | 30 |
30 // ScreenCapturerWinGdi captures 32bit RGB using GDI. | 31 // ScreenCapturerWinGdi captures 32bit RGB using GDI. |
31 // | 32 // |
32 // ScreenCapturerWinGdi is double-buffered as required by ScreenCapturer. | 33 // ScreenCapturerWinGdi is double-buffered as required by ScreenCapturer. |
33 class ScreenCapturerWinGdi : public ScreenCapturer { | 34 class ScreenCapturerWinGdi : public ScreenCapturer { |
34 public: | 35 public: |
35 explicit ScreenCapturerWinGdi(const DesktopCaptureOptions& options); | 36 explicit ScreenCapturerWinGdi(const DesktopCaptureOptions& options); |
36 virtual ~ScreenCapturerWinGdi(); | 37 virtual ~ScreenCapturerWinGdi(); |
37 | 38 |
38 // Overridden from ScreenCapturer: | 39 // Overridden from ScreenCapturer: |
39 void Start(Callback* callback) override; | 40 void Start(Callback* callback) override; |
40 void SetSharedMemoryFactory( | 41 void SetSharedMemoryFactory( |
41 std::unique_ptr<SharedMemoryFactory> shared_memory_factory) override; | 42 rtc::scoped_ptr<SharedMemoryFactory> shared_memory_factory) override; |
42 void Capture(const DesktopRegion& region) override; | 43 void Capture(const DesktopRegion& region) override; |
43 bool GetScreenList(ScreenList* screens) override; | 44 bool GetScreenList(ScreenList* screens) override; |
44 bool SelectScreen(ScreenId id) override; | 45 bool SelectScreen(ScreenId id) override; |
45 | 46 |
46 private: | 47 private: |
47 typedef HRESULT (WINAPI * DwmEnableCompositionFunc)(UINT); | 48 typedef HRESULT (WINAPI * DwmEnableCompositionFunc)(UINT); |
48 | 49 |
49 // Make sure that the device contexts match the screen configuration. | 50 // Make sure that the device contexts match the screen configuration. |
50 void PrepareCaptureResources(); | 51 void PrepareCaptureResources(); |
51 | 52 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 87 |
87 // Used to suppress duplicate logging of SetThreadExecutionState errors. | 88 // Used to suppress duplicate logging of SetThreadExecutionState errors. |
88 bool set_thread_execution_state_failed_; | 89 bool set_thread_execution_state_failed_; |
89 | 90 |
90 RTC_DISALLOW_COPY_AND_ASSIGN(ScreenCapturerWinGdi); | 91 RTC_DISALLOW_COPY_AND_ASSIGN(ScreenCapturerWinGdi); |
91 }; | 92 }; |
92 | 93 |
93 } // namespace webrtc | 94 } // namespace webrtc |
94 | 95 |
95 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_SCREEN_CAPTURER_WIN_GDI_H_ | 96 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_SCREEN_CAPTURER_WIN_GDI_H_ |
OLD | NEW |