Interface Synchronizer
-
- All Known Implementing Classes:
SynchronizerImpl
public interface Synchronizer- Author:
- Boris Grozev
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longgetLocalTime(long ssrc, long rtpTime)Tries to find the local time (as returned by System.currentTimeMillis()) that corresponds to the RTP timestamp rtpTime for the SSRC ssrc.voidmapLocalToNtp(long ssrc, long localTime, double ntpTime)Notifies this Synchronizer that the local timestamp localTime corresponds to the NTP timestamp ntpTime (for SSRC ssrc).voidmapRtpToNtp(long ssrc, long rtpTime, double ntpTime)Notifies this Synchronizer that the RTP timestamp rtpTime (for SSRC ssrc) corresponds to the NTP timestamp ntpTime.voidsetEndpoint(long ssrc, String endpointId)Sets the endpoint identifier for a specific SSRC.voidsetRtpClockRate(long ssrc, long clockRate)Sets the clock rate of the RTP clock for a specific SSRC.
-
-
-
Method Detail
-
setRtpClockRate
void setRtpClockRate(long ssrc, long clockRate)Sets the clock rate of the RTP clock for a specific SSRC.- Parameters:
ssrc- the SSRC for which to set the RTP clock rate.clockRate- the clock rate.
-
setEndpoint
void setEndpoint(long ssrc, String endpointId)Sets the endpoint identifier for a specific SSRC.- Parameters:
ssrc- the SSRC for which to set the endpoint identifier.endpointId- the endpoint identifier to set.
-
mapRtpToNtp
void mapRtpToNtp(long ssrc, long rtpTime, double ntpTime)Notifies this Synchronizer that the RTP timestamp rtpTime (for SSRC ssrc) corresponds to the NTP timestamp ntpTime.- Parameters:
ssrc- the SSRC.rtpTime- the RTP timestamp which corresponds to ntpTime.ntpTime- the NTP timestamp which corresponds to rtpTime.
-
mapLocalToNtp
void mapLocalToNtp(long ssrc, long localTime, double ntpTime)Notifies this Synchronizer that the local timestamp localTime corresponds to the NTP timestamp ntpTime (for SSRC ssrc).- Parameters:
ssrc- the SSRC.localTime- the local timestamp which corresponds to ntpTime.ntpTime- the NTP timestamp which corresponds to localTime.
-
getLocalTime
long getLocalTime(long ssrc, long rtpTime)Tries to find the local time (as returned by System.currentTimeMillis()) that corresponds to the RTP timestamp rtpTime for the SSRC ssrc. Returns -1 if the local time cannot be found (for example because not enough information for the SSRC has been previously provided to the Synchronizer).- Parameters:
ssrc- the SSRC with which rtpTime is associated.rtpTime- the RTP timestamp- Returns:
- the local time corresponding to rtpTime for SSRC ssrc if it can be calculated, and -1 otherwise.
-
-