当前位置: 首页>>代码示例>>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;未经允许,请勿转载。