Java 类org.jivesoftware.smackx.jingleold.nat.JingleTransportManager 实例源码

项目:Smack    文件:JingleSession.java   
/**
     * This is the starting point for intitiating a new session.
     * 
     * @throws IllegalStateException
     * @throws SmackException 
     */
    public void startOutgoing() throws IllegalStateException, SmackException {

        updatePacketListener();
        setSessionState(JingleSessionStatePending.getInstance());

        Jingle jingle = new Jingle(JingleActionEnum.SESSION_INITIATE);

        // Create a content negotiator for each media manager on the session.
        for (JingleMediaManager mediaManager : getMediaManagers()) {
            ContentNegotiator contentNeg = new ContentNegotiator(this, ContentNegotiator.INITIATOR, mediaManager.getName());

            // Create the media negotiator for this content description.
            contentNeg.setMediaNegotiator(new MediaNegotiator(this, mediaManager, mediaManager.getPayloads(), contentNeg));

            JingleTransportManager transportManager = mediaManager.getTransportManager();
            TransportResolver resolver = null;
            try {
                resolver = transportManager.getResolver(this);
            } catch (XMPPException e) {
                e.printStackTrace();
            }

            if (resolver.getType().equals(TransportResolver.Type.rawupd)) {
                contentNeg.setTransportNegotiator(new TransportNegotiator.RawUdp(this, resolver, contentNeg));
            }
            if (resolver.getType().equals(TransportResolver.Type.ice)) {
                contentNeg.setTransportNegotiator(new TransportNegotiator.Ice(this, resolver, contentNeg));
            }

            addContentNegotiator(contentNeg);
        }

        // Give each of the content negotiators a chance to return a portion of the structure to make the Jingle packet.
        for (ContentNegotiator contentNegotiator : contentNegotiators) {
            jingle.addContent(contentNegotiator.getJingleContent());
        }

        // Save the session-initiate packet ID, so that we can respond to it.
        sessionInitPacketID = jingle.getStanzaId();

        sendStanza(jingle);

        // Now setup to track the media negotiators, so that we know when (if) to send a session-accept.
        setupListeners();

        // Give each of the content negotiators a chance to start 
        // and return a portion of the structure to make the Jingle packet.

// Don't do this anymore.  The problem is that the other side might not be ready.
// Later when we receive our first jingle packet from the other side we'll fire-up the negotiators
// before processing it.  (See receivePacketAndRespond() above.
//        for (ContentNegotiator contentNegotiator : contentNegotiators) {
//            contentNegotiator.start();
//        }
    }
项目:Smack    文件:JmfMediaManager.java   
/**
 * Creates a Media Manager instance
 */
public JmfMediaManager(JingleTransportManager transportManager) {
    super(transportManager);
    setupPayloads();
}
项目:Smack    文件:JmfMediaManager.java   
/**
 * Creates a Media Manager instance
 *
 * @param mediaLocator Media Locator
 */
public JmfMediaManager(String mediaLocator, JingleTransportManager transportManager) {
    super(transportManager);
    this.mediaLocator = mediaLocator;
    setupPayloads();
}
项目:Smack    文件:ScreenShareMediaManager.java   
public ScreenShareMediaManager(JingleTransportManager transportManager) {
    super(transportManager);
    setupPayloads();
}
项目:Smack    文件:SpeexMediaManager.java   
public SpeexMediaManager(JingleTransportManager transportManager) {
    super(transportManager);
    setupPayloads();
    setupJMF();
}
项目:Smack    文件:TestMediaManager.java   
public TestMediaManager(JingleTransportManager transportManager) {
    super(transportManager);
}
项目:Smack    文件:MultiMediaManager.java   
public MultiMediaManager(JingleTransportManager transportManager) {
    super(transportManager);
}
项目:Smack    文件:ContentNegotiator.java   
/**
 * @param jingleTransportManager
 */
public void setJingleTransportManager(JingleTransportManager jingleTransportManager) {
    this.jingleTransportManager = jingleTransportManager;
}
项目:Smack    文件:ContentNegotiator.java   
/**
 * @return the JingleTransportManager
 */
public JingleTransportManager getTransportManager() {
    return jingleTransportManager;
}
项目:Smack    文件:JingleMediaManager.java   
public JingleMediaManager(JingleTransportManager transportManager) {
    this.transportManager = transportManager;
}
项目:Smack    文件:JingleMediaManager.java   
/**
 * Return   The transport manager that goes with this media manager.
 */
public JingleTransportManager getTransportManager() {
    return transportManager;
}