Class JNIDecoder

  • All Implemented Interfaces:
    javax.media.Codec, javax.media.Control, javax.media.Controls, javax.media.PlugIn, FECDecoderControl

    public class JNIDecoder
    extends AbstractCodec2
    implements FECDecoderControl
    Implements an Opus decoder.
    Author:
    Boris Grozev, Lyubomir Marinov
    • Constructor Detail

      • JNIDecoder

        public JNIDecoder()
        Initializes a new JNIDecoder instance.
    • Method Detail

      • doOpen

        protected void doOpen()
                       throws javax.media.ResourceUnavailableException
        Opens this Codec and acquires the resources that it needs to operate. A call to PlugIn.open() on this instance will result in a call to doOpen only if AbstractCodec.opened is false. All required input and/or output formats are assumed to have been set on this Codec before doOpen is called.
        Specified by:
        doOpen in class AbstractCodec2
        Throws:
        javax.media.ResourceUnavailableException - if any of the resources that this Codec needs to operate cannot be acquired
        See Also:
        AbstractCodec2.doOpen()
      • doProcess

        protected int doProcess​(javax.media.Buffer inBuf,
                                javax.media.Buffer outBuf)
        Decodes an Opus packet.
        Specified by:
        doProcess in class AbstractCodec2
      • fecPacketsDecoded

        public int fecPacketsDecoded()
        Returns the number of packets decoded with FEC.
        Specified by:
        fecPacketsDecoded in interface FECDecoderControl
        Returns:
        the number of packets decoded with FEC
      • getControlComponent

        public Component getControlComponent()
        Implements Control.getControlComponent(). JNIDecoder does not provide user interface of its own.
        Specified by:
        getControlComponent in interface javax.media.Control
        Returns:
        null to signify that JNIDecoder does not provide user interface of its own
      • getMatchingOutputFormats

        protected javax.media.Format[] getMatchingOutputFormats​(javax.media.Format inputFormat)
        Gets the Formats which are supported by this Codec as output when the input is in a specific Format.
        Overrides:
        getMatchingOutputFormats in class AbstractCodec2
        Parameters:
        inputFormat - the Format of the input for which the supported output Formats are to be returned
        Returns:
        an array of Formats supported by this Codec as output when the input is in the specified inputFormat
      • setInputFormat

        public javax.media.Format setInputFormat​(javax.media.Format format)
        Makes sure that the outputFormat of this instance is in accord with the inputFormat of this instance.
        Specified by:
        setInputFormat in interface javax.media.Codec
        Overrides:
        setInputFormat in class AbstractCodec2
      • setOutputFormat

        public javax.media.Format setOutputFormat​(javax.media.Format format)
        Specified by:
        setOutputFormat in interface javax.media.Codec
        Overrides:
        setOutputFormat in class AbstractCodec2