public void put(Buffer buffer){
  if (buffer.getLength() <= 2) {
    return;
  }
  byte[] currentRtpPacketData=((byte[])buffer.getData());
  H264RtpHeaders h264RtpHeaders=new H264RtpHeaders(currentRtpPacketData);
  if (h264RtpHeaders.getFUI_F()) {
    return;
  }
  if (reassembledData == null) {
    timestamp=buffer.getTimestamp();
    format=buffer.getFormat();
    seqNumber=buffer.getSequenceNumber();
    reassembledDataNALHeader=h264RtpHeaders.getNALHeader();
    reassembledData=new byte[JavaPacketizer.H264_MAX_RTP_PKTS][H264_FRAME_PACKET_SIZE];
    reassembledDataSize=new int[JavaPacketizer.H264_MAX_RTP_PKTS];
    reassembledDataHasStart=false;
    reassembledDataHasEnd=false;
  }
  int posSeq=(int)(buffer.getSequenceNumber() & VIDEO_DECODER_MAX_PAYLOADS_CHUNKS_MASK);
  int payloadStartPosition=h264RtpHeaders.getHeaderSize();
  int payloadLength=buffer.getLength() - h264RtpHeaders.getHeaderSize();
  if (h264RtpHeaders.getFUI_TYPE() == H264RtpHeaders.AVC_NALTYPE_FUA) {
    reassembledDataHasStart|=(h264RtpHeaders.getFUH_S());
    reassembledDataHasEnd|=(h264RtpHeaders.getFUH_E());
    reassembledDataPosSeqStart=((h264RtpHeaders.getFUH_S()) ? posSeq : reassembledDataPosSeqStart);
    reassembledDataPosSeqEnd=((h264RtpHeaders.getFUH_E()) ? posSeq : reassembledDataPosSeqEnd);
  }
  reassembledDataSize[posSeq]=payloadLength;
  reassembledDataFullSize+=payloadLength;
  System.arraycopy(currentRtpPacketData,payloadStartPosition,reassembledData[posSeq],0,payloadLength);
  videoOrientation=buffer.getVideoOrientation();
}

public void put ( Buffer buffer ) { if ( buffer . getLength ( ) <= 2 ) { return ; } byte [ ] currentRtpPacketData = ( ( byte [ ] ) buffer . getData ( ) ) ; H264RtpHeaders h264RtpHeaders = new H264RtpHeaders ( currentRtpPacketData ) ; if ( h264RtpHeaders . getFUI_F ( ) ) { return ; } if ( reassembledData == null ) { timestamp = buffer . getTimestamp ( ) ; format = buffer . getFormat ( ) ; seqNumber = buffer . getSequenceNumber ( ) ; reassembledDataNALHeader = h264RtpHeaders . getNALHeader ( ) ; reassembledData = new byte [ JavaPacketizer . H264_MAX_RTP_PKTS ] [ H264_FRAME_PACKET_SIZE ] ; reassembledDataSize = new int [ JavaPacketizer . H264_MAX_RTP_PKTS ] ; reassembledDataHasStart = false ; reassembledDataHasEnd = false ; } int posSeq = ( int ) ( buffer . getSequenceNumber ( ) & VIDEO_DECODER_MAX_PAYLOADS_CHUNKS_MASK ) ; int payloadStartPosition = h264RtpHeaders . getHeaderSize ( ) ; int payloadLength = buffer . getLength ( ) - h264RtpHeaders . getHeaderSize ( ) ; if ( h264RtpHeaders . getFUI_TYPE ( ) == H264RtpHeaders . AVC_NALTYPE_FUA ) { reassembledDataHasStart |= ( h264RtpHeaders . getFUH_S ( ) ) ; reassembledDataHasEnd |= ( h264RtpHeaders . getFUH_E ( ) ) ; reassembledDataPosSeqStart = ( ( h264RtpHeaders . getFUH_S ( ) ) ? posSeq : reassembledDataPosSeqStart ) ; reassembledDataPosSeqEnd = ( ( h264RtpHeaders . getFUH_E ( ) ) ? posSeq : reassembledDataPosSeqEnd ) ; } reassembledDataSize [ posSeq ] = payloadLength ; reassembledDataFullSize += payloadLength ; System . arraycopy ( currentRtpPacketData , payloadStartPosition , reassembledData [ posSeq ] , 0 , payloadLength ) ; videoOrientation = buffer . getVideoOrientation ( ) ; }
add the buffer ( which contains a fragment ) to the assembler .
