添加rtp 调试接口

This commit is contained in:
xiongziliang 2021-04-11 01:15:02 +08:00
parent 33da2e28ec
commit 012f58d27c
2 changed files with 8 additions and 0 deletions

View File

@ -521,6 +521,10 @@ RtpHeader* RtpPacket::getHeader(){
return (RtpHeader*)(data() + RtpPacket::kRtpTcpHeaderSize); return (RtpHeader*)(data() + RtpPacket::kRtpTcpHeaderSize);
} }
string RtpPacket::dumpString() const{
return ((RtpPacket *) this)->getHeader()->dumpString(size() - RtpPacket::kRtpTcpHeaderSize);
}
uint16_t RtpPacket::getSeq(){ uint16_t RtpPacket::getSeq(){
return ntohs(getHeader()->seq); return ntohs(getHeader()->seq);
} }

View File

@ -150,7 +150,11 @@ public:
kRtpTcpHeaderSize = 4 kRtpTcpHeaderSize = 4
}; };
//获取rtp头
RtpHeader* getHeader(); RtpHeader* getHeader();
//打印调试信息
string dumpString() const;
//主机字节序的seq //主机字节序的seq
uint16_t getSeq(); uint16_t getSeq();
//主机字节序的时间戳,已经转换为毫秒 //主机字节序的时间戳,已经转换为毫秒