org.mobicents.media.server.impl.dsp.audio.speex
Class Encoder

java.lang.Object
  extended by org.mobicents.media.server.impl.dsp.audio.speex.Encoder
All Implemented Interfaces:
java.io.Serializable, org.mobicents.media.server.spi.dsp.Codec

public class Encoder
extends java.lang.Object
implements org.mobicents.media.server.spi.dsp.Codec

Implements Speex narrow band, 8kHz compressor.

Author:
Amit Bhayani, Oleg Kulikov
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.mobicents.media.server.spi.dsp.Codec
G729, GSM, LINEAR_AUDIO, PCMA, PCMU, SPEEX
 
Constructor Summary
Encoder()
           
 
Method Summary
 int getMode()
          Gets the mode of the codec.
 int getQuality()
          Gets the quality value.
 org.mobicents.media.Format getSupportedInputFormat()
          (Non Java-doc)
 org.mobicents.media.Format getSupportedOutputFormat()
          (Non Java-doc)
 void process(org.mobicents.media.Buffer buffer)
          (Non Java-doc)
 int process(byte[] media, int offset, int length, byte[] dest)
          Perform compression.
 void setMode(int mode)
          Sets the mode of codec.
 void setQuality(int quality)
          Modify quality value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Encoder

public Encoder()
Method Detail

getMode

public int getMode()
Gets the mode of the codec.

Returns:
integer identifier of the mode.

setMode

public void setMode(int mode)
Sets the mode of codec.

Parameters:
mode - the new mode value

getQuality

public int getQuality()
Gets the quality value.

Returns:
integer value in range 0..10 which shows the quality.

setQuality

public void setQuality(int quality)
Modify quality value.

Parameters:
quality - integer value in range 0..10 which shows the quality.

getSupportedInputFormat

public org.mobicents.media.Format getSupportedInputFormat()
(Non Java-doc)

Specified by:
getSupportedInputFormat in interface org.mobicents.media.server.spi.dsp.Codec
See Also:
org.mobicents.media.server.impl.jmf.dsp.Codec#getSupportedFormat().

getSupportedOutputFormat

public org.mobicents.media.Format getSupportedOutputFormat()
(Non Java-doc)

Specified by:
getSupportedOutputFormat in interface org.mobicents.media.server.spi.dsp.Codec
See Also:
org.mobicents.media.server.impl.jmf.dsp.Codec#getSupportedFormat().

process

public void process(org.mobicents.media.Buffer buffer)
(Non Java-doc)

Specified by:
process in interface org.mobicents.media.server.spi.dsp.Codec
See Also:
org.mobicents.media.server.impl.jmf.dsp.Codec#process(Buffer).

process

public int process(byte[] media,
                   int offset,
                   int length,
                   byte[] dest)
Perform compression.

Parameters:
media - input media
Returns:
compressed media.


Copyright © 2010. All Rights Reserved.