mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-17 14:11:33 +00:00
Add environment variable for overriding decoder capabilities
This commit is contained in:
@@ -70,7 +70,17 @@ void FFmpegVideoDecoder::setHdrMode(bool enabled)
|
|||||||
|
|
||||||
int FFmpegVideoDecoder::getDecoderCapabilities()
|
int FFmpegVideoDecoder::getDecoderCapabilities()
|
||||||
{
|
{
|
||||||
int capabilities = m_BackendRenderer->getDecoderCapabilities();
|
bool ok;
|
||||||
|
|
||||||
|
int capabilities = qEnvironmentVariableIntValue("DECODER_CAPS", &ok);
|
||||||
|
if (ok) {
|
||||||
|
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
|
"Using decoder capability override: 0x%x",
|
||||||
|
capabilities);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Start with the backend renderer's capabilities
|
||||||
|
capabilities = m_BackendRenderer->getDecoderCapabilities();
|
||||||
|
|
||||||
if (!isHardwareAccelerated()) {
|
if (!isHardwareAccelerated()) {
|
||||||
// Slice up to 4 times for parallel CPU decoding, once slice per core
|
// Slice up to 4 times for parallel CPU decoding, once slice per core
|
||||||
@@ -80,8 +90,11 @@ int FFmpegVideoDecoder::getDecoderCapabilities()
|
|||||||
slices);
|
slices);
|
||||||
capabilities |= CAPABILITY_SLICES_PER_FRAME(slices);
|
capabilities |= CAPABILITY_SLICES_PER_FRAME(slices);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// We use our own decoder thread with the "pull" model
|
// We use our own decoder thread with the "pull" model. This cannot
|
||||||
|
// be overridden using the by the user because it is critical to
|
||||||
|
// our operation.
|
||||||
capabilities |= CAPABILITY_PULL_RENDERER;
|
capabilities |= CAPABILITY_PULL_RENDERER;
|
||||||
|
|
||||||
return capabilities;
|
return capabilities;
|
||||||
|
|||||||
Reference in New Issue
Block a user