diff --git a/modules/desktop_capture/desktop_capture_options.h b/modules/desktop_capture/desktop_capture_options.h index 9796b5fca2..ee823d296f 100644 --- a/modules/desktop_capture/desktop_capture_options.h +++ b/modules/desktop_capture/desktop_capture_options.h @@ -159,10 +159,6 @@ class RTC_EXPORT DesktopCaptureOptions { } #if defined(RTC_ENABLE_WIN_WGC) - // TODO(henrika): to be removed. - bool allow_wgc_capturer() const { return allow_wgc_capturer_; } - void set_allow_wgc_capturer(bool allow) { allow_wgc_capturer_ = allow; } - // This flag enables the WGC capturer for capturing the screen. // This capturer should offer similar or better performance than the cropping // capturer without the disadvantages listed above. However, the WGC capturer @@ -248,7 +244,6 @@ class RTC_EXPORT DesktopCaptureOptions { bool allow_directx_capturer_ = false; bool allow_cropping_window_capturer_ = false; #if defined(RTC_ENABLE_WIN_WGC) - bool allow_wgc_capturer_ = false; bool allow_wgc_screen_capturer_ = false; bool allow_wgc_window_capturer_ = false; bool allow_wgc_capturer_fallback_ = false; diff --git a/modules/desktop_capture/desktop_capturer.cc b/modules/desktop_capture/desktop_capturer.cc index 2017c60670..f9efd93a64 100644 --- a/modules/desktop_capture/desktop_capturer.cc +++ b/modules/desktop_capture/desktop_capturer.cc @@ -65,7 +65,7 @@ bool DesktopCapturer::IsOccluded(const DesktopVector& pos) { std::unique_ptr DesktopCapturer::CreateWindowCapturer( const DesktopCaptureOptions& options) { #if defined(RTC_ENABLE_WIN_WGC) - if ((options.allow_wgc_capturer() || options.allow_wgc_window_capturer()) && + if (options.allow_wgc_window_capturer() && IsWgcSupported(CaptureType::kWindow)) { return WgcCapturerWin::CreateRawWindowCapturer(options); } @@ -89,7 +89,7 @@ std::unique_ptr DesktopCapturer::CreateWindowCapturer( std::unique_ptr DesktopCapturer::CreateScreenCapturer( const DesktopCaptureOptions& options) { #if defined(RTC_ENABLE_WIN_WGC) - if ((options.allow_wgc_capturer() || options.allow_wgc_screen_capturer()) && + if (options.allow_wgc_screen_capturer() && IsWgcSupported(CaptureType::kScreen)) { return WgcCapturerWin::CreateRawScreenCapturer(options); }