Class JavaEncoder

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

    public class JavaEncoder
    extends AbstractCodec2
    implements PacketLossAwareEncoder
    Implements the SILK encoder as an FMJ/JMF Codec.
    Author:
    Dingxin Xu, Boris Grozev
    • Constructor Detail

      • JavaEncoder

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

      • doOpen

        protected void doOpen()
                       throws javax.media.ResourceUnavailableException
        Description copied from class: AbstractCodec2
        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
      • doProcess

        protected int doProcess​(javax.media.Buffer inputBuffer,
                                javax.media.Buffer outputBuffer)
        Specified by:
        doProcess in class AbstractCodec2
      • 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()
      • setExpectedPacketLoss

        public void setExpectedPacketLoss​(int percentage)
        Updates the encoder's packet loss percentage. Takes into account this.alwaysAssumePacketLoss.
        Specified by:
        setExpectedPacketLoss in interface PacketLossAwareEncoder
        Parameters:
        percentage - the expected packet loss percentage to set.
      • getControlComponent

        public Component getControlComponent()
        Stub. Only added in order to implement the PacketLossAwareEncoder interface.
        Specified by:
        getControlComponent in interface javax.media.Control
        Returns:
        null