javax.sdp
Interface MediaDescription

All Superinterfaces:
Cloneable, Serializable
All Known Implementing Classes:
MediaDescriptionImpl

public interface MediaDescription
extends Serializable, Cloneable

A MediaDescription identifies the set of medias that may be received on a specific port or set of ports. It 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. The following 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
 void addAttribute(AttributeField at)
          Add Media Attribute based on an AttributeField value
 void addDynamicPayloads(Vector payloadNames, Vector payloadValues)
          Adds dynamic media types to the description.
 String getAttribute(String name)
          Returns the value of the specified attribute.
 Vector getAttributes(boolean create)
          Returns the set of attributes for this Description as a Vector of Attribute objects in the order they were parsed.
 int getBandwidth(String name)
          Returns the integer value of the specified bandwidth name.
 Vector getBandwidths(boolean create)
          Returns the Bandwidth of the specified type.
 Connection getConnection()
          Returns the connection information associated with this object.
 Info getInfo()
          Returns value of the info field (i=) of this object.
 Key getKey()
          Returns the key data.
 Media getMedia()
          Return the Media field of the description.
 Vector getMimeParameters()
          Returns a Vector containing a string of parameters for each of the codecs in this description.
 Vector getMimeTypes()
          Returns a Vector containing a string indicating the MIME type for each of the codecs in this description.
 Vector getPreconditionFields()
          Get all Precondition Fields in the Media Descritpion
 void removeAttribute(String name)
          Removes the attribute specified by the value parameter.
 void removeBandwidth(String name)
          Removes the specified bandwidth type.
 void setAttribute(String name, String value)
          Sets the value of the specified attribute
 void setAttributes(Vector Attributes)
          Adds the specified Attribute to this Description object.
 void setBandwidth(String name, int value)
          Sets the value of the specified bandwidth type.
 void setBandwidths(Vector bandwidths)
          set the value of the Bandwidth with the specified type
 void setConnection(Connection conn)
          Set the connection data for this entity
 void setInfo(Info i)
          Sets the i= field of this object.
 void setKey(Key key)
          Sets encryption key information.
 void setMedia(Media media)
          Set the Media field of the description.
 void setPreconditionFields(Vector segPrecondition)
          Set PreconditionFields for the Media Description
 void setPreconditions(PreconditionFields segPrecondition)
          Set PreconditionFields for the Media Description
 

Method Detail

getMedia

Media getMedia()
Return the Media field of the description.

Returns:
the Media field of the description.

setMedia

void setMedia(Media media)
              throws SdpException
Set the Media field of the description.

Parameters:
media - to set
Throws:
SdpException - if the media field is null

getInfo

Info getInfo()
Returns value of the info field (i=) of this object.

Returns:
value of the info field (i=) of this object.

setInfo

void setInfo(Info i)
             throws SdpException
Sets the i= field of this object.

Parameters:
i - to set
Throws:
SdpException - if the info is null

getConnection

Connection getConnection()
Returns the connection information associated with this object. This may be null for SessionDescriptions if all Media objects have a connection object and may be null for Media objects if the corresponding session connection is non-null.

Returns:
connection

setConnection

void setConnection(Connection conn)
                   throws SdpException
Set the connection data for this entity

Parameters:
conn - to set
Throws:
SdpException - if the connexion is null

getBandwidths

Vector getBandwidths(boolean create)
Returns the Bandwidth of the specified type.

Parameters:
create - type of the Bandwidth to return
Returns:
the Bandwidth or null if undefined

setBandwidths

void setBandwidths(Vector bandwidths)
                   throws SdpException
set the value of the Bandwidth with the specified type

Parameters:
bandwidths - type of the Bandwidth object whose value is requested
Throws:
SdpException - if vector is null

getBandwidth

int getBandwidth(String name)
                 throws SdpParseException
Returns the integer value of the specified bandwidth name.

Parameters:
name - the name of the bandwidth type.
Returns:
the value of the named bandwidth
Throws:
SdpParseException

setBandwidth

void setBandwidth(String name,
                  int value)
                  throws SdpException
Sets the value of the specified bandwidth type.

Parameters:
name - the name of the bandwidth type.
value - the value of the named bandwidth type.
Throws:
SdpException - if the name is null

removeBandwidth

void removeBandwidth(String name)
Removes the specified bandwidth type.

Parameters:
name - the name of the bandwidth type.

getKey

Key getKey()
Returns the key data.

Returns:
the key data.

setKey

void setKey(Key key)
            throws SdpException
Sets encryption key information. This consists of a method and an encryption key included inline.

Parameters:
key - the encryption key data; depending on method may be null
Throws:
SdpException - if the key is null

getAttributes

Vector getAttributes(boolean create)
Returns the set of attributes for this Description as a Vector of Attribute objects in the order they were parsed.

Parameters:
create - specifies whether to return null or a new empty Vector in case no attributes exists for this Description
Returns:
attributes for this Description

setAttributes

void setAttributes(Vector Attributes)
                   throws SdpException
Adds the specified Attribute to this Description object.

Parameters:
Attributes - the attribute to add
Throws:
SdpException - if the attribute is null

getAttribute

String getAttribute(String name)
                    throws SdpParseException
Returns the value of the specified attribute.

Parameters:
name - the name of the attribute.
Returns:
the value of the named attribute
Throws:
SdpParseException

setAttribute

void setAttribute(String name,
                  String value)
                  throws SdpException
Sets the value of the specified attribute

Parameters:
name - the name of the attribute.
value - the value of the named attribute.
Throws:
SdpException - if the parameters are null

removeAttribute

void removeAttribute(String name)
Removes the attribute specified by the value parameter.

Parameters:
name - the name of the attribute.

getMimeTypes

Vector getMimeTypes()
                    throws SdpException
Returns a Vector containing a string indicating the MIME type for each of the codecs in this description. A MIME value is computed for each codec in the media description. The MIME type is computed in the following fashion: The type is the mediaType from the media field. The subType is determined by the protocol. The result is computed as the string of the form: type + '/' + subType The subType portion is computed in the following fashion. RTP/AVP the subType is returned as the codec name. This will either be extracted from the rtpmap attribute or computed. other the protocol is returned as the subType. If the protocol is RTP/AVP and the rtpmap attribute for a codec is absent, then the codec name will be computed in the following fashion. String indexed in table SdpConstants.avpTypeNames if the value is an int greater than or equal to 0 and less than AVP_DEFINED_STATIC_MAX, and has been assigned a value. SdpConstant.RESERVED if the value is an int greater than or equal to 0 and less than AVP_DEFINED_STATIC_MAX, and has not been assigned a value. SdpConstant.UNASSIGNED An int greater than or equal to AVP_DEFINED_STATIC_MAX and less than AVP_DYNAMIC_MIN - currently unassigned. SdpConstant.DYNAMIC Any int less than 0 or greater than or equal to AVP_DYNAMIC_MIN

Returns:
a Vector containing a string indicating the MIME type for each of the codecs in this description
Throws:
SdpException - if there is a problem extracting the parameters.

getMimeParameters

Vector getMimeParameters()
                         throws SdpException
Returns a Vector containing a string of parameters for each of the codecs in this description. A parameter string is computed for each codec. The parameter string is computed in the following fashion. The rate is extracted from the rtpmap or static data. The number of channels is extracted from the rtpmap or static data. The ptime is extracted from the ptime attribute. The maxptime is extracted from the maxptime attribute. Any additional parameters are extracted from the ftmp attribute.

Returns:
a Vector containing a string of parameters for each of the codecs in this description.
Throws:
SdpException - if there is a problem extracting the parameters.

addDynamicPayloads

void addDynamicPayloads(Vector payloadNames,
                        Vector payloadValues)
                        throws SdpException
Adds dynamic media types to the description.

Parameters:
payloadNames - a Vector of String - each one the name of a dynamic payload to be added (usually an integer larger than SdpConstants.AVP_DYNAMIC_MIN).
payloadValues - a Vector of String - each contains the value describing the correlated dynamic payloads to be added
Throws:
SdpException - if either vector is null or empty. if the vector sizes are unequal.

setPreconditionFields

void setPreconditionFields(Vector segPrecondition)
                           throws SdpException

Set PreconditionFields for the Media Description

issued by Miguel Freitas (IT) PTInovacao

Parameters:
segPrecondition - Vector with values to ser
Throws:
SdpException

setPreconditions

void setPreconditions(PreconditionFields segPrecondition)

Set PreconditionFields for the Media Description

issued by Miguel Freitas (IT) PTInovacao

Parameters:
segPrecondition - PreconditionFields with values to set

getPreconditionFields

Vector getPreconditionFields()

Get all Precondition Fields in the Media Descritpion

issued by Miguel Freitas (IT) PTInovacao

Returns:
Vector precondition fields

addAttribute

void addAttribute(AttributeField at)

Add Media Attribute based on an AttributeField value

issued by Miguel Freitas (IT) PTInovacao

Parameters:
at - AttributeField


Copyright © 2012. All Rights Reserved.