public class DynamicRTPExtensionsRegistry
extends java.lang.Object
Mappings of extension IDs 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 extension mappings for the lifetime of a particular session. One instance of this registry is supposed to be mapped to one media session and they should have the same life cycle.
Modifier and Type | Field and Description |
---|---|
static int |
MAX_ONE_BYTE_HEADER_ID
The maximum integer that is allowed for use when mapping extensions using
the one-byte header.
|
static int |
MAX_TWO_BYTE_HEADER_ID
The maximum integer that is allowed for use when mapping extensions using
the two-byte header.
|
static int |
MIN_HEADER_ID
The minimum integer that is allowed for use when mapping extensions using
the one-byte header.
|
Constructor and Description |
---|
DynamicRTPExtensionsRegistry() |
Modifier and Type | Method and Description |
---|---|
void |
addMapping(org.jitsi.service.neomedia.RTPExtension extension,
byte extID)
Adds the specified extension to extID mapping to
the list of mappings known to this registry.
|
org.jitsi.service.neomedia.RTPExtension |
findExtension(byte extID)
Returns a reference to the RTPExtension with the specified
mapping or null if the number specified by extID
has not been allocated yet.
|
byte |
getExtensionMapping(org.jitsi.service.neomedia.RTPExtension extension)
Returns the ID that has been allocated for extension or
-1 if no extension exists.
|
java.util.Map<org.jitsi.service.neomedia.RTPExtension,java.lang.Byte> |
getMappings()
Returns a copy of all mappings currently registered in this registry.
|
byte |
obtainExtensionMapping(org.jitsi.service.neomedia.RTPExtension extension)
Returns the ID that has been allocated for extension.
|
public static final int MIN_HEADER_ID
public static final int MAX_ONE_BYTE_HEADER_ID
public static final int MAX_TWO_BYTE_HEADER_ID
public byte obtainExtensionMapping(org.jitsi.service.neomedia.RTPExtension extension) throws java.lang.IllegalStateException
extension
- the RTPExtension instance that we'd like to
obtain a dynamic ID for.java.lang.IllegalStateException
- if we have already registered more RTP
extensions than allowed for by RTP.public byte getExtensionMapping(org.jitsi.service.neomedia.RTPExtension extension)
extension
- the RTPExtension instance whose ID we'd like to
find.public void addMapping(org.jitsi.service.neomedia.RTPExtension extension, byte extID) throws java.lang.IllegalArgumentException
extID
- the extension ID that we'd like to allocated to
extension.extension
- the RTPExtension that we'd like to create a
dynamic mapping for.java.lang.IllegalArgumentException
- in case extID has already been
assigned to another RTPExtension.public org.jitsi.service.neomedia.RTPExtension findExtension(byte extID)
extID
- the ID whose RTPExtension we are trying to
discover.public java.util.Map<org.jitsi.service.neomedia.RTPExtension,java.lang.Byte> getMappings()
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.