Allow software decoding on the emulator for testing

This commit is contained in:
Cameron Gutman 2017-06-08 22:21:51 -07:00
parent f5680b59a5
commit 8d05f044f5

View File

@ -64,9 +64,12 @@ public class MediaCodecHelper {
static { static {
blacklistedDecoderPrefixes = new LinkedList<>(); blacklistedDecoderPrefixes = new LinkedList<>();
// Software decoders that don't support H264 high profile // 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("omx.google");
blacklistedDecoderPrefixes.add("AVCDecoder"); blacklistedDecoderPrefixes.add("AVCDecoder");
}
// Without bitstream fixups, we perform horribly on NVIDIA's HEVC // Without bitstream fixups, we perform horribly on NVIDIA's HEVC
// decoder. While not strictly necessary, I'm going to fully blacklist this // decoder. While not strictly necessary, I'm going to fully blacklist this
@ -104,6 +107,11 @@ public class MediaCodecHelper {
static { static {
whitelistedHevcDecoders = new LinkedList<>(); 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 // Exynos seems to be the only HEVC decoder that works reliably
whitelistedHevcDecoders.add("omx.exynos"); whitelistedHevcDecoders.add("omx.exynos");