首页 > 解决方案 > Libjingle Android VideoCall 断开连接但连续看到日志

问题描述

  I/org.webrtc.Logging: VideoCapturerAndroid: Camera fps: 0.
 I/org.webrtc.Logging: VideoCapturerAndroid: Camera fps: 0.
 I/org.webrtc.Logging: VideoCapturerAndroid: Camera fps: 0.
 I/org.webrtc.Logging: VideoCapturerAndroid: Camera fps: 0.
 I/org.webrtc.Logging: VideoCapturerAndroid: Camera fps: 0.
 I/org.webrtc.Logging: VideoCapturerAndroid: Camera fps: 0.
I/org.webrtc.Logging: VideoCapturerAndroid: Camera fps: 0.
 I/org.webrtc.Logging: VideoCapturerAndroid: Camera fps: 0.
 I/org.webrtc.Logging: VideoCapturerAndroid: Camera fps: 0.
I/org.webrtc.Logging: VideoCapturerAndroid: Camera fps: 0.
 I/org.webrtc.Logging: VideoCapturerAndroid: Camera fps: 0.
 I/org.webrtc.Logging: VideoCapturerAndroid: Camera fps: 0.

在 android 应用程序中使用 libjingle 进行 webrtc 视频通话,通话结束后释放所有资源,但仍然可以在 logcat 中看到日志。我认为对象没有被释放并持有这个过程。

fun freeAllResources() {
        if (localVideoTrack != null) {
            localVideoTrack?.setEnabled(false)
            localVideoTrack?.removeRenderer(localVideoRenderer)
            localVideoTrack?.dispose()
            localVideoTrack = null
        }

        if (localAudioTrack != null) {
            localAudioTrack?.setEnabled(false)
            localAudioTrack?.dispose()
            localAudioTrack = null
        }
        localVideoSource?.stop()
        peerConnection?.removeStream(localMediaStream)
        peerConnection?.close()
        peerConnection = null
        Log.d(TAG, "videoCaptureAndroid is Disposing starts")

        videoCapturerAndroid?.dispose()
        Log.d(TAG, "videoCaptureAndroid Release ${videoCapturerAndroid?.isReleased}")

        videoCapturerAndroid = null
        localMediaStream = null
        localVideoSource = null
        remoteVideoRenderer = null
        peerConnectionFactory = null
    }

任何解决方案?

标签: androidkotlinwebrtclibjingle

解决方案


推荐阅读