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

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

Issue 2468753002: Add CreateWindowCapturer() and CreateScreenCapturer() in DesktopCapturer (Closed)
Patch Set: Created 4 years, 1 month 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/desktop_capturer.cc
diff --git a/webrtc/modules/desktop_capture/desktop_capturer.cc b/webrtc/modules/desktop_capture/desktop_capturer.cc
index a18976a62664a476534de69b2d29e567f7661bd6..0c5290cf228dc8f716b666b119dd223765dfccf7 100644
--- a/webrtc/modules/desktop_capture/desktop_capturer.cc
+++ b/webrtc/modules/desktop_capture/desktop_capturer.cc
@@ -11,7 +11,7 @@
#include "webrtc/modules/desktop_capture/desktop_capturer.h"
#include "webrtc/modules/desktop_capture/desktop_capture_options.h"
-#include "webrtc/modules/desktop_capture/screen_capturer_differ_wrapper.h"
+#include "webrtc/modules/desktop_capture/desktop_capturer_differ_wrapper.h"
namespace webrtc {
@@ -34,4 +34,28 @@ bool DesktopCapturer::FocusOnSelectedSource() {
return false;
}
+#if defined(RTC_DESKTOP_CAPTURE_SUPPORTED)
Sergey Ulanov 2016/11/01 20:33:31 Ideally this file shouldn't be compiled at all whe
Hzj_jie 2016/11/01 21:12:13 Is there any reason we put AuraDesktopCapturer for
+// static
+std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateWindowCapturer(
+ const DesktopCaptureOptions& options) {
+ std::unique_ptr<DesktopCapturer> capturer = CreateRawWindowCapturer(options);
+ if (options.detect_updated_region()) {
+ capturer.reset(new DesktopCapturerDifferWrapper(std::move(capturer)));
+ }
+
+ return capturer;
+}
+
+// static
+std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateScreenCapturer(
+ const DesktopCaptureOptions& options) {
+ std::unique_ptr<DesktopCapturer> capturer = CreateRawScreenCapturer(options);
+ if (options.detect_updated_region()) {
+ capturer.reset(new DesktopCapturerDifferWrapper(std::move(capturer)));
+ }
+
+ return capturer;
+}
+#endif
Sergey Ulanov 2016/11/01 20:33:31 // defined(RTC_DESKTOP_CAPTURE_SUPPORTED)
Hzj_jie 2016/11/01 21:12:13 Done.
+
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698