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!
This commit is contained in:
Cameron Gutman
2022-06-18 15:00:10 -05:00
parent a93422d3ed
commit ce850ac12f

View File

@@ -144,12 +144,16 @@ public class MediaCodecHelper {
// NVIDIA does partial HEVC acceleration on the Shield Tablet. I don't know // 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 // 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 // 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 // fully accelerated HEVC pipeline. AFAIK, the only K1 devices with this
// partially accelerated HEVC decoder is the Shield Tablet, so I'll // partially accelerated HEVC decoder are the Shield Tablet and Xiaomi MiPad,
// check for it here. Since there are 2 models of Shield Tablet (possibly // so I'll check for those here.
// more with LTE), I will also exclude pre-Oreo OSes since only Shield ATV //
// got an Oreo update. // In case there are some that I missed, I will also exclude pre-Oreo OSes since
if (!Build.DEVICE.equalsIgnoreCase("shieldtablet") && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { // 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"); whitelistedHevcDecoders.add("omx.nvidia");
} }