Allow HEVC decoders to satisfy hardware decoding check if H.264 is unavailable

This commit is contained in:
Cameron Gutman
2022-01-06 22:07:31 -06:00
parent 0d70bd9ac0
commit b2265080fd
2 changed files with 18 additions and 1 deletions

View File

@@ -412,7 +412,7 @@ ApplicationWindow {
ErrorMessageDialog {
id: noHwDecoderDialog
text: qsTr("No functioning hardware accelerated H.264 video decoder was detected by Moonlight. " +
text: qsTr("No functioning hardware accelerated video decoder was detected by Moonlight. " +
"Your streaming performance may be severely degraded in this configuration.")
helpText: qsTr("Click the Help button for more information on solving this problem.")
helpUrl: "https://github.com/moonlight-stream/moonlight-docs/wiki/Fixing-Hardware-Decoding-Problems"

View File

@@ -307,6 +307,23 @@ void Session::getDecoderInfo(SDL_Window* window,
maxResolution = decoder->getDecoderMaxResolution();
delete decoder;
// If we don't get back a hardware H.264 decoder, see if we have a hardware
// HEVC decoder. This can be the case on the Raspberry Pi with Full KMS
// when not running in X11. Everything since Maxwell in 2014 can encode HEVC,
// so we probably don't need to be concerned about a lack of fast H.264
// decoding enough to bug the user about it every launch.
if (!isHardwareAccelerated) {
if (chooseDecoder(StreamingPreferences::VDS_FORCE_HARDWARE,
window, VIDEO_FORMAT_H265, 1920, 1080, 60,
false, false, true, decoder)) {
isHardwareAccelerated = decoder->isHardwareAccelerated();
isFullScreenOnly = decoder->isAlwaysFullScreen();
maxResolution = decoder->getDecoderMaxResolution();
delete decoder;
}
}
}
bool Session::isHardwareDecodeAvailable(SDL_Window* window,