Here are the examples of the java api android.media.MediaCodecInfo taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
233 Examples
19
Source : IjkMediaCodecInfo.java
with MIT License
from zzh12138
with MIT License
from zzh12138
public clreplaced IjkMediaCodecInfo {
private final static String TAG = "IjkMediaCodecInfo";
public static final int RANK_MAX = 1000;
public static final int RANK_TESTED = 800;
public static final int RANK_ACCEPTABLE = 700;
public static final int RANK_LAST_CHANCE = 600;
public static final int RANK_SECURE = 300;
public static final int RANK_SOFTWARE = 200;
public static final int RANK_NON_STANDARD = 100;
public static final int RANK_NO_SENSE = 0;
public MediaCodecInfo mCodecInfo;
public int mRank = 0;
public String mMimeType;
private static Map<String, Integer> sKnownCodecList;
private static synchronized Map<String, Integer> getKnownCodecList() {
if (sKnownCodecList != null)
return sKnownCodecList;
sKnownCodecList = new TreeMap<String, Integer>(String.CASE_INSENSITIVE_ORDER);
// ----- Nvidia -----
// Tegra3
// Nexus 7 (2012)
// Tegra K1
// Nexus 9
sKnownCodecList.put("OMX.Nvidia.h264.decode", RANK_TESTED);
sKnownCodecList.put("OMX.Nvidia.h264.decode.secure", RANK_SECURE);
// ----- Intel -----
// Atom Z3735
// Teclast X98 Air
sKnownCodecList.put("OMX.Intel.hw_vd.h264", RANK_TESTED + 1);
// Atom Z2560
// Dell Venue 7 3730
sKnownCodecList.put("OMX.Intel.VideoDecoder.AVC", RANK_TESTED);
// ----- Qualcomm -----
// MSM8260
// Xiaomi MI 1S
sKnownCodecList.put("OMX.qcom.video.decoder.avc", RANK_TESTED);
sKnownCodecList.put("OMX.ittiam.video.decoder.avc", RANK_NO_SENSE);
// ----- Samsung -----
// Exynos 3110
// Nexus S
sKnownCodecList.put("OMX.SEC.avc.dec", RANK_TESTED);
sKnownCodecList.put("OMX.SEC.AVC.Decoder", RANK_TESTED - 1);
// OMX.SEC.avcdec doesn't reorder output pictures on GT-9100
sKnownCodecList.put("OMX.SEC.avcdec", RANK_TESTED - 2);
sKnownCodecList.put("OMX.SEC.avc.sw.dec", RANK_SOFTWARE);
// Exynos 5 ?
sKnownCodecList.put("OMX.Exynos.avc.dec", RANK_TESTED);
sKnownCodecList.put("OMX.Exynos.AVC.Decoder", RANK_TESTED - 1);
// ------ Huawei hisilicon ------
// Kirin 910, Mali 450 MP
// Huawei HONOR 3C (H30-L01)
sKnownCodecList.put("OMX.k3.video.decoder.avc", RANK_TESTED);
// Kirin 920, Mali T624
// Huawei HONOR 6
sKnownCodecList.put("OMX.IMG.MSVDX.Decoder.AVC", RANK_TESTED);
// ----- TI -----
// TI OMAP4460
// Galaxy Nexus
sKnownCodecList.put("OMX.TI.DUCATI1.VIDEO.DECODER", RANK_TESTED);
// ------ RockChip ------
// Youku TVBox
sKnownCodecList.put("OMX.rk.video_decoder.avc", RANK_TESTED);
// ------ AMLogic -----
// MiBox1, 1s, 2
sKnownCodecList.put("OMX.amlogic.avc.decoder.awesome", RANK_TESTED);
// ------ Marvell ------
// Lenovo A788t
sKnownCodecList.put("OMX.MARVELL.VIDEO.HW.CODA7542DECODER", RANK_TESTED);
sKnownCodecList.put("OMX.MARVELL.VIDEO.H264DECODER", RANK_SOFTWARE);
// ----- TODO: need test -----
sKnownCodecList.remove("OMX.Action.Video.Decoder");
sKnownCodecList.remove("OMX.allwinner.video.decoder.avc");
sKnownCodecList.remove("OMX.BRCM.vc4.decoder.avc");
sKnownCodecList.remove("OMX.brcm.video.h264.hw.decoder");
sKnownCodecList.remove("OMX.brcm.video.h264.decoder");
sKnownCodecList.remove("OMX.cosmo.video.decoder.avc");
sKnownCodecList.remove("OMX.duos.h264.decoder");
sKnownCodecList.remove("OMX.hantro.81x0.video.decoder");
sKnownCodecList.remove("OMX.hantro.G1.video.decoder");
sKnownCodecList.remove("OMX.hisi.video.decoder");
sKnownCodecList.remove("OMX.LG.decoder.video.avc");
sKnownCodecList.remove("OMX.MS.AVC.Decoder");
sKnownCodecList.remove("OMX.RENESAS.VIDEO.DECODER.H264");
sKnownCodecList.remove("OMX.RTK.video.decoder");
sKnownCodecList.remove("OMX.sprd.h264.decoder");
sKnownCodecList.remove("OMX.ST.VFM.H264Dec");
sKnownCodecList.remove("OMX.vpu.video_decoder.avc");
sKnownCodecList.remove("OMX.WMT.decoder.avc");
// Really ?
sKnownCodecList.remove("OMX.bluestacks.hw.decoder");
// ---------------
// Useless codec
// ----- google -----
sKnownCodecList.put("OMX.google.h264.decoder", RANK_SOFTWARE);
sKnownCodecList.put("OMX.google.h264.lc.decoder", RANK_SOFTWARE);
// ----- huawei k920 -----
sKnownCodecList.put("OMX.k3.ffmpeg.decoder", RANK_SOFTWARE);
sKnownCodecList.put("OMX.ffmpeg.video.decoder", RANK_SOFTWARE);
// ----- unknown -----
sKnownCodecList.put("OMX.sprd.soft.h264.decoder", RANK_SOFTWARE);
return sKnownCodecList;
}
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public static IjkMediaCodecInfo setupCandidate(MediaCodecInfo codecInfo, String mimeType) {
if (codecInfo == null || Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN)
return null;
String name = codecInfo.getName();
if (TextUtils.isEmpty(name))
return null;
name = name.toLowerCase(Locale.US);
int rank = RANK_NO_SENSE;
if (!name.startsWith("omx.")) {
rank = RANK_NON_STANDARD;
} else if (name.startsWith("omx.pv")) {
rank = RANK_SOFTWARE;
} else if (name.startsWith("omx.google.")) {
rank = RANK_SOFTWARE;
} else if (name.startsWith("omx.ffmpeg.")) {
rank = RANK_SOFTWARE;
} else if (name.startsWith("omx.k3.ffmpeg.")) {
rank = RANK_SOFTWARE;
} else if (name.startsWith("omx.avcodec.")) {
rank = RANK_SOFTWARE;
} else if (name.startsWith("omx.ittiam.")) {
// unknown codec in qualcomm SoC
rank = RANK_NO_SENSE;
} else if (name.startsWith("omx.mtk.")) {
// 1. MTK only works on 4.3 and above
// 2. MTK works on MIUI 6 (4.2.1)
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2)
rank = RANK_NO_SENSE;
else
rank = RANK_TESTED;
} else {
Integer knownRank = getKnownCodecList().get(name);
if (knownRank != null) {
rank = knownRank;
} else {
try {
CodecCapabilities cap = codecInfo.getCapabilitiesForType(mimeType);
if (cap != null)
rank = RANK_ACCEPTABLE;
else
rank = RANK_LAST_CHANCE;
} catch (Throwable e) {
rank = RANK_LAST_CHANCE;
}
}
}
IjkMediaCodecInfo candidate = new IjkMediaCodecInfo();
candidate.mCodecInfo = codecInfo;
candidate.mRank = rank;
candidate.mMimeType = mimeType;
return candidate;
}
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public void dumpProfileLevels(String mimeType) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN)
return;
try {
CodecCapabilities caps = mCodecInfo.getCapabilitiesForType(mimeType);
int maxProfile = 0;
int maxLevel = 0;
if (caps != null) {
if (caps.profileLevels != null) {
for (CodecProfileLevel profileLevel : caps.profileLevels) {
if (profileLevel == null)
continue;
maxProfile = Math.max(maxProfile, profileLevel.profile);
maxLevel = Math.max(maxLevel, profileLevel.level);
}
}
}
Log.i(TAG, String.format(Locale.US, "%s", getProfileLevelName(maxProfile, maxLevel)));
} catch (Throwable e) {
Log.i(TAG, "profile-level: exception");
}
}
public static String getProfileLevelName(int profile, int level) {
return String.format(Locale.US, " %s Profile Level %s (%d,%d)", getProfileName(profile), getLevelName(level), profile, level);
}
public static String getProfileName(int profile) {
switch(profile) {
case CodecProfileLevel.AVCProfileBaseline:
return "Baseline";
case CodecProfileLevel.AVCProfileMain:
return "Main";
case CodecProfileLevel.AVCProfileExtended:
return "Extends";
case CodecProfileLevel.AVCProfileHigh:
return "High";
case CodecProfileLevel.AVCProfileHigh10:
return "High10";
case CodecProfileLevel.AVCProfileHigh422:
return "High422";
case CodecProfileLevel.AVCProfileHigh444:
return "High444";
default:
return "Unknown";
}
}
public static String getLevelName(int level) {
switch(level) {
case CodecProfileLevel.AVCLevel1:
return "1";
case CodecProfileLevel.AVCLevel1b:
return "1b";
case CodecProfileLevel.AVCLevel11:
return "11";
case CodecProfileLevel.AVCLevel12:
return "12";
case CodecProfileLevel.AVCLevel13:
return "13";
case CodecProfileLevel.AVCLevel2:
return "2";
case CodecProfileLevel.AVCLevel21:
return "21";
case CodecProfileLevel.AVCLevel22:
return "22";
case CodecProfileLevel.AVCLevel3:
return "3";
case CodecProfileLevel.AVCLevel31:
return "31";
case CodecProfileLevel.AVCLevel32:
return "32";
case CodecProfileLevel.AVCLevel4:
return "4";
case CodecProfileLevel.AVCLevel41:
return "41";
case CodecProfileLevel.AVCLevel42:
return "42";
case CodecProfileLevel.AVCLevel5:
return "5";
case CodecProfileLevel.AVCLevel51:
return "51";
case // CodecProfileLevel.AVCLevel52:
65536:
return "52";
default:
return "0";
}
}
}
19
Source : H264EncodeConsumer.java
with Apache License 2.0
from z-jc
with Apache License 2.0
from z-jc
/**
* select color format available on specific codec and we can use.
*
* @return 0 if no colorFormat is matched
*/
protected static final int selectColorFormat(final MediaCodecInfo codecInfo, final String mimeType) {
int result = 0;
final MediaCodecInfo.CodecCapabilities caps;
try {
Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
caps = codecInfo.getCapabilitiesForType(mimeType);
} finally {
Thread.currentThread().setPriority(Thread.NORM_PRIORITY);
}
int colorFormat;
for (int i = 0; i < caps.colorFormats.length; i++) {
colorFormat = caps.colorFormats[i];
if (isRecognizedViewoFormat(colorFormat)) {
if (result == 0)
result = colorFormat;
break;
}
}
if (result == 0)
Log.e(TAG, "couldn't find a good color format for " + codecInfo.getName() + " / " + mimeType);
return result;
}
19
Source : SVideoUtil.java
with Apache License 2.0
from yellowcath
with Apache License 2.0
from yellowcath
public static void checkColorFormat(MediaCodecInfo codecInfo) {
try {
mSupportColorFormat = VideoEncoderFromBuffer.selectColorFormat(codecInfo, VideoEncoderFromBuffer.MIME_TYPE);
} catch (Exception e) {
RL.e(e);
}
}
19
Source : SVideoUtil.java
with Apache License 2.0
from yellowcath
with Apache License 2.0
from yellowcath
/**
* 是否支持MP4硬编码
*
* @return
*/
public static boolean supportAvcEncode() {
MediaCodecInfo codecInfo = VideoEncoderFromBuffer.selectCodec(VideoEncoderFromBuffer.MIME_TYPE);
if (codecInfo == null) {
String err = Build.MODEL + " api" + Build.VERSION.SDK_INT + " 不支持 " + VideoEncoderFromBuffer.MIME_TYPE + " 硬编码,改用软编码";
RL.e(err);
RL.e(new NotSupportAvcThrowable(err));
return false;
} else {
checkColorFormat(codecInfo);
}
return true;
}
19
Source : EncodeDecode.java
with Apache License 2.0
from xiaoyifan6
with Apache License 2.0
from xiaoyifan6
/**
* Returns a color format that is supported by the codec and by this test
* code. If no match is found, this throws a test failure -- the set of
* formats known to the test should be expanded for new platforms.
*/
private static int selectColorFormat(MediaCodecInfo codecInfo, String mimeType) {
MediaCodecInfo.CodecCapabilities capabilities = codecInfo.getCapabilitiesForType(mimeType);
for (int i = 0; i < capabilities.colorFormats.length; i++) {
int colorFormat = capabilities.colorFormats[i];
if (isRecognizedFormat(colorFormat)) {
return colorFormat;
}
}
// not reached
return 0;
}
19
Source : FimiMediaCodecInfo.java
with MIT License
from wladimir-computin
with MIT License
from wladimir-computin
public clreplaced FimiMediaCodecInfo {
public static int RANK_ACCEPTABLE = 700;
public static int RANK_LAST_CHANCE = ScribeConfig.DEFAULT_SEND_INTERVAL_SECONDS;
public static int RANK_MAX = 1000;
public static int RANK_NON_STANDARD = 100;
public static int RANK_NO_SENSE = 0;
public static int RANK_SECURE = GenericDraweeHierarchyBuilder.DEFAULT_FADE_DURATION;
public static int RANK_SOFTWARE = 200;
public static int RANK_TESTED = 800;
private static final String TAG = "FimiMediaCodecInfo";
private static Map<String, Integer> sKnownCodecList;
public MediaCodecInfo mCodecInfo;
public String mMimeType;
public int mRank = 0;
private static synchronized Map<String, Integer> getKnownCodecList() {
Map<String, Integer> map;
synchronized (FimiMediaCodecInfo.clreplaced) {
if (sKnownCodecList != null) {
map = sKnownCodecList;
} else {
sKnownCodecList = new TreeMap(String.CASE_INSENSITIVE_ORDER);
sKnownCodecList.put("OMX.Nvidia.h264.decode", Integer.valueOf(RANK_TESTED));
sKnownCodecList.put("OMX.Nvidia.h264.decode.secure", Integer.valueOf(RANK_SECURE));
sKnownCodecList.put("OMX.Intel.hw_vd.h264", Integer.valueOf(RANK_TESTED + 1));
sKnownCodecList.put("OMX.Intel.VideoDecoder.AVC", Integer.valueOf(RANK_TESTED));
sKnownCodecList.put("OMX.qcom.video.decoder.avc", Integer.valueOf(RANK_TESTED));
sKnownCodecList.put("OMX.ittiam.video.decoder.avc", Integer.valueOf(RANK_NO_SENSE));
sKnownCodecList.put("OMX.SEC.avc.dec", Integer.valueOf(RANK_TESTED));
sKnownCodecList.put("OMX.SEC.AVC.Decoder", Integer.valueOf(RANK_TESTED - 1));
sKnownCodecList.put("OMX.SEC.avcdec", Integer.valueOf(RANK_TESTED - 2));
sKnownCodecList.put("OMX.SEC.avc.sw.dec", Integer.valueOf(RANK_SOFTWARE));
sKnownCodecList.put("OMX.Exynos.avc.dec", Integer.valueOf(RANK_TESTED));
sKnownCodecList.put("OMX.Exynos.AVC.Decoder", Integer.valueOf(RANK_TESTED - 1));
sKnownCodecList.put("OMX.k3.video.decoder.avc", Integer.valueOf(RANK_TESTED));
sKnownCodecList.put("OMX.IMG.MSVDX.Decoder.AVC", Integer.valueOf(RANK_TESTED));
sKnownCodecList.put("OMX.TI.DUCATI1.VIDEO.DECODER", Integer.valueOf(RANK_TESTED));
sKnownCodecList.put("OMX.rk.video_decoder.avc", Integer.valueOf(RANK_TESTED));
sKnownCodecList.put("OMX.amlogic.avc.decoder.awesome", Integer.valueOf(RANK_TESTED));
sKnownCodecList.put("OMX.MARVELL.VIDEO.HW.CODA7542DECODER", Integer.valueOf(RANK_TESTED));
sKnownCodecList.put("OMX.MARVELL.VIDEO.H264DECODER", Integer.valueOf(RANK_SOFTWARE));
sKnownCodecList.remove("OMX.BRCM.vc4.decoder.avc");
sKnownCodecList.remove("OMX.brcm.video.h264.hw.decoder");
sKnownCodecList.remove("OMX.brcm.video.h264.decoder");
sKnownCodecList.remove("OMX.ST.VFM.H264Dec");
sKnownCodecList.remove("OMX.allwinner.video.decoder.avc");
sKnownCodecList.remove("OMX.MS.AVC.Decoder");
sKnownCodecList.remove("OMX.hantro.81x0.video.decoder");
sKnownCodecList.remove("OMX.hisi.video.decoder");
sKnownCodecList.remove("OMX.cosmo.video.decoder.avc");
sKnownCodecList.remove("OMX.duos.h264.decoder");
sKnownCodecList.remove("OMX.bluestacks.hw.decoder");
sKnownCodecList.put("OMX.google.h264.decoder", Integer.valueOf(RANK_SOFTWARE));
sKnownCodecList.put("OMX.google.h264.lc.decoder", Integer.valueOf(RANK_SOFTWARE));
sKnownCodecList.put("OMX.k3.ffmpeg.decoder", Integer.valueOf(RANK_SOFTWARE));
sKnownCodecList.put("OMX.ffmpeg.video.decoder", Integer.valueOf(RANK_SOFTWARE));
map = sKnownCodecList;
}
}
return map;
}
@TargetApi(16)
public static FimiMediaCodecInfo setupCandidate(MediaCodecInfo codecInfo, String mimeType) {
if (codecInfo == null || VERSION.SDK_INT < 16) {
return null;
}
String name = codecInfo.getName();
if (TextUtils.isEmpty(name)) {
return null;
}
name = name.toLowerCase(Locale.US);
int rank = RANK_NO_SENSE;
if (!name.startsWith("omx.")) {
rank = RANK_NON_STANDARD;
} else if (name.startsWith("omx.pv")) {
rank = RANK_SOFTWARE;
} else if (name.startsWith("omx.google.")) {
rank = RANK_SOFTWARE;
} else if (name.startsWith("omx.ffmpeg.")) {
rank = RANK_SOFTWARE;
} else if (name.startsWith("omx.k3.ffmpeg.")) {
rank = RANK_SOFTWARE;
} else if (name.startsWith("omx.avcodec.")) {
rank = RANK_SOFTWARE;
} else if (name.startsWith("omx.ittiam.")) {
rank = RANK_NO_SENSE;
} else if (!name.startsWith("omx.mtk.")) {
Integer knownRank = (Integer) getKnownCodecList().get(name);
if (knownRank != null) {
rank = knownRank.intValue();
} else {
try {
if (codecInfo.getCapabilitiesForType(mimeType) != null) {
rank = RANK_ACCEPTABLE;
} else {
rank = RANK_LAST_CHANCE;
}
} catch (Throwable th) {
rank = RANK_LAST_CHANCE;
}
}
} else if (VERSION.SDK_INT < 18) {
rank = RANK_NO_SENSE;
} else {
rank = RANK_TESTED;
}
FimiMediaCodecInfo candidate = new FimiMediaCodecInfo();
candidate.mCodecInfo = codecInfo;
candidate.mRank = rank;
candidate.mMimeType = mimeType;
return candidate;
}
@TargetApi(16)
public void dumpProfileLevels(String mimeType) {
if (VERSION.SDK_INT >= 16) {
try {
CodecCapabilities caps = this.mCodecInfo.getCapabilitiesForType(mimeType);
int maxProfile = 0;
int maxLevel = 0;
if (!(caps == null || caps.profileLevels == null)) {
for (CodecProfileLevel profileLevel : caps.profileLevels) {
if (profileLevel != null) {
maxProfile = Math.max(maxProfile, profileLevel.profile);
maxLevel = Math.max(maxLevel, profileLevel.level);
}
}
}
Log.i(TAG, String.format(Locale.US, "%s", new Object[] { getProfileLevelName(maxProfile, maxLevel) }));
} catch (Throwable th) {
Log.i(TAG, "profile-level: exception");
}
}
}
public static String getProfileLevelName(int profile, int level) {
return String.format(Locale.US, " %s Profile Level %s (%d,%d)", new Object[] { getProfileName(profile), getLevelName(level), Integer.valueOf(profile), Integer.valueOf(level) });
}
public static String getProfileName(int profile) {
switch(profile) {
case 1:
return "Baseline";
case 2:
return "Main";
case 4:
return "Extends";
case 8:
return "High";
case 16:
return "High10";
case 32:
return "High422";
case 64:
return "High444";
default:
return replacedyticsEvents.PARAMETER_DIALOG_OUTCOME_VALUE_UNKNOWN;
}
}
public static String getLevelName(int level) {
switch(level) {
case 1:
return "1";
case 2:
return "1b";
case 4:
return "11";
case 8:
return "12";
case 16:
return "13";
case 32:
return "2";
case 64:
return "21";
case 128:
return "22";
case 256:
return ThirdPartyConstants.LOGIN_CHANNEL_TW;
case 512:
return ANSIConstants.RED_FG;
case 1024:
return ANSIConstants.GREEN_FG;
case 2048:
return "4";
case 4096:
return "41";
case 8192:
return "42";
case 16384:
return "5";
case 32768:
return "51";
case 65536:
return "52";
default:
return "0";
}
}
}
19
Source : VideoTranscoder.java
with GNU Affero General Public License v3.0
from threema-ch
with GNU Affero General Public License v3.0
from threema-ch
private void createAudioEncoder() throws IOException {
MediaCodecInfo codecInfo = selectCodec(Defaults.OUTPUT_AUDIO_MIME_TYPE);
mAudioEncoder = MediaCodec.createByCodecName(codecInfo.getName());
mAudioEncoder.configure(mOutputAudioFormat, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);
mAudioEncoder.start();
}
19
Source : IjkMediaCodecInfo.java
with Apache License 2.0
from smartyuge
with Apache License 2.0
from smartyuge
public clreplaced IjkMediaCodecInfo {
private final static String TAG = "IjkMediaCodecInfo";
public static int RANK_MAX = 1000;
public static int RANK_TESTED = 800;
public static int RANK_ACCEPTABLE = 700;
public static int RANK_LAST_CHANCE = 600;
public static int RANK_SECURE = 300;
public static int RANK_SOFTWARE = 200;
public static int RANK_NON_STANDARD = 100;
public static int RANK_NO_SENSE = 0;
public MediaCodecInfo mCodecInfo;
public int mRank = 0;
public String mMimeType;
private static Map<String, Integer> sKnownCodecList;
private static synchronized Map<String, Integer> getKnownCodecList() {
if (sKnownCodecList != null)
return sKnownCodecList;
sKnownCodecList = new TreeMap<String, Integer>(String.CASE_INSENSITIVE_ORDER);
// ----- Nvidia -----
// Tegra3
// Nexus 7 (2012)
// Tegra K1
// Nexus 9
sKnownCodecList.put("OMX.Nvidia.h264.decode", RANK_TESTED);
sKnownCodecList.put("OMX.Nvidia.h264.decode.secure", RANK_SECURE);
// ----- Intel -----
// Atom Z3735
// Teclast X98 Air
sKnownCodecList.put("OMX.Intel.hw_vd.h264", RANK_TESTED + 1);
// Atom Z2560
// Dell Venue 7 3730
sKnownCodecList.put("OMX.Intel.VideoDecoder.AVC", RANK_TESTED);
// ----- Qualcomm -----
// MSM8260
// Xiaomi MI 1S
sKnownCodecList.put("OMX.qcom.video.decoder.avc", RANK_TESTED);
sKnownCodecList.put("OMX.ittiam.video.decoder.avc", RANK_NO_SENSE);
// ----- Samsung -----
// Exynos 3110
// Nexus S
sKnownCodecList.put("OMX.SEC.avc.dec", RANK_TESTED);
sKnownCodecList.put("OMX.SEC.AVC.Decoder", RANK_TESTED - 1);
// OMX.SEC.avcdec doesn't reorder output pictures on GT-9100
sKnownCodecList.put("OMX.SEC.avcdec", RANK_TESTED - 2);
sKnownCodecList.put("OMX.SEC.avc.sw.dec", RANK_SOFTWARE);
// Exynos 5 ?
sKnownCodecList.put("OMX.Exynos.avc.dec", RANK_TESTED);
sKnownCodecList.put("OMX.Exynos.AVC.Decoder", RANK_TESTED - 1);
// ------ Huawei hisilicon ------
// Kirin 910, Mali 450 MP
// Huawei HONOR 3C (H30-L01)
sKnownCodecList.put("OMX.k3.video.decoder.avc", RANK_TESTED);
// Kirin 920, Mali T624
// Huawei HONOR 6
sKnownCodecList.put("OMX.IMG.MSVDX.Decoder.AVC", RANK_TESTED);
// ----- TI -----
// TI OMAP4460
// Galaxy Nexus
sKnownCodecList.put("OMX.TI.DUCATI1.VIDEO.DECODER", RANK_TESTED);
// ------ RockChip ------
// Youku TVBox
sKnownCodecList.put("OMX.rk.video_decoder.avc", RANK_TESTED);
// ------ AMLogic -----
// MiBox1, 1s, 2
sKnownCodecList.put("OMX.amlogic.avc.decoder.awesome", RANK_TESTED);
// ------ Marvell ------
// Lenovo A788t
sKnownCodecList.put("OMX.MARVELL.VIDEO.HW.CODA7542DECODER", RANK_TESTED);
sKnownCodecList.put("OMX.MARVELL.VIDEO.H264DECODER", RANK_SOFTWARE);
// ----- TODO: need test -----
sKnownCodecList.remove("OMX.Action.Video.Decoder");
sKnownCodecList.remove("OMX.allwinner.video.decoder.avc");
sKnownCodecList.remove("OMX.BRCM.vc4.decoder.avc");
sKnownCodecList.remove("OMX.brcm.video.h264.hw.decoder");
sKnownCodecList.remove("OMX.brcm.video.h264.decoder");
sKnownCodecList.remove("OMX.cosmo.video.decoder.avc");
sKnownCodecList.remove("OMX.duos.h264.decoder");
sKnownCodecList.remove("OMX.hantro.81x0.video.decoder");
sKnownCodecList.remove("OMX.hantro.G1.video.decoder");
sKnownCodecList.remove("OMX.hisi.video.decoder");
sKnownCodecList.remove("OMX.LG.decoder.video.avc");
sKnownCodecList.remove("OMX.MS.AVC.Decoder");
sKnownCodecList.remove("OMX.RENESAS.VIDEO.DECODER.H264");
sKnownCodecList.remove("OMX.RTK.video.decoder");
sKnownCodecList.remove("OMX.sprd.h264.decoder");
sKnownCodecList.remove("OMX.ST.VFM.H264Dec");
sKnownCodecList.remove("OMX.vpu.video_decoder.avc");
sKnownCodecList.remove("OMX.WMT.decoder.avc");
// Really ?
sKnownCodecList.remove("OMX.bluestacks.hw.decoder");
// ---------------
// Useless codec
// ----- google -----
sKnownCodecList.put("OMX.google.h264.decoder", RANK_SOFTWARE);
sKnownCodecList.put("OMX.google.h264.lc.decoder", RANK_SOFTWARE);
// ----- huawei k920 -----
sKnownCodecList.put("OMX.k3.ffmpeg.decoder", RANK_SOFTWARE);
sKnownCodecList.put("OMX.ffmpeg.video.decoder", RANK_SOFTWARE);
// ----- unknown -----
sKnownCodecList.put("OMX.sprd.soft.h264.decoder", RANK_SOFTWARE);
return sKnownCodecList;
}
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public static IjkMediaCodecInfo setupCandidate(MediaCodecInfo codecInfo, String mimeType) {
if (codecInfo == null || Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN)
return null;
String name = codecInfo.getName();
if (TextUtils.isEmpty(name))
return null;
name = name.toLowerCase(Locale.US);
int rank = RANK_NO_SENSE;
if (!name.startsWith("omx.")) {
rank = RANK_NON_STANDARD;
} else if (name.startsWith("omx.pv")) {
rank = RANK_SOFTWARE;
} else if (name.startsWith("omx.google.")) {
rank = RANK_SOFTWARE;
} else if (name.startsWith("omx.ffmpeg.")) {
rank = RANK_SOFTWARE;
} else if (name.startsWith("omx.k3.ffmpeg.")) {
rank = RANK_SOFTWARE;
} else if (name.startsWith("omx.avcodec.")) {
rank = RANK_SOFTWARE;
} else if (name.startsWith("omx.ittiam.")) {
// unknown codec in qualcomm SoC
rank = RANK_NO_SENSE;
} else if (name.startsWith("omx.mtk.")) {
// 1. MTK only works on 4.3 and above
// 2. MTK works on MIUI 6 (4.2.1)
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2)
rank = RANK_NO_SENSE;
else
rank = RANK_TESTED;
} else {
Integer knownRank = getKnownCodecList().get(name);
if (knownRank != null) {
rank = knownRank;
} else {
try {
CodecCapabilities cap = codecInfo.getCapabilitiesForType(mimeType);
if (cap != null)
rank = RANK_ACCEPTABLE;
else
rank = RANK_LAST_CHANCE;
} catch (Throwable e) {
rank = RANK_LAST_CHANCE;
}
}
}
IjkMediaCodecInfo candidate = new IjkMediaCodecInfo();
candidate.mCodecInfo = codecInfo;
candidate.mRank = rank;
candidate.mMimeType = mimeType;
return candidate;
}
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public void dumpProfileLevels(String mimeType) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN)
return;
try {
CodecCapabilities caps = mCodecInfo.getCapabilitiesForType(mimeType);
int maxProfile = 0;
int maxLevel = 0;
if (caps != null) {
if (caps.profileLevels != null) {
for (CodecProfileLevel profileLevel : caps.profileLevels) {
if (profileLevel == null)
continue;
maxProfile = Math.max(maxProfile, profileLevel.profile);
maxLevel = Math.max(maxLevel, profileLevel.level);
}
}
}
Log.i(TAG, String.format(Locale.US, "%s", getProfileLevelName(maxProfile, maxLevel)));
} catch (Throwable e) {
Log.i(TAG, "profile-level: exception");
}
}
public static String getProfileLevelName(int profile, int level) {
return String.format(Locale.US, " %s Profile Level %s (%d,%d)", getProfileName(profile), getLevelName(level), profile, level);
}
public static String getProfileName(int profile) {
switch(profile) {
case CodecProfileLevel.AVCProfileBaseline:
return "Baseline";
case CodecProfileLevel.AVCProfileMain:
return "Main";
case CodecProfileLevel.AVCProfileExtended:
return "Extends";
case CodecProfileLevel.AVCProfileHigh:
return "High";
case CodecProfileLevel.AVCProfileHigh10:
return "High10";
case CodecProfileLevel.AVCProfileHigh422:
return "High422";
case CodecProfileLevel.AVCProfileHigh444:
return "High444";
default:
return "Unknown";
}
}
public static String getLevelName(int level) {
switch(level) {
case CodecProfileLevel.AVCLevel1:
return "1";
case CodecProfileLevel.AVCLevel1b:
return "1b";
case CodecProfileLevel.AVCLevel11:
return "11";
case CodecProfileLevel.AVCLevel12:
return "12";
case CodecProfileLevel.AVCLevel13:
return "13";
case CodecProfileLevel.AVCLevel2:
return "2";
case CodecProfileLevel.AVCLevel21:
return "21";
case CodecProfileLevel.AVCLevel22:
return "22";
case CodecProfileLevel.AVCLevel3:
return "3";
case CodecProfileLevel.AVCLevel31:
return "31";
case CodecProfileLevel.AVCLevel32:
return "32";
case CodecProfileLevel.AVCLevel4:
return "4";
case CodecProfileLevel.AVCLevel41:
return "41";
case CodecProfileLevel.AVCLevel42:
return "42";
case CodecProfileLevel.AVCLevel5:
return "5";
case CodecProfileLevel.AVCLevel51:
return "51";
case // CodecProfileLevel.AVCLevel52:
65536:
return "52";
default:
return "0";
}
}
}
19
Source : VideoEncoder.java
with Apache License 2.0
from ricohapi
with Apache License 2.0
from ricohapi
private FormatVideoEncoder chooseColorDynamically(MediaCodecInfo mediaCodecInfo) {
for (int color : mediaCodecInfo.getCapabilitiesForType(mime).colorFormats) {
if (color == FormatVideoEncoder.YUV420PLANAR.getFormatCodec()) {
return FormatVideoEncoder.YUV420PLANAR;
} else if (color == FormatVideoEncoder.YUV420SEMIPLANAR.getFormatCodec()) {
return FormatVideoEncoder.YUV420SEMIPLANAR;
} else if (color == FormatVideoEncoder.YUV420PACKEDPLANAR.getFormatCodec()) {
return FormatVideoEncoder.YUV420PACKEDPLANAR;
}
}
return null;
}
19
Source : MediaVideoEncoder.java
with Apache License 2.0
from pili-engineering
with Apache License 2.0
from pili-engineering
/**
* select color format available on specific codec and we can use.
*
* @return 0 if no colorFormat is matched
*/
protected static final int selectColorFormat(final MediaCodecInfo codecInfo, final String mimeType) {
if (DEBUG)
Log.i(TAG, "selectColorFormat: " + mimeType);
int result = 0;
final MediaCodecInfo.CodecCapabilities caps;
try {
Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
caps = codecInfo.getCapabilitiesForType(mimeType);
} finally {
Thread.currentThread().setPriority(Thread.NORM_PRIORITY);
}
int colorFormat;
for (int i = 0; i < caps.colorFormats.length; i++) {
colorFormat = caps.colorFormats[i];
if (isRecognizedViewoFormat(colorFormat)) {
if (result == 0)
result = colorFormat;
break;
}
}
if (result == 0)
Log.e(TAG, "couldn't find a good color format for " + codecInfo.getName() + " / " + mimeType);
return result;
}
19
Source : BitmapToVideoEncoder.java
with GNU Lesser General Public License v2.1
from Peter-St
with GNU Lesser General Public License v2.1
from Peter-St
private static int selectColorFormat(MediaCodecInfo codecInfo, String mimeType) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
MediaCodecInfo.CodecCapabilities capabilities = codecInfo.getCapabilitiesForType(mimeType);
for (int i = 0; i < capabilities.colorFormats.length; i++) {
int colorFormat = capabilities.colorFormats[i];
if (isRecognizedFormat(colorFormat)) {
return colorFormat;
}
}
// not reached
return 0;
} else
return 0;
}
19
Source : VideoEncoder.java
with Apache License 2.0
from pedroSG94
with Apache License 2.0
from pedroSG94
private FormatVideoEncoder chooseColorDynamically(MediaCodecInfo mediaCodecInfo) {
for (int color : mediaCodecInfo.getCapabilitiesForType(type).colorFormats) {
if (color == FormatVideoEncoder.YUV420PLANAR.getFormatCodec()) {
return FormatVideoEncoder.YUV420PLANAR;
} else if (color == FormatVideoEncoder.YUV420SEMIPLANAR.getFormatCodec()) {
return FormatVideoEncoder.YUV420SEMIPLANAR;
}
}
return null;
}
19
Source : MediaCodecUtils.java
with MIT License
from pcgpcgpcg
with MIT License
from pcgpcgpcg
static boolean codecSupportsType(MediaCodecInfo info, VideoCodecType type) {
for (String mimeType : info.getSupportedTypes()) {
if (type.mimeType().equals(mimeType)) {
return true;
}
}
return false;
}
19
Source : HardwareVideoEncoderFactory.java
with MIT License
from pcgpcgpcg
with MIT License
from pcgpcgpcg
// Returns true if the given MediaCodecInfo indicates a supported encoder for the given type.
private boolean isSupportedCodec(MediaCodecInfo info, VideoCodecType type) {
if (!MediaCodecUtils.codecSupportsType(info, type)) {
return false;
}
// Check for a supported color format.
if (MediaCodecUtils.selectColorFormat(MediaCodecUtils.ENCODER_COLOR_FORMATS, info.getCapabilitiesForType(type.mimeType())) == null) {
return false;
}
return isHardwareSupportedInCurrentSdk(info, type);
}
19
Source : HardwareVideoEncoderFactory.java
with MIT License
from pcgpcgpcg
with MIT License
from pcgpcgpcg
private boolean isH264HighProfileSupported(MediaCodecInfo info) {
return enableH264HighProfile && Build.VERSION.SDK_INT > Build.VERSION_CODES.M && info.getName().startsWith(EXYNOS_PREFIX);
}
19
Source : HardwareVideoEncoderFactory.java
with MIT License
from pcgpcgpcg
with MIT License
from pcgpcgpcg
// Returns true if the given MediaCodecInfo indicates a hardware module that is supported on the
// current SDK.
private boolean isHardwareSupportedInCurrentSdk(MediaCodecInfo info, VideoCodecType type) {
switch(type) {
case VP8:
return isHardwareSupportedInCurrentSdkVp8(info);
case VP9:
return isHardwareSupportedInCurrentSdkVp9(info);
case H264:
return isHardwareSupportedInCurrentSdkH264(info);
}
return false;
}
19
Source : HardwareVideoDecoderFactory.java
with MIT License
from pcgpcgpcg
with MIT License
from pcgpcgpcg
// Returns true if the given MediaCodecInfo indicates a supported encoder for the given type.
private boolean isSupportedCodec(MediaCodecInfo info, VideoCodecType type) {
if (!MediaCodecUtils.codecSupportsType(info, type)) {
return false;
}
// Check for a supported color format.
if (MediaCodecUtils.selectColorFormat(MediaCodecUtils.DECODER_COLOR_FORMATS, info.getCapabilitiesForType(type.mimeType())) == null) {
return false;
}
return isHardwareSupported(info, type);
}
19
Source : MediaCodecVideoDecoderFactory.java
with GNU General Public License v3.0
from NekoX-Dev
with GNU General Public License v3.0
from NekoX-Dev
private boolean isCodecAllowed(MediaCodecInfo info) {
if (codecAllowedPredicate == null) {
return true;
}
return codecAllowedPredicate.test(info);
}
19
Source : MediaCodecVideoDecoderFactory.java
with GNU General Public License v3.0
from NekoX-Dev
with GNU General Public License v3.0
from NekoX-Dev
@Nullable
private MediaCodecInfo findCodecForType(VideoCodecMimeType type) {
// HW decoding is not supported on builds before KITKAT.
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
return null;
}
ArrayList<MediaCodecInfo> infos = MediaCodecUtils.getSortedCodecsList();
int codecCount = infos.size();
for (int i = 0; i < codecCount; ++i) {
MediaCodecInfo info = infos.get(i);
if (info == null || info.isEncoder()) {
continue;
}
if (isSupportedCodec(info, type)) {
return info;
}
}
// No support for this type.
return null;
}
19
Source : MediaCodecUtils.java
with GNU General Public License v3.0
from NekoX-Dev
with GNU General Public License v3.0
from NekoX-Dev
static boolean isHardwareAccelerated(MediaCodecInfo info) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
return isHardwareAcceleratedQOrHigher(info);
}
return !isSoftwareOnly(info);
}
19
Source : HardwareVideoEncoderFactory.java
with GNU General Public License v3.0
from NekoX-Dev
with GNU General Public License v3.0
from NekoX-Dev
// Returns true if the given MediaCodecInfo indicates a supported encoder for the given type.
private boolean isSupportedCodec(MediaCodecInfo info, VideoCodecMimeType type) {
if (!MediaCodecUtils.codecSupportsType(info, type)) {
return false;
}
// Check for a supported color format.
if (MediaCodecUtils.selectColorFormat(MediaCodecUtils.ENCODER_COLOR_FORMATS, info.getCapabilitiesForType(type.mimeType())) == null) {
return false;
}
return isHardwareSupportedInCurrentSdk(info, type) && isMediaCodecAllowed(info);
}
19
Source : HardwareVideoEncoderFactory.java
with GNU General Public License v3.0
from NekoX-Dev
with GNU General Public License v3.0
from NekoX-Dev
private boolean isMediaCodecAllowed(MediaCodecInfo info) {
if (codecAllowedPredicate == null) {
return true;
}
return codecAllowedPredicate.test(info);
}
19
Source : TrackTranscoderException.java
with BSD 2-Clause "Simplified" License
from linkedin
with BSD 2-Clause "Simplified" License
from linkedin
@NonNull
private String convertMediaCodecInfoToString(@NonNull MediaCodecInfo mediaCodecInfo) {
return "MediaCodecInfo: " + mediaCodecInfo.getName() + ',' + mediaCodecInfo.isEncoder() + ',' + Arrays.asList(mediaCodecInfo.getSupportedTypes()).toString();
}
19
Source : TrackTranscoderException.java
with BSD 2-Clause "Simplified" License
from linkedin
with BSD 2-Clause "Simplified" License
from linkedin
@NonNull
private String convertMediaCodecListToString(@NonNull MediaCodecList mediaCodecList) {
StringBuilder builder = new StringBuilder();
try {
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
// TODO filter supported codecs for the mime type
for (MediaCodecInfo mediaCodecInfo : mediaCodecList.getCodecInfos()) {
if (mediaCodecInfo != null) {
builder.append('\n').append(convertMediaCodecInfoToString(mediaCodecInfo));
}
}
} else {
Log.e(TAG, "Failed to retrieve media codec info below API level 21.");
}
} catch (IllegalStateException e) {
Log.e(TAG, "Failed to retrieve media codec info.", e);
}
return builder.toString();
}
19
Source : Utils.java
with Apache License 2.0
from lingochamp
with Apache License 2.0
from lingochamp
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
private static boolean checkIsSpecifyCodec(String mimeType, MediaCodecInfo mediaCodecInfo) {
String[] types = mediaCodecInfo.getSupportedTypes();
for (String type : types) {
if (type.equalsIgnoreCase(mimeType)) {
return true;
}
}
return false;
}
19
Source : IjkMediaCodecInfo.java
with MIT License
from jianliaoim
with MIT License
from jianliaoim
public clreplaced IjkMediaCodecInfo {
private final static String TAG = "IjkMediaCodecInfo";
public static int RANK_MAX = 1000;
public static final int RANK_TESTED = 800;
public static final int RANK_ACCEPTABLE = 700;
public static final int RANK_LAST_CHANCE = 600;
public static final int RANK_SECURE = 300;
public static final int RANK_SOFTWARE = 200;
public static final int RANK_NON_STANDARD = 100;
public static final int RANK_NO_SENSE = 0;
public MediaCodecInfo mCodecInfo;
public int mRank = 0;
public String mMimeType;
private static Map<String, Integer> sKnownCodecList;
private static synchronized Map<String, Integer> getKnownCodecList() {
if (sKnownCodecList != null)
return sKnownCodecList;
sKnownCodecList = new TreeMap<String, Integer>(String.CASE_INSENSITIVE_ORDER);
// ----- Nvidia -----
// Tegra3
// Nexus 7 (2012)
// Tegra K1
// Nexus 9
sKnownCodecList.put("OMX.Nvidia.h264.decode", RANK_TESTED);
sKnownCodecList.put("OMX.Nvidia.h264.decode.secure", RANK_SECURE);
// ----- Intel -----
// Atom Z3735
// Teclast X98 Air
sKnownCodecList.put("OMX.Intel.hw_vd.h264", RANK_TESTED + 1);
// Atom Z2560
// Dell Venue 7 3730
sKnownCodecList.put("OMX.Intel.VideoDecoder.AVC", RANK_TESTED);
// ----- Qualcomm -----
// MSM8260
// Xiaomi MI 1S
sKnownCodecList.put("OMX.qcom.video.decoder.avc", RANK_TESTED);
sKnownCodecList.put("OMX.ittiam.video.decoder.avc", RANK_NO_SENSE);
// ----- Samsung -----
// Exynos 3110
// Nexus S
sKnownCodecList.put("OMX.SEC.avc.dec", RANK_TESTED);
sKnownCodecList.put("OMX.SEC.AVC.Decoder", RANK_TESTED - 1);
// OMX.SEC.avcdec doesn't reorder output pictures on GT-9100
sKnownCodecList.put("OMX.SEC.avcdec", RANK_TESTED - 2);
sKnownCodecList.put("OMX.SEC.avc.sw.dec", RANK_SOFTWARE);
// Exynos 5 ?
sKnownCodecList.put("OMX.Exynos.avc.dec", RANK_TESTED);
sKnownCodecList.put("OMX.Exynos.AVC.Decoder", RANK_TESTED - 1);
// ------ Huawei hisilicon ------
// Kirin 910, Mali 450 MP
// Huawei HONOR 3C (H30-L01)
sKnownCodecList.put("OMX.k3.video.decoder.avc", RANK_TESTED);
// Kirin 920, Mali T624
// Huawei HONOR 6
sKnownCodecList.put("OMX.IMG.MSVDX.Decoder.AVC", RANK_TESTED);
// ----- TI -----
// TI OMAP4460
// Galaxy Nexus
sKnownCodecList.put("OMX.TI.DUCATI1.VIDEO.DECODER", RANK_TESTED);
// ------ RockChip ------
// Youku TVBox
sKnownCodecList.put("OMX.rk.video_decoder.avc", RANK_TESTED);
// ------ AMLogic -----
// MiBox1, 1s, 2
sKnownCodecList.put("OMX.amlogic.avc.decoder.awesome", RANK_TESTED);
// ------ Marvell ------
// Lenovo A788t
sKnownCodecList.put("OMX.MARVELL.VIDEO.HW.CODA7542DECODER", RANK_TESTED);
sKnownCodecList.put("OMX.MARVELL.VIDEO.H264DECODER", RANK_SOFTWARE);
// ----- TODO: need test -----
sKnownCodecList.remove("OMX.Action.Video.Decoder");
sKnownCodecList.remove("OMX.allwinner.video.decoder.avc");
sKnownCodecList.remove("OMX.BRCM.vc4.decoder.avc");
sKnownCodecList.remove("OMX.brcm.video.h264.hw.decoder");
sKnownCodecList.remove("OMX.brcm.video.h264.decoder");
sKnownCodecList.remove("OMX.cosmo.video.decoder.avc");
sKnownCodecList.remove("OMX.duos.h264.decoder");
sKnownCodecList.remove("OMX.hantro.81x0.video.decoder");
sKnownCodecList.remove("OMX.hantro.G1.video.decoder");
sKnownCodecList.remove("OMX.hisi.video.decoder");
sKnownCodecList.remove("OMX.LG.decoder.video.avc");
sKnownCodecList.remove("OMX.MS.AVC.Decoder");
sKnownCodecList.remove("OMX.RENESAS.VIDEO.DECODER.H264");
sKnownCodecList.remove("OMX.RTK.video.decoder");
sKnownCodecList.remove("OMX.sprd.h264.decoder");
sKnownCodecList.remove("OMX.ST.VFM.H264Dec");
sKnownCodecList.remove("OMX.vpu.video_decoder.avc");
sKnownCodecList.remove("OMX.WMT.decoder.avc");
// Really ?
sKnownCodecList.remove("OMX.bluestacks.hw.decoder");
// ---------------
// Useless codec
// ----- google -----
sKnownCodecList.put("OMX.google.h264.decoder", RANK_SOFTWARE);
sKnownCodecList.put("OMX.google.h264.lc.decoder", RANK_SOFTWARE);
// ----- huawei k920 -----
sKnownCodecList.put("OMX.k3.ffmpeg.decoder", RANK_SOFTWARE);
sKnownCodecList.put("OMX.ffmpeg.video.decoder", RANK_SOFTWARE);
// ----- unknown -----
sKnownCodecList.put("OMX.sprd.soft.h264.decoder", RANK_SOFTWARE);
return sKnownCodecList;
}
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public static IjkMediaCodecInfo setupCandidate(MediaCodecInfo codecInfo, String mimeType) {
if (codecInfo == null || Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN)
return null;
String name = codecInfo.getName();
if (TextUtils.isEmpty(name))
return null;
name = name.toLowerCase(Locale.US);
int rank = RANK_NO_SENSE;
if (!name.startsWith("omx.")) {
rank = RANK_NON_STANDARD;
} else if (name.startsWith("omx.pv")) {
rank = RANK_SOFTWARE;
} else if (name.startsWith("omx.google.")) {
rank = RANK_SOFTWARE;
} else if (name.startsWith("omx.ffmpeg.")) {
rank = RANK_SOFTWARE;
} else if (name.startsWith("omx.k3.ffmpeg.")) {
rank = RANK_SOFTWARE;
} else if (name.startsWith("omx.avcodec.")) {
rank = RANK_SOFTWARE;
} else if (name.startsWith("omx.ittiam.")) {
// unknown codec in qualcomm SoC
rank = RANK_NO_SENSE;
} else if (name.startsWith("omx.mtk.")) {
// 1. MTK only works on 4.3 and above
// 2. MTK works on MIUI 6 (4.2.1)
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2)
rank = RANK_NO_SENSE;
else
rank = RANK_TESTED;
} else {
Integer knownRank = getKnownCodecList().get(name);
if (knownRank != null) {
rank = knownRank;
} else {
try {
CodecCapabilities cap = codecInfo.getCapabilitiesForType(mimeType);
if (cap != null)
rank = RANK_ACCEPTABLE;
else
rank = RANK_LAST_CHANCE;
} catch (Throwable e) {
rank = RANK_LAST_CHANCE;
}
}
}
IjkMediaCodecInfo candidate = new IjkMediaCodecInfo();
candidate.mCodecInfo = codecInfo;
candidate.mRank = rank;
candidate.mMimeType = mimeType;
return candidate;
}
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public void dumpProfileLevels(String mimeType) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN)
return;
try {
CodecCapabilities caps = mCodecInfo.getCapabilitiesForType(mimeType);
int maxProfile = 0;
int maxLevel = 0;
if (caps != null) {
if (caps.profileLevels != null) {
for (CodecProfileLevel profileLevel : caps.profileLevels) {
if (profileLevel == null)
continue;
maxProfile = Math.max(maxProfile, profileLevel.profile);
maxLevel = Math.max(maxLevel, profileLevel.level);
}
}
}
Log.i(TAG, String.format(Locale.US, "%s", getProfileLevelName(maxProfile, maxLevel)));
} catch (Throwable e) {
Log.i(TAG, "profile-level: exception");
}
}
public static String getProfileLevelName(int profile, int level) {
return String.format(Locale.US, " %s Profile Level %s (%d,%d)", getProfileName(profile), getLevelName(level), profile, level);
}
public static String getProfileName(int profile) {
switch(profile) {
case CodecProfileLevel.AVCProfileBaseline:
return "Baseline";
case CodecProfileLevel.AVCProfileMain:
return "Main";
case CodecProfileLevel.AVCProfileExtended:
return "Extends";
case CodecProfileLevel.AVCProfileHigh:
return "High";
case CodecProfileLevel.AVCProfileHigh10:
return "High10";
case CodecProfileLevel.AVCProfileHigh422:
return "High422";
case CodecProfileLevel.AVCProfileHigh444:
return "High444";
default:
return "Unknown";
}
}
public static String getLevelName(int level) {
switch(level) {
case CodecProfileLevel.AVCLevel1:
return "1";
case CodecProfileLevel.AVCLevel1b:
return "1b";
case CodecProfileLevel.AVCLevel11:
return "11";
case CodecProfileLevel.AVCLevel12:
return "12";
case CodecProfileLevel.AVCLevel13:
return "13";
case CodecProfileLevel.AVCLevel2:
return "2";
case CodecProfileLevel.AVCLevel21:
return "21";
case CodecProfileLevel.AVCLevel22:
return "22";
case CodecProfileLevel.AVCLevel3:
return "3";
case CodecProfileLevel.AVCLevel31:
return "31";
case CodecProfileLevel.AVCLevel32:
return "32";
case CodecProfileLevel.AVCLevel4:
return "4";
case CodecProfileLevel.AVCLevel41:
return "41";
case CodecProfileLevel.AVCLevel42:
return "42";
case CodecProfileLevel.AVCLevel5:
return "5";
case CodecProfileLevel.AVCLevel51:
return "51";
case // CodecProfileLevel.AVCLevel52:
65536:
return "52";
default:
return "0";
}
}
}
19
Source : MediaCodecCapabilitiesTest.java
with GNU General Public License v2.0
from jellyfin
with GNU General Public License v2.0
from jellyfin
public clreplaced MediaCodecCapabilitiesTest {
private static final String TAG = "MediaCodecCapabilitiesTest";
private static final int PLAY_TIME_MS = 30000;
// 1 sec
private static final int TIMEOUT_US = 1000000;
// 10 seconds between I-frames
private static final int IFRAME_INTERVAL = 10;
private final MediaCodecList mRegularCodecs = new MediaCodecList(MediaCodecList.REGULAR_CODECS);
private final MediaCodecList mAllCodecs = new MediaCodecList(MediaCodecList.ALL_CODECS);
private final MediaCodecInfo[] mRegularInfos = mRegularCodecs.getCodecInfos();
private final MediaCodecInfo[] mAllInfos = mAllCodecs.getCodecInfos();
public boolean supportsHevc() {
return MediaUtils.checkDecoder(MIMETYPE_VIDEO_HEVC);
}
public boolean supportsHevcMain10() {
return hasDecoder(MIMETYPE_VIDEO_HEVC, HEVCProfileMain10, HEVCMainTierLevel5);
}
private boolean checkDecoder(String mime, int profile, int level) {
if (!hasDecoder(mime, profile, level)) {
Timber.i("no %s decoder for profile %d and level %d", mime, profile, level);
return false;
}
return true;
}
private boolean hasDecoder(String mime, int profile, int level) {
return supports(mime, false, /* isEncoder */
profile, level);
}
private boolean supports(String mime, boolean isEncoder, int profile, int level) {
MediaCodecList mcl = new MediaCodecList(MediaCodecList.REGULAR_CODECS);
for (MediaCodecInfo info : mcl.getCodecInfos()) {
if (isEncoder != info.isEncoder()) {
continue;
}
try {
MediaCodecInfo.CodecCapabilities caps = info.getCapabilitiesForType(mime);
for (MediaCodecInfo.CodecProfileLevel pl : caps.profileLevels) {
if (pl.profile != profile) {
continue;
}
// H.263 levels are not completely ordered:
// Level45 support only implies Level10 support
if (mime.equalsIgnoreCase(MIMETYPE_VIDEO_H263)) {
if (pl.level != level && pl.level == H263Level45 && level > H263Level10) {
continue;
}
}
if (pl.level >= level) {
return true;
}
}
} catch (IllegalArgumentException e) {
Timber.w(e);
}
}
return false;
}
}
19
Source : Api16Builder.java
with GNU General Public License v2.0
from jellyfin
with GNU General Public License v2.0
from jellyfin
protected void processCodecProfile(MediaCodecInfo codecInfo, String type, MediaCodecInfo.CodecCapabilities codecCapabilities, CodecProfile profile) {
AddProfileLevels(codecCapabilities, profile);
}
19
Source : Api16Builder.java
with GNU General Public License v2.0
from jellyfin
with GNU General Public License v2.0
from jellyfin
protected void ProcessMediaCodecInfoType(MediaCodecInfo codecInfo, String type, MediaCodecInfo.CodecCapabilities codecCapabilities, ArrayList<DirectPlayProfile> directPlayProfiles, ArrayList<CodecProfile> codecProfiles) {
addDirectPlayProfile(directPlayProfiles, type);
ArrayList<CodecProfile> newCodecProfiles = getCodecProfiles(type, codecCapabilities);
for (CodecProfile cp : newCodecProfiles) {
if (!containsCodecProfile(codecProfiles, cp)) {
codecProfiles.add(cp);
processCodecProfile(codecInfo, type, codecCapabilities, cp);
}
}
}
19
Source : Api16Builder.java
with GNU General Public License v2.0
from jellyfin
with GNU General Public License v2.0
from jellyfin
protected void ProcessMediaCodecInfo(MediaCodecInfo codecInfo, ArrayList<DirectPlayProfile> directPlayProfiles, ArrayList<CodecProfile> codecProfiles) {
for (String type : codecInfo.getSupportedTypes()) {
try {
final MediaCodecInfo.CodecCapabilities codecCapabilities = codecInfo.getCapabilitiesForType(type);
ProcessMediaCodecInfoType(codecInfo, type, codecCapabilities, directPlayProfiles, codecProfiles);
} catch (IllegalArgumentException ex) {
Timber.e("IllegalArgumentException thrown by codecInfo.getCapabilitiesForType(type). type: %s", type);
}
}
}
19
Source : Api16Builder.java
with GNU General Public License v2.0
from jellyfin
with GNU General Public License v2.0
from jellyfin
public void buildProfiles(DeviceProfile profile) {
ArrayList<DirectPlayProfile> directPlayProfiles = new ArrayList<>();
ArrayList<CodecProfile> codecProfiles = new ArrayList<>();
int numCodecs = MediaCodecList.getCodecCount();
for (int i = 0; i < numCodecs; i++) {
MediaCodecInfo codecInfo = MediaCodecList.getCodecInfoAt(i);
if (codecInfo.isEncoder()) {
continue;
}
ProcessMediaCodecInfo(codecInfo, directPlayProfiles, codecProfiles);
}
profile.setDirectPlayProfiles(directPlayProfiles.toArray(new DirectPlayProfile[directPlayProfiles.size()]));
profile.setCodecProfiles(codecProfiles.toArray(new CodecProfile[codecProfiles.size()]));
}
19
Source : Utils.java
with Apache License 2.0
from HelloHuDi
with Apache License 2.0
from HelloHuDi
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
private static String[] findAllCodecName(boolean isVideo) {
MediaCodecInfo[] infos = isVideo ? findAllVideoEncoder() : findAllAudioEncoder();
String[] names = new String[infos.length];
for (int i = 0; i < infos.length; i++) {
names[i] = infos[i].getName();
}
return names;
}
19
Source : Utils.java
with Apache License 2.0
from HelloHuDi
with Apache License 2.0
from HelloHuDi
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
private static MediaCodecInfo.CodecCapabilities findProfileLevel(boolean isVideo, String codecName) {
MediaCodecInfo codec = isVideo ? matchVideoCodecInfo(codecName) : matchAudioCodecInfo(codecName);
return codec.getCapabilitiesForType(isVideo ? MediaFormat.MIMETYPE_VIDEO_AVC : MediaFormat.MIMETYPE_AUDIO_AAC);
}
19
Source : ScreenRecordActivity.java
with Apache License 2.0
from FreeSunny
with Apache License 2.0
from FreeSunny
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
private void printInfo() {
MediaCodecList list = new MediaCodecList(MediaCodecList.ALL_CODECS);
MediaCodecInfo[] codecInfos = list.getCodecInfos();
for (MediaCodecInfo info : codecInfos) {
if (info.isEncoder()) {
StringBuilder sb = new StringBuilder();
sb.append(info.getName() + " types=");
String[] supportedTypes = info.getSupportedTypes();
for (String string : supportedTypes) {
sb.append(" " + string);
}
LogUtil.e(sb.toString());
}
}
}
19
Source : MediaCodecVideoDecoderFactory.java
with MIT License
from ddssingsong
with MIT License
from ddssingsong
private MediaCodecInfo findCodecForType(VideoCodecType type) {
// HW decoding is not supported on builds before KITKAT.
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
return null;
}
for (int i = 0; i < MediaCodecList.getCodecCount(); ++i) {
MediaCodecInfo info = null;
try {
info = MediaCodecList.getCodecInfoAt(i);
} catch (IllegalArgumentException e) {
Logging.e(TAG, "Cannot retrieve decoder codec info", e);
}
if (info == null || info.isEncoder()) {
continue;
}
if (isSupportedCodec(info, type)) {
return info;
}
}
// No support for this type.
return null;
}
19
Source : HardwareVideoEncoderFactory.java
with MIT License
from ddssingsong
with MIT License
from ddssingsong
private MediaCodecInfo findCodecForType(VideoCodecType type) {
for (int i = 0; i < MediaCodecList.getCodecCount(); ++i) {
MediaCodecInfo info = null;
try {
info = MediaCodecList.getCodecInfoAt(i);
} catch (IllegalArgumentException e) {
Logging.e(TAG, "Cannot retrieve encoder codec info", e);
}
if (info == null || !info.isEncoder()) {
continue;
}
if (isSupportedCodec(info, type)) {
return info;
}
}
// No support for this type.
return null;
}
19
Source : HardwareVideoEncoderFactory.java
with MIT License
from ddssingsong
with MIT License
from ddssingsong
// Returns true if the given MediaCodecInfo indicates a supported encoder for the given type.
private boolean isSupportedCodec(MediaCodecInfo info, VideoCodecType type) {
if (!MediaCodecUtils.codecSupportsType(info, type)) {
return false;
}
// Check for a supported color format.
if (MediaCodecUtils.selectColorFormat(MediaCodecUtils.ENCODER_COLOR_FORMATS, info.getCapabilitiesForType(type.mimeType())) == null) {
return false;
}
return isHardwareSupportedInCurrentSdk(info, type) && isMediaCodecAllowed(info);
}
19
Source : CodecDiscovery.java
with Apache License 2.0
from archos-sa
with Apache License 2.0
from archos-sa
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
private static boolean isCodecInfoSupported(MediaCodecInfo codecInfo, String codecType, boolean allowSwCodec) {
if (codecInfo.isEncoder())
// || (!allowSwCodec && ( codecInfo.getName().startsWith("OMX.google")
// || codecInfo.getName().toLowerCase().contains("sw") )))
return false;
String[] types = codecInfo.getSupportedTypes();
for (String type : types) {
if (type.equalsIgnoreCase(codecType))
return true;
}
return false;
}
19
Source : HeifWriterTest.java
with Apache License 2.0
from androidx
with Apache License 2.0
from androidx
private boolean hasEncoderForMime(String mime) {
for (MediaCodecInfo info : sMCL.getCodecInfos()) {
if (info.isEncoder()) {
for (String type : info.getSupportedTypes()) {
if (type.equalsIgnoreCase(mime)) {
Log.i(TAG, "found codec " + info.getName() + " for mime " + mime);
return true;
}
}
}
}
return false;
}
18
Source : H264EncodeConsumer.java
with Apache License 2.0
from z-jc
with Apache License 2.0
from z-jc
/**
* select the first codec that match a specific MIME type
*
* @param mimeType
* @return null if no codec matched
*/
@SuppressWarnings("deprecation")
protected final MediaCodecInfo selectVideoCodec(final String mimeType) {
// get the list of available codecs
final int numCodecs = MediaCodecList.getCodecCount();
for (int i = 0; i < numCodecs; i++) {
final MediaCodecInfo codecInfo = MediaCodecList.getCodecInfoAt(i);
if (!codecInfo.isEncoder()) {
// skipp decoder
continue;
}
// select first codec that match a specific MIME type and color format
final String[] types = codecInfo.getSupportedTypes();
for (int j = 0; j < types.length; j++) {
if (types[j].equalsIgnoreCase(mimeType)) {
final int format = selectColorFormat(codecInfo, mimeType);
if (format > 0) {
mColorFormat = format;
return codecInfo;
}
}
}
}
return null;
}
18
Source : AACEncodeConsumer.java
with Apache License 2.0
from z-jc
with Apache License 2.0
from z-jc
/**
* 遍历所有编解码器,返回第一个与指定MIME类型匹配的编码器
* 判断是否有支持指定mime类型的编码器
*/
private MediaCodecInfo selectSupportCodec(String mimeType) {
int numCodecs = MediaCodecList.getCodecCount();
for (int i = 0; i < numCodecs; i++) {
MediaCodecInfo codecInfo = MediaCodecList.getCodecInfoAt(i);
// 判断是否为编码器,否则直接进入下一次循环
if (!codecInfo.isEncoder()) {
continue;
}
// 如果是编码器,判断是否支持Mime类型
String[] types = codecInfo.getSupportedTypes();
for (int j = 0; j < types.length; j++) {
if (types[j].equalsIgnoreCase(mimeType)) {
return codecInfo;
}
}
}
return null;
}
18
Source : VideoUtil.java
with Apache License 2.0
from yellowcath
with Apache License 2.0
from yellowcath
public static boolean trySetProfileAndLevel(MediaCodec codec, String mime, MediaFormat format, int profileInt, int levelInt) {
MediaCodecInfo codecInfo = codec.getCodecInfo();
MediaCodecInfo.CodecCapabilities capabilities = codecInfo.getCapabilitiesForType(mime);
MediaCodecInfo.CodecProfileLevel[] profileLevels = capabilities.profileLevels;
if (profileLevels == null) {
return false;
}
for (MediaCodecInfo.CodecProfileLevel level : profileLevels) {
if (level.profile == profileInt) {
if (level.level == levelInt) {
format.setInteger(MediaFormat.KEY_PROFILE, profileInt);
format.setInteger(MediaFormat.KEY_LEVEL, levelInt);
return true;
}
}
}
return false;
}
18
Source : VideoUtil.java
with Apache License 2.0
from yellowcath
with Apache License 2.0
from yellowcath
public static int getMaxSupportBitrate(MediaCodec codec, String mime) {
try {
MediaCodecInfo codecInfo = codec.getCodecInfo();
MediaCodecInfo.CodecCapabilities capabilities = codecInfo.getCapabilitiesForType(mime);
Integer maxBitrate = capabilities.getVideoCapabilities().getBitrateRange().getUpper();
return maxBitrate;
} catch (Exception e) {
CL.e(e);
return -1;
}
}
18
Source : VideoEncoderFromBuffer.java
with Apache License 2.0
from yellowcath
with Apache License 2.0
from yellowcath
/**
* Returns a color format that is supported by the codec and by this test
* code. If no match is found, this throws a test failure -- the set of
* formats known to the test should be expanded for new platforms.
* ps:这个函数貌似在线程里跑非常非常慢
*/
public static int selectColorFormat(MediaCodecInfo codecInfo, String mimeType) {
MediaCodecInfo.CodecCapabilities capabilities = codecInfo.getCapabilitiesForType(mimeType);
// 优先选NV21,因为已有线程的YUV转换函数
for (int i = 0; i < capabilities.colorFormats.length; i++) {
int colorFormat = capabilities.colorFormats[i];
if (colorFormat == MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420SemiPlanar) {
return colorFormat;
}
}
// 没有再选择其它
for (int i = 0; i < capabilities.colorFormats.length; i++) {
int colorFormat = capabilities.colorFormats[i];
if (isRecognizedFormat(colorFormat)) {
return colorFormat;
}
}
RL.e("couldn't find a good color format for " + codecInfo.getName() + " / " + mimeType);
// not reached
return 0;
}
18
Source : VideoEncoderFromBuffer.java
with Apache License 2.0
from yellowcath
with Apache License 2.0
from yellowcath
/**
* Returns the first codec capable of encoding the specified MIME type, or
* null if no match was found.
*/
public static MediaCodecInfo selectCodec(String mimeType) {
int numCodecs = MediaCodecList.getCodecCount();
for (int i = 0; i < numCodecs; i++) {
MediaCodecInfo codecInfo = MediaCodecList.getCodecInfoAt(i);
if (!codecInfo.isEncoder()) {
continue;
}
String[] types = codecInfo.getSupportedTypes();
for (int j = 0; j < types.length; j++) {
if (types[j].equalsIgnoreCase(mimeType)) {
return codecInfo;
}
}
}
return null;
}
18
Source : EncodeDecode.java
with Apache License 2.0
from xiaoyifan6
with Apache License 2.0
from xiaoyifan6
/**
* Returns the first codec capable of encoding the specified MIME type, or
* null if no match was found.
*/
private static MediaCodecInfo selectCodec(String mimeType) {
int numCodecs = MediaCodecList.getCodecCount();
for (int i = 0; i < numCodecs; i++) {
MediaCodecInfo codecInfo = MediaCodecList.getCodecInfoAt(i);
if (!codecInfo.isEncoder()) {
continue;
}
String[] types = codecInfo.getSupportedTypes();
for (int j = 0; j < types.length; j++) {
if (types[j].equalsIgnoreCase(mimeType)) {
return codecInfo;
}
}
}
return null;
}
18
Source : AvcEncoder.java
with Apache License 2.0
from xiaoyifan6
with Apache License 2.0
from xiaoyifan6
public int[] getMediaCodecList() {
// 获取解码器列表
int numCodecs = MediaCodecList.getCodecCount();
MediaCodecInfo codecInfo = null;
for (int i = 0; i < numCodecs && codecInfo == null; i++) {
MediaCodecInfo info = MediaCodecList.getCodecInfoAt(i);
if (!info.isEncoder()) {
continue;
}
String[] types = info.getSupportedTypes();
boolean found = false;
// 轮训所要的解码器
for (int j = 0; j < types.length && !found; j++) {
if (types[j].equals("video/avc")) {
found = true;
}
}
if (!found) {
continue;
}
codecInfo = info;
}
Log.d(TAG, "found" + codecInfo.getName() + "supporting" + " video/avc");
MediaCodecInfo.CodecCapabilities capabilities = codecInfo.getCapabilitiesForType("video/avc");
return capabilities.colorFormats;
}
18
Source : RecordVideoRealActivity.java
with MIT License
from wuqingsen
with MIT License
from wuqingsen
@SuppressLint("NewApi")
private boolean SupportAvcCodec() {
if (Build.VERSION.SDK_INT >= 18) {
for (int j = MediaCodecList.getCodecCount() - 1; j >= 0; j--) {
MediaCodecInfo codecInfo = MediaCodecList.getCodecInfoAt(j);
String[] types = codecInfo.getSupportedTypes();
for (int i = 0; i < types.length; i++) {
if (types[i].equalsIgnoreCase("video/avc")) {
return true;
}
}
}
}
return false;
}
18
Source : ScreenRecordByCodecActivity.java
with MIT License
from wossoneri
with MIT License
from wossoneri
private VideoEncodeConfig createVideoConfig() {
MediaCodecInfo[] mci = Utils.findEncodersByType(VIDEO_AVC);
for (int i = 0; i < mci.length; i++) {
MediaCodecInfo info = mci[i];
Log.d("WOW", info.getName());
}
// getSelectedVideoCodec();
final String codec = mci[0].getName();
if (codec == null) {
// no selected codec ??
return null;
}
// video size
// getSelectedWithHeight();
int[] selectedWithHeight = new int[] { 832, 480 };
// isLandscape();
boolean isLandscape = false;
int width = selectedWithHeight[isLandscape ? 0 : 1];
int height = selectedWithHeight[isLandscape ? 1 : 0];
// getSelectedFramerate();
int framerate = 30;
// getSelectedIFrameInterval();
int iframe = 1;
// getSelectedVideoBitrate();
int bitrate = 800;
// getSelectedProfileLevel();
MediaCodecInfo.CodecProfileLevel profileLevel = null;
return new VideoEncodeConfig(width, height, bitrate, framerate, iframe, codec, VIDEO_AVC, profileLevel);
}
18
Source : CodecUtil.java
with MIT License
from uestccokey
with MIT License
from uestccokey
private static MediaCodecInfo selectVideoCodec(final String mimeType) {
int count = MediaCodecList.getCodecCount();
for (int i = 0; i < count; i++) {
MediaCodecInfo codecInfo = MediaCodecList.getCodecInfoAt(i);
if (!codecInfo.isEncoder()) {
// skipp decoder
continue;
}
// select first codec that match a specific MIME type and color format
final String[] types = codecInfo.getSupportedTypes();
for (String type : types) {
if (type.equalsIgnoreCase(mimeType)) {
final int format = selectColorFormat(codecInfo, mimeType);
if (format > 0) {
return codecInfo;
}
}
}
}
return null;
}
See More Examples