public class SdpFactory extends Object
Modifier and Type | Method and Description |
---|---|
Attribute |
createAttribute(String name,
String value)
Returns Attribute object with the specified values.
|
BandWidth |
createBandwidth(String modifier,
int value)
Returns Bandwidth object with the specified values.
|
Connection |
createConnection(String addr)
Returns a Connection object with the specified address.
|
Connection |
createConnection(String addr,
int ttl,
int numAddrs)
Returns a Connection object with the specified properties and a network
and address type of "IN" and "IP4" respectively.
|
Connection |
createConnection(String netType,
String addrType,
String addr)
Returns a Connection object with the specified properties and no TTL and
a default number of addresses (1).
|
Connection |
createConnection(String netType,
String addrType,
String addr,
int ttl,
int numAddrs)
Returns a Connection object with the specified properties a
|
EMail |
createEMail(String value)
Returns EMail object with the specified value.
|
Info |
createInfo(String value)
Returns Info object with the specified value.
|
Key |
createKey(String method,
String key)
Returns Key object with the specified value.
|
Media |
createMedia(String media,
int port,
int numPorts,
String transport,
Vector staticRtpAvpTypes)
Returns Media object with the specified properties.
|
MediaDescription |
createMediaDescription(String media,
int port,
int numPorts,
String transport,
int[] staticRtpAvpTypes)
Returns MediaDescription object with the specified properties.
|
MediaDescription |
createMediaDescription(String media,
int port,
int numPorts,
String transport,
String[] formats)
Returns MediaDescription object with the specified properties.
|
Origin |
createOrigin(String userName,
long sessionId,
long sessionVersion,
String networkType,
String addrType,
String address)
Returns Origin object with the specified properties.
|
Origin |
createOrigin(String userName,
String address)
Returns Origin object with the specified properties.
|
Phone |
createPhone(String value)
Returns Phone object with the specified value.
|
RepeatTime |
createRepeatTime(int repeatInterval,
int activeDuration,
int[] offsets)
Returns a RepeatTime object with the specified interval, duration, and
time offsets.
|
SessionDescription |
createSessionDescription()
Creates a new, empty SessionDescription.
|
SessionDescription |
createSessionDescription(SessionDescription otherSessionDescription)
Creates a new SessionDescription, deep copy of another
SessionDescription.
|
SessionDescription |
createSessionDescription(String s)
Creates a SessionDescription populated with the information contained
within the string parameter.
|
SessionName |
createSessionName(String name)
Returns SessionName object with the specified name.
|
Time |
createTime()
Returns an unbounded Time specification (i.e., "t=0 0").
|
Time |
createTime(Date start,
Date stop)
Returns a Time specification with the specified start and stop times.
|
TimeDescription |
createTimeDescription()
Returns TimeDescription unbounded (i.e.
|
TimeDescription |
createTimeDescription(Date start,
Date stop)
Returns TimeDescription object with the specified properties.
|
TimeDescription |
createTimeDescription(Time t)
Returns TimeDescription object with the specified properties.
|
TimeZoneAdjustment |
createTimeZoneAdjustment(Date d,
int offset)
Constructs a timezone adjustment record.
|
URI |
createURI(URL value)
Returns URI object with the specified value.
|
Version |
createVersion(int value)
Returns Version object with the specified values.
|
String |
formatMulticastAddress(String addr,
int ttl,
int numAddrs)
Returns a String containing the computed form for a multi-connection
address.
|
static Date |
getDateFromNtp(long ntpTime) |
static SdpFactory |
getInstance()
Obtain an instance of an SdpFactory.
|
static long |
getNtpTime(Date d)
Returns a long containing the NTP value for a given Java Date.
|
static void |
main(String[] args) |
public static SdpFactory getInstance()
public SessionDescription createSessionDescription() throws SdpException
SdpException
- SdpException, - if there is a problem constructing the
SessionDescription.public SessionDescription createSessionDescription(SessionDescription otherSessionDescription) throws SdpException
otherSessionDescription
- -
the SessionDescription to copy from.SdpException
- -
if there is a problem constructing the SessionDescription.public SessionDescription createSessionDescription(String s) throws SdpParseException
s
- s - the sdp message that is to be parsed.SdpParseException
- SdpParseException - if there is a problem parsing the String.public BandWidth createBandwidth(String modifier, int value)
modifier
- modifier - the bandwidth typevalue
- the bandwidth value measured in kilobits per secondpublic Attribute createAttribute(String name, String value)
name
- the namee of the attributevalue
- the value of the attributepublic Info createInfo(String value)
value
- the string containing the description.public Phone createPhone(String value)
value
- the string containing the description.public EMail createEMail(String value)
value
- the string containing the description.public URI createURI(URL value) throws SdpException
value
- the URL containing the description.SdpException
public SessionName createSessionName(String name)
name
- the string containing the name of the session.public Key createKey(String method, String key)
method
- the string containing the method type.key
- the key to setpublic Version createVersion(int value)
value
- the version number.public Media createMedia(String media, int port, int numPorts, String transport, Vector staticRtpAvpTypes) throws SdpException
media
- the media type, eg "audio"port
- port number on which to receive medianumPorts
- number of ports used for this media streamtransport
- transport type, eg "RTP/AVP"staticRtpAvpTypes
- vector to setSdpException
public Origin createOrigin(String userName, String address) throws SdpException
userName
- the user name.address
- the IP4 encoded address.SdpException
- if the parameters are nullpublic Origin createOrigin(String userName, long sessionId, long sessionVersion, String networkType, String addrType, String address) throws SdpException
userName
- String containing the user that created the string.sessionId
- long containing the session identifier.sessionVersion
- long containing the session version.networkType
- String network type for the origin (usually "IN").addrType
- String address type (usually "IP4").address
- String IP address usually the address of the host.SdpException
- if the parameters are nullpublic MediaDescription createMediaDescription(String media, int port, int numPorts, String transport, int[] staticRtpAvpTypes) throws IllegalArgumentException, SdpException
media
- media -port
- port number on which to receive medianumPorts
- number of ports used for this media streamtransport
- transport type, eg "RTP/AVP"staticRtpAvpTypes
- list of static RTP/AVP media payload types which should be
specified by the returned MediaDescription throws
IllegalArgumentException if passed an invalid RTP/AVP payload
typeIllegalArgumentException
SdpException
public MediaDescription createMediaDescription(String media, int port, int numPorts, String transport, String[] formats)
media
- the media type, eg "audio"port
- port number on which to receive medianumPorts
- number of ports used for this media streamtransport
- transport type, eg "RTP/AVP"formats
- list of formats which should be specified by the returned
MediaDescriptionpublic TimeDescription createTimeDescription(Time t) throws SdpException
t
- the Time that the time description applies to. Returns
TimeDescription object with the specified properties.SdpException
public TimeDescription createTimeDescription() throws SdpException
SdpException
public TimeDescription createTimeDescription(Date start, Date stop) throws SdpException
start
- start time.stop
- stop time.SdpException
- if the parameters are nullpublic String formatMulticastAddress(String addr, int ttl, int numAddrs)
public Connection createConnection(String netType, String addrType, String addr, int ttl, int numAddrs) throws SdpException
netType
- network type, eg "IN" for "Internet"addrType
- address type, eg "IP4" for IPv4 type addressesaddr
- connection addressttl
- time to live (TTL) for multicast addressesnumAddrs
- number of addresses used by the connectionSdpException
public Connection createConnection(String netType, String addrType, String addr) throws SdpException
netType
- network type, eg "IN" for "Internet"addrType
- address type, eg "IP4" for IPv4 type addressesaddr
- connection addressSdpException
- if the parameters are nullpublic Connection createConnection(String addr, int ttl, int numAddrs) throws SdpException
addr
- connection addressttl
- time to live (TTL) for multicast addressesnumAddrs
- number of addresses used by the connectionSdpException
public Connection createConnection(String addr) throws SdpException
addr
- connection addressSdpException
- if the parameter is nullpublic Time createTime(Date start, Date stop) throws SdpException
start
- start timestop
- stop timeSdpException
- if the parameters are nullpublic Time createTime() throws SdpException
SdpException
public RepeatTime createRepeatTime(int repeatInterval, int activeDuration, int[] offsets)
repeatInterval
- the "repeat interval" in secondsactiveDuration
- the "active duration" in secondsoffsets
- the list of offsets relative to the start time of the Time
object with which the returned RepeatTime will be associatedpublic TimeZoneAdjustment createTimeZoneAdjustment(Date d, int offset)
d
- the Date at which the adjustment is going to take place.offset
- the adjustment in number of seconds relative to the start time
of the SessionDescription with which this object is
associated.public static Date getDateFromNtp(long ntpTime)
ntpTime
- long to setpublic static long getNtpTime(Date d) throws SdpParseException
d
- Date to setSdpParseException
public static void main(String[] args) throws SdpParseException, SdpException
SdpParseException
SdpException
Copyright © 2018. All Rights Reserved.