Fixes issues with ICE processing in a basic use case
This commit is contained in:
parent
ef7a75fcc4
commit
795e0f0fd1
@ -1013,12 +1013,16 @@ public class Agent
|
||||
*/
|
||||
protected void validatePair(CandidatePair validPair)
|
||||
{
|
||||
IceMediaStream parentStream
|
||||
= validPair.getParentComponent().getParentStream();
|
||||
Component parentComponent = validPair.getParentComponent();
|
||||
IceMediaStream parentStream = parentComponent.getParentStream();
|
||||
CheckList checkList = parentStream.getCheckList();
|
||||
|
||||
parentStream.addValidPair(validPair);
|
||||
|
||||
if(!validPair.isNominated())
|
||||
//If the pair is not already nominated and if its parent component
|
||||
//does not already contain a nominated pair - nominate it.
|
||||
if(!validPair.isNominated()
|
||||
&& !checkList.containsNomineeForComponent(parentComponent))
|
||||
{
|
||||
validPair.nominate();
|
||||
validPair.getParentComponent().getParentStream()
|
||||
@ -1077,7 +1081,8 @@ public class Agent
|
||||
allListsEnded = false;
|
||||
break;
|
||||
}
|
||||
else if(stream.getCheckList().getState() == CheckListState.COMPLETED)
|
||||
else if(stream.getCheckList().getState()
|
||||
== CheckListState.COMPLETED)
|
||||
{
|
||||
atLeastOneListSucceeded = true;
|
||||
}
|
||||
|
||||
@ -364,4 +364,28 @@ public class CheckList
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns <tt>true</tt> if this <tt>CheckList</tt> already contains a
|
||||
* nominated {@link CandidatePair} for the specified <tt>component</tt>
|
||||
* and <tt>false</tt> otherwise.
|
||||
*
|
||||
* @param componennt the {@link Component} that we'd whose nominees we are
|
||||
* interested in.
|
||||
*
|
||||
* @return <tt>true</tt> if this <tt>CheckList</tt> already contains a
|
||||
* nominated {@link CandidatePair} for the specified <tt>component</tt>
|
||||
* and <tt>false</tt> otherwise.
|
||||
*/
|
||||
public synchronized boolean containsNomineeForComponent(
|
||||
Component componennt)
|
||||
{
|
||||
for (CandidatePair pair : this)
|
||||
{
|
||||
if (pair.isNominated() && pair.getParentComponent() == componennt)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -116,12 +116,20 @@ public class Ice
|
||||
System.out.println(cmpName + ": "
|
||||
+ cmp.getSelectedPair());
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println("Printing the check lists:");
|
||||
for(IceMediaStream stream : streams)
|
||||
{
|
||||
String streamName = stream.getName();
|
||||
System.out.println("Check list for stream: "
|
||||
+ streamName);
|
||||
//uncomment for a more verbose output
|
||||
System.out.println(stream.getCheckList());
|
||||
}
|
||||
}
|
||||
else if(evt.getNewValue() == IceProcessingState.TERMINATED)
|
||||
{
|
||||
System.out.println("ICE Agent was terminated.");
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
@ -233,8 +241,8 @@ public class Ice
|
||||
new TransportAddress("ipv6.sip-communicator.net",
|
||||
3478, Transport.UDP));
|
||||
|
||||
//agent.addCandidateHarvester(stunHarv);
|
||||
//agent.addCandidateHarvester(stun6Harv);
|
||||
agent.addCandidateHarvester(stunHarv);
|
||||
agent.addCandidateHarvester(stun6Harv);
|
||||
|
||||
createStream(rtpPort, "audio", agent);
|
||||
//createStream(rtpPort + 2, "video", agent);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user