1 /* 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. 3 * 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 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 #ifndef MODULES_DESKTOP_CAPTURE_WIN_DISPLAY_CONFIGURATION_MONITOR_H_ 12 #define MODULES_DESKTOP_CAPTURE_WIN_DISPLAY_CONFIGURATION_MONITOR_H_ 13 14 #include "modules/desktop_capture/desktop_geometry.h" 15 16 namespace webrtc { 17 18 // A passive monitor to detect the change of display configuration on a Windows 19 // system. 20 // TODO(zijiehe): Also check for pixel format changes. 21 class DisplayConfigurationMonitor { 22 public: 23 // Checks whether the change of display configuration has happened after last 24 // IsChanged() call. This function won't return true for the first time after 25 // constructor or Reset() call. 26 bool IsChanged(); 27 28 // Resets to the initial state. 29 void Reset(); 30 31 private: 32 DesktopRect rect_; 33 bool initialized_ = false; 34 }; 35 36 } // namespace webrtc 37 38 #endif // MODULES_DESKTOP_CAPTURE_WIN_DISPLAY_CONFIGURATION_MONITOR_H_ 39