Methods Summary |
---|
public java.lang.Object | clone()Copies the current instance.
MediaField retval = new MediaField();
retval.media = media;
retval.port = port;
retval.nports = nports;
retval.proto = proto;
for (int i = 0; i < formats.size(); i++) {
retval.formats.addElement(formats.elementAt(i));
}
return retval;
|
public java.lang.String | encode()Gets the string encoded version of this object.
String encoded_string;
encoded_string = MEDIA_FIELD;
if (media != null) encoded_string += media + Separators.SP + port;
// Leave out the nports parameter as this confuses the messenger.
if (nports > 1) encoded_string += Separators.SLASH + nports;
if (proto != null) encoded_string += Separators.SP + proto;
if (formats != null)
encoded_string += Separators.SP + encodeFormats();
encoded_string += Separators.NEWLINE;
return encoded_string;
|
private java.lang.String | encodeFormats()Gets the string encoded version of the media formats.
String retval = "";
for (int i = 0; i < formats.size(); i++) {
retval += formats.elementAt(i);
if (i < formats.size() -1)
retval += Separators.SP;
}
return retval;
|
public java.util.Vector | getFormats()Gets the vector of media formats
return formats;
|
public java.lang.String | getMedia()Gets the media type.
return media;
|
public java.util.Vector | getMediaFormats(boolean create)Returns an Vector of the media formats supported by this description.
Each element in this Vector will be an String value which matches one of
the a=rtpmap: attribute fields of the media description.
if (!create && formats.size() == 0)
return null;
else return formats;
|
public int | getMediaPort()Returns the port of the media defined by this description
return getPort();
|
public java.lang.String | getMediaType()Returns the type (audio,video etc) of the
media defined by this description.
return getMedia();
|
public int | getNports()Gets the number of ports.
return nports;
|
public int | getPort()Gets the port information.
return port;
|
public int | getPortCount()Returns the number of ports associated with this media description
return getNports();
|
public java.lang.String | getProto()Gets the protocl information.
return proto;
|
public java.lang.String | getProtocol()Returns the protocol over which this media should be transmitted.
return getProto();
|
public void | setFormats(java.util.Vector formats)Sets the formats member.
this.formats = formats;
|
public void | setMedia(java.lang.String m)Sets the media member.
media = m;
|
public void | setMediaFormats(java.util.Vector mediaFormats)Adds a media format to the media description.
Each element in this Vector should be an String value which
matches one of the
a=rtpmap: attribute fields of the media description.
if (mediaFormats == null)
throw new SdpException("The mediaFormats is null");
this.formats = mediaFormats;
|
public void | setMediaPort(int port)Sets the port of the media defined by this description
if (port < 0)
throw new SdpException("The port is < 0");
else setPort(port);
|
public void | setMediaType(java.lang.String mediaType)Sets the type (audio,video etc) of the media defined by this description.
if (mediaType == null)
throw new SdpException("The mediaType is null");
else setMedia(mediaType);
|
public void | setNports(int n)Sets the number of ports member.
nports = n;
|
public void | setPort(int p)Sets the port member.
port = p;
|
public void | setPortCount(int portCount)Sets the number of ports associated with this media description.
if (portCount < 0)
throw new SdpException("The port count is < 0");
else setNports(portCount);
|
public void | setProto(java.lang.String p)Sets the protocol type member.
proto = p;
|
public void | setProtocol(java.lang.String protocol)Sets the protocol over which this media should be transmitted.
if (protocol == null)
throw new SdpException("The protocol is null");
else setProto(protocol);
|