Class AbstractAudioFrameBuffer

    • Field Detail

      • synchronizer

        protected final java.lang.Object synchronizer
      • locked

        protected volatile boolean locked
      • receivedFrames

        protected volatile boolean receivedFrames
      • terminated

        protected boolean terminated
      • terminateOnEmpty

        protected boolean terminateOnEmpty
      • clearOnInsert

        protected boolean clearOnInsert
    • Constructor Detail

      • AbstractAudioFrameBuffer

        protected AbstractAudioFrameBuffer​(AudioDataFormat format)
    • Method Detail

      • waitForTermination

        public void waitForTermination()
                                throws java.lang.InterruptedException
        Description copied from interface: AudioFrameBuffer
        Wait until another thread has consumed a terminator frame from this buffer
        Specified by:
        waitForTermination in interface AudioFrameBuffer
        Throws:
        java.lang.InterruptedException - When interrupted externally (or for seek/stop).
      • setTerminateOnEmpty

        public void setTerminateOnEmpty()
        Description copied from interface: AudioFrameBuffer
        Signal that no more input is expected and if the content frames have been consumed, emit a terminator frame.
        Specified by:
        setTerminateOnEmpty in interface AudioFrameBuffer
      • setClearOnInsert

        public void setClearOnInsert()
        Description copied from interface: AudioFrameBuffer
        Signal that the next frame provided to the buffer will clear the frames before it. This is useful when the next data is not contiguous with the current frame buffer, but the remaining frames in the buffer should be used until the next data arrives to prevent a situation where the buffer cannot provide any frames for a while.
        Specified by:
        setClearOnInsert in interface AudioFrameBuffer
      • hasClearOnInsert

        public boolean hasClearOnInsert()
        Specified by:
        hasClearOnInsert in interface AudioFrameBuffer
        Returns:
        Whether the next frame is set to clear the buffer.
      • hasReceivedFrames

        public boolean hasReceivedFrames()
        Specified by:
        hasReceivedFrames in interface AudioFrameBuffer
        Returns:
        True if this buffer has received any input frames.
      • signalWaiters

        protected abstract void signalWaiters()