Package net.java.sip.communicator.impl.protocol.jabber.extensions.jingle

Examples of net.java.sip.communicator.impl.protocol.jabber.extensions.jingle.ContentPacketExtension


     */
    public ContentPacketExtension getRemoteContent(String contentType)
    {
        for(String key : remoteContentMap.keySet())
        {
            ContentPacketExtension content = remoteContentMap.get(key);
            RtpDescriptionPacketExtension description
                = JingleUtils.getRtpDescription(content);

            if(description.getMedia().equals(contentType))
                return content;
View Full Code Here


     */
    public ContentPacketExtension getLocalContent(String contentType)
    {
        for(String key : localContentMap.keySet())
        {
            ContentPacketExtension content = localContentMap.get(key);
            RtpDescriptionPacketExtension description
                = JingleUtils.getRtpDescription(content);

            if(description.getMedia().equals(contentType))
                return content;
View Full Code Here

                closeStream(mediaType);
                continue;
            }

            // create the answer description
            ContentPacketExtension ourContent
                = JingleUtils.createDescription(
                        content.getCreator(),
                        content.getName(),
                        JingleUtils.getSenders(
                                direction,
                                !getPeer().isInitiator()),
                        mutuallySupportedFormats,
                        rtpExtensions,
                        getDynamicPayloadTypes(),
                        getRtpExtensionsRegistry());

            // ZRTP
            if(getPeer().getCall().isSipZrtpAttribute())
            {
                ZrtpControl control = getZrtpControls().get(mediaType);
                if(control == null)
                {
                    control = JabberActivator.getMediaService()
                        .createZrtpControl();
                    getZrtpControls().put(mediaType, control);
                }

                String helloHash[] = control.getHelloHashSep();

                if(helloHash != null && helloHash[1].length() > 0)
                {
                    EncryptionPacketExtension encryption = new
                        EncryptionPacketExtension();
                    ZrtpHashPacketExtension hash
                        = new ZrtpHashPacketExtension();
                    hash.setVersion(helloHash[0]);
                    hash.setValue(helloHash[1]);

                    encryption.addChildExtension(hash);
                    RtpDescriptionPacketExtension rtpDescription =
                        JingleUtils.getRtpDescription(ourContent);
                    rtpDescription.setEncryption(encryption);
                }
            }

            // got an content which have inputevt, it means that peer requests
            // a desktop sharing session so tell it we support inputevt
            if(content.getChildExtensionsOfType(InputEvtPacketExtension.class)
                    != null)
            {
                ourContent.addChildExtension(new InputEvtPacketExtension());
            }

            answer.add(ourContent);
            localContentMap.put(content.getName(), ourContent);
View Full Code Here

            MediaDirection direction
                = JingleUtils.getDirection(ourContent, !peer.isInitiator());

            //let's now see what was the format we announced as first and
            //configure the stream with it.
            ContentPacketExtension theirContent
                = this.remoteContentMap.get(ourContent.getName());
            RtpDescriptionPacketExtension theirDescription
                = JingleUtils.getRtpDescription(theirContent);
            MediaFormat format = null;
View Full Code Here

        if(isLocallyOnHold())
            direction = direction.and(MediaDirection.SENDONLY);

        if(direction != MediaDirection.INACTIVE)
        {
            ContentPacketExtension content = createContentForOffer(
                    dev.getSupportedFormats(), direction,
                    dev.getSupportedExtensions());

            //ZRTP
            if(getPeer().getCall().isSipZrtpAttribute())
View Full Code Here

        List<ContentPacketExtension> mediaDescs
                                    = new ArrayList<ContentPacketExtension>();

        if (dev != null)
        {
            ContentPacketExtension content = createContent(dev);

            if(content != null)
                mediaDescs.add(content);
        }
View Full Code Here

                if (MediaDirection.RECVONLY.equals(direction))
                    direction = MediaDirection.INACTIVE;

                if(direction != MediaDirection.INACTIVE)
                {
                    ContentPacketExtension content
                        = createContentForOffer(
                                dev.getSupportedFormats(),
                                direction,
                                dev.getSupportedExtensions());

                    //ZRTP
                    if(getPeer().getCall().isSipZrtpAttribute())
                    {
                        ZrtpControl control = getZrtpControls().get(mediaType);
                        if(control == null)
                        {
                            control = JabberActivator.getMediaService()
                                .createZrtpControl();
                            getZrtpControls().put(mediaType, control);
                        }

                        String helloHash[] = control.getHelloHashSep();

                        if(helloHash != null && helloHash[1].length() > 0)
                        {
                            EncryptionPacketExtension encryption = new
                                EncryptionPacketExtension();
                            ZrtpHashPacketExtension hash
                                = new ZrtpHashPacketExtension();
                            hash.setVersion(helloHash[0]);
                            hash.setValue(helloHash[1]);

                            encryption.addChildExtension(hash);
                            RtpDescriptionPacketExtension description =
                                JingleUtils.getRtpDescription(content);
                            description.setEncryption(encryption);
                        }
                    }

                    /* we request a desktop sharing session so add the inputevt
                     * extension in the "video" content
                     */
                    RtpDescriptionPacketExtension description
                        = JingleUtils.getRtpDescription(content);
                    if(description.getMedia().equals(MediaType.VIDEO.toString())
                            && localInputEvtAware)
                    {
                        content.addChildExtension(
                                new InputEvtPacketExtension());
                    }

                    mediaDescs.add(content);
                }
View Full Code Here

    private ContentPacketExtension createContentForOffer(
                                        List<MediaFormat>  supportedFormats,
                                        MediaDirection     direction,
                                        List<RTPExtension> supportedExtensions)
    {
        ContentPacketExtension content
            = JingleUtils.createDescription(
                    CreatorEnum.initiator,
                    supportedFormats.get(0).getMediaType().toString(),
                    JingleUtils.getSenders(direction, !getPeer().isInitiator()),
                    supportedFormats,
                    supportedExtensions,
                    getDynamicPayloadTypes(),
                    getRtpExtensionsRegistry());

        this.localContentMap.put(content.getName(), content);
        return content;
    }
View Full Code Here

            throws OperationFailedException,
            IllegalArgumentException
    {
        for(String key : remoteContentMap.keySet())
        {
            ContentPacketExtension ext = remoteContentMap.get(key);

            if(ext != null)
                processContent(ext);
        }
    }
View Full Code Here

            String name,
            ContentPacketExtension.SendersEnum senders)
        throws OperationFailedException,
               IllegalArgumentException
    {
        ContentPacketExtension ext = remoteContentMap.get(name);

        if(ext != null)
        {
            ext.setSenders(senders);
            processContent(ext);
            remoteContentMap.put(name, ext);
        }
    }
View Full Code Here

TOP

Related Classes of net.java.sip.communicator.impl.protocol.jabber.extensions.jingle.ContentPacketExtension

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.