mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-02-16 10:31:07 +00:00
Correct media performance class check
Media performance class is 12+ even though it has values for 11+
This commit is contained in:
@@ -3,7 +3,6 @@ package com.limelight.binding.video;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
@@ -715,19 +714,12 @@ public class MediaCodecHelper {
|
||||
// HEVC decoder present is fast and modern enough for streaming.
|
||||
//
|
||||
// [5.3/H-1-1] MUST NOT drop more than 2 frames in 10 seconds (i.e less than 0.333 percent frame drop) for a 1080p 60 fps video session under load.
|
||||
//
|
||||
// NB: We use reflection here because this field seems to be absent on Amazon Fire OS devices
|
||||
try {
|
||||
Field mediaClassField = Build.VERSION.class.getDeclaredField("MEDIA_PERFORMANCE_CLASS");
|
||||
int mediaClass = mediaClassField.getInt(null);
|
||||
if (mediaClass >= Build.VERSION_CODES.S) {
|
||||
LimeLog.info("Allowing HEVC based on media performance class: " + mediaClass);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||
LimeLog.info("Media performance class: " + Build.VERSION.MEDIA_PERFORMANCE_CLASS);
|
||||
if (Build.VERSION.MEDIA_PERFORMANCE_CLASS >= Build.VERSION_CODES.S) {
|
||||
LimeLog.info("Allowing HEVC based on media performance class");
|
||||
return true;
|
||||
}
|
||||
} catch (NoSuchFieldException e) {
|
||||
LimeLog.info("Build.VERSION.MEDIA_PERFORMANCE_CLASS not present");
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// If the decoder supports FEATURE_LowLatency, we will assume it is fast and modern enough
|
||||
|
||||
Reference in New Issue
Block a user