Packetizerpublic class Packetizer extends AudioPacketizer Implements an GSM Packetizer. |
Constructors Summary |
---|
public Packetizer()
packetSize=99;
supportedInputFormats = new AudioFormat[] {
new AudioFormat(
AudioFormat.GSM,
8000,
Format.NOT_SPECIFIED,
1,
Format.NOT_SPECIFIED,
Format.NOT_SPECIFIED,
33*8,
Format.NOT_SPECIFIED,
Format.byteArray
)
} ;
defaultOutputFormats = new AudioFormat[] {
new AudioFormat(
AudioFormat.GSM_RTP,
8000,
Format.NOT_SPECIFIED,
1,
Format.NOT_SPECIFIED,
Format.NOT_SPECIFIED,
33*8,
Format.NOT_SPECIFIED,
Format.byteArray
)
} ;
PLUGIN_NAME="GSM Packetizer";
|
Methods Summary |
---|
public java.lang.Object[] | getControls()
if (controls==null) {
controls=new Control[1];
controls[0]=new PacketSizeAdapter(this,packetSize,true);
}
return (Object[])controls;
| protected javax.media.Format[] | getMatchingOutputFormats(javax.media.Format in)
AudioFormat af =(AudioFormat) in;
supportedOutputFormats = new AudioFormat[] {
new AudioFormat(
AudioFormat.GSM_RTP,
8000,
Format.NOT_SPECIFIED,
1,
Format.NOT_SPECIFIED,
Format.NOT_SPECIFIED,
33*8,
Format.NOT_SPECIFIED,
Format.byteArray
)
};
return supportedOutputFormats;
| public void | open()
setPacketSize(packetSize);
reset();
| public synchronized void | setPacketSize(int newPacketSize)
packetSize=newPacketSize;
sample_count = (packetSize / 33) * 160;
if (history==null) {
history=new byte[packetSize];
return;
}
if (packetSize > history.length ) {
byte[] newHistory=new byte[packetSize];
System.arraycopy(history,0,newHistory,0,historyLength);
history=newHistory;
}
|
|