修复webrtc rtx包计入receiver report统计导致simulcast推流失效的问题

This commit is contained in:
ziyue
2021-07-14 21:39:30 +08:00
parent 6bc39058ab
commit 6ddd420f1c
4 changed files with 17 additions and 27 deletions

View File

@@ -594,14 +594,15 @@ public:
~RtpChannel() override = default;
bool inputRtp(TrackType type, int sample_rate, uint8_t *ptr, size_t len, bool is_rtx){
if (!is_rtx) {
RtpHeader *rtp = (RtpHeader *) ptr;
auto seq = ntohs(rtp->seq);
RtpPacket::Ptr inputRtp(TrackType type, int sample_rate, uint8_t *ptr, size_t len, bool is_rtx) {
auto rtp = RtpTrack::inputRtp(type, sample_rate, ptr, len);
if (!is_rtx && rtp) {
//统计rtp接受情况便于生成nack rtcp包
auto seq = rtp->getSeq();
_nack_ctx.received(seq);
_rtcp_context.onRtp(seq, rtp->getStamp(), rtp->ntp_stamp, sample_rate, len);
}
return RtpTrack::inputRtp(type, sample_rate, ptr, len);
return rtp;
}
Buffer::Ptr createRtcpRR(RtcpHeader *sr, uint32_t ssrc) {
@@ -609,14 +610,6 @@ public:
return _rtcp_context.createRtcpRR(ssrc, getSSRC());
}
protected:
void onBeforeRtpSorted(const RtpPacket::Ptr &rtp) override {
//统计rtp收到的情况好做rr汇报
_rtcp_context.onRtp(rtp->getSeq(), rtp->getStamp(), rtp->ntp_stamp, rtp->sample_rate,
rtp->size() - RtpPacket::kRtpTcpHeaderSize);
RtpTrackImp::onBeforeRtpSorted(rtp);
}
private:
NackContext _nack_ctx;
RtcpContext _rtcp_context{true};