Correct media performance class check

Media performance class is 12+ even though it has values for 11+
This commit is contained in:
Cameron Gutman
2022-11-13 13:27:43 -06:00
parent 4a64967b1f
commit 37b9133eb6

View File

@@ -3,7 +3,6 @@ package com.limelight.binding.video;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.File; import java.io.File;
import java.io.FileReader; import java.io.FileReader;
import java.lang.reflect.Field;
import java.util.Collections; import java.util.Collections;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
@@ -715,19 +714,12 @@ public class MediaCodecHelper {
// HEVC decoder present is fast and modern enough for streaming. // 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. // [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.
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
// NB: We use reflection here because this field seems to be absent on Amazon Fire OS devices LimeLog.info("Media performance class: " + Build.VERSION.MEDIA_PERFORMANCE_CLASS);
try { if (Build.VERSION.MEDIA_PERFORMANCE_CLASS >= Build.VERSION_CODES.S) {
Field mediaClassField = Build.VERSION.class.getDeclaredField("MEDIA_PERFORMANCE_CLASS"); LimeLog.info("Allowing HEVC based on media performance class");
int mediaClass = mediaClassField.getInt(null);
if (mediaClass >= Build.VERSION_CODES.S) {
LimeLog.info("Allowing HEVC based on media performance class: " + mediaClass);
return true; 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 // If the decoder supports FEATURE_LowLatency, we will assume it is fast and modern enough