WebRTC: H.264 On Non-Qualcomm Android Devices
User might expiring SDP failure on non-Qualcomm/SAMSUNG chip Android devices when received SDP from another peer that only support H.264. This was caused by a limitation of Android WebRTC SDK that it will check H.264 capabilities via a chip whitelist, which only has Qualcomm and Exynos listed. To make it available for other Android devices, we need to modify and recompile WebRTC Android SDK.
Fetch Code And Test Build
WebRTC: Compile Native WebRTC Android SDK
Modifications
Original code in HardwareVideoEncoderFactory.java:
1 | private boolean isHardwareSupportedInCurrentSdkH264(MediaCodecInfo info) { |
You could add your chips into whitelist here, but it might be easier to remove whitelist check if your target devices is running Android 5.0+(LOLLIPOP), since basically all chips in Android devices support H.264 nowadays.
1 | private boolean isHardwareSupportedInCurrentSdkH264(MediaCodecInfo info) { |
Same modifications should be added into MediaCodecVideoDecoderFactory.java as well.
Original code in MediaCodecVideoDecoderFactory.java:
1 | private boolean isH264HighProfileSupported(MediaCodecInfo info) { |
modified:
1 | private boolean isH264HighProfileSupported(MediaCodecInfo info) { |
Then recompile SDK by following Fetch Code And Test Build.