d3d11desktopdup: Support desktop switches
authorJakub Adam <jakub.adam@collabora.com>
Thu, 29 Apr 2021 20:10:15 +0000 (22:10 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Fri, 30 Apr 2021 04:47:36 +0000 (04:47 +0000)
commitfb8ed9e5d22e0867a361f385646db7220e265ee1
tree7765b2f11cfaa6179381e68debbd6ba7ede4f96d
parentaac012ce72e56ce5f6fdd95e73cb1861f198748f
d3d11desktopdup: Support desktop switches

Before creating output duplication interface, call SetThreadDesktop()
with HDESK of the current input desktop in case a desktop switch has
occurred.

This allows d3d11desktopdupsrc to capture Windows User Account Control
(UAC) prompts, which appear on a separate secure desktop. Otherwise
IDXGIOutput1::DuplicateOutput() will return E_ACCESSDENIED and the
element won't produce any frames as long as the UAC screen is active.

Note that in order to access secure desktop the application still has to
run at LOCAL_SYSTEM privileges. For GStreamer applications running with
regular user privileges this change has no effect.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2209>
sys/d3d11/gstd3d11desktopdup.cpp