From 012f58d27c07446d6f6464d32e98cbeea62730ba Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Sun, 11 Apr 2021 01:15:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0rtp=20=E8=B0=83=E8=AF=95?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Rtsp/Rtsp.cpp | 4 ++++ src/Rtsp/Rtsp.h | 4 ++++ 2 files changed, 8 insertions(+) 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(); //主机字节序的时间戳,已经转换为毫秒