From dc2c8829948da7b6d29d445ec2d5326eaebf5114 Mon Sep 17 00:00:00 2001 From: xia-chu <771730766@qq.com> Date: Fri, 30 Apr 2021 15:08:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0remb=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webrtc/Sdp.cpp | 20 ++++++++++++++++---- webrtc/Sdp.h | 1 + 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/webrtc/Sdp.cpp b/webrtc/Sdp.cpp index 8a671f66..3c137fde 100644 --- a/webrtc/Sdp.cpp +++ b/webrtc/Sdp.cpp @@ -1252,6 +1252,8 @@ bool RtcSession::supportRtcpFb(const string &name, TrackType type) const { static string const kTWCCRtcpFb = "transport-cc"; static string const kTWCCExtMap = "http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01"; +static string const kRembRtcpFb = "goog-remb"; +static string const kRembExtMap = "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time"; void RtcConfigure::RtcTrackConfigure::enableTWCC(bool enable){ if (!enable) { @@ -1263,6 +1265,16 @@ void RtcConfigure::RtcTrackConfigure::enableTWCC(bool enable){ } } +void RtcConfigure::RtcTrackConfigure::enableREMB(bool enable){ + if (!enable) { + rtcp_fb.erase(kRembRtcpFb); + extmap.erase(kRembExtMap); + } else { + rtcp_fb.emplace(kRembRtcpFb); + extmap.emplace(kRembExtMap); + } +} + void RtcConfigure::RtcTrackConfigure::setDefaultSetting(TrackType type){ enable = true; rtcp_mux = true; @@ -1278,11 +1290,11 @@ void RtcConfigure::RtcTrackConfigure::setDefaultSetting(TrackType type){ case TrackAudio: { //此处调整偏好的编码格式优先级 preferred_codec = {CodecAAC, CodecG711U, CodecG711A, CodecOpus}; - rtcp_fb = {kTWCCRtcpFb}; + rtcp_fb = {kTWCCRtcpFb, kRembRtcpFb}; extmap = { kTWCCExtMap, + kRembExtMap, "urn:ietf:params:rtp-hdrext:ssrc-audio-level", - "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time", "urn:ietf:params:rtp-hdrext:sdes:mid", "urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id", "urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id" @@ -1292,11 +1304,11 @@ void RtcConfigure::RtcTrackConfigure::setDefaultSetting(TrackType type){ case TrackVideo: { //此处调整偏好的编码格式优先级 preferred_codec = {CodecH264, CodecH265}; - rtcp_fb = {kTWCCRtcpFb, "nack", "ccm fir", "nack pli", "goog-remb"}; + rtcp_fb = {kTWCCRtcpFb, kRembRtcpFb, "nack", "ccm fir", "nack pli"}; extmap = { kTWCCExtMap, + kRembExtMap, "urn:ietf:params:rtp-hdrext:toffset", - "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time", "urn:3gpp:video-orientation", "http://www.webrtc.org/experiments/rtp-hdrext/playout-delay", "http://www.webrtc.org/experiments/rtp-hdrext/video-content-type", diff --git a/webrtc/Sdp.h b/webrtc/Sdp.h index bcd1783c..a180c5ee 100644 --- a/webrtc/Sdp.h +++ b/webrtc/Sdp.h @@ -701,6 +701,7 @@ public: void setDefaultSetting(TrackType type); void enableTWCC(bool enable = true); + void enableREMB(bool enable = true); }; RtcTrackConfigure video;