Wrap ScreenCapturer with ScreenCapturerDifferWrapper
This change is to add an DesktopCapturerOptions accurate_updated_region() with
default value as false to indicate whether a pixel-wise differentiation is
required. And ScreenCapturer::Create() function will wrap the implementation
with ScreenCapturerDifferWrapper.
Chromoting will use this option to filter out unchanged frames.
BUG=314516
Review-Url: https://codereview.webrtc.org/2314323002
Cr-Original-Commit-Position: refs/heads/master@{#14248}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: e9a3c7f43c697c3c1e7c8956baebeaf2a1a867f6
diff --git a/modules/desktop_capture/desktop_capture_options.h b/modules/desktop_capture/desktop_capture_options.h
index 2aa3e51..d872d7d 100644
--- a/modules/desktop_capture/desktop_capture_options.h
+++ b/modules/desktop_capture/desktop_capture_options.h
@@ -72,6 +72,16 @@
disable_effects_ = disable_effects;
}
+ // Flag that should be set if the consumer uses updated_region() and the
+ // capturer should try to provide correct updated_region() for the frames it
+ // generates (e.g. by comparing each frame with the previous one).
+ // TODO(zijiehe): WindowCapturer ignores this opinion until we merge
+ // ScreenCapturer and WindowCapturer interfaces.
+ bool detect_updated_region() const { return detect_updated_region_; }
+ void set_detect_updated_region(bool detect_updated_region) {
+ detect_updated_region_ = detect_updated_region;
+ }
+
#if defined(WEBRTC_WIN)
bool allow_use_magnification_api() const {
return allow_use_magnification_api_;
@@ -110,6 +120,7 @@
bool use_update_notifications_ = true;
#endif
bool disable_effects_ = true;
+ bool detect_updated_region_ = false;
};
} // namespace webrtc