From 8d05f044f5d251354a51fec67cf7b4b7ec9ed38c Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 8 Jun 2017 22:21:51 -0700 Subject: [PATCH] Allow software decoding on the emulator for testing --- .../binding/video/MediaCodecHelper.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 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 bec3be96..e7c57f3c 100644 --- a/app/src/main/java/com/limelight/binding/video/MediaCodecHelper.java +++ b/app/src/main/java/com/limelight/binding/video/MediaCodecHelper.java @@ -63,10 +63,13 @@ public class MediaCodecHelper { static { blacklistedDecoderPrefixes = new LinkedList<>(); - - // Software decoders that don't support H264 high profile - blacklistedDecoderPrefixes.add("omx.google"); - blacklistedDecoderPrefixes.add("AVCDecoder"); + + // Blacklist software decoders that don't support H264 high profile, + // but exclude the official AOSP emulator from this restriction. + if (!Build.HARDWARE.equals("ranchu") || !Build.BRAND.equals("google")) { + blacklistedDecoderPrefixes.add("omx.google"); + blacklistedDecoderPrefixes.add("AVCDecoder"); + } // Without bitstream fixups, we perform horribly on NVIDIA's HEVC // decoder. While not strictly necessary, I'm going to fully blacklist this @@ -104,6 +107,11 @@ public class MediaCodecHelper { static { whitelistedHevcDecoders = new LinkedList<>(); + // Allow software HEVC decoding in the official AOSP emulator + if (Build.HARDWARE.equals("ranchu") && Build.BRAND.equals("google")) { + whitelistedHevcDecoders.add("omx.google"); + } + // Exynos seems to be the only HEVC decoder that works reliably whitelistedHevcDecoders.add("omx.exynos");