Display a friendly error when trying to stream over 4K with H.264

This commit is contained in:
Cameron Gutman 2020-04-04 12:47:44 -07:00
parent d36d5936da
commit c98ef6e8a9
2 changed files with 13 additions and 1 deletions

View file

@ -628,6 +628,18 @@ bool Session::validateLaunch(SDL_Window* testWindow)
emitLaunchWarning("An attached gamepad has no mapping and won't be usable. Visit the Moonlight help to resolve this.");
}
// NVENC will fail to initialize when using dimensions over 4096 and H.264.
if (m_StreamConfig.width > 4096 || m_StreamConfig.height > 4096) {
if (m_Computer->maxLumaPixelsHEVC == 0) {
emit displayLaunchError("Your host PC's GPU doesn't support streaming video resolutions over 4K.");
return false;
}
else if (!m_StreamConfig.supportsHevc) {
emit displayLaunchError("Video resolutions over 4K are only supported by the HEVC codec.");
return false;
}
}
if (m_Preferences->videoDecoderSelection == StreamingPreferences::VDS_FORCE_HARDWARE &&
!m_StreamConfig.enableHdr && // HEVC Main10 was already checked for hardware decode support above
!isHardwareDecodeAvailable(testWindow,

@ -1 +1 @@
Subproject commit c2471157c0e1ba841f8419e7009c8835fb2e6d45
Subproject commit 0cda408d3c152aa3dc14bd49bac633bff2c6e493