webrtc更新日期 2017.11.01
WebRTC默认支持使用了高通,英特尔和三星CPU等国际大厂的机型,很多小众的机型或者新生的CPU没有开启支持,需要我们手动添加
修改方法:WebRTC通过MediaCodec来支持硬编码,我们需要修改的核心文件为以下两个
./src/webrtc/sdk/android/api/org/webrtc/MediaCodecVideoEncoder.java
./src/webrtc/sdk/android/api/org/webrtc/MediaCodecVideoDecoder.java
改动后的代码
private static final String[] supportedH264HwCodecPrefixes = { "OMX.qcom.", "OMX.Intel.", "OMX.Exynos." ,"OMX.Nvidia.H264." /*Nexus 7(2012), Nexus 9, Tegra 3, Tegra K1*/ ,"OMX.ittiam.video." /*Xiaomi Mi 1s*/ ,"OMX.SEC.avc." /*Exynos 3110, Nexus S*/ ,"OMX.IMG.MSVDX." /*Huawei Honor 6, Kirin 920*/ ,"OMX.k3.video." /*Huawei Honor 3C, Kirin 910*/ ,"OMX.hisi." /*Huawei Premium Phones, Kirin 950*/ ,"OMX.TI.DUCATI1." /*Galaxy Nexus, Ti OMAP4460*/ ,"OMX.MTK.VIDEO." /*no sense*/ ,"OMX.LG.decoder." /*no sense*/ //,"OMX.rk.video_decoder."/*Youku TVBox. our service doesn't need this */ //,"OMX.amlogic.avc" /*MiBox1, 1s, 2. our service doesn't need this */ };
参考文章
1、RTC8:Webrt中H264编码相关问题
2、Android 源码导读:视频硬编码实现分析
3、ijkPlayer 的 IjkMediaCodecInfo.java