mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-04-05 23:46:04 +00:00
Update for Android 11
This commit is contained in:
@@ -318,8 +318,8 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer {
|
||||
videoFormat.setInteger(MediaFormat.KEY_MAX_HEIGHT, height);
|
||||
}
|
||||
|
||||
if (lowLatency) {
|
||||
videoFormat.setInteger(MediaCodecHelper.KEY_LOW_LATENCY, 1);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R && lowLatency) {
|
||||
videoFormat.setInteger(MediaFormat.KEY_LOW_LATENCY, 1);
|
||||
}
|
||||
else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
// Set the Qualcomm vendor low latency extension if the Android R option is unavailable
|
||||
|
||||
@@ -40,10 +40,6 @@ public class MediaCodecHelper {
|
||||
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";
|
||||
public static final String KEY_LOW_LATENCY = "low-latency";
|
||||
|
||||
private static boolean isLowEndSnapdragon = false;
|
||||
private static boolean initialized = false;
|
||||
|
||||
@@ -343,10 +339,9 @@ public class MediaCodecHelper {
|
||||
}
|
||||
|
||||
public static boolean decoderSupportsLowLatency(MediaCodecInfo decoderInfo, String mimeType) {
|
||||
// KitKat added CodecCapabilities.isFeatureSupported()
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
try {
|
||||
if (decoderInfo.getCapabilitiesForType(mimeType).isFeatureSupported(FEATURE_LowLatency)) {
|
||||
if (decoderInfo.getCapabilitiesForType(mimeType).isFeatureSupported(CodecCapabilities.FEATURE_LowLatency)) {
|
||||
LimeLog.info("Low latency decoding mode supported (FEATURE_LowLatency)");
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user