public class IceUdpTransportManager extends TransportManagerJabberImpl implements java.beans.PropertyChangeListener
TransportManagerJabberImpl
implementation that would use ICE for
candidate management.Modifier and Type | Field and Description |
---|---|
protected java.util.List<ContentPacketExtension> |
cpeList
This is where we keep our answer between the time we get the offer and
are ready with the answer.
|
protected static java.lang.String |
DEFAULT_STUN_SERVER_ADDRESS
Default STUN server address.
|
protected static int |
DEFAULT_STUN_SERVER_PORT
Default STUN server port.
|
protected org.ice4j.ice.Agent |
iceAgent
The ICE agent that this transport manager would be using for ICE
negotiation.
|
isEstablishingConnectivityWithJitsiVideobridge, startConnectivityEstablishmentWithJitsiVideobridge
Constructor and Description |
---|
IceUdpTransportManager(CallPeerJabberImpl callPeer)
Creates a new instance of this transport manager, binding it to the
specified peer.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close this transport manager and release resources.
|
protected org.ice4j.ice.Agent |
createIceAgent()
Creates the ICE agent that we would be using in this transport manager
for all negotiation.
|
protected org.ice4j.ice.IceMediaStream |
createIceStream(java.lang.String media)
Creates an
IceMediaStream with the specified media
name. |
protected org.jivesoftware.smack.packet.PacketExtension |
createTransport(org.ice4j.ice.IceMediaStream stream)
Converts the ICE media stream and its local candidates into a
IceUdpTransportPacketExtension . |
protected org.jivesoftware.smack.packet.PacketExtension |
createTransport(java.lang.String media) |
protected org.jivesoftware.smack.packet.PacketExtension |
createTransportPacketExtension()
Initializes a new PacketExtension instance appropriate to the
type of Jingle transport represented by this TransportManager.
|
protected org.jitsi.service.neomedia.StreamConnector |
doCreateStreamConnector(org.jitsi.service.neomedia.MediaType mediaType)
Creates a media StreamConnector for a stream of a specific
MediaType.
|
long |
getHarvestingTime(java.lang.String harvesterName)
Returns the harvesting time (in ms) for the harvester given in parameter.
|
java.lang.String |
getICECandidateExtendedType(java.lang.String streamName)
Returns the extended type of the candidate selected if this transport
manager is using ICE.
|
java.net.InetSocketAddress |
getICELocalHostAddress(java.lang.String streamName)
Returns the ICE local host address.
|
java.net.InetSocketAddress |
getICELocalReflexiveAddress(java.lang.String streamName)
Returns the ICE local reflexive address (server or peer reflexive).
|
java.net.InetSocketAddress |
getICELocalRelayedAddress(java.lang.String streamName)
Returns the ICE local relayed address (server or peer relayed).
|
java.net.InetSocketAddress |
getICERemoteHostAddress(java.lang.String streamName)
Returns the ICE remote host address.
|
java.net.InetSocketAddress |
getICERemoteReflexiveAddress(java.lang.String streamName)
Returns the ICE remote reflexive address (server or peer reflexive).
|
java.net.InetSocketAddress |
getICERemoteRelayedAddress(java.lang.String streamName)
Returns the ICE remote relayed address (server or peer relayed).
|
java.lang.String |
getICEState()
Returns the current state of ICE processing.
|
int |
getNbHarvesting()
Returns the number of harvesting for this agent.
|
int |
getNbHarvesting(java.lang.String harvesterName)
Returns the number of harvesting time for the harvester given in
parameter.
|
org.jitsi.service.neomedia.StreamConnector |
getStreamConnector(org.jitsi.service.neomedia.MediaType mediaType)
Gets the StreamConnector to be used as the connector of
the MediaStream with a specific MediaType.
|
org.jitsi.service.neomedia.MediaStreamTarget |
getStreamTarget(org.jitsi.service.neomedia.MediaType mediaType)
|
long |
getTotalHarvestingTime()
Returns the total harvesting time (in ms) for all harvesters.
|
java.lang.String |
getXmlNamespace()
Implements
TransportManagerJabberImpl.getXmlNamespace() . |
void |
propertyChange(java.beans.PropertyChangeEvent evt)
Retransmit state change events from the Agent to the media handler.
|
void |
removeContent(java.lang.String name)
Removes a content with a specific name from the transport-related part of
the session represented by this TransportManagerJabberImpl which
may have been reported through previous calls to the
startCandidateHarvest and
startConnectivityEstablishment methods.
|
protected org.jivesoftware.smack.packet.PacketExtension |
startCandidateHarvest(ContentPacketExtension theirContent,
ContentPacketExtension ourContent,
TransportInfoSender transportInfoSender,
java.lang.String media)
Starts transport candidate harvest for a specific
ContentPacketExtension that we are going to offer or answer
with.
|
void |
startCandidateHarvest(java.util.List<ContentPacketExtension> theirOffer,
java.util.List<ContentPacketExtension> ourAnswer,
TransportInfoSender transportInfoSender)
Starts transport candidate harvest.
|
boolean |
startConnectivityEstablishment(java.lang.Iterable<ContentPacketExtension> remote)
Starts the connectivity establishment of the associated ICE
Agent.
|
protected boolean |
startConnectivityEstablishment(java.util.Map<java.lang.String,IceUdpTransportPacketExtension> remote)
Starts the connectivity establishment of the associated ICE
Agent.
|
java.util.List<ContentPacketExtension> |
wrapupCandidateHarvest()
Simply returns the list of local candidates that we gathered during the
harvest.
|
void |
wrapupConnectivityEstablishment()
Waits for the associated ICE Agent to finish any started
connectivity checks.
|
cloneTransportAndCandidates, closeStreamConnector, createStreamConnector, createTransportForStartCandidateHarvest, findContentByName, findTransportManagerEstablishingConnectivityWithJitsiVideobridge, getColibriChannel, getCurrentGeneration, getIntendedDestination, getNextID, incrementGeneration, removeContent, sendTransportInfoToJitsiVideobridge, startCandidateHarvest
closeStreamConnector, createIceStream, getCallPeer, getICECandidateExtendedType, getLastUsedLocalHost, getPortTracker, getPortTracker, initializePortNumbers, sendHolePunchPacket, sendHolePunchPacket, setTrafficClass
protected static final java.lang.String DEFAULT_STUN_SERVER_ADDRESS
protected static final int DEFAULT_STUN_SERVER_PORT
protected java.util.List<ContentPacketExtension> cpeList
protected final org.ice4j.ice.Agent iceAgent
public IceUdpTransportManager(CallPeerJabberImpl callPeer)
callPeer
- the CallPeer
whose traffic we will be taking
care of.protected org.ice4j.ice.Agent createIceAgent()
createIceAgent
in class TransportManager<CallPeerJabberImpl>
protected org.jitsi.service.neomedia.StreamConnector doCreateStreamConnector(org.jitsi.service.neomedia.MediaType mediaType) throws OperationFailedException
doCreateStreamConnector
in class TransportManagerJabberImpl
mediaType
- the MediaType of the stream for which a
StreamConnector is to be createdOperationFailedException
- if the binding of the sockets failspublic org.jitsi.service.neomedia.StreamConnector getStreamConnector(org.jitsi.service.neomedia.MediaType mediaType) throws OperationFailedException
getStreamConnector
in class TransportManager<CallPeerJabberImpl>
mediaType
- the MediaType of the MediaStream which
is to have its connector set to the returned
StreamConnectorOperationFailedException
- if anything goes wrong while
initializing the requested StreamConnectorgetStreamConnector(MediaType)
public org.jitsi.service.neomedia.MediaStreamTarget getStreamTarget(org.jitsi.service.neomedia.MediaType mediaType)
TransportManagerJabberImpl.getStreamTarget(MediaType)
.
Gets the MediaStreamTarget to be used as the target of
the MediaStream with a specific MediaType.getStreamTarget
in class TransportManagerJabberImpl
mediaType
- the MediaType of the MediaStream which
is to have its target set to the returned
MediaStreamTargetTransportManagerJabberImpl.getStreamTarget(MediaType)
public java.lang.String getXmlNamespace()
TransportManagerJabberImpl.getXmlNamespace()
. Gets the
XML namespace of the Jingle transport implemented by this
TransportManagerJabberImpl.getXmlNamespace
in class TransportManagerJabberImpl
TransportManagerJabberImpl.getXmlNamespace()
protected org.jivesoftware.smack.packet.PacketExtension createTransportPacketExtension()
createTransportPacketExtension
in class TransportManagerJabberImpl
protected org.jivesoftware.smack.packet.PacketExtension startCandidateHarvest(ContentPacketExtension theirContent, ContentPacketExtension ourContent, TransportInfoSender transportInfoSender, java.lang.String media) throws OperationFailedException
startCandidateHarvest
in class TransportManagerJabberImpl
theirContent
- the ContentPacketExtension offered by the
remote peer to which we are going to answer with ourContent or
null if ourContent will be an offer to the remote peerourContent
- the ContentPacketExtension for which transport
candidate harvest is to be startedtransportInfoSender
- a TransportInfoSender if the
harvested transport candidates are to be sent in a
transport-info rather than in ourContent; otherwise,
nullmedia
- the media of the RtpDescriptionPacketExtension
child of ourContentOperationFailedException
- if anything goes wrong while starting
transport candidate harvest for the specified ourContentpublic void startCandidateHarvest(java.util.List<ContentPacketExtension> theirOffer, java.util.List<ContentPacketExtension> ourAnswer, TransportInfoSender transportInfoSender) throws OperationFailedException
wrapupCandidateHarvest()
method which would be called once we
absolutely need the candidates.startCandidateHarvest
in class TransportManagerJabberImpl
theirOffer
- a media description offer that we've received from the
remote party and that we should use in case we need to know what
transports our peer is using.ourAnswer
- the content descriptions that we should be adding our
transport lists to (although not necessarily in this very instance).transportInfoSender
- the TransportInfoSender to be used by
this TransportManagerJabberImpl to send transport-info
JingleIQs from the local peer to the remote peer if this
TransportManagerJabberImpl wishes to utilize
transport-info. Local candidate addresses sent by this
TransportManagerJabberImpl in transport-info are
expected to not be included in the result of
wrapupCandidateHarvest()
.OperationFailedException
- if we fail to allocate a port number.TransportManagerJabberImpl.startCandidateHarvest(List, List,
TransportInfoSender)
protected org.jivesoftware.smack.packet.PacketExtension createTransport(org.ice4j.ice.IceMediaStream stream)
IceUdpTransportPacketExtension
.stream
- the IceMediaStream
that we'd like to describe in
XML.IceUdpTransportPacketExtension
that weprotected org.jivesoftware.smack.packet.PacketExtension createTransport(java.lang.String media) throws OperationFailedException
createTransport
in class TransportManagerJabberImpl
OperationFailedException
protected org.ice4j.ice.IceMediaStream createIceStream(java.lang.String media) throws OperationFailedException
IceMediaStream
with the specified media
name.media
- the name of the stream we'd like to create.IceMediaStream
OperationFailedException
- if binding on the specified media stream
fails for some reason.public java.util.List<ContentPacketExtension> wrapupCandidateHarvest()
wrapupCandidateHarvest
in class TransportManagerJabberImpl
TransportManagerJabberImpl.wrapupCandidateHarvest()
public boolean startConnectivityEstablishment(java.lang.Iterable<ContentPacketExtension> remote)
startConnectivityEstablishment
in class TransportManagerJabberImpl
remote
- the collection of ContentPacketExtensions which
represents the remote counterpart of the negotiation between the local
and the remote peersTransportManagerJabberImpl.startConnectivityEstablishment(Iterable)
protected boolean startConnectivityEstablishment(java.util.Map<java.lang.String,IceUdpTransportPacketExtension> remote)
startConnectivityEstablishment
in class TransportManagerJabberImpl
remote
- a Map of
media-IceUdpTransportPacketExtension pairs which represents the
remote counterpart of the negotiation between the local and the remote
peersTransportManagerJabberImpl.startConnectivityEstablishment(Map)
public void wrapupConnectivityEstablishment() throws OperationFailedException
wrapupConnectivityEstablishment
in class TransportManagerJabberImpl
OperationFailedException
- if ICE processing has failedTransportManagerJabberImpl.wrapupConnectivityEstablishment()
public void removeContent(java.lang.String name)
removeContent
in class TransportManagerJabberImpl
name
- the name of the content to be removed from the
transport-related part of the session represented by this
TransportManagerJabberImplTransportManagerJabberImpl.removeContent(String)
public void close()
close
in class TransportManagerJabberImpl
public java.lang.String getICECandidateExtendedType(java.lang.String streamName)
getICECandidateExtendedType
in class TransportManager<CallPeerJabberImpl>
streamName
- The stream name (AUDIO, VIDEO);public java.lang.String getICEState()
getICEState
in class TransportManager<CallPeerJabberImpl>
public java.net.InetSocketAddress getICELocalHostAddress(java.lang.String streamName)
getICELocalHostAddress
in class TransportManager<CallPeerJabberImpl>
streamName
- The stream name (AUDIO, VIDEO);public java.net.InetSocketAddress getICERemoteHostAddress(java.lang.String streamName)
getICERemoteHostAddress
in class TransportManager<CallPeerJabberImpl>
streamName
- The stream name (AUDIO, VIDEO);public java.net.InetSocketAddress getICELocalReflexiveAddress(java.lang.String streamName)
getICELocalReflexiveAddress
in class TransportManager<CallPeerJabberImpl>
streamName
- The stream name (AUDIO, VIDEO);public java.net.InetSocketAddress getICERemoteReflexiveAddress(java.lang.String streamName)
getICERemoteReflexiveAddress
in class TransportManager<CallPeerJabberImpl>
streamName
- The stream name (AUDIO, VIDEO);public java.net.InetSocketAddress getICELocalRelayedAddress(java.lang.String streamName)
getICELocalRelayedAddress
in class TransportManager<CallPeerJabberImpl>
streamName
- The stream name (AUDIO, VIDEO);public java.net.InetSocketAddress getICERemoteRelayedAddress(java.lang.String streamName)
getICERemoteRelayedAddress
in class TransportManager<CallPeerJabberImpl>
streamName
- The stream name (AUDIO, VIDEO);public long getTotalHarvestingTime()
getTotalHarvestingTime
in class TransportManager<CallPeerJabberImpl>
public long getHarvestingTime(java.lang.String harvesterName)
getHarvestingTime
in class TransportManager<CallPeerJabberImpl>
harvesterName
- The class name if the harvester.public int getNbHarvesting()
getNbHarvesting
in class TransportManager<CallPeerJabberImpl>
public int getNbHarvesting(java.lang.String harvesterName)
getNbHarvesting
in class TransportManager<CallPeerJabberImpl>
harvesterName
- The class name if the harvester.public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
evt
- the event for state change.
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.