From d2b3bc962f1089fe24026332b630d0d7d874bd64 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Tue, 20 Aug 2024 23:03:41 -0500 Subject: [PATCH] Probe for a HDR-compatible software renderer --- app/streaming/session.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/streaming/session.cpp b/app/streaming/session.cpp index 9a2b32eb..3e4ec712 100644 --- a/app/streaming/session.cpp +++ b/app/streaming/session.cpp @@ -402,9 +402,17 @@ void Session::getDecoderInfo(SDL_Window* window, delete decoder; } else { - // HDR can only be supported by a hardware codec that can handle 10-bit video. - // If we made it this far, we don't have one, so HDR will not be available. - isHdrSupported = false; + // If we found no hardware decoders with HDR, check for a renderer + // that supports HDR rendering with software decoded frames. + if (chooseDecoder(StreamingPreferences::VDS_FORCE_SOFTWARE, + window, VIDEO_FORMAT_H265_MAIN10, 1920, 1080, 60, + false, false, true, decoder) || + chooseDecoder(StreamingPreferences::VDS_FORCE_SOFTWARE, + window, VIDEO_FORMAT_AV1_MAIN10, 1920, 1080, 60, + false, false, true, decoder)) { + isHdrSupported = decoder->isHdrSupported(); + delete decoder; + } } // Try a regular hardware accelerated HEVC decoder now