public class SynchronizerImpl extends java.lang.Object implements Synchronizer
Constructor and Description |
---|
SynchronizerImpl() |
Modifier and Type | Method and Description |
---|---|
(package private) void |
addRTCPPacket(RawPacket pkt)
Adds an RTCP packet to this instance.
|
(package private) void |
addRTCPPacket(RawPacket pkt,
long localTime)
Adds an RTCP packet to this instance.
|
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.
|
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).
|
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.
|
long |
readUnsignedIntAsLong(byte[] buf,
int off)
Read an unsigned integer as long at specified offset
|
(package private) void |
removeMapping(long ssrc)
Removes the RTP-NTP mapping for a given SSRC.
|
void |
setEndpoint(long ssrc,
java.lang.String endpointId)
Sets the endpoint identifier for a specific SSRC.
|
void |
setRtpClockRate(long ssrc,
long clockRate)
Sets the clock rate of the RTP clock for a specific SSRC.
|
public void setRtpClockRate(long ssrc, long clockRate)
setRtpClockRate
in interface Synchronizer
ssrc
- the SSRC for which to set the RTP clock rate.clockRate
- the clock rate.public void setEndpoint(long ssrc, java.lang.String endpointId)
setEndpoint
in interface Synchronizer
ssrc
- the SSRC for which to set the endpoint identifier.endpointId
- the endpoint identifier to set.public void mapRtpToNtp(long ssrc, long rtpTime, double ntpTime)
mapRtpToNtp
in interface Synchronizer
ssrc
- the SSRC.rtpTime
- the RTP timestamp which corresponds to ntpTime.ntpTime
- the NTP timestamp which corresponds to rtpTime.public void mapLocalToNtp(long ssrc, long localTime, double ntpTime)
mapLocalToNtp
in interface Synchronizer
ssrc
- the SSRC.localTime
- the local timestamp which corresponds to ntpTime.ntpTime
- the NTP timestamp which corresponds to localTime.public long getLocalTime(long ssrc, long rtp0)
getLocalTime
in interface Synchronizer
ssrc
- the SSRC with which rtpTime is associated.rtp0
- the RTP timestampvoid addRTCPPacket(RawPacket pkt)
pkt
- the packet to add.void addRTCPPacket(RawPacket pkt, long localTime)
pkt
- the packet to add.localTime
- the local time of reception of the packet.public long readUnsignedIntAsLong(byte[] buf, int off)
off
- start offset of this unsigned integervoid removeMapping(long ssrc)
ssrc
- the SSRC for which to remove the RTP-NTP mapping
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.