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;
}
}
Aggregations