private void copyToBuffer(Buffer bDest){
  if (reassembledDataFullSize <= MAX_H264_FRAME_SIZE) {
    byte[] finalData=new byte[reassembledDataFullSize + 1];
    int finalDataPos=0;
    finalData[finalDataPos]=reassembledDataNALHeader;
    finalDataPos+=1;
    int posCurrent=reassembledDataPosSeqStart;
    int posSeq=0;
    while ((posCurrent & VIDEO_DECODER_MAX_PAYLOADS_CHUNKS_MASK) != reassembledDataPosSeqEnd) {
      posSeq=posCurrent & VIDEO_DECODER_MAX_PAYLOADS_CHUNKS_MASK;
      System.arraycopy(reassembledData[posSeq],0,finalData,finalDataPos,reassembledDataSize[posSeq]);
      finalDataPos+=reassembledDataSize[posSeq];
      posCurrent++;
    }
    System.arraycopy(reassembledData[reassembledDataPosSeqEnd],0,finalData,finalDataPos,reassembledDataSize[reassembledDataPosSeqEnd]);
    bDest.setData(finalData);
    bDest.setLength(reassembledDataSize[reassembledDataPosSeqEnd]);
    bDest.setOffset(0);
    bDest.setTimestamp(timestamp);
    bDest.setFormat(format);
    bDest.setFlags(Buffer.FLAG_RTP_MARKER | Buffer.FLAG_RTP_TIME);
    bDest.setVideoOrientation(videoOrientation);
    bDest.setSequenceNumber(seqNumber);
  }
  reassembledData=null;
}

private void copyToBuffer ( Buffer bDest ) { if ( reassembledDataFullSize <= MAX_H264_FRAME_SIZE ) { byte [ ] finalData = new byte [ reassembledDataFullSize + 1 ] ; int finalDataPos = 0 ; finalData [ finalDataPos ] = reassembledDataNALHeader ; finalDataPos += 1 ; int posCurrent = reassembledDataPosSeqStart ; int posSeq = 0 ; while ( ( posCurrent & VIDEO_DECODER_MAX_PAYLOADS_CHUNKS_MASK ) != reassembledDataPosSeqEnd ) { posSeq = posCurrent & VIDEO_DECODER_MAX_PAYLOADS_CHUNKS_MASK ; System . arraycopy ( reassembledData [ posSeq ] , 0 , finalData , finalDataPos , reassembledDataSize [ posSeq ] ) ; finalDataPos += reassembledDataSize [ posSeq ] ; posCurrent ++ ; } System . arraycopy ( reassembledData [ reassembledDataPosSeqEnd ] , 0 , finalData , finalDataPos , reassembledDataSize [ reassembledDataPosSeqEnd ] ) ; bDest . setData ( finalData ) ; bDest . setLength ( reassembledDataSize [ reassembledDataPosSeqEnd ] ) ; bDest . setOffset ( 0 ) ; bDest . setTimestamp ( timestamp ) ; bDest . setFormat ( format ) ; bDest . setFlags ( Buffer . FLAG_RTP_MARKER | Buffer . FLAG_RTP_TIME ) ; bDest . setVideoOrientation ( videoOrientation ) ; bDest . setSequenceNumber ( seqNumber ) ; } reassembledData = null ; }
assumes that complete ( ) has been called and returns true .
