|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.java.sip.communicator.impl.neomedia.audiolevel.AudioLevelMap
public class AudioLevelMap
The class implements a basic mapping utility that allows binding long CSRC ID-s to int audio levels. The class does not implement any synchronization for neither read nor write operations but it is still intended to handle concurrent access in a manner that can be considered graceful for the audio level use case. The class uses a bi-dimensional long[][] matrix that is recreated every time a new CSRC is added or an existing one is removed. Iterating through the matrix is only possible after obtaining a direct reference to it. It is possible for this reference to become invalid shortly after someone has obtained it (e.g. because someone added a new CSRC) but this should not cause problems for the CSRC audio level delivery case.
| Constructor Summary | |
|---|---|
AudioLevelMap()
|
|
| Method Summary | |
|---|---|
int |
getLevel(long csrc)
Returns the audio level of the specified csrc id or -1 if csrc is not currently registered in this map. |
void |
putLevel(long csrc,
int level)
If this map already contains csrc this method updates its level, otherwise we add a new entry mapping csrc to level. |
boolean |
removeLevel(long csrc)
Removes csrc and its mapped level from this map. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AudioLevelMap()
| Method Detail |
|---|
public void putLevel(long csrc,
int level)
csrc - the CSRC key that we'd like to add/update.level - the new audio level for the specified csrc.public boolean removeLevel(long csrc)
csrc - the CSRC ID that we'd like to remove from this map.
public int getLevel(long csrc)
csrc - the CSRC ID whose level we'd like to obtain.
|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||