| 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 16 matching lines...) Expand all Loading... |
| 27 // ScreenCapturerWinGdi captures 32bit RGB using GDI. | 27 // ScreenCapturerWinGdi captures 32bit RGB using GDI. |
| 28 // | 28 // |
| 29 // ScreenCapturerWinGdi is double-buffered as required by ScreenCapturer. | 29 // ScreenCapturerWinGdi is double-buffered as required by ScreenCapturer. |
| 30 class ScreenCapturerWinGdi : public ScreenCapturer { | 30 class ScreenCapturerWinGdi : public ScreenCapturer { |
| 31 public: | 31 public: |
| 32 explicit ScreenCapturerWinGdi(const DesktopCaptureOptions& options); | 32 explicit ScreenCapturerWinGdi(const DesktopCaptureOptions& options); |
| 33 virtual ~ScreenCapturerWinGdi(); | 33 virtual ~ScreenCapturerWinGdi(); |
| 34 | 34 |
| 35 // Overridden from ScreenCapturer: | 35 // Overridden from ScreenCapturer: |
| 36 void Start(Callback* callback) override; | 36 void Start(Callback* callback) override; |
| 37 void SetSharedMemoryFactory( |
| 38 rtc::scoped_ptr<SharedMemoryFactory> shared_memory_factory) override; |
| 37 void Capture(const DesktopRegion& region) override; | 39 void Capture(const DesktopRegion& region) override; |
| 38 bool GetScreenList(ScreenList* screens) override; | 40 bool GetScreenList(ScreenList* screens) override; |
| 39 bool SelectScreen(ScreenId id) override; | 41 bool SelectScreen(ScreenId id) override; |
| 40 | 42 |
| 41 private: | 43 private: |
| 42 typedef HRESULT (WINAPI * DwmEnableCompositionFunc)(UINT); | 44 typedef HRESULT (WINAPI * DwmEnableCompositionFunc)(UINT); |
| 43 | 45 |
| 44 // Make sure that the device contexts match the screen configuration. | 46 // Make sure that the device contexts match the screen configuration. |
| 45 void PrepareCaptureResources(); | 47 void PrepareCaptureResources(); |
| 46 | 48 |
| 47 // Captures the current screen contents into the current buffer. Returns true | 49 // Captures the current screen contents into the current buffer. Returns true |
| 48 // if succeeded. | 50 // if succeeded. |
| 49 bool CaptureImage(); | 51 bool CaptureImage(); |
| 50 | 52 |
| 51 // Capture the current cursor shape. | 53 // Capture the current cursor shape. |
| 52 void CaptureCursor(); | 54 void CaptureCursor(); |
| 53 | 55 |
| 54 Callback* callback_; | 56 Callback* callback_; |
| 57 rtc::scoped_ptr<SharedMemoryFactory> shared_memory_factory_; |
| 55 ScreenId current_screen_id_; | 58 ScreenId current_screen_id_; |
| 56 std::wstring current_device_key_; | 59 std::wstring current_device_key_; |
| 57 | 60 |
| 58 // A thread-safe list of invalid rectangles, and the size of the most | 61 // A thread-safe list of invalid rectangles, and the size of the most |
| 59 // recently captured screen. | 62 // recently captured screen. |
| 60 ScreenCapturerHelper helper_; | 63 ScreenCapturerHelper helper_; |
| 61 | 64 |
| 62 ScopedThreadDesktop desktop_; | 65 ScopedThreadDesktop desktop_; |
| 63 | 66 |
| 64 // GDI resources used for screen capture. | 67 // GDI resources used for screen capture. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 80 | 83 |
| 81 // Used to suppress duplicate logging of SetThreadExecutionState errors. | 84 // Used to suppress duplicate logging of SetThreadExecutionState errors. |
| 82 bool set_thread_execution_state_failed_; | 85 bool set_thread_execution_state_failed_; |
| 83 | 86 |
| 84 RTC_DISALLOW_COPY_AND_ASSIGN(ScreenCapturerWinGdi); | 87 RTC_DISALLOW_COPY_AND_ASSIGN(ScreenCapturerWinGdi); |
| 85 }; | 88 }; |
| 86 | 89 |
| 87 } // namespace webrtc | 90 } // namespace webrtc |
| 88 | 91 |
| 89 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_SCREEN_CAPTURER_WIN_GDI_H_ | 92 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_SCREEN_CAPTURER_WIN_GDI_H_ |
| OLD | NEW |