There is a crash report from the Windows OS API where it repro only win10, not a Win11. Unfortunately, Microsoft can't access the dump file or hasn't repro internally so we decided to disable the WGC fallback use in the OS other than Win11 now. Once the change (support WGC fallback) reaches to Microsoft Edge and it produce crash report, Edge team will take the dump file to the Windows OS API owner for Win10 level fix (or bring the Win11 fix to Win10). Bug: chromium:1312937 Change-Id: I5335e2c57076d4fab08e9c74ade599259cff10d7 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258821 Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Alexander Cooper <alcooper@chromium.org> Commit-Queue: Alexander Cooper <alcooper@chromium.org> Cr-Commit-Position: refs/heads/main@{#36558}
49 lines
1.9 KiB
C++
49 lines
1.9 KiB
C++
/*
|
|
* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
|
|
#include "modules/desktop_capture/desktop_capture_options.h"
|
|
#include "modules/desktop_capture/desktop_capturer.h"
|
|
#include "modules/desktop_capture/win/window_capturer_win_gdi.h"
|
|
|
|
#if defined(RTC_ENABLE_WIN_WGC)
|
|
#include "modules/desktop_capture/blank_detector_desktop_capturer_wrapper.h"
|
|
#include "modules/desktop_capture/fallback_desktop_capturer_wrapper.h"
|
|
#include "modules/desktop_capture/win/wgc_capturer_win.h"
|
|
#include "rtc_base/win/windows_version.h"
|
|
#endif // defined(RTC_ENABLE_WIN_WGC)
|
|
|
|
namespace webrtc {
|
|
|
|
// static
|
|
std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawWindowCapturer(
|
|
const DesktopCaptureOptions& options) {
|
|
std::unique_ptr<DesktopCapturer> capturer(
|
|
WindowCapturerWinGdi::CreateRawWindowCapturer(options));
|
|
#if defined(RTC_ENABLE_WIN_WGC)
|
|
if (options.allow_wgc_capturer_fallback() &&
|
|
rtc::rtc_win::GetVersion() >= rtc::rtc_win::Version::VERSION_WIN11) {
|
|
// BlankDectector capturer will send an error when it detects a failed
|
|
// GDI rendering, then Fallback capturer will try to capture it again with
|
|
// WGC.
|
|
capturer = std::make_unique<BlankDetectorDesktopCapturerWrapper>(
|
|
std::move(capturer), RgbaColor(0, 0, 0, 0),
|
|
/*check_per_capture*/ true);
|
|
|
|
capturer = std::make_unique<FallbackDesktopCapturerWrapper>(
|
|
std::move(capturer),
|
|
WgcCapturerWin::CreateRawWindowCapturer(
|
|
options, /*allow_delayed_capturable_check*/ true));
|
|
}
|
|
#endif // defined(RTC_ENABLE_WIN_WGC)
|
|
return capturer;
|
|
}
|
|
|
|
} // namespace webrtc
|