Commit dc2c8829 by xia-chu

添加remb开关

parent 8f17fcdf
...@@ -1252,6 +1252,8 @@ bool RtcSession::supportRtcpFb(const string &name, TrackType type) const { ...@@ -1252,6 +1252,8 @@ bool RtcSession::supportRtcpFb(const string &name, TrackType type) const {
static string const kTWCCRtcpFb = "transport-cc"; 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 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){ void RtcConfigure::RtcTrackConfigure::enableTWCC(bool enable){
if (!enable) { if (!enable) {
...@@ -1263,6 +1265,16 @@ void RtcConfigure::RtcTrackConfigure::enableTWCC(bool 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){ void RtcConfigure::RtcTrackConfigure::setDefaultSetting(TrackType type){
enable = true; enable = true;
rtcp_mux = true; rtcp_mux = true;
...@@ -1278,11 +1290,11 @@ void RtcConfigure::RtcTrackConfigure::setDefaultSetting(TrackType type){ ...@@ -1278,11 +1290,11 @@ void RtcConfigure::RtcTrackConfigure::setDefaultSetting(TrackType type){
case TrackAudio: { case TrackAudio: {
//此处调整偏好的编码格式优先级 //此处调整偏好的编码格式优先级
preferred_codec = {CodecAAC, CodecG711U, CodecG711A, CodecOpus}; preferred_codec = {CodecAAC, CodecG711U, CodecG711A, CodecOpus};
rtcp_fb = {kTWCCRtcpFb}; rtcp_fb = {kTWCCRtcpFb, kRembRtcpFb};
extmap = { extmap = {
kTWCCExtMap, kTWCCExtMap,
kRembExtMap,
"urn:ietf:params:rtp-hdrext:ssrc-audio-level", "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:mid",
"urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id", "urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id",
"urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id" "urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"
...@@ -1292,11 +1304,11 @@ void RtcConfigure::RtcTrackConfigure::setDefaultSetting(TrackType type){ ...@@ -1292,11 +1304,11 @@ void RtcConfigure::RtcTrackConfigure::setDefaultSetting(TrackType type){
case TrackVideo: { case TrackVideo: {
//此处调整偏好的编码格式优先级 //此处调整偏好的编码格式优先级
preferred_codec = {CodecH264, CodecH265}; preferred_codec = {CodecH264, CodecH265};
rtcp_fb = {kTWCCRtcpFb, "nack", "ccm fir", "nack pli", "goog-remb"}; rtcp_fb = {kTWCCRtcpFb, kRembRtcpFb, "nack", "ccm fir", "nack pli"};
extmap = { extmap = {
kTWCCExtMap, kTWCCExtMap,
kRembExtMap,
"urn:ietf:params:rtp-hdrext:toffset", "urn:ietf:params:rtp-hdrext:toffset",
"http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time",
"urn:3gpp:video-orientation", "urn:3gpp:video-orientation",
"http://www.webrtc.org/experiments/rtp-hdrext/playout-delay", "http://www.webrtc.org/experiments/rtp-hdrext/playout-delay",
"http://www.webrtc.org/experiments/rtp-hdrext/video-content-type", "http://www.webrtc.org/experiments/rtp-hdrext/video-content-type",
......
...@@ -701,6 +701,7 @@ public: ...@@ -701,6 +701,7 @@ public:
void setDefaultSetting(TrackType type); void setDefaultSetting(TrackType type);
void enableTWCC(bool enable = true); void enableTWCC(bool enable = true);
void enableREMB(bool enable = true);
}; };
RtcTrackConfigure video; RtcTrackConfigure video;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论