public class DynamicPayloadTypeRegistry
extends java.lang.Object
Mappings of dynamic payload types are handled with SDP. They are created for a particular session and remain the same for its entire lifetime. They may however change in following sessions.
We use this class as a utility for easily creating and tracking dynamic payload mappings for the lifetime of a particular session. One instance of this registry is supposed to be mapped to one media session. They should have pretty much the same life cycle.
Constructor and Description |
---|
DynamicPayloadTypeRegistry() |
Modifier and Type | Method and Description |
---|---|
void |
addMapping(org.jitsi.service.neomedia.format.MediaFormat format,
byte payloadType)
Adds the specified format to payloadType mapping to
the list of mappings known to this registry.
|
org.jitsi.service.neomedia.format.MediaFormat |
findFormat(byte payloadType)
Return s a reference to the MediaFormat with the specified
mapping or null if the number specified by payloadType
has not been allocated yet.
|
java.util.Map<java.lang.Byte,java.lang.Byte> |
getMappingOverrides()
Returns a copy of all mapping overrides currently registered in this
registry.
|
java.util.Map<org.jitsi.service.neomedia.format.MediaFormat,java.lang.Byte> |
getMappings()
Returns a copy of all mappings currently registered in this registry.
|
java.lang.Byte |
getPayloadType(org.jitsi.service.neomedia.format.MediaFormat format)
Returns the payload type that is currently mapped to format or
null if there is currently no such payload type.
|
byte |
obtainPayloadTypeNumber(org.jitsi.service.neomedia.format.MediaFormat format)
Returns the dynamic payload type that has been allocated for
format.
|
void |
setLocalPayloadTypePreferences(java.util.Map<java.lang.Byte,java.lang.String> mappings)
Sets the override payload type numbers.
|
public void setLocalPayloadTypePreferences(java.util.Map<java.lang.Byte,java.lang.String> mappings)
mappings
- the override payload-type mappings.public byte obtainPayloadTypeNumber(org.jitsi.service.neomedia.format.MediaFormat format) throws java.lang.IllegalStateException
format
- the MediaFormat instance that we'd like to obtain
a payload type number for.java.lang.IllegalStateException
- if we have already registered more dynamic
formats than allowed for by RTP.public void addMapping(org.jitsi.service.neomedia.format.MediaFormat format, byte payloadType) throws java.lang.IllegalArgumentException
payloadType
- the payload type number that we'd like to allocated
to format.format
- the MediaFormat that we'd like to create a
dynamic mapping for.java.lang.IllegalArgumentException
- in case payloadType has
already been assigned to another format.public org.jitsi.service.neomedia.format.MediaFormat findFormat(byte payloadType)
payloadType
- the number of the payload type that we are trying to
get a format for.public java.util.Map<org.jitsi.service.neomedia.format.MediaFormat,java.lang.Byte> getMappings()
public java.util.Map<java.lang.Byte,java.lang.Byte> getMappingOverrides()
public java.lang.Byte getPayloadType(org.jitsi.service.neomedia.format.MediaFormat format)
format
- the MediaFormat
whose mapping we are looking for
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.