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

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

Issue 2314323002: Wrap ScreenCapturer with ScreenCapturerDifferWrapper (Closed)
Patch Set: Resolve review comments 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
Index: webrtc/modules/desktop_capture/screen_capturer_x11.cc
diff --git a/webrtc/modules/desktop_capture/screen_capturer_x11.cc b/webrtc/modules/desktop_capture/screen_capturer_x11.cc
index 57c2e5fc163981a5a5136f38a6e90d98a494043c..d274140e9868b94a886781c3581bad28ebcf1b32 100644
--- a/webrtc/modules/desktop_capture/screen_capturer_x11.cc
+++ b/webrtc/modules/desktop_capture/screen_capturer_x11.cc
@@ -14,6 +14,7 @@
#include <memory>
#include <set>
+#include <utility>
#include <X11/extensions/Xdamage.h>
#include <X11/extensions/Xfixes.h>
@@ -27,6 +28,7 @@
#include "webrtc/modules/desktop_capture/desktop_frame.h"
#include "webrtc/modules/desktop_capture/differ.h"
#include "webrtc/modules/desktop_capture/screen_capture_frame_queue.h"
+#include "webrtc/modules/desktop_capture/screen_capturer_differ_wrapper.h"
#include "webrtc/modules/desktop_capture/screen_capturer_helper.h"
#include "webrtc/modules/desktop_capture/shared_desktop_frame.h"
#include "webrtc/modules/desktop_capture/x11/x_server_pixel_buffer.h"
@@ -426,9 +428,15 @@ ScreenCapturer* ScreenCapturer::Create(const DesktopCaptureOptions& options) {
if (!options.x_display())
return nullptr;
- std::unique_ptr<ScreenCapturerLinux> capturer(new ScreenCapturerLinux());
- if (!capturer->Init(options))
- capturer.reset();
+ std::unique_ptr<ScreenCapturer> capturer(new ScreenCapturerLinux());
+ if (!static_cast<ScreenCapturerLinux*>(capturer.get())->Init(options)) {
+ return nullptr;
+ }
+
+ if (options.detect_updated_region()) {
+ capturer.reset(new ScreenCapturerDifferWrapper(std::move(capturer)));
+ }
+
return capturer.release();
}

Powered by Google App Engine
This is Rietveld 408576698