WebRTC Android H264 硬解碼支持更多的機型

webrtc更新日期 2017.11.01php

WebRTC默認支持使用了高通,英特爾和三星CPU等國際大廠的機型,不少小衆的機型或者新生的CPU沒有開啓支持,須要咱們手動添加java

修改方法:WebRTC經過MediaCodec來支持硬編碼,咱們須要修改的核心文件爲如下兩個android

./src/webrtc/sdk/android/api/org/webrtc/MediaCodecVideoEncoder.java
./src/webrtc/sdk/android/api/org/webrtc/MediaCodecVideoDecoder.java

改動後的代碼git

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 */
};

 

參考文章github

一、RTC8:Webrt中H264編碼相關問題web

二、Android 源碼導讀:視頻硬編碼實現分析api

三、ijkPlayer 的 IjkMediaCodecInfo.javaide

相關文章
相關標籤/搜索