Package javax.media.rtp.rtcp

Examples of javax.media.rtp.rtcp.SourceDescription


                        stream.readFully(desc);

                        String descStr = new String(desc, "UTF-8");

                        SourceDescription description =

                            new SourceDescription(type, descStr, 0, false);

                        sourceDescriptions.add(description);

                        if (type == SourceDescription.SOURCE_DESC_CNAME) {
View Full Code Here


            Vector sdes = participant.getSourceDescription();

            for (int i = 0; i < sdes.size(); i++) {

                SourceDescription sdesItem = (SourceDescription) sdes.get(i);

                participant.addSourceDescription(sdesItem);

            }
View Full Code Here

        this.cName = cName;

        addSourceDescription(

                new SourceDescription(SourceDescription.SOURCE_DESC_CNAME,

                        cName, 1, false));

        addSourceDescription(

                new SourceDescription(SourceDescription.SOURCE_DESC_NAME,

                        cName, 1, false));

    }
View Full Code Here

     */

    protected void addSourceDescription(SourceDescription sdes) {

        SourceDescription oldSdes =

            (SourceDescription) sourceDescriptions.get(

                    new Integer(sdes.getType()));

        if (oldSdes != null) {

            sdesSize -= oldSdes.getDescription().length();

            sdesSize -= 2;

        }

View Full Code Here

        // rtcp packets use in the "rtp timestamp" the same initial value as rtp packets ( see RFC 3550 Page 37 )
        initialTimestamp = SSRCGenerator.nextSecuredRandomInt();
        lastTimestamp = initialTimestamp;
       
        addSourceDescription(
                new SourceDescription(SourceDescription.SOURCE_DESC_CNAME,
                        participant.getCNAME(), 1, false));
        addSourceDescription(
                new SourceDescription(SourceDescription.SOURCE_DESC_NAME,
                        participant.getCNAME(), 1, false));
    }
View Full Code Here

    /**
     * Adds a source description to this send stream
     * @param sdes The description to add
     */
    public void addSourceDescription(SourceDescription sdes) {
        SourceDescription oldSdes =
            (SourceDescription) sourceDescriptions.get(
                    new Integer(sdes.getType()));
        if (oldSdes != null) {
            sdesSize -= oldSdes.getDescription().length();
            sdesSize -= 2;
        }
        sourceDescriptions.put(new Integer(sdes.getType()), sdes);
        sdesSize += 2;
        sdesSize += sdes.getDescription().length();
View Full Code Here

        {
            user = System.getProperty("user.name");
        }
        initialize(new SessionAddress[] { localAddress },
                new SourceDescription[] {
                        new SourceDescription(
                                SourceDescription.SOURCE_DESC_CNAME, user
                                        + "@"
                                        + InetAddress.getLocalHost()
                                                .getHostName(), 1, false),
                        new SourceDescription(
                                SourceDescription.SOURCE_DESC_NAME, user
                                        + "@"
                                        + InetAddress.getLocalHost()
                                                .getHostName(), 3, false) },
                0.05, 0.25, null);
View Full Code Here

        // initial length (SSRC and the terminating SDES item, a zero octet)
        int sdesLength = 5;
        for (int i=0; i<sdesItems.size(); i++)
        {
            SourceDescription sdesItem = (SourceDescription)sdesItems.elementAt(i);
            if ( !onlyCNAME || (sdesItem.getType() == SourceDescription.SOURCE_DESC_CNAME) )
            {
                sdesLength += sdesItem.getDescription().getBytes("UTF-8").length + 2;
            }
        }

        // do we need padding to next 32-bit boundary
        int padding = 0;
        if ( (sdesLength % 4) != 0 )
        {
            padding = 4 - (sdesLength % 4);
            sdesLength += padding;
        }

        // write the rtcp sdes packet
        output.writeByte(0x81);
        output.writeByte(RTCPPacket.PT_SDES & 0xFF);
        output.writeShort(sdesLength / 4);

        // only one chunk
        output.writeInt((int)(ssrc & 0xFFFFFFFF));

        // write sdes item(s) for ssrc
        for (int i=0; i<sdesItems.size(); i++)
        {
            SourceDescription sdesItem = (SourceDescription)sdesItems.elementAt(i);
            if ( !onlyCNAME || (sdesItem.getType() == SourceDescription.SOURCE_DESC_CNAME) )
            {
                output.writeByte(sdesItem.getType() & 0xFF);

                byte[] desc = sdesItem.getDescription().getBytes("UTF-8");
                output.writeByte(desc.length & 0xFF);
                output.write(desc);
            }
        }
View Full Code Here

        Vector sdes = lastReport.getSourceDescription();

        for (int i = 0; i < sdes.size(); i++) {

            SourceDescription sdesItem = (SourceDescription) sdes.get(i);

            sourceDescriptions.put(new Integer(sdesItem.getType()), sdesItem);

        }

        if (lastReport instanceof RTCPReport) {
View Full Code Here

    rtpMgrs = new RTPManager[pbss.length];
    SessionAddress localAddr, destAddr;
    InetAddress ipAddr;
    SendStream sendStream;
    int port;
    SourceDescription srcDesList[];

    for (int i = 0; i < pbss.length; i++) {
        try {
      rtpMgrs[i] = RTPManager.newInstance();     
     
View Full Code Here

TOP

Related Classes of javax.media.rtp.rtcp.SourceDescription

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.