Puts the Agent into WAITING state when creating a new media stream. This way all incoming connectivity checks are added to the preDiscoveredPairsQueue until this Agent turn back intro RUNNING state.

This commit is contained in:
chenzo 2012-07-06 11:55:21 +00:00
parent c17fa4675a
commit 891392e18a

View File

@ -283,6 +283,15 @@ public class Agent
= new IceMediaStream(Agent.this, mediaStreamName);
mediaStreams.put(mediaStreamName, mediaStream);
// Since we add a new stream, we must wait to add the component and the
// remote candidates before starting to "RUN" this Agent.
// This is usefull if this Agent is already in COMPLETED state
// (isStarted() == true) due to a previous successful ICE preocedure:
// this way incoming connectivity checks are registered in the
// preDiscoveredPairsQueue until this Agent is in RUNNING state.
this.setState(IceProcessingState.WAITING);
return mediaStream;
}