RtcpReceiverReport extends RtcpReport { @Override protected int decode(byte[] rawData, int offSet) { int tmp = offSet; offSet = super.decode(rawData, offSet); this.ssrc |= rawData[offSet++] & 0xFF; this.ssrc <<= 8; this.ssrc |= rawData[offSet++] & 0xFF; this.ssrc <<= 8; this.ssrc |= rawData[offSet++] & 0xFF; this.ssrc <<= 8; this.ssrc |= rawData[offSet++] & 0xFF; int tmpCount = 0; while ((offSet - tmp) < this.length) { RtcpReportBlock rtcpReceptionReportItem = new RtcpReportBlock(); offSet = rtcpReceptionReportItem.decode(rawData, offSet); this.reportBlocks.add(rtcpReceptionReportItem); tmpCount++; } return offSet; } protected  RtcpReceiverReport();  RtcpReceiverReport(boolean padding, long ssrc); @Override boolean isSender(); @Override String toString();  }
@Test public void testDecode() { RtcpReceiverReport rtcpReceptionReport = new RtcpReceiverReport(); rtcpReceptionReport.decode(p, 0); assertEquals(2, rtcpReceptionReport.getVersion()); assertFalse(rtcpReceptionReport.isPadding()); assertEquals(1, rtcpReceptionReport.getCount()); assertEquals(RtcpHeader.RTCP_RR, rtcpReceptionReport.getPacketType()); assertEquals(32, rtcpReceptionReport.getLength()); assertEquals(233393951, rtcpReceptionReport.getSsrc()); RtcpReportBlock rtcpReceptionReportItem = rtcpReceptionReport.getReportBlocks()[0]; assertNotNull(rtcpReceptionReportItem); assertEquals(266283887, rtcpReceptionReportItem.getSsrc()); assertEquals(0, rtcpReceptionReportItem.getFraction()); assertEquals(0, rtcpReceptionReportItem.getLost()); assertEquals(0, rtcpReceptionReportItem.getSeqNumCycle()); assertEquals(17250, rtcpReceptionReportItem.getLastSeq()); assertEquals(57, rtcpReceptionReportItem.getJitter()); assertEquals(4221306863l, rtcpReceptionReportItem.getLsr()); assertEquals(263851, rtcpReceptionReportItem.getDlsr()); }