https://tools.ietf.org/html/rfc4585#page-31
janus 代码
gboolean janus_rtcp_has_pli(char *packet, int len) {
/* Parse RTCP compound packet */
janus_rtcp_header *rtcp = (janus_rtcp_header *)packet;
int pno = 0, total = len, offset = 0;
while(rtcp) {
if(rtcp->version != 2)
break;
pno++;
switch(rtcp->type) {
case RTCP_PSFB: {
gint fmt = rtcp->rc;
if(fmt == 1) #######重点这里####
return TRUE;
break;
}
default:
break;
}
RTCP协议的FB分三层不同的msg
- Transport layer FB messages
-
Payload-specific FB messages
-
Application layer FB messages
Payload type (PT): 8 bits
This is the RTCP packet type that identifies the packet as being
an RTCP FB message. Two values are defined by the IANA:Name | Value | Brief Description ----------+-------+------------------------------------ RTPFB | 205 | Transport layer FB message PSFB | 206 | Payload-specific FB message
-
PT=RTPFB
-
FMT=1 Generic NACK
-
FMT=15 接收端构造TransportCC报文 transport wide cc https://tools.ietf.org/html/draft-holmer-rmcat-transport-wide-cc-extensions-01#section-3 这个主要是以连续16个包的接受状态(接受时间和序列号、丢失) 来提高反馈信息,这里涉及到BWE(带宽预测),需要单独抽出来
PT=PSFB
- 0: unassigned
- 1: Picture Loss Indication (PLI)
- 2: Slice Loss Indication (SLI)
- 3: Reference Picture Selection Indication (RPSI)
- 4-14: unassigned
- 15: Application layer FB (AFB) message
- 6-30: unassigned
- 31: reserved for future expansion of the sequence number space