Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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

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.PayloadTypePacketExtension
All Implemented Interfaces:
org.jivesoftware.smack.packet.PacketExtension

public class PayloadTypePacketExtension
extends AbstractPacketExtension

Represents the payload-type elements described in XEP-0167.

Author:
Emil Ivov

Field Summary
static String CHANNELS_ATTR_NAME
          The name of the channels payload-type argument.
static String CLOCKRATE_ATTR_NAME
          The name of the clockrate SDP argument.
static String ELEMENT_NAME
          The name of the "payload-type" element.
static String ID_ATTR_NAME
          The name of the payload id SDP argument.
static String MAXPTIME_ATTR_NAME
          The name of the maxptime SDP argument.
static String NAME_ATTR_NAME
          The name of the name SDP argument.
static String PTIME_ATTR_NAME
          The name of the ptime SDP argument.
 
Fields inherited from class net.java.sip.communicator.impl.protocol.jabber.extensions.AbstractPacketExtension
attributes
 
Constructor Summary
PayloadTypePacketExtension()
          Creates a new PayloadTypePacketExtension instance.
 
Method Summary
 void addParameter(ParameterPacketExtension parameter)
          Adds an SDP parameter to the list that we already have registered for this payload type.
 int getChannels()
          Returns the number of channels in this payload type.
 int getClockrate()
          Returns the sampling frequency in Hertz used by this encoding.
 int getID()
          Returns the payload identifier for this encoding (as specified by RFC 3551 or a dynamic one).
 int getMaxptime()
          Returns maximum packet time as specified in RFC 4566.
 String getName()
          Returns the name of the encoding, or as per the XEP: the appropriate subtype of the MIME type.
 List<ParameterPacketExtension> getParameters()
          Returns a reference to the the list of parameters currently registered for this payload type.
 int getPtime()
          Returns packet time as specified in RFC 4566.
 void setChannels(int channels)
          Sets the number of channels in this payload type.
 void setClockrate(int clockrate)
          Specifies the sampling frequency in Hertz used by this encoding.
 void setId(int id)
          Specifies the payload identifier for this encoding.
 void setMaxptime(int maxptime)
          Sets the maximum packet time as specified in RFC 4566.
 void setName(String name)
          Sets the name of the encoding, or as per the XEP: the appropriate subtype of the MIME type.
 void setPtime(int ptime)
          Sets the packet time as specified in RFC 4566.
 
Methods inherited from class net.java.sip.communicator.impl.protocol.jabber.extensions.AbstractPacketExtension
addChildExtension, getAttribute, getAttributeAsInt, getAttributeAsInt, getAttributeAsString, getAttributeAsURI, getAttributeNames, getChildExtensions, 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

ELEMENT_NAME

public static final String ELEMENT_NAME
The name of the "payload-type" element.

See Also:
Constant Field Values

CHANNELS_ATTR_NAME

public static final String CHANNELS_ATTR_NAME
The name of the channels payload-type argument.

See Also:
Constant Field Values

CLOCKRATE_ATTR_NAME

public static final String CLOCKRATE_ATTR_NAME
The name of the clockrate SDP argument.

See Also:
Constant Field Values

ID_ATTR_NAME

public static final String ID_ATTR_NAME
The name of the payload id SDP argument.

See Also:
Constant Field Values

MAXPTIME_ATTR_NAME

public static final String MAXPTIME_ATTR_NAME
The name of the maxptime SDP argument.

See Also:
Constant Field Values

NAME_ATTR_NAME

public static final String NAME_ATTR_NAME
The name of the name SDP argument.

See Also:
Constant Field Values

PTIME_ATTR_NAME

public static final String PTIME_ATTR_NAME
The name of the ptime SDP argument.

See Also:
Constant Field Values
Constructor Detail

PayloadTypePacketExtension

public PayloadTypePacketExtension()
Creates a new PayloadTypePacketExtension instance.

Method Detail

setChannels

public void setChannels(int channels)
Sets the number of channels in this payload type. If omitted, it will be assumed to contain one channel.

Parameters:
channels - the number of channels in this payload type.

getChannels

public int getChannels()
Returns the number of channels in this payload type.

Returns:
the number of channels in this payload type.

setClockrate

public void setClockrate(int clockrate)
Specifies the sampling frequency in Hertz used by this encoding.

Parameters:
clockrate - the sampling frequency in Hertz used by this encoding.

getClockrate

public int getClockrate()
Returns the sampling frequency in Hertz used by this encoding.

Returns:
the sampling frequency in Hertz used by this encoding.

setId

public void setId(int id)
Specifies the payload identifier for this encoding.

Parameters:
id - the payload type id

getID

public int getID()
Returns the payload identifier for this encoding (as specified by RFC 3551 or a dynamic one).

Returns:
the payload identifier for this encoding (as specified by RFC 3551 or a dynamic one).

setMaxptime

public void setMaxptime(int maxptime)
Sets the maximum packet time as specified in RFC 4566.

Parameters:
maxptime - the maximum packet time as specified in RFC 4566

getMaxptime

public int getMaxptime()
Returns maximum packet time as specified in RFC 4566.

Returns:
maximum packet time as specified in RFC 4566

setPtime

public void setPtime(int ptime)
Sets the packet time as specified in RFC 4566.

Parameters:
ptime - the packet time as specified in RFC 4566

getPtime

public int getPtime()
Returns packet time as specified in RFC 4566.

Returns:
packet time as specified in RFC 4566

setName

public void setName(String name)
Sets the name of the encoding, or as per the XEP: the appropriate subtype of the MIME type. Setting this field is RECOMMENDED for static payload types, REQUIRED for dynamic payload types.

Parameters:
name - the name of this encoding.

getName

public String getName()
Returns the name of the encoding, or as per the XEP: the appropriate subtype of the MIME type. Setting this field is RECOMMENDED for static payload types, REQUIRED for dynamic payload types.

Returns:
the name of the encoding, or as per the XEP: the appropriate subtype of the MIME type. Setting this field is RECOMMENDED for static payload types, REQUIRED for dynamic payload types.

addParameter

public void addParameter(ParameterPacketExtension parameter)
Adds an SDP parameter to the list that we already have registered for this payload type.

Parameters:
parameter - an SDP parameter for this encoding.

getParameters

public List<ParameterPacketExtension> getParameters()
Returns a reference to the the list of parameters currently registered for this payload type.

Returns:
a reference to the the list of parameters currently registered for this payload type.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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