Class SynchronizerImpl
- java.lang.Object
-
- org.jitsi.impl.neomedia.recording.SynchronizerImpl
-
- All Implemented Interfaces:
Synchronizer
public class SynchronizerImpl extends Object implements Synchronizer
- Author:
- Boris Grozev
-
-
Constructor Summary
Constructors Constructor Description SynchronizerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetLocalTime(long ssrc, long rtp0)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.longreadUnsignedIntAsLong(byte[] buf, int off)Read an unsigned integer as long at specified offsetvoidsetEndpoint(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
public void setRtpClockRate(long ssrc, long clockRate)Sets the clock rate of the RTP clock for a specific SSRC.- Specified by:
setRtpClockRatein interfaceSynchronizer- Parameters:
ssrc- the SSRC for which to set the RTP clock rate.clockRate- the clock rate.
-
setEndpoint
public void setEndpoint(long ssrc, String endpointId)Sets the endpoint identifier for a specific SSRC.- Specified by:
setEndpointin interfaceSynchronizer- Parameters:
ssrc- the SSRC for which to set the endpoint identifier.endpointId- the endpoint identifier to set.
-
mapRtpToNtp
public 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.- Specified by:
mapRtpToNtpin interfaceSynchronizer- Parameters:
ssrc- the SSRC.rtpTime- the RTP timestamp which corresponds to ntpTime.ntpTime- the NTP timestamp which corresponds to rtpTime.
-
mapLocalToNtp
public 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).- Specified by:
mapLocalToNtpin interfaceSynchronizer- Parameters:
ssrc- the SSRC.localTime- the local timestamp which corresponds to ntpTime.ntpTime- the NTP timestamp which corresponds to localTime.
-
getLocalTime
public long getLocalTime(long ssrc, long rtp0)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).- Specified by:
getLocalTimein interfaceSynchronizer- Parameters:
ssrc- the SSRC with which rtpTime is associated.rtp0- the RTP timestamp- Returns:
- the local time corresponding to rtpTime for SSRC ssrc if it can be calculated, and -1 otherwise.
-
readUnsignedIntAsLong
public long readUnsignedIntAsLong(byte[] buf, int off)Read an unsigned integer as long at specified offset- Parameters:
off- start offset of this unsigned integer- Returns:
- unsigned integer as long at offset
-
-