src/net/java/sip/communicator/impl/protocol/jabber/CallPeerMediaHandlerJabberImpl.java
/**
     * Creates a <tt>List</tt> containing the {@link ContentPacketExtension}s of
     * the streams that this handler is prepared to initiate depending on
     * available <tt>MediaDevice</tt>s and local on-hold and video transmission
     * preferences.
     *
     * @return a {@link List} containing the {@link ContentPacketExtension}s of
     * streams 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 List containing the  ContentPacketExtensions of
the streams that this handler is prepared to initiate depending on
available MediaDevices and local on-hold and video transmission
preferences.

@return a  List containing the  ContentPacketExtensions of
streams 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 List containing the ContentPacketExtensions of the streams that this handler is prepared to initiate depending on available MediaDevices and local on - hold and video transmission preferences . @return a List containing the ContentPacketExtensions of streams 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 .
public List<ContentPacketExtension> createContentList()
        throws OperationFailedException
    {
        List<ContentPacketExtension> mediaDescs
            = new ArrayList<ContentPacketExtension>();
        boolean jitsiVideobridge
            = getPeer().getCall().getConference().isJitsiVideobridge();
        for (MediaType mediaType : MediaType.values())
        {
            MediaDevice dev = getDefaultDevice(mediaType);
            if (isDeviceActive(dev))
            {
                MediaDirection direction = dev.getDirection();
                /*
                 * 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));
                }
                if (isLocallyOnHold())
                    direction = direction.and(MediaDirection.SENDONLY);
                /*
                 * If we're only able to receive, we don't have to offer it at
                 * all. For example, we have to offer audio and no video when we
                 * start an audio call.
                 */
                if (MediaDirection.RECVONLY.equals(direction))
                    direction = MediaDirection.INACTIVE;
                if (direction != MediaDirection.INACTIVE)
                {
                    ContentPacketExtension content
                        = createContentForOffer(
                                getLocallySupportedFormats(dev),
                                direction,
                                dev.getSupportedExtensions());
                    RtpDescriptionPacketExtension description
                        = JingleUtils.getRtpDescription(content);
                    setDtlsEncryptionOnContent(mediaType, content, null);
                    /*
                     * Neither SDES nor ZRTP is supported in telephony
                     * conferences utilizing the server-side technology Jitsi
                     * Videobridge yet.
                     */
                    if (!jitsiVideobridge)
                    {
                        setSDesEncryptionOnDescription(
                                mediaType,
                                description,
                                null);
                        setZrtpEncryptionOnDescription(
                                mediaType,
                                description,
                                null);
                    }
                    if (description.getMedia().equals(
                                MediaType.VIDEO.toString())
                            && getLocalInputEvtAware())
                    {
                        content.addChildExtension(
                                new InputEvtPacketExtension());
                    }
                    mediaDescs.add(content);
                }
            }
        }
        if (mediaDescs.isEmpty())
        {
            ProtocolProviderServiceJabberImpl.throwOperationFailedException(
                    "We couldn't find any active Audio/Video devices"
                        + " and couldn't create a call",
                    OperationFailedException.GENERAL_ERROR,
                    null,
                    logger);
        }
        return harvestCandidates(null, mediaDescs, null);
    }
public List < ContentPacketExtension > createContentList ( ) throws OperationFailedException { List < ContentPacketExtension > mediaDescs = new ArrayList < ContentPacketExtension > ( ) ; boolean jitsiVideobridge = getPeer ( ) . getCall ( ) . getConference ( ) . isJitsiVideobridge ( ) ; for ( MediaType mediaType : MediaType . values ( ) ) { MediaDevice dev = getDefaultDevice ( mediaType ) ; if ( isDeviceActive ( dev ) ) { MediaDirection direction = dev . getDirection ( ) ; /*
                 * 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 ) ) ; } if ( isLocallyOnHold ( ) ) direction = direction . and ( MediaDirection . SENDONLY ) ; /*
                 * If we're only able to receive, we don't have to offer it at
                 * all. For example, we have to offer audio and no video when we
                 * start an audio call.
                 */ if ( MediaDirection . RECVONLY . equals ( direction ) ) direction = MediaDirection . INACTIVE ; if ( direction != MediaDirection . INACTIVE ) { ContentPacketExtension content = createContentForOffer ( getLocallySupportedFormats ( dev ) , direction , dev . getSupportedExtensions ( ) ) ; RtpDescriptionPacketExtension description = JingleUtils . getRtpDescription ( content ) ; setDtlsEncryptionOnContent ( mediaType , content , null ) ; /*
                     * Neither SDES nor ZRTP is supported in telephony
                     * conferences utilizing the server-side technology Jitsi
                     * Videobridge yet.
                     */ if ( ! jitsiVideobridge ) { setSDesEncryptionOnDescription ( mediaType , description , null ) ; setZrtpEncryptionOnDescription ( mediaType , description , null ) ; } if ( description . getMedia ( ) . equals ( MediaType . VIDEO . toString ( ) ) && getLocalInputEvtAware ( ) ) { content . addChildExtension ( new InputEvtPacketExtension ( ) ) ; } mediaDescs . add ( content ) ; } } } if ( mediaDescs . isEmpty ( ) ) { ProtocolProviderServiceJabberImpl . throwOperationFailedException ( "We couldn't find any active Audio/Video devices" + " and couldn't create a call" , OperationFailedException . GENERAL_ERROR , null , logger ) ; } return harvestCandidates ( null , mediaDescs , null ) ; }
Creates a <tt>List</tt> containing the {@link ContentPacketExtension}s of
 the streams that this handler is prepared to initiate depending on
 available <tt>MediaDevice</tt>s and local on-hold and video transmission
 preferences.
Creates a <tt > List< / tt > containing the { @link ContentPacketExtension } s of the streams that this handler is prepared to initiate depending on available <tt > MediaDevice< / tt > s and local on - hold and video transmission preferences .
// Describe the media. // DTLS-SRTP // SDES //ZRTP // we request a desktop sharing session so add the inputevt // extension in the "video" content // Fail if no media is described (e.g. all devices are inactive). // Describe the transport(s).