Packetizerpublic class Packetizer extends AudioPacketizer Implements an G723 Packetizer. |
Constructors Summary |
---|
public Packetizer()
packetSize=48;
supportedInputFormats = new AudioFormat[] {
new AudioFormat(
AudioFormat.G723,
8000,
Format.NOT_SPECIFIED,
1,
Format.NOT_SPECIFIED,
Format.NOT_SPECIFIED,
24*8,
Format.NOT_SPECIFIED,
Format.byteArray
)
} ;
defaultOutputFormats = new AudioFormat[] {
new AudioFormat(
AudioFormat.G723_RTP,
8000,
Format.NOT_SPECIFIED,
1,
Format.NOT_SPECIFIED,
Format.NOT_SPECIFIED,
24*8,
Format.NOT_SPECIFIED,
Format.byteArray
)
} ;
PLUGIN_NAME="G723 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.G723_RTP,
8000,
Format.NOT_SPECIFIED,
1,
Format.NOT_SPECIFIED,
Format.NOT_SPECIFIED,
24*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 / 24 )*240;
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;
}
|
|