Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.jabber.extensions.jingle
Class RtpDescriptionPacketExtension

java.lang.Object
  extended by net.java.sip.communicator.impl.protocol.jabber.extensions.AbstractPacketExtension
      extended by net.java.sip.communicator.impl.protocol.jabber.extensions.jingle.RtpDescriptionPacketExtension
All Implemented Interfaces:
org.jivesoftware.smack.packet.PacketExtension

public class RtpDescriptionPacketExtension
extends AbstractPacketExtension

Represents the content description elements described in XEP-0167.

Author:
Emil Ivov

Field Summary
static String ELEMENT_NAME
          The name of the "description" element.
static String MEDIA_ATTR_NAME
          The name of the media description argument.
static String NAMESPACE
          The name space for RTP description elements.
static String SSRC_ATTR_NAME
          The name of the ssrc description argument.
 
Fields inherited from class net.java.sip.communicator.impl.protocol.jabber.extensions.AbstractPacketExtension
attributes
 
Constructor Summary
RtpDescriptionPacketExtension()
          Creates a new RtpDescriptionPacketExtension.
RtpDescriptionPacketExtension(String namespace)
          Create a new RtpDescriptionPacketExtension with a different namespace.
 
Method Summary
 void addChildExtension(org.jivesoftware.smack.packet.PacketExtension childExtension)
          Casts childExtension to one of the extensions allowed here and sets the corresponding field.
 void addExtmap(RTPHdrExtPacketExtension extmap)
          Adds an optional extmap element that allows negotiation RTP extension headers as per RFC 5282.
 void addPayloadType(PayloadTypePacketExtension payloadType)
          Adds a new payload type to this description element.
 BandwidthPacketExtension getBandwidth()
          Returns an optional bandwidth element that specifies the allowable or preferred bandwidth for use by this application type.
 List<? extends org.jivesoftware.smack.packet.PacketExtension> getChildExtensions()
          Returns all child elements that we currently have in this packet.
 EncryptionPacketExtension getEncryption()
          Returns the optional encryption element that contains encryption parameters for this session.
 List<RTPHdrExtPacketExtension> getExtmapList()
          Returns a List of the optional extmap elements that allow negotiating RTP extension headers as per RFC 5282.
 String getMedia()
          Returns the media type for the stream that this description element represents, such as "audio" or "video".
 List<PayloadTypePacketExtension> getPayloadTypes()
          Returns a reference to the list of payload types that we have registered with this description so far.
 String getSsrc()
          Returns the synchronization source ID (SSRC as per RFC 3550) that the stream represented by this description element will be using.
 void setBandwidth(BandwidthPacketExtension bandwidth)
          Sets an optional bandwidth element that specifies the allowable or preferred bandwidth for use by this application type.
 void setEncryption(EncryptionPacketExtension encryption)
          Sets the optional encryption element that contains encryption parameters for this session.
 void setMedia(String media)
          Specifies the media type for the stream that this description element represents, such as "audio" or "video".
 void setSsrc(String ssrc)
          Sets the synchronization source ID (SSRC as per RFC 3550) that the stream represented by this description element will be using.
 
Methods inherited from class net.java.sip.communicator.impl.protocol.jabber.extensions.AbstractPacketExtension
getAttribute, getAttributeAsInt, getAttributeAsInt, getAttributeAsString, getAttributeAsURI, getAttributeNames, getChildExtensionsOfType, getElementName, getFirstChildOfType, getNamespace, getText, removeAttribute, setAttribute, setNamespace, setText, toXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAMESPACE

public static final String NAMESPACE
The name space for RTP description elements.

See Also:
Constant Field Values

ELEMENT_NAME

public static final String ELEMENT_NAME
The name of the "description" element.

See Also:
Constant Field Values

MEDIA_ATTR_NAME

public static final String MEDIA_ATTR_NAME
The name of the media description argument.

See Also:
Constant Field Values

SSRC_ATTR_NAME

public static final String SSRC_ATTR_NAME
The name of the ssrc description argument.

See Also:
Constant Field Values
Constructor Detail

RtpDescriptionPacketExtension

public RtpDescriptionPacketExtension()
Creates a new RtpDescriptionPacketExtension.


RtpDescriptionPacketExtension

public RtpDescriptionPacketExtension(String namespace)
Create a new RtpDescriptionPacketExtension with a different namespace.

Parameters:
namespace - namespace to use
Method Detail

setMedia

public void setMedia(String media)
Specifies the media type for the stream that this description element represents, such as "audio" or "video".

Parameters:
media - the media type for the stream that this element represents such as "audio" or "video".

getMedia

public String getMedia()
Returns the media type for the stream that this description element represents, such as "audio" or "video".

Returns:
the media type for the stream that this description element represents, such as "audio" or "video".

setSsrc

public void setSsrc(String ssrc)
Sets the synchronization source ID (SSRC as per RFC 3550) that the stream represented by this description element will be using.

Parameters:
ssrc - the SSRC ID that the RTP stream represented here will be using.

getSsrc

public String getSsrc()
Returns the synchronization source ID (SSRC as per RFC 3550) that the stream represented by this description element will be using.

Returns:
the synchronization source ID (SSRC as per RFC 3550) that the stream represented by this description element will be using.

addPayloadType

public void addPayloadType(PayloadTypePacketExtension payloadType)
Adds a new payload type to this description element.

Parameters:
payloadType - the new payload to add.

getPayloadTypes

public List<PayloadTypePacketExtension> getPayloadTypes()
Returns a reference to the list of payload types that we have registered with this description so far.

Returns:
a reference to the list of payload types that we have registered with this description so far.

getChildExtensions

public List<? extends org.jivesoftware.smack.packet.PacketExtension> getChildExtensions()
Returns all child elements that we currently have in this packet.

Overrides:
getChildExtensions in class AbstractPacketExtension
Returns:
the List of child elements currently registered with this packet.

addChildExtension

public void addChildExtension(org.jivesoftware.smack.packet.PacketExtension childExtension)
Casts childExtension to one of the extensions allowed here and sets the corresponding field.

Overrides:
addChildExtension in class AbstractPacketExtension
Parameters:
childExtension - the extension we'd like to add here.

setEncryption

public void setEncryption(EncryptionPacketExtension encryption)
Sets the optional encryption element that contains encryption parameters for this session.

Parameters:
encryption - the encryption PacketExtension we'd like to add to this packet.

getEncryption

public EncryptionPacketExtension getEncryption()
Returns the optional encryption element that contains encryption parameters for this session.

Returns:
the encryption PacketExtension added to this packet or null if none has been set yet.

setBandwidth

public void setBandwidth(BandwidthPacketExtension bandwidth)
Sets an optional bandwidth element that specifies the allowable or preferred bandwidth for use by this application type.

Parameters:
bandwidth - the max/preferred bandwidth indication that we'd like to add to this packet.

getBandwidth

public BandwidthPacketExtension getBandwidth()
Returns an optional bandwidth element that specifies the allowable or preferred bandwidth for use by this application type.

Returns:
the max/preferred bandwidth set for this session or null if none has been set yet.

addExtmap

public void addExtmap(RTPHdrExtPacketExtension extmap)
Adds an optional extmap element that allows negotiation RTP extension headers as per RFC 5282.

Parameters:
extmap - an optional extmap element that allows negotiation RTP extension headers as per RFC 5282.

getExtmapList

public List<RTPHdrExtPacketExtension> getExtmapList()
Returns a List of the optional extmap elements that allow negotiating RTP extension headers as per RFC 5282.

Returns:
a List of the optional extmap elements that allow negotiating RTP extension headers as per RFC 5282.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.