style: Whitespace and braces.

This commit is contained in:
Boris Grozev 2016-12-15 10:45:43 -06:00
parent abec6b79e5
commit a1796c9bfb
2 changed files with 92 additions and 64 deletions

View File

@ -1253,7 +1253,9 @@ public class Agent
buff.append("):\n"); buff.append("):\n");
for (IceMediaStream stream : getStreams()) for (IceMediaStream stream : getStreams())
{
buff.append(stream).append("\n"); buff.append(stream).append("\n");
}
return buff.toString(); return buff.toString();
} }
@ -1287,9 +1289,11 @@ public class Agent
CheckList list = stream.getCheckList(); CheckList list = stream.getCheckList();
if (list != null) if (list != null)
{
list.recomputePairPriorities(); list.recomputePairPriorities();
} }
} }
}
/** /**
* Removes <tt>stream</tt> and all its child <tt>Component</tt>s and * Removes <tt>stream</tt> and all its child <tt>Component</tt>s and
@ -1343,8 +1347,10 @@ public class Agent
LocalCandidate cnd = stream.findLocalCandidate(localAddress); LocalCandidate cnd = stream.findLocalCandidate(localAddress);
if (cnd != null) if (cnd != null)
{
return cnd; return cnd;
} }
}
return null; return null;
} }
@ -1399,8 +1405,10 @@ public class Agent
RemoteCandidate cnd = stream.findRemoteCandidate(remoteAddress); RemoteCandidate cnd = stream.findRemoteCandidate(remoteAddress);
if (cnd != null) if (cnd != null)
{
return cnd; return cnd;
} }
}
return null; return null;
} }
@ -1746,7 +1754,9 @@ public class Agent
CheckList checkList = parentStream.getCheckList(); CheckList checkList = parentStream.getCheckList();
if ( checkList.getState() == CheckListState.RUNNING ) if ( checkList.getState() == CheckListState.RUNNING )
{
checkList.handleNominationConfirmed(nominatedPair); checkList.handleNominationConfirmed(nominatedPair);
}
//Once there is at least one nominated pair in the valid list for //Once there is at least one nominated pair in the valid list for
//every component of the media stream and the state of the //every component of the media stream and the state of the
@ -1771,7 +1781,9 @@ public class Agent
boolean atLeastOneListSucceeded = false; boolean atLeastOneListSucceeded = false;
if (getState().isEstablished()) if (getState().isEstablished())
{
return; return;
}
List<IceMediaStream> streams = getStreams(); List<IceMediaStream> streams = getStreams();
@ -1794,7 +1806,9 @@ public class Agent
if (!allListsEnded) if (!allListsEnded)
{
return; return;
}
if (!atLeastOneListSucceeded) if (!atLeastOneListSucceeded)
{ {
@ -1827,7 +1841,9 @@ public class Agent
// under our nose here has been observed (and not in a single instance) // under our nose here has been observed (and not in a single instance)
// So check that we did indeed just trigger the change. // So check that we did indeed just trigger the change.
if (!setState(IceProcessingState.COMPLETED)) if (!setState(IceProcessingState.COMPLETED))
{
return; return;
}
// keep ICE running (answer STUN Binding requests, send STUN Binding // keep ICE running (answer STUN Binding requests, send STUN Binding
// indications or requests) // indications or requests)
@ -1917,8 +1933,10 @@ public class Agent
Collection<IceMediaStream> streamsCol = mediaStreams.values(); Collection<IceMediaStream> streamsCol = mediaStreams.values();
for (IceMediaStream stream : streamsCol) for (IceMediaStream stream : streamsCol)
{
num += stream.countHostCandidates(); num += stream.countHostCandidates();
} }
}
return num; return num;
} }
@ -2304,7 +2322,9 @@ public class Agent
} }
if (!runInStunKeepAliveThreadCondition()) if (!runInStunKeepAliveThreadCondition())
{
break; break;
}
try try
{ {

View File

@ -908,8 +908,10 @@ public class Component
for (RemoteCandidate remoteCnd : remoteCandidates) for (RemoteCandidate remoteCnd : remoteCandidates)
{ {
if (remoteCnd.getTransportAddress().equals(remoteAddress)) if (remoteCnd.getTransportAddress().equals(remoteAddress))
{
return remoteCnd; return remoteCnd;
} }
}
return null; return null;
} }
@ -955,12 +957,18 @@ public class Component
public String getName() public String getName()
{ {
if (componentID == RTP) if (componentID == RTP)
{
return "RTP"; return "RTP";
}
else if (componentID == RTCP) else if (componentID == RTCP)
{
return "RTCP"; return "RTCP";
}
else else
{
return Integer.toString(componentID); return Integer.toString(componentID);
} }
}
/** /**
* Use builder pattern to allow creation of immutable Component instances, * Use builder pattern to allow creation of immutable Component instances,