Class OpusPacketRouter


  • public class OpusPacketRouter
    extends java.lang.Object
    A router for opus packets to the output specified by an audio processing context. It automatically detects if the packets can go clean through to the output without any decoding and encoding steps on each packet and rebuilds the pipeline of the output if necessary.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Free all resources.
      void flush()
      Indicates that no more input is coming.
      void process​(java.nio.ByteBuffer buffer)
      Process one opus packet.
      void seekPerformed​(long requestedTimecode, long providedTimecode)
      Notify downstream handlers about a seek.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OpusPacketRouter

        public OpusPacketRouter​(AudioProcessingContext context,
                                int inputFrequency,
                                int inputChannels)
        Parameters:
        context - Configuration and output information for processing
        inputFrequency - Sample rate of the opus track
        inputChannels - Number of channels in the opus track
    • Method Detail

      • seekPerformed

        public void seekPerformed​(long requestedTimecode,
                                  long providedTimecode)
        Notify downstream handlers about a seek.
        Parameters:
        requestedTimecode - Timecode in milliseconds to which the seek was requested to
        providedTimecode - Timecode in milliseconds to which the seek was actually performed to
      • flush

        public void flush()
                   throws java.lang.InterruptedException
        Indicates that no more input is coming. Flush any buffers to output.
        Throws:
        java.lang.InterruptedException - When interrupted externally (or for seek/stop).
      • process

        public void process​(java.nio.ByteBuffer buffer)
                     throws java.lang.InterruptedException
        Process one opus packet.
        Parameters:
        buffer - Byte buffer of the packet
        Throws:
        java.lang.InterruptedException - When interrupted externally (or for seek/stop).
      • close

        public void close()
        Free all resources.