public boolean isSupportMediaCodecHardDecoder(){
boolean isHardcode = false;
//读取系统配置文件/system/etc/media_codecc.xml
File file = new File("/system/etc/media_codecs.xml");
InputStream inFile = null;
try {
inFile = new FileInputStream(file);
} catch (Exception e) {
// TODO: handle exception
}
if(inFile != null) {
XmlPullParserFactory pullFactory;
try {
pullFactory = XmlPullParserFactory.newInstance();
XmlPullParser xmlPullParser = pullFactory.newPullParser();
xmlPullParser.setInput(inFile, "UTF-8");
int eventType = xmlPullParser.getEventType();
while (eventType != XmlPullParser.END_DOCUMENT) {
String tagName = xmlPullParser.getName();
switch (eventType) {
case XmlPullParser.START_TAG:
if ("MediaCodec".equ
【第四篇章-android平台MediaCodec】判断是否支持硬解码代码
最新推荐文章于 2025-04-01 01:37:49 发布