接收Nack的调用栈
Call::DeliverPacket
RTCP包的判断
H:\webrtc-20210315\webrtc-20210315\webrtc\webrtc-checkout\src\call\call.cc
bool IsRtcp(const uint8_t* packet, size_t length) {
RtpUtility::RtpHeaderParser rtp_parser(packet, length);
return rtp_parser.RTCP();
}
H:\webrtc-20210315\webrtc-20210315\webrtc\webrtc-checkout\src\modules\rtp_rtcp\source\rtp_utility.cc
bool RtpHeaderParser::RTCP() const {
// 72 to 76 is reserved for RTP
// 77 to 79 is not reserver but they are not assigned we will block them
// for RTCP 200 SR == marker bit + 72
// for RTCP 204 APP == marker bit + 76
/*
* RTCP
*
* FIR full INTRA-frame request 192 [RFC2032] supported
* NACK negative acknowledgement 193 [RFC2032]
* IJ Extended inter-arrival jitter report 195 [RFC-ietf-avt-rtp-toff
* set-07.txt] http://tools.ietf.org/html/draft-ietf-avt-rtp-toffset-07
* SR sender report 200 [RFC3551] supported
* RR receiver report 201 [RFC3551] supported
* SDES source description 202 [RFC3551] supported
* BYE goodbye 203 [RFC3551] supported
* APP application-defined 204 [RFC3551] ignored
* RTPFB Transport layer FB message 205 [RFC4585] supported
* PSFB Payload-specific FB message 206 [RFC4585] supported
* XR extended report 207 [RFC3611] supported
*/
/* 205 RFC 5104
* FMT 1 NACK supported
* FMT 2 reserved
* FMT 3 TMMBR supported
* FMT 4 TMMBN supported
*/
/* 206 RFC 5104
* FMT 1: Picture Loss Indication (PLI) supported
* FMT 2: Slice Lost Indication (SLI)
* FMT 3: Reference Picture Selection Indication (RPSI)
* FMT 4: Full Intra Request (FIR) Command supported
* FMT 5: Temporal-Spatial Trade-off Request (TSTR)
* FMT 6: Temporal-Spatial Trade-off Notification (TSTN)
* FMT 7: Video Back Channel Message (VBCM)
* FMT 15: Application layer FB message
*/
const ptrdiff_t length = _ptrRTPDataEnd - _ptrRTPDataBegin;
if (length < kRtcpMinHeaderLength) {
return false;
}
const uint8_t V = _ptrRTPDataBegin[0] >> 6;
if (V != kRtcpExpectedVersion) {
return false;
}
const uint8_t payloadType = _ptrRTPDataBegin[1];
switch (payloadType) {
case 192:
return true;
case 193:
// not supported
// pass through and check for a potential RTP packet
return false;
case 195:
case 200:
case 201:
case 202:
case 203:
case 204:
case 205:
case 206:
case 207:
return true;
default:
return false;
}
}
RTCPReceiver::IncomingPacket
ParseCompoundPacket 解析联合包, 联合包就是将多个rtcp包组合起来为一个UDP包发送出去。
多个RTCP包如何解析? 通过解析每一个包的长度来,找到长度后,拿出该长度的内容解析出该包。