net.java.sip.communicator.impl.neomedia.codec.audio.speex
Class JNIEncoder
java.lang.Object
net.sf.fmj.media.AbstractControls
net.sf.fmj.media.AbstractPlugIn
net.sf.fmj.media.AbstractCodec
net.java.sip.communicator.impl.neomedia.codec.AbstractCodecExt
net.java.sip.communicator.impl.neomedia.codec.audio.speex.JNIEncoder
- All Implemented Interfaces:
- javax.media.Codec, javax.media.Controls, javax.media.PlugIn
public class JNIEncoder
- extends AbstractCodecExt
Implements a Speex encoder and RTP packetizer using the native Speex library.
- Author:
- Lubomir Marinov
|
Field Summary |
(package private) static double[] |
SUPPORTED_INPUT_SAMPLE_RATES
The list of sample rates of audio data supported as input by
JNIEncoder 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 |
JNIEncoder()
Initializes a new JNIEncoder 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)
Processes (encode) a specific input Buffer. |
protected javax.media.Format[] |
getMatchingOutputFormats(javax.media.Format inputFormat)
Get the output formats matching a specific input format. |
javax.media.Format |
getOutputFormat()
Get the output format. |
javax.media.Format |
setInputFormat(javax.media.Format format)
Sets the input format. |
| Methods inherited from class net.java.sip.communicator.impl.neomedia.codec.AbstractCodecExt |
close, discardOutputBuffer, getName, getSupportedOutputFormats, matches, open, process, 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 |
SUPPORTED_INPUT_SAMPLE_RATES
static final double[] SUPPORTED_INPUT_SAMPLE_RATES
- The list of sample rates of audio data supported as input by
JNIEncoder instances.
JNIEncoder
public JNIEncoder()
- Initializes a new JNIEncoder instance.
doClose
protected void doClose()
- Specified by:
doClose in class AbstractCodecExt
- See Also:
AbstractCodecExt.doClose()
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 AbstractCodecExt
- Throws:
javax.media.ResourceUnavailableException - if any of the resources that this
Codec needs to operate cannot be acquired- See Also:
AbstractCodecExt.doOpen()
doProcess
protected int doProcess(javax.media.Buffer inputBuffer,
javax.media.Buffer outputBuffer)
- Processes (encode) a specific input Buffer.
- Specified by:
doProcess in class AbstractCodecExt
- Parameters:
inputBuffer - input bufferoutputBuffer - output buffer
- Returns:
- BUFFER_PROCESSED_OK if buffer has been successfully
processed
- See Also:
AbstractCodecExt.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 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)
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 AbstractCodecExt
- Parameters:
format - format to set
- Returns:
- format
- See Also:
AbstractCodecExt.setInputFormat(Format)
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.