/** * Stops the transmission if already started. * Stops the receiver also. */ public void stop() { if (!started) return; synchronized (this) { try { started = false; if (processor != null) { processor.stop(); processor = null; for (RTPManager rtpMgr : rtpMgrs) { rtpMgr.removeReceiveStreamListener(audioReceiver); rtpMgr.removeSessionListener(audioReceiver); rtpMgr.removeTargets("Session ended."); rtpMgr.dispose(); } sendStreams.clear(); } } catch (Exception e) { LOGGER.log(Level.WARNING, "exception", e); } } }
public void dispose() { if (translator == null) manager.dispose(); else translator.dispose(this); }
try manager.dispose();
/** * Stops the transmission if already started. * Stops the receiver also. */ public void stop() { if (!started) return; synchronized (this) { try { started = false; if (processor != null) { processor.stop(); processor = null; for (RTPManager rtpMgr : rtpMgrs) { rtpMgr.removeReceiveStreamListener(audioReceiver); rtpMgr.removeSessionListener(audioReceiver); rtpMgr.removeTargets("Session ended."); rtpMgr.dispose(); } sendStreams.clear(); } } catch (Exception e) { e.printStackTrace(); } } }
/** * Stops the transmission if already started. * Stops the receiver also. */ public void stop() { if (!started) return; synchronized (this) { try { started = false; if (processor != null) { processor.stop(); processor = null; for (RTPManager rtpMgr : rtpMgrs) { rtpMgr.removeReceiveStreamListener(audioReceiver); rtpMgr.removeSessionListener(audioReceiver); rtpMgr.removeTargets("Session ended."); rtpMgr.dispose(); } sendStreams.clear(); } } catch (Exception e) { e.printStackTrace(); } } }
@Override public void stop() { if (started) { if (logger.isInfoEnabled()) logger.info("Stopping " + hashCode()); // remove the recorder from the translator (e.g. stop new packets from // being written to rtpConnector if (streamRTPManager != null) streamRTPManager.dispose(); HashSet<ReceiveStreamDesc> streamsToRemove = new HashSet<ReceiveStreamDesc>(); synchronized (receiveStreams) { streamsToRemove.addAll(receiveStreams); } for(ReceiveStreamDesc r : streamsToRemove) removeReceiveStream(r, false); rtpConnector.rtcpPacketTransformer.close(); rtpConnector.rtpPacketTransformer.close(); rtpManager.dispose(); if (activeSpeakerDetector != null) activeSpeakerDetector.removeActiveSpeakerChangedListener(this); started=false; } }