Я использую библиотеку Android WebRTC для создания приложения для видеозвонков.
Но иногда, когда я завершаю действие, приложение аварийно завершает работу.
Я не знаю, неправильный ли у меня поток закрытия или библиотека сам по себе.
Я заметил, что эта ошибка указывает на signal_thread.
Поскольку это приложение разработано для использования в локальной сети, поэтому я не добавлял STUN и IceCandidate Server в PeerConnection.< /p>
Кроме того, я использую последнюю версию библиотеки
implementation 'org.webrtc:google-webrtc:1.0.32006'
Код, когда я закрываю:
private void close() {
if (localVideoView != null) {
localVideoView.release();
localVideoView = null;
}
if (remoteVideoView != null) {
remoteVideoView.release();
remoteVideoView = null;
}
if (peerConnection != null) {
Log.e(TAG, "peerConnection close");
peerConnection.dispose();
}
if (audioSource != null) {
audioSource.dispose();
audioSource = null;
Log.e(TAG, "audioSource close");
}
if (videoCapturer != null) {
try {
videoCapturer.stopCapture();
} catch (InterruptedException e) {
e.printStackTrace();
}
videoCapturer.dispose();
videoCapturer = null;
Log.e(TAG, "videoCapture close");
}
if (videoSource != null) {
videoSource.dispose();
videoSource = null;
Log.e(TAG, "videoSource close");
}
if (surfaceTextureHelper != null) {
Log.e(TAG, "surfaceTextureHelper close");
surfaceTextureHelper.dispose();
surfaceTextureHelper = null;
}
if (mediaStreamLocal != null) {
while (mediaStreamLocal.audioTracks.size() > 0) {
mediaStreamLocal.removeTrack(mediaStreamLocal.audioTracks.get(0));
Log.e(TAG, "audioTrack close");
}
while (mediaStreamLocal.videoTracks.size() > 0) {
mediaStreamLocal.removeTrack(mediaStreamLocal.videoTracks.get(0));
Log.e(TAG, "videoTrack close");
}
mediaStreamLocal = null;
Log.e(TAG, "mediaStream close");
}
if (peerConnectionFactory != null) {
peerConnectionFactory.dispose();
Log.e(TAG, "peerConnectionFactory close");
}
if (eglBaseContext != null) {
Log.e(TAG, "eglBaseContext close");
eglBaseContext = null;
}
PeerConnectionFactory.stopInternalTracingCapture();
PeerConnectionFactory.shutdownInternalTracer();
Log.e(TAG, "close done");
}
Сообщение об ошибке при сбое:
--------- beginning of crash
03-03 14:05:31.630 26351 28454 F libc : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 28454 (signaling_threa), pid 26351 (getupsetting_ap)
03-03 14:05:31.753 28489 28489 I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
03-03 14:05:31.758 28489 28489 I crash_dump64: performing dump of process 26351 (target tid = 28454)
03-03 14:05:31.764 28489 28489 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
03-03 14:05:31.764 28489 28489 F DEBUG : Build fingerprint: 'asus/WW_Z01RD/ASUS_Z01R_1:10/QKQ1.191008.001/WW_100.10.107.123_20210131:user/release-keys'
03-03 14:05:31.764 28489 28489 F DEBUG : Revision: '0'
03-03 14:05:31.764 28489 28489 F DEBUG : ABI: 'arm64'
03-03 14:05:31.765 28489 28489 F DEBUG : Timestamp: 2022-03-03 14:05:31+0800
03-03 14:05:31.765 28489 28489 F DEBUG : pid: 26351, tid: 28454, name: signaling_threa >>> org.getupsetting_ap
Подробнее здесь: https://stackoverflow.com/questions/713 ... oid-webrtc