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

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

Issue 2468753002: Add CreateWindowCapturer() and CreateScreenCapturer() in DesktopCapturer (Closed)
Patch Set: Build break without X11 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..f28630e9c450a1ca2aaa0d3bd9ad86da5942b982 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,32 @@ bool DesktopCapturer::FocusOnSelectedSource() {
return false;
}
+// Some platforms, such as ChromeOS, have their DesktopCapturer implementations
+// in Chromium. So even we do not have CreateRawWindowCapturer() or
+// CreateRawScreenCapturer() implemented in WebRTC, we still need to build other
+// DesktopCapturer components when RTC_DESKTOP_CAPTURE_SUPPORTED is not defined.
+#if defined(RTC_DESKTOP_CAPTURE_SUPPORTED)
+// 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 // defined(RTC_DESKTOP_CAPTURE_SUPPORTED)
+
} // namespace webrtc
« no previous file with comments | « webrtc/modules/desktop_capture/desktop_capturer.h ('k') | webrtc/modules/desktop_capture/desktop_capturer_differ_wrapper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698