RtpMember { public void onReceiveSR(RtcpSenderReport report) { this.lastSrTimestamp = report.getNtpTs(); this.lastSrReceivedOn = this.wallClock.getCurrentTime(); this.receivedSinceSR = 0; } RtpMember(RtpClock clock, long ssrc, String cname);  RtpMember(RtpClock clock, long ssrc); long getSsrc(); String getCname(); void setCname(String cname); long getPacketsReceived(); long getPacketsExpected(); long getOctetsReceived(); long getReceivedSinceSR(); long getFractionLost(); long getPacketsLost(); int getSequenceCycle(); long getJitter(); long getLastSR(); long getLastSRdelay(); int getExtHighSequence(); int getRTT(); void estimateRtt(long receiptDate, long lastSR, long delaySinceSR); void onReceiveRtp(RtpPacket packet); void onReceiveSR(RtcpSenderReport report); static final int RTP_SEQ_MOD; static final int MAX_DROPOUT; static final int MAX_MISORDER; static final int MIN_SEQUENTIAL; }
@Test public void testOnReceiveSR() { RtpMember member = new RtpMember(rtpClock, 123); TimeStamp ntp = new TimeStamp(new Date()); RtcpSenderReport sendReport = new RtcpSenderReport(false, 123, ntp.getSeconds(), ntp.getFraction(), 160 * 2, 100, 100 * 130); long receiveTime = this.wallClock.getCurrentTime(); member.onReceiveSR(sendReport); this.wallClock.tick(20000000L); long expectedSrTimestamp = NtpUtils.calculateLastSrTimestamp(ntp.getSeconds(), ntp.getFraction()); assertEquals(expectedSrTimestamp, member.getLastSR()); assertEquals(0, member.getReceivedSinceSR()); long expectedDelay = (long) ((this.wallClock.getCurrentTime() - receiveTime) * 65.536); assertEquals(expectedDelay, member.getLastSRdelay()); }