From aa8d8e93d2f771856fbb00dca0f80c4a638d3051 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Tue, 31 Dec 2019 12:59:20 -0600 Subject: [PATCH] Whitelist newer Bravia devices for HEVC to minimize crashes --- .../com/limelight/binding/video/MediaCodecHelper.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 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 45ade795..0fb20bce 100644 --- a/app/src/main/java/com/limelight/binding/video/MediaCodecHelper.java +++ b/app/src/main/java/com/limelight/binding/video/MediaCodecHelper.java @@ -138,14 +138,19 @@ public class MediaCodecHelper { // TODO: This needs a similar fixup to the Tegra 3 otherwise it buffers 16 frames } - // Sony ATVs have broken MediaTek codecs (decoder hangs after rendering the first frame). - // I know the Fire TV 2 and 3 works, so I'll just whitelist Amazon devices which seem - // to actually be tested. + // Older Sony ATVs (SVP-DTV15) have broken MediaTek codecs (decoder hangs after rendering the first frame). + // I know the Fire TV 2 and 3 works, so I'll whitelist Amazon devices which seem to actually be tested. if (Build.MANUFACTURER.equalsIgnoreCase("Amazon")) { whitelistedHevcDecoders.add("omx.mtk"); whitelistedHevcDecoders.add("omx.amlogic"); } + // Plot twist: On newer Sony devices (BRAVIA_ATV2, BRAVIA_ATV3_4K, BRAVIA_UR1_4K) the H.264 decoder crashes + // on several configurations (> 60 FPS and 1440p) that work with HEVC, so we'll whitelist those devices for HEVC. + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && Build.DEVICE.startsWith("BRAVIA_")) { + whitelistedHevcDecoders.add("omx.mtk"); + } + // These theoretically have good HEVC decoding capabilities (potentially better than // their AVC decoders), but haven't been tested enough //whitelistedHevcDecoders.add("omx.amlogic");