Search in sources :

Example 1 with EglBase

use of org.webrtc.EglBase in project Conversations by siacs.

the class WebRTCWrapper method close.

synchronized void close() {
    final PeerConnection peerConnection = this.peerConnection;
    final CapturerChoice capturerChoice = this.capturerChoice;
    final AppRTCAudioManager audioManager = this.appRTCAudioManager;
    final EglBase eglBase = this.eglBase;
    if (peerConnection != null) {
        dispose(peerConnection);
        this.peerConnection = null;
    }
    if (audioManager != null) {
        toneManager.setAppRtcAudioManagerHasControl(false);
        mainHandler.post(audioManager::stop);
    }
    this.localVideoTrack = null;
    this.remoteVideoTrack = null;
    if (capturerChoice != null) {
        try {
            capturerChoice.cameraVideoCapturer.stopCapture();
        } catch (InterruptedException e) {
            Log.e(Config.LOGTAG, "unable to stop capturing");
        }
    }
    if (eglBase != null) {
        eglBase.release();
        this.eglBase = null;
    }
}
Also used : PeerConnection(org.webrtc.PeerConnection) EglBase(org.webrtc.EglBase) AppRTCAudioManager(eu.siacs.conversations.services.AppRTCAudioManager)

Aggregations

AppRTCAudioManager (eu.siacs.conversations.services.AppRTCAudioManager)1 EglBase (org.webrtc.EglBase)1 PeerConnection (org.webrtc.PeerConnection)1