public class ReportPacket extends RTCPPacket
Constructor and Description |
---|
ReportPacket(java.lang.Long ssrc)
Constructor for a receiver report.
|
ReportPacket(java.lang.Long ssrc,
java.lang.Long rtpTimestamp,
java.lang.Long packetCount,
java.lang.Long octetCount)
Contructor for a sender report.
|
Modifier and Type | Method and Description |
---|---|
void |
addReportBlock(java.lang.Long ssrc,
java.lang.Integer fractionLost,
java.lang.Integer packetsLost,
java.lang.Integer cycle,
java.lang.Integer maxSeqNum,
java.lang.Long jitter,
java.lang.Long lsr,
java.lang.Long dlsr)
Add an item to the report packet.
|
byte[] |
createPacket()
Convert every information of the sender's report header in bytes.
|
static java.lang.Long |
decodeSrLswNtpTimestamp(byte[] data,
java.lang.Integer offset)
Decode LSW Timestamp from a SR report.
|
static java.lang.Long |
decodeSrMswNtpTimestamp(byte[] data,
java.lang.Integer offset)
Decode MSW Timestamp from a SR report.
|
static java.lang.Long |
decodeSsrc(byte[] data,
java.lang.Integer offset)
Decode SSRC from a SR/RR report.
|
static java.lang.Long |
generateLswNtpTimestamp(java.lang.Long time)
Decimal part of the NTP Timestamp.
|
static java.lang.Long |
generateMswNtpTimestamp(java.lang.Long time)
Floor part of the NTP timestamp.
|
java.lang.Integer |
getPacketType()
/**
Returns the packet type.
|
void |
receiverToSender()
Change type of report (201 to 200)
|
void |
senderToReceiver()
Change type of report (200 to 201)
|
void |
setNewValues(java.lang.Long rtpTimestamp,
java.lang.Long packetCount,
java.lang.Long octetCount)
To add new value to the SR report.
|
createRtcpPacket, decodeCount, decodeLength, decodePacketType, decodePadding, decodeTwoComplement, decodeTwoComplement, decodeVersion, getRtcpPackets, packetTypeAvailable
public ReportPacket(java.lang.Long ssrc)
ssrc
- public ReportPacket(java.lang.Long ssrc, java.lang.Long rtpTimestamp, java.lang.Long packetCount, java.lang.Long octetCount)
public byte[] createPacket()
createPacket
in class RTCPPacket
public void addReportBlock(java.lang.Long ssrc, java.lang.Integer fractionLost, java.lang.Integer packetsLost, java.lang.Integer cycle, java.lang.Integer maxSeqNum, java.lang.Long jitter, java.lang.Long lsr, java.lang.Long dlsr)
ssrc
- the SSRC associated to the statistics.fractionLost
- the fraction lost (cf. RFC 3550 p32).packetsLost
- the cumulative number packets lost (cf.RFC 3550 p32).cycle
- the number of cycle of the sequence number (cf.RFC 3550 p33).maxSeqNum
- the maximum sequence number read (cf.RFC 3550 p33).jitter
- the jitter (cf.RFC 3550 p33).lsr
- last sender report (cf.RFC 3550 p33).dlsr
- delay since last sender report (cf.RFC 3550 p33).public void receiverToSender()
public void senderToReceiver()
public static java.lang.Long generateMswNtpTimestamp(java.lang.Long time)
public static java.lang.Long generateLswNtpTimestamp(java.lang.Long time)
public java.lang.Integer getPacketType()
getPacketType
in class RTCPPacket
public static java.lang.Long decodeSsrc(byte[] data, java.lang.Integer offset)
data
- : the data to decode.offset
- : the beginning of the report.public static java.lang.Long decodeSrMswNtpTimestamp(byte[] data, java.lang.Integer offset)
data
- : the data to decode.offset
- : the beginning of the report.public static java.lang.Long decodeSrLswNtpTimestamp(byte[] data, java.lang.Integer offset)
data
- : the data to decode.offset
- : the beginning of the report.public void setNewValues(java.lang.Long rtpTimestamp, java.lang.Long packetCount, java.lang.Long octetCount)
rtpTimestamp
- : the RTP timestamp of the last RTP packet (cf. RFC 3550 p31).packetCount
- : the number of packets since the beginning of the RTP session (cf. RFC 3550 p32).octetCount
- : the number of octets since the beginning of the RTP session (cf. RFC 3550 p32).