@@ -189,7 +189,7 @@ public static List<String> showAllCodecsInfo() {
189189 public static List <MediaCodecInfo > getAllCodecs (boolean filterBroken ) {
190190 List <MediaCodecInfo > mediaCodecInfoList = new ArrayList <>();
191191 if (Build .VERSION .SDK_INT >= 21 ) {
192- MediaCodecList mediaCodecList = new MediaCodecList (MediaCodecList .ALL_CODECS );
192+ MediaCodecList mediaCodecList = new MediaCodecList (MediaCodecList .REGULAR_CODECS );
193193 MediaCodecInfo [] mediaCodecInfos = mediaCodecList .getCodecInfos ();
194194 mediaCodecInfoList .addAll (Arrays .asList (mediaCodecInfos ));
195195 } else {
@@ -459,6 +459,8 @@ private static List<MediaCodecInfo> filterBrokenCodecs(List<MediaCodecInfo> code
459459 private static boolean isValid (String name ) {
460460 //This encoder is invalid and produce errors (Only found in AVD API 16)
461461 if (name .equalsIgnoreCase ("aacencoder" )) return false ;
462+ //Discard secure encoders. It is only used for DRM
463+ else if (name .toLowerCase ().contains (".secure" )) return false ;
462464 return true ;
463465 }
464466
@@ -475,8 +477,6 @@ private static CodecPriority checkCodecPriority(String name) {
475477 //maybe only broke on samsung with Android 12+ using YouTube and AWS MediaLive
476478 // but set as ultra low priority in all cases.
477479 if (name .equalsIgnoreCase ("c2.sec.aac.encoder" )) return CodecPriority .ULTRA_LOW ;
478- //not working in few devices but maybe usable in others.
479- else if (name .toLowerCase ().contains (".secure" )) return CodecPriority .ULTRA_LOW ;
480480 //broke on few devices using YouTube and AWS MediaLive
481481 else if (name .equalsIgnoreCase ("omx.google.aac.encoder" )) return CodecPriority .LOW ;
482482 else return CodecPriority .NORMAL ;
0 commit comments