|
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.AudioLevelEventDispatcher
public class AudioLevelEventDispatcher
The class implements an audio level measurement thread. The thread will measure new data every time it is added through the addData() method and would then deliver it to a registered listener if any. (No measurement would be performed until we have a levelListener). We use a separate thread so that we could compute and deliver audio levels in a way that won't delay the media processing thread.
Note that, for performance reasons this class is not 100% thread safe and you should not modify add or remove audio listeners in this dispatcher in the notification thread (i.e. in the thread where you were notified of an audio level change).
| Constructor Summary | |
|---|---|
AudioLevelEventDispatcher(String threadName)
Initializes a new AudioLevelEventDispatcher instance which is to use a specific name for its Thread which is to run the actual audio level calculations and to dispatch to its SimpleAudioLevelListener |
|
| Method Summary | |
|---|---|
void |
addData(javax.media.Buffer buffer)
Adds data to be processed. |
void |
setAudioLevelCache(AudioLevelMap cache,
long ssrc)
Sets an AudioLevelMap that this dispatcher could use to cache levels it's measuring in addition to simply delivering them to a listener. |
void |
setAudioLevelListener(SimpleAudioLevelListener listener)
Sets the new listener that will be gathering all events from this dispatcher. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AudioLevelEventDispatcher(String threadName)
threadName - | Method Detail |
|---|
public void addData(javax.media.Buffer buffer)
buffer - the data that we'd like to queue for processing.public void setAudioLevelListener(SimpleAudioLevelListener listener)
listener - the listener that we will be notifying or null
if we are to remove it.
public void setAudioLevelCache(AudioLevelMap cache,
long ssrc)
cache - the AudioLevelMap where this dispatcher should
cache measured results.ssrc - the SSRC key where entries should be logged
|
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 | |||||||||