mirror of
https://gitee.com/xia-chu/ZLMediaKit.git
synced 2026-05-18 07:47:50 +08:00
采用定时器发送rr
Some checks are pending
Android / build (push) Waiting to run
CodeQL / Analyze (cpp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
Docker / build (push) Waiting to run
Linux / build (push) Waiting to run
macOS / build (push) Waiting to run
Windows / build (push) Waiting to run
Some checks are pending
Android / build (push) Waiting to run
CodeQL / Analyze (cpp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
Docker / build (push) Waiting to run
Linux / build (push) Waiting to run
macOS / build (push) Waiting to run
Windows / build (push) Waiting to run
This commit is contained in:
parent
21d1ea9676
commit
b9d513f9aa
@ -1127,11 +1127,10 @@ public:
|
|||||||
}
|
}
|
||||||
return rtp;
|
return rtp;
|
||||||
}
|
}
|
||||||
|
void onRtcp(RtcpHeader *sr) {
|
||||||
Buffer::Ptr createRtcpRR(RtcpHeader *sr, uint32_t ssrc) {
|
_rtcp_context.onRtcp(sr);
|
||||||
if (sr) {
|
}
|
||||||
_rtcp_context.onRtcp(sr);
|
Buffer::Ptr createRtcpRR(uint32_t ssrc) {
|
||||||
}
|
|
||||||
return _rtcp_context.createRtcpRR(ssrc, getSSRC());
|
return _rtcp_context.createRtcpRR(ssrc, getSSRC());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1217,9 +1216,7 @@ void WebRtcTransportImp::onRtcp(const char *buf, size_t len) {
|
|||||||
// 设置rtp时间戳与ntp时间戳的对应关系 [AUTO-TRANSLATED:e92f4749]
|
// 设置rtp时间戳与ntp时间戳的对应关系 [AUTO-TRANSLATED:e92f4749]
|
||||||
// Set the correspondence between rtp timestamp and ntp timestamp
|
// Set the correspondence between rtp timestamp and ntp timestamp
|
||||||
rtp_chn->setNtpStamp(sr->rtpts, sr->getNtpUnixStampMS());
|
rtp_chn->setNtpStamp(sr->rtpts, sr->getNtpUnixStampMS());
|
||||||
auto rr = rtp_chn->createRtcpRR(sr, track->answer_ssrc_rtp);
|
rtp_chn->onRtcp(sr);
|
||||||
sendRtcpPacket(rr->data(), rr->size(), true);
|
|
||||||
_rtcp_rr_send_ticker.resetTime();
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
WarnL << "未识别的sr rtcp包:" << rtcp->dumpString();
|
WarnL << "未识别的sr rtcp包:" << rtcp->dumpString();
|
||||||
@ -1348,14 +1345,12 @@ void WebRtcTransportImp::onRtp(const char *buf, size_t len, uint64_t stamp_ms) {
|
|||||||
|
|
||||||
if (_rtcp_rr_send_ticker.elapsedTime() > 5000) {
|
if (_rtcp_rr_send_ticker.elapsedTime() > 5000) {
|
||||||
_rtcp_rr_send_ticker.resetTime();
|
_rtcp_rr_send_ticker.resetTime();
|
||||||
|
for (auto& it : _ssrc_to_track) {
|
||||||
auto ssrc = ntohl(rtp->ssrc);
|
auto ssrc = it.first;
|
||||||
auto track_it = _ssrc_to_track.find(ssrc);
|
auto &track = it.second;
|
||||||
if (track_it != _ssrc_to_track.end()) {
|
|
||||||
auto &track = track_it->second;
|
|
||||||
auto rtp_chn = track->getRtpChannel(ssrc);
|
auto rtp_chn = track->getRtpChannel(ssrc);
|
||||||
if (rtp_chn) {
|
if (rtp_chn) {
|
||||||
auto rr = rtp_chn->createRtcpRR(nullptr, track->answer_ssrc_rtp);
|
auto rr = rtp_chn->createRtcpRR(track->answer_ssrc_rtp);
|
||||||
if (rr && rr->size() > 0) {
|
if (rr && rr->size() > 0) {
|
||||||
sendRtcpPacket(rr->data(), rr->size(), true);
|
sendRtcpPacket(rr->data(), rr->size(), true);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user