|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.lastbamboo.common.ice.IceMediaStreamImpl
public class IceMediaStreamImpl
Class containing an ICE media stream. Each media stream contains a single ICE check list, as described in ICE section 5.7.
| Constructor Summary | |
|---|---|
IceMediaStreamImpl(IceAgent iceAgent,
org.lastbamboo.common.offer.answer.IceMediaStreamDesc streamDesc,
IceCandidateGatherer gatherer,
IceStunUdpPeer udpPeer)
Creates a new ICE media stream. |
|
| Method Summary | |
|---|---|
void |
addLocalCandidate(IceCandidate localCandidate)
Adds a local candidate. |
void |
addPair(IceCandidatePair pair)
Adds the specified ICE candidate pair to the check list. |
IceCandidate |
addRemotePeerReflexive(org.littleshoot.stun.stack.message.BindingRequest request,
InetSocketAddress localAddress,
InetSocketAddress remoteAddress,
boolean isUdp)
Adds a peer reflexive candidate to the list of remote candidates. |
void |
addTriggeredPair(IceCandidatePair pair)
Adds a pair to the triggered check queue. |
void |
addValidPair(IceCandidatePair pair)
Adds a new valid pair. |
void |
close()
Perform any necessary close operations for the media stream. |
byte[] |
encodeCandidates()
Encodes this media stream in SDP. |
void |
establishStream(Collection<IceCandidate> remoteCandidates)
Establishes a media stream using the answer data from the remote host. |
IceCheckListState |
getCheckListState()
Gets the state of the check list. |
IceCandidate |
getLocalCandidate(InetSocketAddress localAddress,
boolean isUdp)
Accessor for the local candidate associate with the specified local address. |
Collection<IceCandidate> |
getLocalCandidates()
Accessor for the local candidates for this stream. |
Queue<IceCandidatePair> |
getNominatedPairs()
Accessor for all nominated pairs for this stream. |
IceCandidatePair |
getPair(InetSocketAddress localAddress,
InetSocketAddress remoteAddress,
boolean isUdp)
Accesses the pair matching the specified local and remote addresses, if any. |
InetAddress |
getPublicAddress()
|
IceCandidate |
getRemoteCandidate(InetSocketAddress remoteAddress,
boolean isUdp)
Accessor for the remote candidate associate with the specified remote address. |
IceStunUdpPeer |
getStunUdpPeer()
|
Queue<IceCandidatePair> |
getValidPairs()
Accessor for all valid pairs for this stream. |
boolean |
hasHigherPriorityPendingPair(IceCandidatePair pair)
Checks whether or not there are existing pairs on either the triggered check list or the normal check list. |
boolean |
hasRemoteCandidate(InetSocketAddress remoteAddress,
boolean isUdp)
Checks whether or not the specified remote address matches any of the addresses of remote candidates. |
boolean |
hasRemoteCandidateInSdp(InetSocketAddress remoteAddress,
boolean isUdp)
Checks whether or not the specified remote address matches any of the addresses of remote candidates. |
void |
onNominated(IceCandidatePair pair)
Notifies the media stream that there's been a nominated pair. |
void |
recomputePairPriorities(boolean controlling)
Recomputes the priorities of pairs in checklists. |
void |
serviceActivated(org.littleshoot.mina.common.IoService service,
SocketAddress serviceAddress,
org.littleshoot.mina.common.IoHandler handler,
org.littleshoot.mina.common.IoServiceConfig config)
|
void |
serviceDeactivated(org.littleshoot.mina.common.IoService service,
SocketAddress serviceAddress,
org.littleshoot.mina.common.IoHandler handler,
org.littleshoot.mina.common.IoServiceConfig config)
|
void |
sessionCreated(org.littleshoot.mina.common.IoSession session)
|
void |
sessionDestroyed(org.littleshoot.mina.common.IoSession session)
|
void |
setCheckListState(IceCheckListState state)
Sets the state of the check list. |
void |
start(IceCheckList checkList,
Collection<IceCandidate> localCandidates,
IceCheckScheduler scheduler)
Starts gathering candidates and executing ICE. |
String |
toString()
|
void |
updateCheckListAndTimerStates()
Implements ICE section 7.1.2.3. |
void |
updatePairStates(IceCandidatePair generatingPair)
Called when connectivity checks have created a new valid pair and the media stream needs to update the states of other pairs. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public IceMediaStreamImpl(IceAgent iceAgent,
org.lastbamboo.common.offer.answer.IceMediaStreamDesc streamDesc,
IceCandidateGatherer gatherer,
IceStunUdpPeer udpPeer)
iceAgent - The ICE agent.streamDesc - The description of the stream to create.gatherer - The class that will gather ICE candidates for the
stream.| Method Detail |
|---|
public void start(IceCheckList checkList,
Collection<IceCandidate> localCandidates,
IceCheckScheduler scheduler)
IceMediaStream
start in interface IceMediaStreamcheckList - The candidate pair check list.localCandidates - The local candidates.scheduler - The check scheduler.public byte[] encodeCandidates()
IceMediaStream
encodeCandidates in interface IceMediaStreampublic void establishStream(Collection<IceCandidate> remoteCandidates)
IceMediaStream
establishStream in interface IceMediaStreamremoteCandidates - The answer from the remote host.
public IceCandidate addRemotePeerReflexive(org.littleshoot.stun.stack.message.BindingRequest request,
InetSocketAddress localAddress,
InetSocketAddress remoteAddress,
boolean isUdp)
IceMediaStream
addRemotePeerReflexive in interface IceMediaStreamrequest - The BindingRequest that initiated the
establishment of a new peer reflexive candidate.localAddress - The local address the request was sent to. This
allows us to match the local address with the local candidate it was
sent to. We use that to determine the component ID of the new peer
reflexive candidate.remoteAddress - The remote address of the peer that sent the
Binding Request.isUdp - Whether the candidate should be a UDP candidate or not.
public Queue<IceCandidatePair> getValidPairs()
IceMediaStream
getValidPairs in interface IceMediaStreamQueue of all valid pairs for this stream.public void addLocalCandidate(IceCandidate localCandidate)
IceMediaStream
addLocalCandidate in interface IceMediaStreamlocalCandidate - The local candidate to add.
public IceCandidate getLocalCandidate(InetSocketAddress localAddress,
boolean isUdp)
IceMediaStream
getLocalCandidate in interface IceMediaStreamlocalAddress - The local address to look for.
null if there's no associated candidate.
public IceCandidate getRemoteCandidate(InetSocketAddress remoteAddress,
boolean isUdp)
IceMediaStream
getRemoteCandidate in interface IceMediaStreamremoteAddress - The remote address to look for.isUdp - Whether to search for UDP candidates.
null if there's no associated candidate.
public boolean hasRemoteCandidate(InetSocketAddress remoteAddress,
boolean isUdp)
IceMediaStream
hasRemoteCandidate in interface IceMediaStreamremoteAddress - The remote address to check.isUdp - Whether or not the candidate is UDP.
true if the address matches the address of a
remote candidate we already know about, otherwise false.
public boolean hasRemoteCandidateInSdp(InetSocketAddress remoteAddress,
boolean isUdp)
IceMediaStream
hasRemoteCandidateInSdp in interface IceMediaStreamremoteAddress - The remote address to check.isUdp - Whether or not the candidate is UDP.
true if the address matches the address of a
remote candidate we already know about, otherwise false.
public IceCandidatePair getPair(InetSocketAddress localAddress,
InetSocketAddress remoteAddress,
boolean isUdp)
IceMediaStream
getPair in interface IceMediaStreamlocalAddress - The address for the local candidate.remoteAddress - The address for the remote candidate.isUdp - Whether or not the pair is UDP.
null if no
such pair exists.public void updatePairStates(IceCandidatePair generatingPair)
IceMediaStream
updatePairStates in interface IceMediaStreamgeneratingPair - The pair that generated the valid pair.public void updateCheckListAndTimerStates()
IceMediaStream
updateCheckListAndTimerStates in interface IceMediaStreampublic void addValidPair(IceCandidatePair pair)
IceMediaStream
addValidPair in interface IceMediaStreampair - The pair to add.public void recomputePairPriorities(boolean controlling)
IceMediaStream
recomputePairPriorities in interface IceMediaStreamcontrolling - The current controlling status of the agent.public void addTriggeredPair(IceCandidatePair pair)
IceMediaStream
addTriggeredPair in interface IceMediaStreampair - The pair to add.public void addPair(IceCandidatePair pair)
IceMediaStream
addPair in interface IceMediaStreampair - The pair to add.public IceCheckListState getCheckListState()
IceMediaStream
getCheckListState in interface IceMediaStreampublic void setCheckListState(IceCheckListState state)
IceMediaStream
setCheckListState in interface IceMediaStreamstate - The state of the check list.public boolean hasHigherPriorityPendingPair(IceCandidatePair pair)
IceMediaStream
hasHigherPriorityPendingPair in interface IceMediaStreampair - The pair to check.
true if there's a higher priority pair that could
still complete its check, otherwise false.public void onNominated(IceCandidatePair pair)
IceMediaStream
onNominated in interface IceMediaStreampair - The nominated pair.public Queue<IceCandidatePair> getNominatedPairs()
IceMediaStream
getNominatedPairs in interface IceMediaStreamQueue of all nominated pairs for this stream.
public void serviceActivated(org.littleshoot.mina.common.IoService service,
SocketAddress serviceAddress,
org.littleshoot.mina.common.IoHandler handler,
org.littleshoot.mina.common.IoServiceConfig config)
serviceActivated in interface org.littleshoot.mina.common.IoServiceListener
public void serviceDeactivated(org.littleshoot.mina.common.IoService service,
SocketAddress serviceAddress,
org.littleshoot.mina.common.IoHandler handler,
org.littleshoot.mina.common.IoServiceConfig config)
serviceDeactivated in interface org.littleshoot.mina.common.IoServiceListenerpublic void sessionCreated(org.littleshoot.mina.common.IoSession session)
sessionCreated in interface org.littleshoot.mina.common.IoServiceListenerpublic void sessionDestroyed(org.littleshoot.mina.common.IoSession session)
sessionDestroyed in interface org.littleshoot.mina.common.IoServiceListenerpublic void close()
IceMediaStream
close in interface IceMediaStreampublic Collection<IceCandidate> getLocalCandidates()
IceMediaStream
getLocalCandidates in interface IceMediaStreampublic InetAddress getPublicAddress()
getPublicAddress in interface IceMediaStreampublic String toString()
toString in class Objectpublic IceStunUdpPeer getStunUdpPeer()
getStunUdpPeer in interface IceMediaStream
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||