FileDocCategorySizeDatePackage
SdpParser.javaAPI DocJMF 2.1.1e2580Mon May 12 12:20:52 BST 2003com.sun.media.sdp

SdpParser

public class SdpParser extends Parser

Fields Summary
public SessionDescription
sessionDescription
public Vector
mediaDescriptions
static String
input
Constructors Summary
public SdpParser(byte[] data)

        init();

        ByteArrayInputStream bin = new ByteArrayInputStream(data);

        parseData(bin);
    
Methods Summary
public com.sun.media.sdp.MediaDescriptiongetMediaDescription(java.lang.String name)

        MediaDescription description = null;

        if (mediaDescriptions != null) {
            for (int i = 0; i < mediaDescriptions.size(); i++) {
                MediaDescription entry =
                        (MediaDescription) mediaDescriptions.elementAt(i);

                if (entry.name.equals(name)) {
                    description = entry;
                    break;
                }
            }
        }

        return description;
    
public java.util.VectorgetMediaDescriptions()

	return mediaDescriptions;
    
public com.sun.media.sdp.MediaAttributegetSessionAttribute(java.lang.String name)

        MediaAttribute attribute = null;

        if (sessionDescription != null) {
            attribute = sessionDescription.getSessionAttribute(name);
        }

        return attribute;
    
public static voidmain(java.lang.String[] args)


         
        new SdpParser(input.getBytes());
    
public voidparseData(java.io.ByteArrayInputStream bin)

        if (getToken(bin, "v=", true)) {
            sessionDescription = new SessionDescription(bin);

            mediaDescriptions = new Vector();

            boolean found = getToken(bin, "m=", false);

            while (found) {
                MediaDescription mediaDescription = new MediaDescription(bin,
                        sessionDescription .connectionIncluded);

                mediaDescriptions.addElement(mediaDescription);

                found = getToken(bin, "m=", false);
            }
        }