From 44e7266220c234b74da5f9c17b7276dc6655831d Mon Sep 17 00:00:00 2001 From: emcho Date: Sat, 1 May 2010 21:35:37 +0000 Subject: [PATCH] Adds support for computing of initial CandidatePair states in check lists. (section 5.7.4. of 5245 --- src/org/ice4j/ice/IceMediaStream.java | 57 --------------------------- 1 file changed, 57 deletions(-) diff --git a/src/org/ice4j/ice/IceMediaStream.java b/src/org/ice4j/ice/IceMediaStream.java index 59dbf49..862127b 100644 --- a/src/org/ice4j/ice/IceMediaStream.java +++ b/src/org/ice4j/ice/IceMediaStream.java @@ -388,63 +388,6 @@ public class IceMediaStream } } - /** - * Computes and resets states of all pairs in this check list. For all pairs - * with the same foundation, we set the state of the pair with the lowest - * component ID to Waiting. If there is more than one such pair, the one - * with the highest priority is used. - */ - protected void computeInitialCheckListPairStates() - { - Map pairsToWait - = new Hashtable(); - - //first, determine the pairs that we'd need to put in the waiting state. - for(CandidatePair pair : checkList) - { - //we need to check whether the pair is already in the wait list. if - //so we'll compare it with this one and determine which of the two - //needs to stay. - CandidatePair prevPair = pairsToWait.get(pair.getFoundation()); - - if(prevPair == null) - { - //first pair with this foundation. - pairsToWait.put(pair.getFoundation(), pair); - continue; - } - - //we already have a pair with the same foundation. determine which - //of the two has the lower component id and higher priority and - //keep that one in the list. - if( prevPair.getParentComponent() == pair.getParentComponent()) - { - if(pair.getPriority() > prevPair.getPriority()) - { - //need to replace the pair in the list. - pairsToWait.put(pair.getFoundation(), pair); - } - } - else - { - if(pair.getParentComponent().getComponentID() - < prevPair.getParentComponent().getComponentID()) - { - //need to replace the pair in the list. - pairsToWait.put(pair.getFoundation(), pair); - } - } - } - - //now put the pairs we've selected in the Waiting state. - Iterator pairsIter = pairsToWait.values().iterator(); - - while(pairsIter.hasNext()) - { - pairsIter.next().setState(CandidatePairState.WAITING, null); - } - } - /** * Returns the list of CandidatePairs to be used in checks for * this stream.