Class JNIEncoder

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

    public class JNIEncoder
    extends AbstractCodec2
    Implements a Speex encoder and RTP packetizer using the native Speex library.
    Author:
    Lubomir Marinov
    • Constructor Detail

      • JNIEncoder

        public JNIEncoder()
        Initializes a new JNIEncoder 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 inputBuffer,
                                javax.media.Buffer outputBuffer)
        Processes (encode) a specific input Buffer.
        Specified by:
        doProcess in class AbstractCodec2
        Parameters:
        inputBuffer - input buffer
        outputBuffer - output buffer
        Returns:
        BUFFER_PROCESSED_OK if buffer has been successfully processed
        See Also:
        AbstractCodec2.doProcess(Buffer, Buffer)
      • getMatchingOutputFormats

        protected javax.media.Format[] getMatchingOutputFormats​(javax.media.Format inputFormat)
        Get the output formats matching a specific input format.
        Overrides:
        getMatchingOutputFormats in class AbstractCodec2
        Parameters:
        inputFormat - the input format to get the matching output formats of
        Returns:
        the output formats matching the specified input format
        See Also:
        AbstractCodec2.getMatchingOutputFormats(Format)
      • getOutputFormat

        public javax.media.Format getOutputFormat()
        Get the output format.
        Overrides:
        getOutputFormat in class net.sf.fmj.media.AbstractCodec
        Returns:
        output format
        See Also:
        AbstractCodec.getOutputFormat()
      • setInputFormat

        public javax.media.Format setInputFormat​(javax.media.Format format)
        Sets the input format.
        Specified by:
        setInputFormat in interface javax.media.Codec
        Overrides:
        setInputFormat in class AbstractCodec2
        Parameters:
        format - format to set
        Returns:
        format
        See Also:
        AbstractCodec2.setInputFormat(Format)