You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
private fun getSupportType() {
try {
val numCodecs = MediaCodecList.getCodecCount()
for (i in 0 until numCodecs) {
val codecInfo = MediaCodecList.getCodecInfoAt(i)
if (!codecInfo.isEncoder) {
continue
}
val types = codecInfo.supportedTypes
for (j in types.indices) {
supportTypeMap[types[j].toLowerCase()] = true
}
}
ALog.i(TAG, "supportType=${supportTypeMap.keys}")
} catch (t: Throwable) {
ALog.e(TAG, "getSupportType $t")
}
}
在三星A5 Android 5.1.1上面无法播放,翻了下源码发现是判断不支持hevc格式
看了一下获取设备支持格式的代码,貌似是有问题的
这行代码的判断应该是有问题的吧,应该是判断如果是编码器 才执行continue,如果是解码器接着执行。我测试的三星A5这台设备就是没有h265对应的编码器所以导致格式判断不通过,但是设备是有h265对应的解码器的。所以放开格式判断之后是能正常播放的。
The text was updated successfully, but these errors were encountered: