android - 将 WebRTC 版本 1.0.24277 升级到 1.0.25331 时应用崩溃

标签 android webrtc

我们想将使用 native WebRTC 的 Android 项目更新到最新版本。我们使用的版本是 1.0.24277,我们正在升级到 1.0.25331。

此次升级的有趣之处在于它不需要任何代码更改(没有任何内容显示为已弃用或新版本中的任何内容)。我假设他们改变了一些代码需要执行的方式。

所以我的问题是,有谁知道可能需要更改哪些 native Java webrtc 代码才能避免崩溃?

请注意,我在 onRenegotiationNeeded 中没有任何代码,所以我不知道为什么它会崩溃。

2018-11-12 10:58:32.318 1400-2319/com.popinvideobanking.ttcu.demo D/FT_WebRTCPeer: 7ghYoCJtZmDxGNQ2AArv onRenegotiationNeeded
2018-11-12 10:58:32.385 1400-2324/com.popinvideobanking.ttcu.demo I/org.webrtc.Logging: CameraStatistics: Camera fps: 18.Enter one-line summary

    --------- beginning of crash
2018-11-12 10:58:32.425 2404-2318/? A/google-breakpad: Microdump skipped (uninteresting)
2018-11-12 10:58:32.446 1400-2318/com.popinvideobanking.ttcu.demo W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
2018-11-12 10:58:32.446 1400-2318/com.popinvideobanking.ttcu.demo W/google-breakpad: Chrome build fingerprint:
2018-11-12 10:58:32.446 1400-2318/com.popinvideobanking.ttcu.demo W/google-breakpad: 68.0.3440.91
2018-11-12 10:58:32.446 1400-2318/com.popinvideobanking.ttcu.demo W/google-breakpad: 344009152
2018-11-12 10:58:32.446 1400-2318/com.popinvideobanking.ttcu.demo W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
2018-11-12 10:58:32.447 1400-2318/com.popinvideobanking.ttcu.demo A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x6c in tid 2318 (worker_thread -), pid 1400 (nking.ttcu.demo)
2018-11-12 10:58:32.582 2410-2410/? I/crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
2018-11-12 10:58:32.583 612-612/? I//system/bin/tombstoned: received crash request for pid 1400
2018-11-12 10:58:32.584 2410-2410/? I/crash_dump64: performing dump of process 1400 (target tid = 2318)
2018-11-12 10:58:32.584 2410-2410/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2018-11-12 10:58:32.584 2410-2410/? A/DEBUG: Build fingerprint: 'google/angler/angler:8.1.0/OPM7.181105.004/5038062:user/release-keys'
2018-11-12 10:58:32.585 2410-2410/? A/DEBUG: Revision: '0'
2018-11-12 10:58:32.585 2410-2410/? A/DEBUG: ABI: 'arm64'
2018-11-12 10:58:32.585 2410-2410/? A/DEBUG: pid: 1400, tid: 2318, name: worker_thread -  >>> com.popinvideobanking.ttcu.demo <<<
2018-11-12 10:58:32.585 2410-2410/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x6c
2018-11-12 10:58:32.585 2410-2410/? A/DEBUG: Cause: null pointer dereference
2018-11-12 10:58:32.585 2410-2410/? A/DEBUG:     x0   000000774dc84ff0  x1   0000000000000000  x2   000000774d600000  x3   0000000000000003
2018-11-12 10:58:32.585 2410-2410/? A/DEBUG:     x4   00000000000000f1  x5   8000000000000000  x6   ff63646a6e756471  x7   7f7f7f7f7f7f7f7f
2018-11-12 10:58:32.585 2410-2410/? A/DEBUG:     x8   0000000000000000  x9   2bb84e7acb284ad4  x10  0000000000000000  x11  000000774dc85008
2018-11-12 10:58:32.585 2410-2410/? A/DEBUG:     x12  00000000ffffffff  x13  637273536e776f6e  x14  0000000000000000  x15  000000774d600000
2018-11-12 10:58:32.585 2410-2410/? A/DEBUG:     x16  00000077f002dca8  x17  00000077effca4b8  x18  0000000000000008  x19  000000776419f800
2018-11-12 10:58:32.585 2410-2410/? A/DEBUG:     x20  000000774a2ebf64  x21  000000774a6c5b08  x22  0000000000000000  x23  0000000000000000
2018-11-12 10:58:32.585 2410-2410/? A/DEBUG:     x24  000000776419fa10  x25  000000774a6c5739  x26  000000774a393800  x27  0000000000000048
2018-11-12 10:58:32.585 2410-2410/? A/DEBUG:     x28  00000000148952b9  x29  000000774dc85060  x30  000000774e13e58c
2018-11-12 10:58:32.585 2410-2410/? A/DEBUG:     sp   000000774dc84ff0  pc   000000774e13e594  pstate 0000000060000000
2018-11-12 10:58:32.593 2410-2410/? A/DEBUG: backtrace:
2018-11-12 10:58:32.593 2410-2410/? A/DEBUG:     #00 pc 00000000003bb594  /data/app/com.popinvideobanking.ttcu.demo-y2AwFNkfjEt_MV43YvqTnQ==/lib/arm64/libjingle_peerconnection_so.so (offset 0x228000)
2018-11-12 10:58:32.593 2410-2410/? A/DEBUG:     #01 pc 00000000003bab70  /data/app/com.popinvideobanking.ttcu.demo-y2AwFNkfjEt_MV43YvqTnQ==/lib/arm64/libjingle_peerconnection_so.so (offset 0x228000)
2018-11-12 10:58:32.593 2410-2410/? A/DEBUG:     #02 pc 000000000052fefc  /data/app/com.popinvideobanking.ttcu.demo-y2AwFNkfjEt_MV43YvqTnQ==/lib/arm64/libjingle_peerconnection_so.so (offset 0x228000)
2018-11-12 10:58:32.593 2410-2410/? A/DEBUG:     #03 pc 0000000000530674  /data/app/com.popinvideobanking.ttcu.demo-y2AwFNkfjEt_MV43YvqTnQ==/lib/arm64/libjingle_peerconnection_so.so (offset 0x228000)
2018-11-12 10:58:32.593 2410-2410/? A/DEBUG:     #04 pc 00000000002a94f4  /data/app/com.popinvideobanking.ttcu.demo-y2AwFNkfjEt_MV43YvqTnQ==/lib/arm64/libjingle_peerconnection_so.so (offset 0x228000)
2018-11-12 10:58:32.593 2410-2410/? A/DEBUG:     #05 pc 00000000002bac1c  /data/app/com.popinvideobanking.ttcu.demo-y2AwFNkfjEt_MV43YvqTnQ==/lib/arm64/libjingle_peerconnection_so.so (offset 0x228000)
2018-11-12 10:58:32.593 2410-2410/? A/DEBUG:     #06 pc 00000000002a8d54  /data/app/com.popinvideobanking.ttcu.demo-y2AwFNkfjEt_MV43YvqTnQ==/lib/arm64/libjingle_peerconnection_so.so (offset 0x228000)
2018-11-12 10:58:32.593 2410-2410/? A/DEBUG:     #07 pc 00000000002ba950  /data/app/com.popinvideobanking.ttcu.demo-y2AwFNkfjEt_MV43YvqTnQ==/lib/arm64/libjingle_peerconnection_so.so (offset 0x228000)
2018-11-12 10:58:32.593 2410-2410/? A/DEBUG:     #08 pc 00000000002ba858  /data/app/com.popinvideobanking.ttcu.demo-y2AwFNkfjEt_MV43YvqTnQ==/lib/arm64/libjingle_peerconnection_so.so (offset 0x228000)
2018-11-12 10:58:32.593 2410-2410/? A/DEBUG:     #09 pc 0000000000067d0c  /system/lib64/libc.so (__pthread_start(void*)+36)
2018-11-12 10:58:32.593 2410-2410/? A/DEBUG:     #10 pc 000000000001eba4  /system/lib64/libc.so (__start_thread+68)

最佳答案

我们发现发生这种情况的原因之一是他们默认停止添加视频编解码器,您可以在此处的这些发行说明中看到:

https://groups.google.com/forum/#!msg/discuss-webrtc/6ImvPjWQvbE/AlCtGQnYBQAJ

默认情况下,Android SDK 不再包含视频编解码器。如果没有视频编解码器传递给 createPeerConnectionFactory,则不会包含任何视频编解码器。目的是为不需要视频的客户端(例如,仅音频或数据)保存二进制大小。这不会影响已经在使用可注入(inject)编解码器的客户。

以下代码创建默认工厂,为对等连接工厂提供默认视频编码器和解码器。

    PeerConnectionFactory.initialize(PeerConnectionFactory.InitializationOptions.builder(context).createInitializationOptions());
    PeerConnectionFactory.Options options = new PeerConnectionFactory.Options();

    DefaultVideoEncoderFactory defaultVideoEncoderFactory = new DefaultVideoEncoderFactory(
            eglContext,  /* enableIntelVp8Encoder */true,  /* enableH264HighProfile */true);
    DefaultVideoDecoderFactory defaultVideoDecoderFactory = new DefaultVideoDecoderFactory(eglContext);

    this.factory = PeerConnectionFactory.builder()
            .setVideoEncoderFactory(defaultVideoEncoderFactory)
            .setVideoDecoderFactory(defaultVideoDecoderFactory)
            .setOptions(options)
            .setAudioDeviceModule(createJavaAudioDevice(context))
            .createPeerConnectionFactory();

关于android - 将 WebRTC 版本 1.0.24277 升级到 1.0.25331 时应用崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53283988/

相关文章:

java - 如何在 Firebase 中动态获取 key ?

java - 如果我将变量设置为 final,事情会运行得更快吗?

android - 在 Android 上相当于键值观察

websocket - webRTC 文本聊天 - 项目、PeerConnection 和握手设置

android - 深层链接空字符串参数

Android MJPEG 流

javascript - WebRTC 不适用于 AudioContext

c++ - WebRtc 应用程序中的独立 AGC(自动增益控制)

android - 无法在android上的webrtc中发送视频和音频

javascript - RTCDataChannel 信号?