当前位置:网站首页>Working subtotal rtcp length and network byte order
Working subtotal rtcp length and network byte order
2022-08-09 02:36:00 【Zip-List】
最近在看zlMediaKit RTCP部分
RFC 5760 RTCP https://rfc2cn.com/rfc5760.html
Length: 16 bits As defined in [1], the length of the RTCP packet in 32-bit words minus one, including the header and any padding.
length的长度是32-bit下(Just a few lines) - 1(Minus the1是通用头 32 bit 4字节)
下图中length长度即为5
zl中解析rtcp长度:( 转换字节序+1(加头) )* 4 (32bitMeasurement into8bit) Access to the number of bytes of the packet
size_t RtcpHeader::getSize() const {
//加上rtcp头长度
size_t a = ntohs(length);
return (1 + a) << 2;
}
另外debug时,看到length长度=1536,ntohs后转化为6.最终结果7*4=28,And we expect the results of the same28Bytes long onertcp包
Cooperate with the calculator+ntohs源码可以看到 After conversion 0000 0000 0000 0110 = 6(Network turn big end little endian,bitTurn order no,The network card to do)
0xAB --> 0xBA
unsigned short ntohs (unsigned short x)
{
x = (x << 8) | (x >> 8);
return x;
}
0xABCD --> 0xDCBA
unsigned long ntohl(unsigned long x)
{
return (x >> 24) | ((x & 0xff0000) >> 8) | ((x & 0xff00) << 8) | (x << 24);
}
边栏推荐
- 炫酷-轮播图-走马灯
- 连接数据库且在网页运行的RDLC
- Jenkins配置钉钉通知
- 1261. 在受污染的二叉树中查找元素
- 全志平台双路LVDS配置
- 普通人如何增加收入
- ZCMU--5115: Buying Keys(C语言)
- spark RDD转换算子 sample
- The most fierce "employee" in history, madly complaining about the billionaire boss Xiao Zha: So rich, he always wears the same clothes!
- 2022 Eye Health Brand Franchise Exhibition, Beijing Vision Care Exhibition, China Ophthalmology Technology Summit
猜你喜欢
随机推荐
How to install yii2
【云计算】XaaS最全介绍(按24字母合集):AaaS、BaaS、CaaS、DaaS、EaaS、FaaS、GaaS、HaaS、IDaaS…
帮助安全红队取得成功的11条建议
Open3D 均匀采样
Programmer's Daily Life | Daily Fun
YOLOV1详解——Pytorch版
opencv在图像上长按左键画矩形单击右键清除
Open3D 点云曲率计算
【Untitled】
概率模型校准
online schema change and create index
2020.10.13 Development log
Significance Test--Study Notes
物联网未来:未来五年的预期
普通人如何增加收入
【无标题】
旋转霓虹圆圈
313. 超级丑数-暴力解法
Maya engine modeling
Several ways to use JS to achieve array flattening









