diff --git a/src/Rtsp/Rtsp.cpp b/src/Rtsp/Rtsp.cpp index 492eb644..73f84434 100644 --- a/src/Rtsp/Rtsp.cpp +++ b/src/Rtsp/Rtsp.cpp @@ -521,6 +521,10 @@ RtpHeader* RtpPacket::getHeader(){ return (RtpHeader*)(data() + RtpPacket::kRtpTcpHeaderSize); } +string RtpPacket::dumpString() const{ + return ((RtpPacket *) this)->getHeader()->dumpString(size() - RtpPacket::kRtpTcpHeaderSize); +} + uint16_t RtpPacket::getSeq(){ return ntohs(getHeader()->seq); } diff --git a/src/Rtsp/Rtsp.h b/src/Rtsp/Rtsp.h index 884176e1..20307f45 100644 --- a/src/Rtsp/Rtsp.h +++ b/src/Rtsp/Rtsp.h @@ -150,7 +150,11 @@ public: kRtpTcpHeaderSize = 4 }; + //获取rtp头 RtpHeader* getHeader(); + //打印调试信息 + string dumpString() const; + //主机字节序的seq uint16_t getSeq(); //主机字节序的时间戳,已经转换为毫秒