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

Unified Diff: webrtc/modules/desktop_capture/win/screen_capturer_win_directx.cc

Issue 2314323002: Wrap ScreenCapturer with ScreenCapturerDifferWrapper (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « webrtc/modules/desktop_capture/win/screen_capturer_win_directx.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/desktop_capture/win/screen_capturer_win_directx.cc
diff --git a/webrtc/modules/desktop_capture/win/screen_capturer_win_directx.cc b/webrtc/modules/desktop_capture/win/screen_capturer_win_directx.cc
index e4b2c3e8a225b397d4c67693baa646c2c98c34f3..4201fcee3a18abd684e20da7779eec2067c6c416 100644
--- a/webrtc/modules/desktop_capture/win/screen_capturer_win_directx.cc
+++ b/webrtc/modules/desktop_capture/win/screen_capturer_win_directx.cc
@@ -16,16 +16,31 @@
#include "webrtc/base/logging.h"
#include "webrtc/base/timeutils.h"
#include "webrtc/modules/desktop_capture/desktop_frame.h"
+#include "webrtc/modules/desktop_capture/screen_capturer_differ_wrapper.h"
namespace webrtc {
using Microsoft::WRL::ComPtr;
+// static
bool ScreenCapturerWinDirectx::IsSupported() {
// Forward IsSupported function call to DxgiDuplicatorController.
return DxgiDuplicatorController::Instance()->IsSupported();
}
+// static
+std::unique_ptr<ScreenCapturer> ScreenCapturerWinDirectx::Create(
+ const DesktopCaptureOptions& options) {
+ if (!IsSupported()) {
+ return std::unique_ptr<ScreenCapturer>();
Sergey Ulanov 2016/09/07 22:47:23 return nullptr;
+ }
+
+ // Windows is known to return larger updated region, so we wrap a
+ // ScreenCapturerDirectx instance with ScreenCapturerDifferWrapper.
+ return std::unique_ptr<ScreenCapturer>(new ScreenCapturerDifferWrapper(
Sergey Ulanov 2016/09/07 22:47:23 I think it's better to keep this code in ScreenCap
+ std::unique_ptr<ScreenCapturer>(new ScreenCapturerWinDirectx(options))));
+}
+
ScreenCapturerWinDirectx::ScreenCapturerWinDirectx(
const DesktopCaptureOptions& options)
: callback_(nullptr) {}
« no previous file with comments | « webrtc/modules/desktop_capture/win/screen_capturer_win_directx.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698