From ce850ac12ff02270b69e7937bfb8bcdc6dc80ed0 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 18 Jun 2022 15:00:10 -0500 Subject: [PATCH] Fix crash on Xiaomi MiPad running newer custom ROMs AVC Decoder: OMX.Nvidia.h264.decode HEVC Decoder: OMX.Nvidia.h265.decode AVC supported width range: [32, 3840] AVC achievable FPS range: [146.0, 149.0] HEVC supported width range: [32, 528] HEVC achievable FPS range: UNSUPPORTED! --- .../binding/video/MediaCodecHelper.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/limelight/binding/video/MediaCodecHelper.java b/app/src/main/java/com/limelight/binding/video/MediaCodecHelper.java index d455ed2e..24ef05b5 100644 --- a/app/src/main/java/com/limelight/binding/video/MediaCodecHelper.java +++ b/app/src/main/java/com/limelight/binding/video/MediaCodecHelper.java @@ -144,12 +144,16 @@ public class MediaCodecHelper { // NVIDIA does partial HEVC acceleration on the Shield Tablet. I don't know // whether the performance is good enough to use for streaming, but they're // using the same omx.nvidia.h265.decode name as the Shield TV which has a - // fully accelerated HEVC pipeline. AFAIK, the only K1 device with this - // partially accelerated HEVC decoder is the Shield Tablet, so I'll - // check for it here. Since there are 2 models of Shield Tablet (possibly - // more with LTE), I will also exclude pre-Oreo OSes since only Shield ATV - // got an Oreo update. - if (!Build.DEVICE.equalsIgnoreCase("shieldtablet") && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + // fully accelerated HEVC pipeline. AFAIK, the only K1 devices with this + // partially accelerated HEVC decoder are the Shield Tablet and Xiaomi MiPad, + // so I'll check for those here. + // + // In case there are some that I missed, I will also exclude pre-Oreo OSes since + // only Shield ATV got an Oreo update and any newer Tegra devices will not ship + // with an old OS like Nougat. + if (!Build.DEVICE.equalsIgnoreCase("shieldtablet") && + !Build.DEVICE.equalsIgnoreCase("mocha") && + Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { whitelistedHevcDecoders.add("omx.nvidia"); }