Commit 17399809 by xgj

Merge remote-tracking branch 'china/dev' into dev

parents ebf650cf 012f58d2
...@@ -521,6 +521,10 @@ RtpHeader* RtpPacket::getHeader(){ ...@@ -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);
} }
......
...@@ -150,7 +150,11 @@ public: ...@@ -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();
//主机字节序的时间戳,已经转换为毫秒 //主机字节序的时间戳,已经转换为毫秒
......
...@@ -244,7 +244,7 @@ namespace RTC ...@@ -244,7 +244,7 @@ namespace RTC
} }
std::memcpy(EncryptBuffer, *data, *len); std::memcpy(EncryptBuffer, *data, *len);
EncryptBuffer[1] |= (pt & 0x7F); EncryptBuffer[1] = (pt & 0x7F) | (EncryptBuffer[1] & 0x80);
srtp_err_status_t err = srtp_err_status_t err =
srtp_protect(this->session, static_cast<void*>(EncryptBuffer), reinterpret_cast<int*>(len)); srtp_protect(this->session, static_cast<void*>(EncryptBuffer), reinterpret_cast<int*>(len));
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论