src/net/java/sip/communicator/impl/protocol/jabber/CallPeerMediaHandlerJabberImpl.java
/**
     * Creates a {@link ContentPacketExtension}s of the streams for a
     * specific <tt>MediaDevice</tt>.
     *
     * @param dev <tt>MediaDevice</tt>
     * @return the {@link ContentPacketExtension}s of stream that this
     * handler is prepared to initiate.
     * @throws OperationFailedException if we fail to create the descriptions
     * for reasons like problems with device interaction, allocating ports, etc.
     */
Creates a  ContentPacketExtensions of the streams for a
specific MediaDevice.

@param dev MediaDevice
@return the  ContentPacketExtensions of stream that this
handler is prepared to initiate.
@throws OperationFailedException if we fail to create the descriptions
for reasons like problems with device interaction, allocating ports, etc.
Creates a ContentPacketExtensions of the streams for a specific MediaDevice . @param dev MediaDevice @return the ContentPacketExtensions of stream that this handler is prepared to initiate . @throws OperationFailedException if we fail to create the descriptions for reasons like problems with device interaction allocating ports etc .
private ContentPacketExtension createContent(MediaDevice dev)
        throws OperationFailedException
    {
        MediaType mediaType = dev.getMediaType();
        MediaDirection direction = dev.getDirection();
        CallPeerJabberImpl peer = getPeer();
        /*
         * In the case of RTP translation performed by the conference focus,
         * the conference focus is not required to capture media.
         */
        if (!(MediaType.VIDEO.equals(mediaType)
                && isRTPTranslationEnabled(mediaType)))
            direction = direction.and(getDirectionUserPreference(mediaType));
        /*
         * Check if we need to announce sending on behalf of other peers
         */
        CallJabberImpl call = peer.getCall();
        if (call.isConferenceFocus())
        {
            for (CallPeerJabberImpl anotherPeer : call.getCallPeerList())
            {
                if ((anotherPeer != peer)
                        && anotherPeer.getDirection(mediaType)
                                .allowsReceiving())
                {
                    direction = direction.or(MediaDirection.SENDONLY);
                    break;
                }
            }
        }
        if (isLocallyOnHold())
            direction = direction.and(MediaDirection.SENDONLY);
        QualityPreset sendQualityPreset = null;
        QualityPreset receiveQualityPreset = null;
        if(qualityControls != null)
        {
            sendQualityPreset = qualityControls.getRemoteReceivePreset();
            receiveQualityPreset = qualityControls.getRemoteSendMaxPreset();
        }
        if(direction != MediaDirection.INACTIVE)
        {
            ContentPacketExtension content
                = createContentForOffer(
                        getLocallySupportedFormats(
                                dev,
                                sendQualityPreset,
                                receiveQualityPreset),
                        direction,
                        dev.getSupportedExtensions());
            RtpDescriptionPacketExtension description
                = JingleUtils.getRtpDescription(content);
            setDtlsEncryptionOnContent(mediaType, content, null);
            if (!call.getConference().isJitsiVideobridge())
            {
                setSDesEncryptionOnDescription(mediaType, description, null);
                setZrtpEncryptionOnDescription(mediaType, description, null);
            }
            return content;
        }
        return null;
    }
private ContentPacketExtension createContent ( MediaDevice dev ) throws OperationFailedException { MediaType mediaType = dev . getMediaType ( ) ; MediaDirection direction = dev . getDirection ( ) ; CallPeerJabberImpl peer = getPeer ( ) ; /*
         * In the case of RTP translation performed by the conference focus,
         * the conference focus is not required to capture media.
         */ if ( ! ( MediaType . VIDEO . equals ( mediaType ) && isRTPTranslationEnabled ( mediaType ) ) ) direction = direction . and ( getDirectionUserPreference ( mediaType ) ) ; /*
         * Check if we need to announce sending on behalf of other peers
         */ CallJabberImpl call = peer . getCall ( ) ; if ( call . isConferenceFocus ( ) ) { for ( CallPeerJabberImpl anotherPeer : call . getCallPeerList ( ) ) { if ( ( anotherPeer != peer ) && anotherPeer . getDirection ( mediaType ) . allowsReceiving ( ) ) { direction = direction . or ( MediaDirection . SENDONLY ) ; break ; } } } if ( isLocallyOnHold ( ) ) direction = direction . and ( MediaDirection . SENDONLY ) ; QualityPreset sendQualityPreset = null ; QualityPreset receiveQualityPreset = null ; if ( qualityControls != null ) { sendQualityPreset = qualityControls . getRemoteReceivePreset ( ) ; receiveQualityPreset = qualityControls . getRemoteSendMaxPreset ( ) ; } if ( direction != MediaDirection . INACTIVE ) { ContentPacketExtension content = createContentForOffer ( getLocallySupportedFormats ( dev , sendQualityPreset , receiveQualityPreset ) , direction , dev . getSupportedExtensions ( ) ) ; RtpDescriptionPacketExtension description = JingleUtils . getRtpDescription ( content ) ; setDtlsEncryptionOnContent ( mediaType , content , null ) ; if ( ! call . getConference ( ) . isJitsiVideobridge ( ) ) { setSDesEncryptionOnDescription ( mediaType , description , null ) ; setZrtpEncryptionOnDescription ( mediaType , description , null ) ; } return content ; } return null ; }
Creates a {@link ContentPacketExtension}s of the streams for a
 specific <tt>MediaDevice</tt>.
Creates a { @link ContentPacketExtension } s of the streams for a specific <tt > MediaDevice< / tt > .
//this is the direction to be used in the jingle session // the one we will send is the one the remote has announced as // receive // the one we want to receive is the one the remote can send // DTLS-SRTP // Neither SDES nor ZRTP is supported in telephony conferences // utilizing the server-side technology Jitsi Videobridge yet. // SDES // ZRTP