Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Unified Diff: webrtc/modules/desktop_capture/screen_capturer_win.cc

Issue 1845113002: DirectX based screen capturer logic (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Remove width change in Texture::Capture Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/desktop_capture/screen_capturer_win.cc
diff --git a/webrtc/modules/desktop_capture/screen_capturer_win.cc b/webrtc/modules/desktop_capture/screen_capturer_win.cc
index 22113a870df4fa4c54a140801aecf8c694206ecb..0c2d143ec3fc0a6d829ae5093563b3ea2045c020 100644
--- a/webrtc/modules/desktop_capture/screen_capturer_win.cc
+++ b/webrtc/modules/desktop_capture/screen_capturer_win.cc
@@ -14,6 +14,7 @@
#include <utility>
#include "webrtc/modules/desktop_capture/desktop_capture_options.h"
+#include "webrtc/modules/desktop_capture/win/screen_capturer_win_directx.h"
#include "webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.h"
#include "webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.h"
@@ -21,13 +22,18 @@ namespace webrtc {
// static
ScreenCapturer* ScreenCapturer::Create(const DesktopCaptureOptions& options) {
- std::unique_ptr<ScreenCapturer> gdi_capturer(
- new ScreenCapturerWinGdi(options));
+ std::unique_ptr<ScreenCapturer> capturer;
+ if (options.use_directx_capturer() &&
+ ScreenCapturerWinDirectx::Initialize()) {
+ capturer.reset(new ScreenCapturerWinDirectx(options));
Sergey Ulanov 2016/04/14 23:10:42 I think here we need to check Windows version and
Hzj_jie 2016/04/15 19:42:17 Not really, Windows 7 with platform update may als
+ } else {
+ capturer.reset(new ScreenCapturerWinGdi(options));
+ }
if (options.allow_use_magnification_api())
- return new ScreenCapturerWinMagnifier(std::move(gdi_capturer));
+ return new ScreenCapturerWinMagnifier(std::move(capturer));
- return gdi_capturer.release();
+ return capturer.release();
}
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698