From ef037e18d04456cec1f2713e1192e4a17a616469 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 17 Feb 2022 00:26:56 -0600 Subject: [PATCH] Add colorspace and color range override options --- app/streaming/session.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/app/streaming/session.cpp b/app/streaming/session.cpp index 074f0d61..42ffbfe7 100644 --- a/app/streaming/session.cpp +++ b/app/streaming/session.cpp @@ -400,7 +400,30 @@ bool Session::populateDecoderProperties(SDL_Window* window) m_VideoCallbacks.submitDecodeUnit = drSubmitDecodeUnit; } - m_StreamConfig.colorSpace = decoder->getDecoderColorspace(); + { + bool ok; + + m_StreamConfig.colorSpace = qEnvironmentVariableIntValue("COLOR_SPACE_OVERRIDE", &ok); + if (ok) { + SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, + "Using colorspace override: %d", + m_StreamConfig.colorSpace); + } + else { + m_StreamConfig.colorSpace = decoder->getDecoderColorspace(); + } + + m_StreamConfig.colorRange = qEnvironmentVariableIntValue("COLOR_RANGE_OVERRIDE", &ok); + if (ok) { + SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, + "Using color range override: %d", + m_StreamConfig.colorRange); + } + else { + // Limited is the default for GFE + m_StreamConfig.colorRange = COLOR_RANGE_LIMITED; + } + } if (decoder->isAlwaysFullScreen()) { m_IsFullScreen = true;