Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Media.java
   *
   * Created on December 19, 2001, 10:28 AM
   */
  
  package javax.sdp;
  
  import java.util.*;
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.

Author(s):
deruelle
Version:
1.0
 
 public interface Media extends Field {
    
    
Returns the type (audio,video etc) of the media defined by this description.

Returns:
the string media type.
Throws:
SdpParseException
     
     public String getMediaType()
     throws SdpParseException;
    
    
Sets the type (audio,video etc) of the media defined by this description.

Parameters:
mediaType to set
Throws:
SdpException if mediaType is null
     
     public void setMediaType(String mediaType)
     throws SdpException;
    
    
Returns the port of the media defined by this description

Returns:
the integer media port.
Throws:
SdpParseException
     
     public int getMediaPort()
     throws SdpParseException;
    
    
Sets the port of the media defined by this description

Parameters:
port to set
Throws:
SdpException
     
     public void setMediaPort(int port)
     throws SdpException;
    
    
Returns the number of ports associated with this media description

Returns:
the integer port count.
Throws:
SdpParseException
     
     public int getPortCount()
     throws SdpParseException;
    
    
Sets the number of ports associated with this media description.

Parameters:
portCount portCount - the integer port count.
Throws:
SdpException
     
     public void setPortCount(int portCount)
     throws SdpException;
    
    
Returns the protocol over which this media should be transmitted.

Returns:
the String protocol, e.g. RTP/AVP.
Throws:
SdpParseException
     
     public String getProtocol()
     throws SdpParseException;
    
    
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
     
     public void setProtocol(String protocol)
     throws SdpException;
    
    
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
     
    public Vector getMediaFormats(boolean create)
    throws SdpParseException;
    
    
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
    
    public void setMediaFormats(Vector mediaFormats)
    throws SdpException;
    
    
Generates a string description of this object.

Returns:
the description.
    
    public String toString();
    
New to GrepCode? Check out our FAQ X