Class JNIEncoder

    • 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 inBuffer,
                                javax.media.Buffer outBuffer)
        Processes (i.e. encodes) a specific input Buffer.
        Specified by:
        doProcess in class AbstractCodec2
        Parameters:
        inBuffer - the Buffer from which the media to be encoded is to be read
        outBuffer - the Buffer into which the encoded media is to be written
        Returns:
        BUFFER_PROCESSED_OK if the specified inBuffer has been processed successfully
        See Also:
        AbstractCodec2.doProcess(Buffer, Buffer)
      • getControlComponent

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

        public javax.media.Format getOutputFormat()
        Gets the Format of the media output by this Codec.
        Overrides:
        getOutputFormat in class net.sf.fmj.media.AbstractCodec
        Returns:
        the Format of the media output by this Codec
        See Also:
        AbstractCodec.getOutputFormat()
      • setExpectedPacketLoss

        public void setExpectedPacketLoss​(int percentage)
        Updates the encoder's expected packet loss percentage to the bigger of percentage and this.minPacketLoss.
        Specified by:
        setExpectedPacketLoss in interface PacketLossAwareEncoder
        Parameters:
        percentage - the expected packet loss percentage to set
      • setInputFormat

        public javax.media.Format setInputFormat​(javax.media.Format format)
        Automatically tracks and calculates the size in bytes of an audio frame (to be) output by this instance.
        Specified by:
        setInputFormat in interface javax.media.Codec
        Overrides:
        setInputFormat in class AbstractCodec2