Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.neomedia.codec.audio.silk
Class JavaEncoder

java.lang.Object
  extended by net.sf.fmj.media.AbstractControls
      extended by net.sf.fmj.media.AbstractPlugIn
          extended by net.sf.fmj.media.AbstractCodec
              extended by net.java.sip.communicator.impl.neomedia.codec.AbstractCodecExt
                  extended by net.java.sip.communicator.impl.neomedia.codec.audio.silk.JavaEncoder
All Implemented Interfaces:
javax.media.Codec, javax.media.Controls, javax.media.PlugIn

public class JavaEncoder
extends AbstractCodecExt

Implements the SILK encoder as an FMJ/JMF Codec.

Author:
Dingxin Xu

Field Summary
(package private) static javax.media.Format[] SUPPORTED_INPUT_FORMATS
          The list of Formats of audio data supported as input by JavaEncoder instances.
(package private) static javax.media.Format[] SUPPORTED_OUTPUT_FORMATS
          The list of Formats of audio data supported as output by JavaEncoder instances.
 
Fields inherited from class net.sf.fmj.media.AbstractCodec
inputFormat, inputFormats, opened, outputFormat
 
Fields inherited from interface javax.media.PlugIn
BUFFER_PROCESSED_FAILED, BUFFER_PROCESSED_OK, INPUT_BUFFER_NOT_CONSUMED, OUTPUT_BUFFER_NOT_FILLED, PLUGIN_TERMINATED
 
Constructor Summary
JavaEncoder()
          Initializes a new JavaEncoder instance.
 
Method Summary
protected  void doClose()
           
protected  void doOpen()
          Opens this Codec and acquires the resources that it needs to operate.
protected  int doProcess(javax.media.Buffer inputBuffer, javax.media.Buffer outputBuffer)
           
protected  javax.media.Format[] getMatchingOutputFormats(javax.media.Format inputFormat)
          Get the output formats matching a specific input format.
(package private) static javax.media.Format[] getMatchingOutputFormats(javax.media.Format inputFormat, javax.media.Format[] supportedInputFormats, javax.media.Format[] supportedOutputFormats)
           
 javax.media.Format getOutputFormat()
          Get the output format.
 
Methods inherited from class net.java.sip.communicator.impl.neomedia.codec.AbstractCodecExt
close, discardOutputBuffer, getName, getSupportedOutputFormats, matches, open, process, setInputFormat, setOutputFormat, updateOutput, validateByteArraySize, validateShortArraySize
 
Methods inherited from class net.sf.fmj.media.AbstractCodec
checkInputBuffer, dump, getInputFormat, getSupportedInputFormats, isEOM, propagateEOM
 
Methods inherited from class net.sf.fmj.media.AbstractPlugIn
reset
 
Methods inherited from class net.sf.fmj.media.AbstractControls
addControl, getControl, getControls, removeControl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.media.PlugIn
reset
 
Methods inherited from interface javax.media.Controls
getControl, getControls
 

Field Detail

SUPPORTED_INPUT_FORMATS

static final javax.media.Format[] SUPPORTED_INPUT_FORMATS
The list of Formats of audio data supported as input by JavaEncoder instances.


SUPPORTED_OUTPUT_FORMATS

static final javax.media.Format[] SUPPORTED_OUTPUT_FORMATS
The list of Formats of audio data supported as output by JavaEncoder instances.

Constructor Detail

JavaEncoder

public JavaEncoder()
Initializes a new JavaEncoder instance.

Method Detail

doClose

protected void doClose()
Specified by:
doClose in class AbstractCodecExt

doOpen

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

getMatchingOutputFormats

protected javax.media.Format[] getMatchingOutputFormats(javax.media.Format inputFormat)
Get the output formats matching a specific input format.

Overrides:
getMatchingOutputFormats in class AbstractCodecExt
Parameters:
inputFormat - the input format to get the matching output formats of
Returns:
the output formats matching the specified input format
See Also:
AbstractCodecExt.getMatchingOutputFormats(Format)

getMatchingOutputFormats

static javax.media.Format[] getMatchingOutputFormats(javax.media.Format inputFormat,
                                                     javax.media.Format[] supportedInputFormats,
                                                     javax.media.Format[] supportedOutputFormats)

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()

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.