RtpClock { public long getLocalRtpTime() { return scale * wallClock.getTime(TimeUnit.MILLISECONDS) + drift; } RtpClock(Clock wallClock); Clock getWallClock(); void setClockRate(int clockRate); int getClockRate(); void synchronize(long remote); boolean isSynchronized(); void reset(); long getLocalRtpTime(); long convertToAbsoluteTime(long timestamp); long convertToRtpTime(long time); static final Logger logger; }
@Test public void testTime() { long t1 = clock.getLocalRtpTime(); wallClock.tick(20000000L); long t2 = clock.getLocalRtpTime(); assertEquals(160, t2 - t1); }