Methods Summary |
---|
protected int | calculateOutputSize(int inputSize)
return inputSize/24*480;
|
public void | close()
freeDecoder();
|
protected void | decode(byte[] inpData, int readPtr, byte[] outData, int writePtr, int inpLength)
int numberOfFrames = (inpLength/24);
int frameSize =24;
int n;
// loop for all G.723 frames in the current block ("Frame")
for (n=0; n<numberOfFrames ; n++, readPtr += frameSize, writePtr += 2*240) {
decoder.decodeFrame(inpData, readPtr,outData,writePtr);
}
|
protected void | freeDecoder()
decoder=null;
|
public java.lang.Object[] | getControls()
if (controls==null) {
controls=new Control[1];
controls[0]=new SilenceSuppressionAdapter(this,true,false);
}
return (Object[])controls;
|
protected javax.media.Format[] | getMatchingOutputFormats(javax.media.Format in)
AudioFormat af =(AudioFormat) in;
supportedOutputFormats = new AudioFormat[] {
new AudioFormat(
AudioFormat.LINEAR,
af.getSampleRate(),
16,
1,
AudioFormat.LITTLE_ENDIAN, //isBigEndian(),
AudioFormat.SIGNED //isSigned());
) };
return supportedOutputFormats;
|
protected void | initDecoder()
decoder.decoderReset();
|
public void | open()
decoder=new G723Dec();
decoder.decoderOpen();
|
public int | process(javax.media.Buffer inputBuffer, javax.media.Buffer outputBuffer)
if (!checkInputBuffer(inputBuffer) ) {
return BUFFER_PROCESSED_FAILED;
}
if (isEOM(inputBuffer) ) {
propagateEOM(outputBuffer);
return BUFFER_PROCESSED_OK;
}
int inpLength=inputBuffer.getLength();
int outLength = calculateOutputSize(inputBuffer.getLength() );
byte[] inpData = (byte[]) inputBuffer.getData();
byte[] outData = validateByteArraySize(outputBuffer, outLength);
// get offset for both RTP and non RTP streams
decode(inpData, inputBuffer.getOffset(), outData, 0, inpLength);
updateOutput(outputBuffer, outputFormat, outLength, 0);
return BUFFER_PROCESSED_OK;
|
public void | reset()
resetDecoder();
|
protected void | resetDecoder()
decoder.decoderReset();
|