|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.fmj.media.BasicPlugIn
net.sf.fmj.media.BasicCodec
com.sun.media.BasicCodec
com.ibm.media.codec.audio.AudioCodec
net.java.sip.communicator.impl.neomedia.codec.audio.alaw.JavaEncoder
public class JavaEncoder
The ALAW Encoder. Used the FMJ ALawEncoderUtil.
| Field Summary | |
|---|---|
static int |
MAX
maximum that can be held in 15 bits |
static int |
MAX_USHORT
65535 |
| Fields inherited from class com.ibm.media.codec.audio.AudioCodec |
|---|
DEBUG, defaultOutputFormats, inputFormat, outputFormat, PLUGIN_NAME, supportedInputFormats, supportedOutputFormats |
| Fields inherited from class net.sf.fmj.media.BasicCodec |
|---|
inputFormats, opened, outputFormats, pendingEOM |
| Fields inherited from class net.sf.fmj.media.BasicPlugIn |
|---|
controls |
| 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()
Constructs the encoder and init the supported formats. |
|
| Method Summary | |
|---|---|
static void |
aLawEncode(boolean bigEndian,
byte[] data,
int offset,
int length,
byte[] target)
Encode an array of pcm values into a pre-allocated target array |
static byte |
aLawEncode(int pcm)
Encode a pcm value into a a-law byte |
static void |
aLawEncodeBigEndian(byte[] data,
int offset,
int length,
byte[] target)
Encode big endian data. |
static void |
aLawEncodeLittleEndian(byte[] data,
int offset,
int length,
byte[] target)
Encode little endian data. |
void |
close()
No resources used to be cleared. |
protected javax.media.Format[] |
getMatchingOutputFormats(javax.media.Format in)
Returns the output formats according to the input. |
void |
open()
No resources to be opened. |
int |
process(javax.media.Buffer inputBuffer,
javax.media.Buffer outputBuffer)
Encodes the input buffer passing it to the output one |
static int |
uShortToInt(short value)
Unsigned short to integer. |
| Methods inherited from class com.ibm.media.codec.audio.AudioCodec |
|---|
checkFormat, getInputFormat, getName, getOutputFormat, getSupportedInputFormats, getSupportedOutputFormats, setInputFormat, setOutputFormat |
| Methods inherited from class net.sf.fmj.media.BasicCodec |
|---|
checkEOM, checkInputBuffer, getArrayElementSize, isEOM, processAtEOM, propagateEOM, reset, updateOutput, updateRGBFormat |
| Methods inherited from class net.sf.fmj.media.BasicPlugIn |
|---|
error, getClassForName, getControl, getControls, getInputData, getNativeData, getOutputData, matches, plugInExists, validateByteArraySize, validateData, validateIntArraySize, validateShortArraySize |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.media.Controls |
|---|
getControl, getControls |
| Field Detail |
|---|
public static final int MAX
public static final int MAX_USHORT
| Constructor Detail |
|---|
public JavaEncoder()
| Method Detail |
|---|
protected javax.media.Format[] getMatchingOutputFormats(javax.media.Format in)
getMatchingOutputFormats in class com.ibm.media.codec.audio.AudioCodecin - the input format.
public void open()
throws javax.media.ResourceUnavailableException
open in interface javax.media.PlugInopen in class net.sf.fmj.media.BasicCodecjavax.media.ResourceUnavailableException - if open failed (which cannot
happend for this codec since no resources are to be opened)public void close()
close in interface javax.media.PlugInclose in class net.sf.fmj.media.BasicCodec
public int process(javax.media.Buffer inputBuffer,
javax.media.Buffer outputBuffer)
inputBuffer - BufferoutputBuffer - Buffer
public static int uShortToInt(short value)
value - unsigned short.
public static void aLawEncode(boolean bigEndian,
byte[] data,
int offset,
int length,
byte[] target)
bigEndian - the data byte order.data - An array of bytes in Little-Endian formattarget - A pre-allocated array to receive the A-law bytes.
This array must be at least half the size of the source.offset - of the input.length - of the input.
public static void aLawEncodeLittleEndian(byte[] data,
int offset,
int length,
byte[] target)
data - the input data.offset - the input offset.length - the input length.target - the target array to fill.
public static void aLawEncodeBigEndian(byte[] data,
int offset,
int length,
byte[] target)
data - the input data.offset - the input offset.length - the input length.target - the target array to fill.public static byte aLawEncode(int pcm)
pcm - A 16-bit pcm value
|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||