0

Allow client to disable DirectX capturer

We've recently come across a problem on Win11 where certain video
cards are failing to capture in RDP sessions on Win11. The problem
is that they don't fail in a detectable way as the adapter output
looks like the same as a desktop where nothing is changing.

Since we can't detect this condition via a heuristic, I am adding a
session option which allows us to disable the DXGI capturer from
the client. This will allow affected users to disable the capturer
and then re-enable it once a fix is available.

Bug: 339754127
Change-Id: Idb18aefb62da914c8c1ce4d38d13d956135045e2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6065361
Auto-Submit: Joe Downing <joedow@chromium.org>
Commit-Queue: Gary Kacmarcik <garykac@chromium.org>
Reviewed-by: Gary Kacmarcik <garykac@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1391206}
This commit is contained in:
Joe Downing
2024-12-03 20:43:27 +00:00
committed by Chromium LUCI CQ
parent 1ecc8f7c08
commit 9ea6c71fd6
3 changed files with 24 additions and 2 deletions

@ -133,6 +133,14 @@ void DesktopEnvironmentOptions::ApplySessionOptions(
}
#endif // IS_MAC
#if BUILDFLAG(IS_WIN)
std::optional<bool> allow_dxgi_capturer =
options.GetBool("Allow-Dxgi-Capturer");
if (allow_dxgi_capturer.has_value()) {
desktop_capture_options_.set_allow_directx_capturer(*allow_dxgi_capturer);
}
#endif // IS_WIN
#if defined(WEBRTC_USE_PIPEWIRE)
desktop_capture_options_.set_allow_pipewire(true);
desktop_capture_options_.set_pipewire_use_damage_region(true);

@ -266,8 +266,14 @@ BasicDesktopEnvironment::BasicDesktopEnvironment(
desktop_capture_options().x_display()->IgnoreXServerGrabs();
}
#elif BUILDFLAG(IS_WIN)
options_.desktop_capture_options()->set_allow_directx_capturer(
IsD3DAvailable());
// Check whether D3D is available as long as the DirectX capturer wasn't
// explicitly disabled. This check is necessary because the network process
// runs in Session 0 and cannot check whether D3D is available or not so the
// default value is set to true but can be overridden by the client.
if (options_.desktop_capture_options()->allow_directx_capturer()) {
options_.desktop_capture_options()->set_allow_directx_capturer(
IsD3DAvailable());
}
#endif
}

@ -1847,6 +1847,14 @@ void HostProcess::StartHost() {
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
desktop_environment_options_.set_enable_remote_webauthn(is_corp_host_);
#endif
#if BUILDFLAG(IS_WIN)
// Set a default value for whether to allow the dxgi capturer. This value can
// be explicitly disallowed by the client when session options are applied.
// The desktop process will check whether DXGI is supported in the session
// it is capturing before attempting to use it.
desktop_environment_options_.desktop_capture_options()
->set_allow_directx_capturer(true);
#endif
host_ = std::make_unique<ChromotingHost>(
desktop_environment_factory_.get(), std::move(session_manager),