Add environment variable override helper function

This allows FORCE_QT_GLES and SEPARATE_TEST_DECODER to override both true and false.
This commit is contained in:
Cameron Gutman
2025-12-27 15:33:13 -06:00
parent 21fb2832e1
commit 41ad3c0938
9 changed files with 68 additions and 60 deletions
@@ -1,4 +1,5 @@
#include "genhwaccel.h"
#include "utils.h"
GenericHwAccelRenderer::GenericHwAccelRenderer(AVHWDeviceType hwDeviceType)
: IFFmpegRenderer(RendererType::Unknown),
@@ -56,9 +57,9 @@ bool GenericHwAccelRenderer::isDirectRenderingSupported()
int GenericHwAccelRenderer::getDecoderCapabilities()
{
bool ok;
int caps = qEnvironmentVariableIntValue("GENHWACCEL_CAPS", &ok);
if (ok) {
int caps;
if (Utils::getEnvironmentVariableOverride("GENHWACCEL_CAPS", &caps)) {
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
"Using GENHWACCEL_CAPS for decoder capabilities: %x",
caps);