mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-01-29 18:32:38 +00:00
Add warning when Desktop Duplication API masks protected content from capture
This commit is contained in:
parent
17124deb22
commit
33dafbc801
@ -109,6 +109,7 @@ namespace platf::dxgi {
|
||||
dup_t dup;
|
||||
bool has_frame {};
|
||||
bool use_dwmflush {};
|
||||
std::chrono::steady_clock::time_point last_protected_content_warning_time {};
|
||||
|
||||
capture_e
|
||||
next_frame(DXGI_OUTDUPL_FRAME_INFO &frame_info, std::chrono::milliseconds timeout, resource_t::pointer *res_p);
|
||||
|
@ -40,6 +40,14 @@ namespace platf::dxgi {
|
||||
|
||||
switch (status) {
|
||||
case S_OK:
|
||||
// ProtectedContentMaskedOut seems to semi-randomly be TRUE or FALSE even when protected content
|
||||
// is on screen the whole time, so we can't just print when it changes. Instead we'll keep track
|
||||
// of the last time we printed the warning and print another if we haven't printed one recently.
|
||||
if (frame_info.ProtectedContentMaskedOut && std::chrono::steady_clock::now() > last_protected_content_warning_time + 10s) {
|
||||
BOOST_LOG(warning) << "Windows is currently blocking DRM-protected content from capture. You may see black regions where this content would be."sv;
|
||||
last_protected_content_warning_time = std::chrono::steady_clock::now();
|
||||
}
|
||||
|
||||
has_frame = true;
|
||||
return capture_e::ok;
|
||||
case DXGI_ERROR_WAIT_TIMEOUT:
|
||||
|
Loading…
x
Reference in New Issue
Block a user