Class CsrcAudioLevelDispatcher


  • public class CsrcAudioLevelDispatcher
    extends Object
    A simple dispatcher that handles new audio levels reported from incoming RTP packets and then asynchronously delivers them to associated AudioMediaStreamImpl. The asynchronous processing is necessary due to time sensitive nature of incoming RTP packets.
    Author:
    Emil Ivov, Lyubomir Marinov, Yura Yaroshevich
    • Constructor Detail

      • CsrcAudioLevelDispatcher

        public CsrcAudioLevelDispatcher​(AudioMediaStreamImpl mediaStream)
        Initializes a new CsrcAudioLevelDispatcher to dispatch events to a specific AudioMediaStreamImpl.
        Parameters:
        mediaStream - the AudioMediaStreamImpl to which the new instance is to dispatch events
    • Method Detail

      • addLevels

        public void addLevels​(long[] levels,
                              long rtpTime)
        A level matrix that we should deliver to our media stream and its listeners in a separate thread.
        Parameters:
        levels - the levels that we'd like to queue for processing.
        rtpTime - the timestamp carried by the RTP packet which carries the specified levels
      • close

        public void close()
        Closes current CsrcAudioLevelDispatcher to prevent further audio level updates delivery to associated media stream.