public RtpSocket(){
  mCacheSize=0;
  mBufferCount=300;
  mBuffers=new byte[mBufferCount][];
  mPackets=new DatagramPacket[mBufferCount];
  mReport=new SenderReport();
  mAverageBitrate=new AverageBitrate();
  mTransport=TRANSPORT_UDP;
  mTcpHeader=new byte[]{'$',0,0,0};
  resetFifo();
  for (int i=0; i < mBufferCount; i++) {
    mBuffers[i]=new byte[MTU];
    mPackets[i]=new DatagramPacket(mBuffers[i],1);
    mBuffers[i][0]=(byte)Integer.parseInt("10000000",2);
    mBuffers[i][1]=(byte)96;
  }
  try {
    mSocket=new MulticastSocket();
  }
 catch (  Exception e) {
    throw new RuntimeException(e.getMessage());
  }
}

public RtpSocket ( ) { mCacheSize = 0 ; mBufferCount = 300 ; mBuffers = new byte [ mBufferCount ] [ ] ; mPackets = new DatagramPacket [ mBufferCount ] ; mReport = new SenderReport ( ) ; mAverageBitrate = new AverageBitrate ( ) ; mTransport = TRANSPORT_UDP ; mTcpHeader = new byte [ ] { '$' , 0 , 0 , 0 } ; resetFifo ( ) ; for ( int i = 0 ; i < mBufferCount ; i ++ ) { mBuffers [ i ] = new byte [ MTU ] ; mPackets [ i ] = new DatagramPacket ( mBuffers [ i ] , 1 ) ; mBuffers [ i ] [ 0 ] = ( byte ) Integer . parseInt ( "10000000" , 2 ) ; mBuffers [ i ] [ 1 ] = ( byte ) 96 ; } try { mSocket = new MulticastSocket ( ) ; } catch ( Exception e ) { throw new RuntimeException ( e . getMessage ( ) ) ; } }
this rtp socket implements a buffering mechanism relying on a fifo of buffers and a thread .
