194 lines
7.2 KiB
Java
194 lines
7.2 KiB
Java
package com.baidu.cloud.media.player;
|
|
|
|
import android.media.MediaCodecInfo;
|
|
import android.os.Build;
|
|
import android.text.TextUtils;
|
|
import android.util.Log;
|
|
import com.ijm.dataencryption.de.DataDecryptTool;
|
|
import com.ubt.jimu.base.util.FileUtil;
|
|
import com.ubt.jimu.unity.bluetooth.UnityActivity;
|
|
import com.ubtrobot.jimu.robotapi.PeripheralType;
|
|
import java.util.Locale;
|
|
import java.util.Map;
|
|
import java.util.TreeMap;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class a {
|
|
private static Map<String, Integer> d;
|
|
public MediaCodecInfo a;
|
|
public int b = 0;
|
|
public String c;
|
|
|
|
public static a a(MediaCodecInfo mediaCodecInfo, String str) {
|
|
if (mediaCodecInfo == null || Build.VERSION.SDK_INT < 16) {
|
|
return null;
|
|
}
|
|
String name = mediaCodecInfo.getName();
|
|
if (TextUtils.isEmpty(name)) {
|
|
return null;
|
|
}
|
|
String lowerCase = name.toLowerCase(Locale.US);
|
|
int i = 600;
|
|
if (!lowerCase.startsWith("omx.")) {
|
|
i = 100;
|
|
} else if (lowerCase.startsWith("omx.pv") || lowerCase.startsWith("omx.google.") || lowerCase.startsWith("omx.ffmpeg.") || lowerCase.startsWith("omx.k3.ffmpeg.") || lowerCase.startsWith("omx.avcodec.")) {
|
|
i = 200;
|
|
} else {
|
|
if (!lowerCase.startsWith("omx.ittiam.")) {
|
|
if (!lowerCase.startsWith("omx.mtk.")) {
|
|
Integer num = a().get(lowerCase);
|
|
if (num != null) {
|
|
i = num.intValue();
|
|
} else {
|
|
try {
|
|
if (mediaCodecInfo.getCapabilitiesForType(str) != null) {
|
|
i = IMediaPlayer.MEDIA_INFO_VIDEO_TRACK_LAGGING;
|
|
}
|
|
} catch (Throwable unused) {
|
|
}
|
|
}
|
|
} else if (Build.VERSION.SDK_INT >= 18 && !lowerCase.endsWith("decoder.mpeg4")) {
|
|
i = 800;
|
|
}
|
|
}
|
|
i = 0;
|
|
}
|
|
a aVar = new a();
|
|
aVar.a = mediaCodecInfo;
|
|
aVar.b = i;
|
|
aVar.c = str;
|
|
return aVar;
|
|
}
|
|
|
|
public static String a(int i) {
|
|
return i != 1 ? i != 2 ? i != 4 ? i != 8 ? i != 16 ? i != 32 ? i != 64 ? "Unknown" : "High444" : "High422" : "High10" : "High" : "Extends" : "Main" : "Baseline";
|
|
}
|
|
|
|
public static String a(int i, int i2) {
|
|
return String.format(Locale.US, " %s Profile Level %s (%d,%d)", a(i), b(i2), Integer.valueOf(i), Integer.valueOf(i2));
|
|
}
|
|
|
|
private static synchronized Map<String, Integer> a() {
|
|
synchronized (a.class) {
|
|
if (d != null) {
|
|
return d;
|
|
}
|
|
d = new TreeMap(String.CASE_INSENSITIVE_ORDER);
|
|
d.put("OMX.Nvidia.h264.decode", 800);
|
|
d.put("OMX.Nvidia.h264.decode.secure", 300);
|
|
d.put("OMX.Intel.hw_vd.h264", Integer.valueOf(IMediaPlayer.MEDIA_INFO_NOT_SEEKABLE));
|
|
d.put("OMX.Intel.VideoDecoder.AVC", 800);
|
|
d.put("OMX.qcom.video.decoder.avc", 800);
|
|
d.put("OMX.ittiam.video.decoder.avc", 0);
|
|
d.put("OMX.SEC.avc.dec", 800);
|
|
d.put("OMX.SEC.AVC.Decoder", 799);
|
|
d.put("OMX.SEC.avcdec", 798);
|
|
d.put("OMX.SEC.avc.sw.dec", 200);
|
|
d.put("OMX.Exynos.avc.dec", 800);
|
|
d.put("OMX.Exynos.AVC.Decoder", 799);
|
|
d.put("OMX.k3.video.decoder.avc", 800);
|
|
d.put("OMX.IMG.MSVDX.Decoder.AVC", 800);
|
|
d.put("OMX.TI.DUCATI1.VIDEO.DECODER", 800);
|
|
d.put("OMX.rk.video_decoder.avc", 800);
|
|
d.put("OMX.amlogic.avc.decoder.awesome", 800);
|
|
d.put("OMX.MARVELL.VIDEO.HW.CODA7542DECODER", 800);
|
|
d.put("OMX.MARVELL.VIDEO.H264DECODER", 200);
|
|
d.remove("OMX.Action.Video.Decoder");
|
|
d.remove("OMX.allwinner.video.decoder.avc");
|
|
d.remove("OMX.BRCM.vc4.decoder.avc");
|
|
d.remove("OMX.brcm.video.h264.hw.decoder");
|
|
d.remove("OMX.brcm.video.h264.decoder");
|
|
d.remove("OMX.cosmo.video.decoder.avc");
|
|
d.remove("OMX.duos.h264.decoder");
|
|
d.remove("OMX.hantro.81x0.video.decoder");
|
|
d.remove("OMX.hantro.G1.video.decoder");
|
|
d.remove("OMX.hisi.video.decoder");
|
|
d.remove("OMX.LG.decoder.video.avc");
|
|
d.remove("OMX.MS.AVC.Decoder");
|
|
d.remove("OMX.RENESAS.VIDEO.DECODER.H264");
|
|
d.remove("OMX.RTK.video.decoder");
|
|
d.remove("OMX.sprd.h264.decoder");
|
|
d.remove("OMX.ST.VFM.H264Dec");
|
|
d.remove("OMX.vpu.video_decoder.avc");
|
|
d.remove("OMX.WMT.decoder.avc");
|
|
d.remove("OMX.bluestacks.hw.decoder");
|
|
d.put("OMX.google.h264.decoder", 200);
|
|
d.put("OMX.google.h264.lc.decoder", 200);
|
|
d.put("OMX.k3.ffmpeg.decoder", 200);
|
|
d.put("OMX.ffmpeg.video.decoder", 200);
|
|
d.put("OMX.sprd.soft.h264.decoder", 200);
|
|
return d;
|
|
}
|
|
}
|
|
|
|
public static String b(int i) {
|
|
if (i == 1) {
|
|
return "1";
|
|
}
|
|
if (i == 2) {
|
|
return "1b";
|
|
}
|
|
switch (i) {
|
|
case 4:
|
|
return "11";
|
|
case 8:
|
|
return "12";
|
|
case 16:
|
|
return "13";
|
|
case 32:
|
|
return "2";
|
|
case 64:
|
|
return "21";
|
|
case PeripheralType.SERVO /* 128 */:
|
|
return "22";
|
|
case DataDecryptTool.DECRYPT_ALL_FILE /* 256 */:
|
|
return "3";
|
|
case DataDecryptTool.DECRYPT_DB_FILE /* 512 */:
|
|
return "31";
|
|
case DataDecryptTool.DECRYPT_SP_FILE /* 1024 */:
|
|
return "32";
|
|
case 2048:
|
|
return "4";
|
|
case FileUtil.ZIP_BUFFER_SIZE /* 4096 */:
|
|
return "41";
|
|
case UnityActivity.BLOCKLY_TYPE_NONE /* 8192 */:
|
|
return "42";
|
|
case 16384:
|
|
return "5";
|
|
case 32768:
|
|
return "51";
|
|
case 65536:
|
|
return "52";
|
|
default:
|
|
return "0";
|
|
}
|
|
}
|
|
|
|
public void a(String str) {
|
|
int i;
|
|
int i2;
|
|
if (Build.VERSION.SDK_INT < 16) {
|
|
return;
|
|
}
|
|
try {
|
|
MediaCodecInfo.CodecCapabilities capabilitiesForType = this.a.getCapabilitiesForType(str);
|
|
if (capabilitiesForType == null || capabilitiesForType.profileLevels == null) {
|
|
i = 0;
|
|
i2 = 0;
|
|
} else {
|
|
i = 0;
|
|
i2 = 0;
|
|
for (MediaCodecInfo.CodecProfileLevel codecProfileLevel : capabilitiesForType.profileLevels) {
|
|
if (codecProfileLevel != null) {
|
|
i = Math.max(i, codecProfileLevel.profile);
|
|
i2 = Math.max(i2, codecProfileLevel.level);
|
|
}
|
|
}
|
|
}
|
|
Log.i("BDCloudMediaCodecInfo", String.format(Locale.US, "%s", a(i, i2)));
|
|
} catch (Throwable unused) {
|
|
Log.i("BDCloudMediaCodecInfo", "profile-level: exception");
|
|
}
|
|
}
|
|
}
|