Index: webrtc/modules/desktop_capture/win/window_capture_utils.cc |
diff --git a/webrtc/modules/desktop_capture/win/window_capture_utils.cc b/webrtc/modules/desktop_capture/win/window_capture_utils.cc |
index bfe7363f32d8c69b64a59e2388b47cb1a6c08ef5..83922ea7f806e2b8eb0f916e48d70f68a1af7342 100644 |
--- a/webrtc/modules/desktop_capture/win/window_capture_utils.cc |
+++ b/webrtc/modules/desktop_capture/win/window_capture_utils.cc |
@@ -43,4 +43,27 @@ GetCroppedWindowRect(HWND window, |
return true; |
} |
+AeroChecker::AeroChecker() : dwmapi_library_(nullptr), func_(nullptr) { |
+ // Try to load dwmapi.dll dynamically since it is not available on XP. |
+ dwmapi_library_ = LoadLibrary(L"dwmapi.dll"); |
+ if (dwmapi_library_) { |
+ func_ = reinterpret_cast<DwmIsCompositionEnabledFunc>( |
+ GetProcAddress(dwmapi_library_, "DwmIsCompositionEnabled")); |
+ } |
+} |
+ |
+AeroChecker::~AeroChecker() { |
+ if (dwmapi_library_) { |
+ FreeLibrary(dwmapi_library_); |
+ } |
+} |
+ |
+bool AeroChecker::IsAeroEnabled() { |
+ BOOL result = FALSE; |
+ if (func_) { |
+ func_(&result); |
+ } |
+ return result != FALSE; |
+} |
+ |
} // namespace webrtc |