Add option to stream at device native resolution

Fixes #155
This commit is contained in:
Cameron Gutman
2020-12-23 16:17:06 -06:00
parent 7cc7953879
commit b392d7f8e3
6 changed files with 77 additions and 3 deletions

View File

@@ -110,8 +110,10 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer {
if (!MediaCodecHelper.decoderIsWhitelistedForHevc(decoderInfo.getName(), meteredNetwork)) {
LimeLog.info("Found HEVC decoder, but it's not whitelisted - "+decoderInfo.getName());
// HDR implies HEVC forced on, since HEVCMain10HDR10 is required for HDR
if (prefs.videoFormat == PreferenceConfiguration.FORCE_H265_ON || requestedHdr) {
// HDR implies HEVC forced on, since HEVCMain10HDR10 is required for HDR.
// > 4K streaming also requires HEVC, so force it on there too.
if (prefs.videoFormat == PreferenceConfiguration.FORCE_H265_ON || requestedHdr ||
prefs.width > 4096 || prefs.height > 4096) {
LimeLog.info("Forcing H265 enabled despite non-whitelisted decoder");
}
else {
@@ -250,6 +252,11 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer {
return -1;
}
if (width > 4096 || height > 4096) {
LimeLog.severe("> 4K streaming only supported on HEVC");
return -1;
}
// These fixups only apply to H264 decoders
needsSpsBitstreamFixup = MediaCodecHelper.decoderNeedsSpsBitstreamRestrictions(selectedDecoderName);
needsBaselineSpsHack = MediaCodecHelper.decoderNeedsBaselineSpsHack(selectedDecoderName);