|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.jsdp.Media
public class Media
A Media represents a m=<field value> field contained in a SDP message. The media field identifies information about the formats of the media associated with the session. A media field includes:
Field Summary | |
---|---|
protected Vector |
formats
The media formats |
protected String |
media
The media type |
protected int |
port
The transport port to which the media stream will be sent |
protected int |
portsCount
The number of transport port where the media stream will be sent |
protected String |
protocol
The transport protocol |
Fields inherited from interface net.sourceforge.jsdp.Field |
---|
ATTRIBUTE_FIELD, BANDWITH_FIELD, CONNECTION_FIELD, EMAIL_FIELD, END_OF_FIELD, INFORMATION_FIELD, KEY_FIELD, MEDIA_FIELD, ORIGIN_FIELD, PHONE_FIELD, REPEAT_TIME_FIELD, SESSION_NAME_FIELD, TIME_FIELD, TIMEZONE_FIELD, URI_FIELD, VERSION_FIELD |
Constructor Summary | |
---|---|
protected |
Media()
Creates a new Media. |
|
Media(String media,
int port,
int portsCount,
String protocol,
String format)
Creates a new Media. |
|
Media(String media,
int port,
String protocol,
String format)
Creates a new Media. |
Method Summary | |
---|---|
void |
addMediaFormat(String format)
Adds a media format. |
Object |
clone()
Returns a clone of this field. |
String[] |
getMediaFormats()
Returns the media formats |
String |
getMediaType()
Returns the type of the media. |
int |
getPort()
Returns the transport port to which the media stream will be sent. |
int |
getPortsCount()
Returns the number of ports associated with this media. |
String |
getProtocol()
Returns the protocol over which this media should be transmitted. |
char |
getType()
Returns the type character for the field. |
static Media |
parse(String field)
Parse an input string and constructs the equivalent media field. |
void |
setMediaFormats(String[] formats)
Sets the media formats. |
void |
setMediaType(String media)
Sets the media type. |
void |
setPort(int port)
Sets the media transport port. |
void |
setPortsCount(int n)
Sets the number of transport ports where the media stream will be sent. |
void |
setProtocol(String protocol)
Sets the protocol over which this media should be transmitted. |
String |
toString()
Returns a string representation of the field.The representation has the form: m=<media> <port>/<portsCount> <protocol> <formats> |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected String media
protected int port
protected int portsCount
protected String protocol
protected Vector formats
Constructor Detail |
---|
protected Media()
public Media(String media, int port, int portsCount, String protocol, String format) throws SDPException
media
- the media typeport
- the transport port to which the media stream will be sentportsCount
- the number of transport ports where the media stream
will be sentprotocol
- the transport protocolformat
- the media default format
SDPException
- if the parameters are not validpublic Media(String media, int port, String protocol, String format) throws SDPException
media
- the media typeport
- the transport port to which the media stream will be sentprotocol
- the transport protocolformat
- the media default format
SDPException
- if the parameters are not validMethod Detail |
---|
public static Media parse(String field) throws SDPParseException
field
- the string to parse
SDPParseException
- if an error occurs while parsingpublic void addMediaFormat(String format) throws SDPException
format
- the media format to add
SDPException
- if the media format is not validpublic Object clone()
clone
in interface Field
clone
in class Object
public String[] getMediaFormats()
public String getMediaType()
public int getPort()
public int getPortsCount()
public String getProtocol()
public char getType()
getType
in interface Field
public void setMediaFormats(String[] formats) throws SDPException
formats
- the formats to set
SDPException
- if one or more media formats are not valid
IllegalArgumentException
- if the media formats are nullpublic void setMediaType(String media) throws SDPException
media
- the media type to set
SDPException
- if the media type is not validpublic void setPort(int port) throws SDPException
port
- the transport port
SDPException
- if the transport port is less than 1public void setPortsCount(int n) throws SDPException
n
- the number of ports
SDPException
- if the number of ports is less than 1public void setProtocol(String protocol) throws SDPException
protocol
- the transport protocol
SDPException
- if the transport protocol is not validpublic String toString()
toString
in interface Field
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |