RtcpSenderReport extends RtcpReport { 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; this.ntpSec |= rawData[offSet++] & 0xFF; this.ntpSec <<= 8; this.ntpSec |= rawData[offSet++] & 0xFF; this.ntpSec <<= 8; this.ntpSec |= rawData[offSet++] & 0xFF; this.ntpSec <<= 8; this.ntpSec |= rawData[offSet++] & 0xFF; this.ntpFrac |= rawData[offSet++] & 0xFF; this.ntpFrac <<= 8; this.ntpFrac |= rawData[offSet++] & 0xFF; this.ntpFrac <<= 8; this.ntpFrac |= rawData[offSet++] & 0xFF; this.ntpFrac <<= 8; this.ntpFrac |= rawData[offSet++] & 0xFF; this.ntpTs = NtpUtils.calculateLastSrTimestamp(ntpSec, ntpFrac); this.rtpTs |= rawData[offSet++] & 0xFF; this.rtpTs <<= 8; this.rtpTs |= rawData[offSet++] & 0xFF; this.rtpTs <<= 8; this.rtpTs |= rawData[offSet++] & 0xFF; this.rtpTs <<= 8; this.rtpTs |= rawData[offSet++] & 0xFF; this.psent |= rawData[offSet++] & 0xFF; this.psent <<= 8; this.psent |= rawData[offSet++] & 0xFF; this.psent <<= 8; this.psent |= rawData[offSet++] & 0xFF; this.psent <<= 8; this.psent |= rawData[offSet++] & 0xFF; this.osent |= rawData[offSet++] & 0xFF; this.osent <<= 8; this.osent |= rawData[offSet++] & 0xFF; this.osent <<= 8; this.osent |= rawData[offSet++] & 0xFF; this.osent <<= 8; this.osent |= rawData[offSet++] & 0xFF; int tmpCount = 0; while ((offSet - tmp) < this.length) { RtcpReportBlock rtcpReceptionReportItem = new RtcpReportBlock(); offSet = rtcpReceptionReportItem.decode(rawData, offSet); addReceiverReport(rtcpReceptionReportItem); tmpCount++; } return offSet; } protected  RtcpSenderReport();  RtcpSenderReport(boolean padding, long ssrc, long ntpSec, long ntpFrac, long rtpTs, long psent, long osent); long getNtpSec(); long getNtpFrac(); long getNtpTs(); long getRtpTs(); long getPsent(); long getOsent(); @Override boolean isSender(); @Override String toString();  }
@Test public void testDecode() { RtcpSenderReport rtcpSenderReport = new RtcpSenderReport(); rtcpSenderReport.decode(p, 0); assertEquals(2, rtcpSenderReport.getVersion()); assertFalse(rtcpSenderReport.isPadding()); assertEquals(0, rtcpSenderReport.getCount()); assertEquals(RtcpHeader.RTCP_SR, rtcpSenderReport.getPacketType()); assertEquals(28, rtcpSenderReport.getLength()); assertEquals(266283887, rtcpSenderReport.getSsrc()); assertEquals(3471178652l, rtcpSenderReport.getNtpSec()); assertEquals(133143986, rtcpSenderReport.getNtpFrac()); assertEquals(1586529211, rtcpSenderReport.getRtpTs()); assertEquals(1, rtcpSenderReport.getPsent()); assertEquals(11, rtcpSenderReport.getOsent()); }