webrtc 判断是否支持_WebRTC判断是否是rtcp包

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;

}

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值