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

Unified Diff: webrtc/modules/desktop_capture/screen_capturer_mac.mm

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_mac.mm
diff --git a/webrtc/modules/desktop_capture/screen_capturer_mac.mm b/webrtc/modules/desktop_capture/screen_capturer_mac.mm
index 7cb1720ed92235a5d0d1c170ecc1b619b4432b0d..451cd9ed9d8168463d6370ef52b0a012ebfaefaa 100644
--- a/webrtc/modules/desktop_capture/screen_capturer_mac.mm
+++ b/webrtc/modules/desktop_capture/screen_capturer_mac.mm
@@ -14,6 +14,7 @@
#include <memory>
#include <set>
+#include <utility>
#include <ApplicationServices/ApplicationServices.h>
#include <Cocoa/Cocoa.h>
@@ -33,6 +34,7 @@
#include "webrtc/modules/desktop_capture/mac/desktop_configuration_monitor.h"
#include "webrtc/modules/desktop_capture/mac/scoped_pixel_buffer_object.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/system_wrappers/include/logging.h"
@@ -937,10 +939,16 @@ ScreenCapturer* ScreenCapturer::Create(const DesktopCaptureOptions& options) {
if (!options.configuration_monitor())
return nullptr;
- std::unique_ptr<ScreenCapturerMac> capturer(
+ std::unique_ptr<ScreenCapturer> capturer(
new ScreenCapturerMac(options.configuration_monitor()));
- if (!capturer->Init())
- capturer.reset();
+ if (!static_cast<ScreenCapturerMac*>(capturer.get())->Init()) {
+ return nullptr;
+ }
+
+ if (options.detect_updated_region()) {
+ capturer.reset(new ScreenCapturerDifferWrapper(std::move(capturer)));
+ }
+
return capturer.release();
}
« no previous file with comments | « webrtc/modules/desktop_capture/desktop_capture_options.h ('k') | webrtc/modules/desktop_capture/screen_capturer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698