完善发送rtx rtp处理

This commit is contained in:
xiongziliang 2021-05-16 18:06:34 +08:00
parent 7cdd5ed9df
commit bda378c340
2 changed files with 5 additions and 1 deletions

View File

@ -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) {

View File

@ -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;
//媒体相关元数据 //媒体相关元数据