Class MediaNegotiator
java.lang.Object
org.jivesoftware.smackx.jingleold.JingleNegotiator
org.jivesoftware.smackx.jingleold.media.MediaNegotiator
Manager for jmf descriptor negotiation. This class is responsible
for managing the descriptor negotiation process, handling all the xmpp
packets interchange and the stage control. handling all the xmpp packets
interchange and the stage control.
-
Field Summary
Fields inherited from class org.jivesoftware.smackx.jingleold.JingleNegotiator
session
-
Constructor Summary
ConstructorDescriptionMediaNegotiator
(JingleSession session, JingleMediaManager mediaManager, List<PayloadType> pts, ContentNegotiator parentNegotiator) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a payload type to the list of remote payloads.void
close()
Terminate the jmf negotiator.dispatchIncomingPacket
(IQ iq, String id) Dispatch an incoming packet.protected void
doStart()
Called from above when starting a new session.Get the best common codec between both parts.Create a JingleDescription that matches this negotiator.Returns the media manager for this negotiator.boolean
Return true if the content is negotiated.boolean
Return true if the content is fully negotiated.protected void
triggerMediaClosed
(PayloadType currPt) Trigger a jmf closed event.protected void
triggerMediaEstablished
(PayloadType bestPt) Trigger a session established event.Methods inherited from class org.jivesoftware.smackx.jingleold.JingleNegotiator
addExpectedId, addListener, getConnection, getListenersList, getNegotiatorState, getSession, isExpectedId, isStarted, removeExpectedId, removeListener, setNegotiatorState, setSession, start
-
Constructor Details
-
MediaNegotiator
public MediaNegotiator(JingleSession session, JingleMediaManager mediaManager, List<PayloadType> pts, ContentNegotiator parentNegotiator) Default constructor. The constructor establishes some basic parameters, but it does not start the negotiation. For starting the negotiation, call startNegotiation.- Parameters:
session
- TODO javadoc me pleasemediaManager
- the media manager.pts
- the list of payload types.parentNegotiator
- the parent content negotiator.
-
-
Method Details
-
getMediaManager
Returns the media manager for this negotiator.- Returns:
- the media manager.
-
dispatchIncomingPacket
public List<IQ> dispatchIncomingPacket(IQ iq, String id) throws XMPPException, SmackException.NotConnectedException, InterruptedException Dispatch an incoming packet. The method is responsible for recognizing the stanza type and, depending on the current state, delivering the stanza to the right event handler and wait for a response.- Specified by:
dispatchIncomingPacket
in classJingleNegotiator
- Parameters:
iq
- TODO javadoc me please the stanza receivedid
- the ID of the response that will be sent- Returns:
- the new Jingle stanza to send.
- Throws:
XMPPException
- if an XMPP protocol error was received.SmackException.NotConnectedException
- if the XMPP connection is not connected.InterruptedException
- if the calling thread was interrupted.
-
isEstablished
Return true if the content is negotiated.- Returns:
- true if the content is negotiated.
-
isFullyEstablished
Return true if the content is fully negotiated.- Returns:
- true if the content is fully negotiated.
-
addRemoteAudioPayloadType
Adds a payload type to the list of remote payloads.- Parameters:
pt
- TODO javadoc me please the remote payload type
-
getBestCommonAudioPt
Get the best common codec between both parts.- Returns:
- The best common PayloadType codec.
-
triggerMediaEstablished
protected void triggerMediaEstablished(PayloadType bestPt) throws SmackException.NotConnectedException, InterruptedException Trigger a session established event.- Parameters:
bestPt
- TODO javadoc me please payload type that has been agreed.- Throws:
SmackException.NotConnectedException
- if the XMPP connection is not connected.InterruptedException
- if the calling thread was interrupted.
-
triggerMediaClosed
Trigger a jmf closed event.- Parameters:
currPt
- TODO javadoc me please current payload type that is cancelled.
-
doStart
Called from above when starting a new session.- Specified by:
doStart
in classJingleNegotiator
-
close
Terminate the jmf negotiator.- Overrides:
close
in classJingleNegotiator
-
getJingleDescription
Create a JingleDescription that matches this negotiator.- Returns:
- the jingle description.
-