Set the vendor.qti-ext-dec-low-latency.enable Qualcomm vendor extension

This commit is contained in:
Cameron Gutman
2020-02-22 17:06:32 -08:00
parent 3011a5bad7
commit 81b6a8a311
2 changed files with 27 additions and 0 deletions
@@ -38,6 +38,7 @@ public class MediaCodecHelper {
private static final List<String> refFrameInvalidationHevcPrefixes;
private static final List<String> blacklisted49FpsDecoderPrefixes;
private static final List<String> blacklisted59FpsDecoderPrefixes;
private static final List<String> qualcommDecoderPrefixes;
// FIXME: Remove when Android R SDK is finalized
public static final String FEATURE_LowLatency = "low-latency";
@@ -193,6 +194,13 @@ public class MediaCodecHelper {
}
}
static {
qualcommDecoderPrefixes = new LinkedList<>();
qualcommDecoderPrefixes.add("omx.qcom");
qualcommDecoderPrefixes.add("c2.qti");
}
private static boolean isPowerVR(String glRenderer) {
return glRenderer.toLowerCase().contains("powervr");
}
@@ -376,6 +384,13 @@ public class MediaCodecHelper {
return false;
}
public static boolean decoderSupportsQcomVendorLowLatency(String decoderName) {
// MediaCodec vendor extension support was introduced in Android 8.0:
// https://cs.android.com/android/_/android/platform/frameworks/av/+/01c10f8cdcd58d1e7025f426a72e6e75ba5d7fc2
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.O &&
isDecoderInList(qualcommDecoderPrefixes, decoderName);
}
public static boolean decoderNeedsConstrainedHighProfile(String decoderName) {
return isDecoderInList(constrainedHighProfilePrefixes, decoderName);
}