webrtc代码走读二十六(rtcp打包模式及流程)

一、RTCP打包模式

根据webrtc代码定义,webrtc支持的rtcp打包模式有两种:

enum class RtcpMode { kOff, kCompound, kReducedSize };

Compound mode 遵循 RFC 4585 
ReducedSize mode遵循 RFC 5506

两种模式的差别:

1、Compound模式RTCP报文里面必须包含RR or SR and CNAME SDES才能发送报文。这样会导致RTCP报文size比较大,另外对于feedback反馈报文的响应速度也比较慢。

2、ReducedSize mode就是解决这类问题,如RFC 5506字段描述:

二、RTCP报文发送流程调用栈

ModuleRtpRtcpImpl2::ScheduleRtcpSendEvaluation  //定时调用函数
->ModuleRtpRtcpImpl2::MaybeSendRtcp
->RTCPSender::TimeToSendRTCPReport      //判断发送时间是否到,到就SendRTCP
->RTCPSender::SendRTCP                  //发送RTCP报文
->RTCPSender::ComputeCompoundRTCPPacket //封装RTCP报文
->RTCPSender::PrepareReport
->RTCPSender::SetNextRtcpSendEvaluationDuration //配置下次发送rtcp报文时间

RTCPSender::SendRTCP: 

 

  RTCPSender::ComputeCompoundRTCPPacket:

RTCPSender::PrepareReport 

扫描二维码关注公众号,回复: 16159407 查看本文章

 

猜你喜欢

转载自blog.csdn.net/CrystalShaw/article/details/131701275