printf("ts_lsw: 0x%x\n",ts_lsw);//printf("offset: 0x%x 0x%x 0x%x 0x%x\n",rtcp_info[offset],rtcp_info[offset + 1],rtcp_info[offset + 2],rtcp_info[offset + 3]);printf("MSW: %s\n",tvb_ntp_fmt_ts_sec(rtcp_info,offset)); offset+=8;/*RTP timestamp, 32 bits*/offset+=4;/...
int sr_offset = offset; /* NTP timestamp */ ts_msw = ntohl(*(uint32_t*)(rtcp_info + offset)); printf("ts_msw: 0x%x\n",ts_msw); ts_lsw = ntohl(*(uint32_t*)(rtcp_info + offset + 4)); printf("ts_lsw: 0x%x\n",ts_lsw); //printf("offset: 0x%x 0x%x 0x%x 0x%x\n",r...
在 RTCP 中 NTP 时间存放在 8 个字节中,分为:MSW 和 LSW,分别占用 4 个字节。 constchar*tvb_ntp_fmt_ts_sec(u_char*rtcp_info,int offset){uint32_t tempstmp=0;time_t temptime=0;struct tm*bd;char*buff=NULL;tempstmp=ntohl(*(uint32_t*)(rtcp_info+offset));if(tempstmp==0){return"NUL...
其中域及其意义如下: typedefstruct_rtcp_sr_t// sender report{uint32_tssrc;uint32_tntpmsw;// ntp timestamp MSW(in second)uint32_tntplsw;// ntp timestamp LSW(in picosecond)uint32_trtpts;// rtp timestampuint32_tspc;// sender packet countuint32_tsoc;// sender octet count}rtcp_sr_t; ...
NTP :网络时间,占64位,表示自1990年1月以来的秒数,高32位MSW表示整数部分单位为秒,低32位LSW位表示小数部分,单位为皮秒,网上有NRT时间和gettimeofday()获得的时间换算方式大家可以查下。。 RTP: 时间戳占32位,是RTP头中携带的时间戳,单位是毫秒,RTP和NTP是同一个时间点的不同表示方式,它俩之间支持相互转换。
printf("ts_lsw: 0x%x\n",ts_lsw); printf("MSW: %s\n",tvb_ntp_fmt_ts_sec(rtcp_info,offset)); offset += 8; RTCP 协议实现 下面我给出对 RTCP 协议解析实现的代码,根据回放报文,解析字段信息。 /* 接收者/发送者计数是最后5位 */
ntp_msw&0xffff + ntp_lsw>>16 DLSR 从接收到上一个SR包到发送此接收报告块之间的延时,以1/65536秒为单位。 在WebRTC里面函数实现如下: // 处理接受者报告voidRTCPReceiver::HandleReportBlock(constReportBlock&report_block,PacketInformation*packet_information,uint32_tremote_ssrc){// This will be called...
在RTCP中NTP时间存放在8个字节中,分为:MSW和LSW,分别占用4个字节。 MSW: 单位是秒,不过是从1900年1月1日算起,所以使用gettimeofday后需要加上:1900-1970的时间差: msw = (70LL * 365 + 17) * 24 * 60 * 60 + tv.tv_sec; LSW:单位是232皮秒,其中1s = 1012ps,所以以32bit表示的话,每个bit就是...
structRtcp_SR { unsignedintNtpTimestampMSW; unsignedintNtpTimestampLSW; unsignedintRtpTimestamp; unsignedintSenderPacketCnt; unsignedintSenderOctetCnt; }; RTCP报文解析函数 入参:RTCP报文指针、报文字节大小 voidparse_udp_packet(unsignedchar* packet,intpacket_length) ...
ntp_msw&0xffff + ntp_lsw>>16 DLSR 从接收到上一个SR包到发送此接收报告块之间的延时,以1/65536...