diff options
author | Lyubomir Marinov <lyubomir.marinov@jitsi.org> | 2012-10-15 17:56:15 +0000 |
---|---|---|
committer | Lyubomir Marinov <lyubomir.marinov@jitsi.org> | 2012-10-15 17:56:15 +0000 |
commit | 8ab5ddd1bdf897612cc098bf3fe0caf610b4e40e (patch) | |
tree | b9e837b46f4b058d2cb0343503189822385e3f3e /src/net/java/sip/communicator/service/protocol/media/MediaAwareCall.java | |
parent | 1f0a4b1a65ed7274ac9522619bbb1657ee03a613 (diff) | |
download | jitsi-8ab5ddd1bdf897612cc098bf3fe0caf610b4e40e.zip jitsi-8ab5ddd1bdf897612cc098bf3fe0caf610b4e40e.tar.gz jitsi-8ab5ddd1bdf897612cc098bf3fe0caf610b4e40e.tar.bz2 |
Commits work in progress on refactorying the call-related user interface for the purposes of audio and video telephony conferencing over single or multiple protocols and Jitsi VideoBridge.
Diffstat (limited to 'src/net/java/sip/communicator/service/protocol/media/MediaAwareCall.java')
-rw-r--r-- | src/net/java/sip/communicator/service/protocol/media/MediaAwareCall.java | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/net/java/sip/communicator/service/protocol/media/MediaAwareCall.java b/src/net/java/sip/communicator/service/protocol/media/MediaAwareCall.java index d09f57d..24feff2 100644 --- a/src/net/java/sip/communicator/service/protocol/media/MediaAwareCall.java +++ b/src/net/java/sip/communicator/service/protocol/media/MediaAwareCall.java @@ -127,7 +127,7 @@ public abstract class MediaAwareCall< */ protected void addCallPeer(T callPeer) { - if (getCallPeersVector().contains(callPeer)) + if (!doAddCallPeer(callPeer)) return; callPeer.addCallPeerListener(this); @@ -135,17 +135,17 @@ public abstract class MediaAwareCall< synchronized(localUserAudioLevelListenersSyncRoot) { // if there's someone listening for audio level events then they'd - // also like to know about the new peer. - // make sure always the fisrt element is the one to listen - // for local audio events - if(getCallPeersVector().isEmpty()) + // also like to know about the new peer. make sure always the first + // element is the one to listen for local audio events + List<T> callPeers = getCallPeerList(); + + if ((callPeers.size() == 1) && callPeers.get(0).equals(callPeer)) { callPeer.getMediaHandler().setLocalUserAudioLevelListener( localAudioLevelDelegator); } } - getCallPeersVector().add(callPeer); fireCallPeerEvent(callPeer, CallPeerEvent.CALL_PEER_ADDED); } @@ -161,14 +161,11 @@ public abstract class MediaAwareCall< @SuppressWarnings("unchecked") private void removeCallPeer(CallPeerChangeEvent evt) { - T callPeer = (T)evt.getSourceCallPeer(); + T callPeer = (T) evt.getSourceCallPeer(); - if (!getCallPeersVector().contains(callPeer)) + if (!doRemoveCallPeer(callPeer)) return; - int elementPeerIx = getCallPeersVector().indexOf(callPeer); - - getCallPeersVector().remove(callPeer); callPeer.removeCallPeerListener(this); synchronized (localUserAudioLevelListenersSyncRoot) @@ -179,10 +176,13 @@ public abstract class MediaAwareCall< // if there are more peers and the peer was the first, the one // that listens for local levels, now lets make sure // the new first will listen for local level events - if(!getCallPeersVector().isEmpty() && (elementPeerIx == 0)) + List<T> callPeers = getCallPeerList(); + + if(!callPeers.isEmpty()) { - getCallPeersVector().firstElement().getMediaHandler() - .setLocalUserAudioLevelListener(localAudioLevelDelegator); + callPeers.get(0).getMediaHandler() + .setLocalUserAudioLevelListener( + localAudioLevelDelegator); } } @@ -199,7 +199,7 @@ public abstract class MediaAwareCall< callPeer.setCall(null); } - if (getCallPeersVector().isEmpty()) + if (getCallPeerCount() == 0) setCallState(CallState.CALL_ENDED, evt); } |