javax.sdp
Interface Media

All Superinterfaces:
Cloneable, Field, Serializable
All Known Implementing Classes:
MediaField

public interface Media
extends Field

A Media represents an m= field contained within a MediaDescription. The Media identifies information about the format(s) of the media associated with the MediaDescription. The Media field includes: a mediaType (e.g. audio, video, etc.) a port number (or set of ports) a protocol to be used (e.g. RTP/AVP) a set of media formats which correspond to Attributes associated with the media description. Here is an example: m=audio 60000 RTP/AVP 0 a=rtpmap:0 PCMU/8000 This example identifies that the client can receive audio on port 60000 in format 0 which corresponds to PCMU/8000. Please refer to IETF RFC 2327 for a description of SDP.

Version:
1.0
Author:
deruelle

Method Summary
 Vector getMediaFormats(boolean create)
          Returns an Vector of the media formats supported by this description.
 int getMediaPort()
          Returns the port of the media defined by this description
 String getMediaType()
          Returns the type (audio,video etc) of the media defined by this description.
 int getPortCount()
          Returns the number of ports associated with this media description
 String getProtocol()
          Returns the protocol over which this media should be transmitted.
 void setMediaFormats(Vector mediaFormats)
          Adds a media format to the media description.
 void setMediaPort(int port)
          Sets the port of the media defined by this description
 void setMediaType(String mediaType)
          Sets the type (audio,video etc) of the media defined by this description.
 void setPortCount(int portCount)
          Sets the number of ports associated with this media description.
 void setProtocol(String protocol)
          Sets the protocol over which this media should be transmitted.
 String toString()
          Generates a string description of this object.
 
Methods inherited from interface javax.sdp.Field
clone, getTypeChar
 

Method Detail

getMediaType

String getMediaType()
                    throws SdpParseException
Returns the type (audio,video etc) of the media defined by this description.

Returns:
the string media type.
Throws:
SdpParseException

setMediaType

void setMediaType(String mediaType)
                  throws SdpException
Sets the type (audio,video etc) of the media defined by this description.

Parameters:
mediaType - to set
Throws:
SdpException - if mediaType is null

getMediaPort

int getMediaPort()
                 throws SdpParseException
Returns the port of the media defined by this description

Returns:
the integer media port.
Throws:
SdpParseException

setMediaPort

void setMediaPort(int port)
                  throws SdpException
Sets the port of the media defined by this description

Parameters:
port - to set
Throws:
SdpException

getPortCount

int getPortCount()
                 throws SdpParseException
Returns the number of ports associated with this media description

Returns:
the integer port count.
Throws:
SdpParseException

setPortCount

void setPortCount(int portCount)
                  throws SdpException
Sets the number of ports associated with this media description.

Parameters:
portCount - portCount - the integer port count.
Throws:
SdpException

getProtocol

String getProtocol()
                   throws SdpParseException
Returns the protocol over which this media should be transmitted.

Returns:
the String protocol, e.g. RTP/AVP.
Throws:
SdpParseException

setProtocol

void setProtocol(String protocol)
                 throws SdpException
Sets the protocol over which this media should be transmitted.

Parameters:
protocol - - the String protocol, e.g. RTP/AVP.
Throws:
SdpException - if the protocol is null

getMediaFormats

Vector getMediaFormats(boolean create)
                       throws SdpParseException
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.

Parameters:
create - to set
Returns:
the Vector.
Throws:
SdpException
SdpParseException

setMediaFormats

void setMediaFormats(Vector mediaFormats)
                     throws SdpException
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.

Parameters:
mediaFormats - the format to add.
Throws:
SdpException - if the vector is null

toString

String toString()
Generates a string description of this object.

Overrides:
toString in class Object
Returns:
the description.


Copyright © 2012. All Rights Reserved.