當前位置: 首頁>>代碼示例>>Java>>正文


Java CreatorEnum類代碼示例

本文整理匯總了Java中net.java.sip.communicator.impl.protocol.jabber.extensions.jingle.ContentPacketExtension.CreatorEnum的典型用法代碼示例。如果您正苦於以下問題:Java CreatorEnum類的具體用法?Java CreatorEnum怎麽用?Java CreatorEnum使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


CreatorEnum類屬於net.java.sip.communicator.impl.protocol.jabber.extensions.jingle.ContentPacketExtension包,在下文中一共展示了CreatorEnum類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initiateOutgoingCall

import net.java.sip.communicator.impl.protocol.jabber.extensions.jingle.ContentPacketExtension.CreatorEnum; //導入依賴的package包/類
public void initiateOutgoingCall(final String targetJid) throws IOException {
    // derive stun and turn server addresses from the connection:
    StunTurnAddress sta = StunTurnAddress.getAddress( connection );
    // create an ice agent using the stun/turn address. We will need this to figure out
    // how to connect our clients:
    iceAgent = new IceAgent(true, sta);
    // setup our jingle stream manager using the default audio and video devices:
    jingleStreamManager = new JingleStreamManager(CreatorEnum.initiator);
    jingleStreamManager.addDefaultMedia(MediaType.VIDEO, "video");
    jingleStreamManager.addDefaultMedia(MediaType.AUDIO, "audio");
    // create ice streams that correspond to the jingle streams that we want
    iceAgent.createStreams(jingleStreamManager.getMediaNames());

    List<ContentPacketExtension> contentList = jingleStreamManager.createContentList(SendersEnum.both);
    iceAgent.addLocalCandidateToContents(contentList);
    
       JingleIQ sessionInitIQ = JinglePacketFactory.createSessionInitiate(
       		connection.getUser(),
       		targetJid,
       		JingleIQ.generateSID(),
       		contentList );
       
       connection.sendPacket(sessionInitIQ);
}
 
開發者ID:bejayoharen,項目名稱:java-bells,代碼行數:25,代碼來源:SampleJinglePacketHandler.java

示例2: JingleStreamManager

import net.java.sip.communicator.impl.protocol.jabber.extensions.jingle.ContentPacketExtension.CreatorEnum; //導入依賴的package包/類
public JingleStreamManager(CreatorEnum creator) {
    this.creator = creator;
}
 
開發者ID:bejayoharen,項目名稱:java-bells,代碼行數:4,代碼來源:JingleStreamManager.java

示例3: createDescription

import net.java.sip.communicator.impl.protocol.jabber.extensions.jingle.ContentPacketExtension.CreatorEnum; //導入依賴的package包/類
/**
 * Creates a new {@link ContentPacketExtension} instance according to the
 * specified <tt>formats</tt>, <tt>connector</tt> and <tt>direction</tt>,
 * and using the <tt>dynamicPayloadTypes</tt> registry to handle dynamic
 * payload type registrations. The type (e.g. audio/video) of the media
 * description is determined via from the type of the first
 * {@link MediaFormat} in the <tt>formats</tt> list.
 *
 * @param creator indicates whether the person who originally created this
 * content was the initiator or the responder of the jingle session
 * @param contentName the name of the content element as indicator by the
 * creator or, in case we are the creators: as we'd like it to be.
 * @param formats the list of formats that should be advertised in the newly
 * created content extension.
 * @param senders indicates the direction of the media in this stream.
 * @param rtpExtensions a list of <tt>RTPExtension</tt>s supported by the
 * <tt>MediaDevice</tt> that we will be advertising.
 * @param dynamicPayloadTypes a reference to the
 * <tt>DynamicPayloadTypeRegistry</tt> that we should be using to lookup
 * and register dynamic RTP mappings.
 * @param rtpExtensionsRegistry a reference to the
 * <tt>DynamicRTPExtensionRegistry</tt> that we should be using to lookup
 * and register URN to ID mappings.
 *
 * @return the newly create SDP <tt>MediaDescription</tt>.
 */
public static ContentPacketExtension createDescription(
                        CreatorEnum                  creator,
                        String                       contentName,
                        SendersEnum                  senders,
                        List<MediaFormat>            formats,
                        List<RTPExtension>           rtpExtensions,
                        DynamicPayloadTypeRegistry   dynamicPayloadTypes,
                        DynamicRTPExtensionsRegistry rtpExtensionsRegistry)
{
    ContentPacketExtension content = new ContentPacketExtension();
    RtpDescriptionPacketExtension description
                                = new RtpDescriptionPacketExtension();

    content.setCreator(creator);
    content.setName(contentName);

    //senders - only if we have them and if they are different from default
    if(senders != null && senders != SendersEnum.both)
        content.setSenders(senders);

    //RTP description
    content.addChildExtension(description);
    description.setMedia(formats.get(0).getMediaType().toString());

    //now fill in the RTP description
    for(MediaFormat fmt : formats)
    {
        description.addPayloadType(
                        formatToPayloadType(fmt, dynamicPayloadTypes));
    }

    // extmap attributes
    if (rtpExtensions != null && rtpExtensions.size() > 0)
    {
        for (RTPExtension extension : rtpExtensions)
        {
            byte extID
                = rtpExtensionsRegistry.obtainExtensionMapping(extension);
            URI uri = extension.getURI();
            MediaDirection extDirection = extension.getDirection();
            String attributes = extension.getExtensionAttributes();
            SendersEnum sendersEnum = getSenders(extDirection,
                    false);
            RTPHdrExtPacketExtension ext = new RTPHdrExtPacketExtension();

            ext.setURI(uri);
            ext.setSenders(sendersEnum);
            ext.setID(Byte.toString(extID));
            ext.setAttributes(attributes);

            description.addChildExtension(ext);
        }
    }
    return content;
}
 
開發者ID:zhaozw,項目名稱:android-1,代碼行數:82,代碼來源:JingleUtils.java


注:本文中的net.java.sip.communicator.impl.protocol.jabber.extensions.jingle.ContentPacketExtension.CreatorEnum類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。