From 8f17fcdf1d1e2594c09fe94bf2de34bcea0e1193 Mon Sep 17 00:00:00 2001 From: xia-chu <771730766@qq.com> Date: Fri, 30 Apr 2021 14:49:06 +0800 Subject: [PATCH] =?UTF-8?q?remb=E6=94=B9=E6=88=90=E5=9B=BA=E5=AE=9A?= =?UTF-8?q?=E9=97=B4=E9=9A=94=E5=8F=91=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webrtc/WebRtcTransport.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/webrtc/WebRtcTransport.cpp b/webrtc/WebRtcTransport.cpp index 178daca6..cfe70132 100644 --- a/webrtc/WebRtcTransport.cpp +++ b/webrtc/WebRtcTransport.cpp @@ -416,10 +416,6 @@ void WebRtcTransportImp::onStartWebRTC() { if (canRecvRtp()) { _push_src->setSdp(getSdp(SdpType::answer).toRtspSdp()); - GET_CONFIG(size_t, remb_bit_rate, RTC::kRembBitRate); - if (remb_bit_rate && getSdp(SdpType::answer).supportRtcpFb("goog-remb")) { - sendRtcpRemb(_recv_video_ssrc, remb_bit_rate); - } } if (canSendRtp()) { _reader = _play_src->getRing()->attach(getPoller(), true); @@ -624,6 +620,12 @@ void WebRtcTransportImp::onSortedRtp(const RtpPayloadInfo &info, RtpPacket::Ptr //定期发送pli请求关键帧,方便非rtc等协议 _pli_ticker.resetTime(); sendRtcpPli(_recv_video_ssrc); + + //开启remb,则发送remb包调节比特率 + GET_CONFIG(size_t, remb_bit_rate, RTC::kRembBitRate); + if (remb_bit_rate) { + sendRtcpRemb(_recv_video_ssrc, remb_bit_rate); + } } if (_push_src) { _push_src->onWrite(std::move(rtp), false);