Commit bda378c3 by xiongziliang

完善发送rtx rtp处理

parent 7cdd5ed9
...@@ -820,11 +820,14 @@ void WebRtcTransportImp::onBeforeEncryptRtp(const char *buf, size_t &len, void * ...@@ -820,11 +820,14 @@ void WebRtcTransportImp::onBeforeEncryptRtp(const char *buf, size_t &len, void *
if (pr->second->answer_ssrc_rtx) { if (pr->second->answer_ssrc_rtx) {
//有rtx单独的ssrc,有些情况下,浏览器支持rtx,但是未指定rtx单独的ssrc //有rtx单独的ssrc,有些情况下,浏览器支持rtx,但是未指定rtx单独的ssrc
header->ssrc = htonl(pr->second->answer_ssrc_rtx); header->ssrc = htonl(pr->second->answer_ssrc_rtx);
} else {
//未单独指定rtx的ssrc,那么使用rtp的ssrc
header->ssrc = htonl(pr->second->answer_ssrc_rtp);
} }
auto origin_seq = ntohs(header->seq); auto origin_seq = ntohs(header->seq);
//seq跟原来的不一样 //seq跟原来的不一样
header->seq = htons(origin_seq + 100); header->seq = htons(_rtx_seq[pr->second->media->type]++);
auto payload = header->getPayloadData(); auto payload = header->getPayloadData();
auto payload_size = header->getPayloadSize(len); auto payload_size = header->getPayloadSize(len);
if (payload_size) { if (payload_size) {
......
...@@ -360,6 +360,7 @@ private: ...@@ -360,6 +360,7 @@ private:
void onSendNack(RtpPayloadInfo &info, const FCI_NACK &nack); void onSendNack(RtpPayloadInfo &info, const FCI_NACK &nack);
private: private:
uint16_t _rtx_seq[2] = {0, 0};
//用掉的总流量 //用掉的总流量
uint64_t _bytes_usage = 0; uint64_t _bytes_usage = 0;
//媒体相关元数据 //媒体相关元数据
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论