| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "media/video/capture/screen/screen_capturer.h" | 5 #include "media/video/capture/screen/screen_capturer.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 CaptureCursor(); | 260 CaptureCursor(); |
| 261 } | 261 } |
| 262 | 262 |
| 263 void ScreenCapturerWin::Start(Delegate* delegate) { | 263 void ScreenCapturerWin::Start(Delegate* delegate) { |
| 264 DCHECK(delegate_ == NULL); | 264 DCHECK(delegate_ == NULL); |
| 265 | 265 |
| 266 delegate_ = delegate; | 266 delegate_ = delegate; |
| 267 | 267 |
| 268 // Load dwmapi.dll dynamically since it is not available on XP. | 268 // Load dwmapi.dll dynamically since it is not available on XP. |
| 269 if (!dwmapi_library_.is_valid()) { | 269 if (!dwmapi_library_.is_valid()) { |
| 270 FilePath path(base::GetNativeLibraryName(UTF8ToUTF16(kDwmapiLibraryName))); | 270 base::FilePath path(base::GetNativeLibraryName( |
| 271 UTF8ToUTF16(kDwmapiLibraryName))); |
| 271 dwmapi_library_.Reset(base::LoadNativeLibrary(path, NULL)); | 272 dwmapi_library_.Reset(base::LoadNativeLibrary(path, NULL)); |
| 272 } | 273 } |
| 273 | 274 |
| 274 if (dwmapi_library_.is_valid() && composition_func_ == NULL) { | 275 if (dwmapi_library_.is_valid() && composition_func_ == NULL) { |
| 275 composition_func_ = static_cast<DwmEnableCompositionFunc>( | 276 composition_func_ = static_cast<DwmEnableCompositionFunc>( |
| 276 dwmapi_library_.GetFunctionPointer("DwmEnableComposition")); | 277 dwmapi_library_.GetFunctionPointer("DwmEnableComposition")); |
| 277 } | 278 } |
| 278 | 279 |
| 279 // Vote to disable Aero composited desktop effects while capturing. Windows | 280 // Vote to disable Aero composited desktop effects while capturing. Windows |
| 280 // will restore Aero automatically if the process exits. This has no effect | 281 // will restore Aero automatically if the process exits. This has no effect |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 void ScreenCapturer::Delegate::ReleaseSharedBuffer( | 578 void ScreenCapturer::Delegate::ReleaseSharedBuffer( |
| 578 scoped_refptr<SharedBuffer> buffer) { | 579 scoped_refptr<SharedBuffer> buffer) { |
| 579 } | 580 } |
| 580 | 581 |
| 581 // static | 582 // static |
| 582 scoped_ptr<ScreenCapturer> ScreenCapturer::Create() { | 583 scoped_ptr<ScreenCapturer> ScreenCapturer::Create() { |
| 583 return scoped_ptr<ScreenCapturer>(new ScreenCapturerWin()); | 584 return scoped_ptr<ScreenCapturer>(new ScreenCapturerWin()); |
| 584 } | 585 } |
| 585 | 586 |
| 586 } // namespace media | 587 } // namespace media |
| OLD | NEW |