Commit c77c4cfd by xia-chu

sdp相关特性暴露成常量

parent dc2c8829
...@@ -1250,28 +1250,28 @@ bool RtcSession::supportRtcpFb(const string &name, TrackType type) const { ...@@ -1250,28 +1250,28 @@ bool RtcSession::supportRtcpFb(const string &name, TrackType type) const {
return ref.find(name) != ref.end(); return ref.find(name) != ref.end();
} }
static string const kTWCCRtcpFb = "transport-cc"; string const SdpConst::kTWCCRtcpFb = "transport-cc";
static string const kTWCCExtMap = "http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01"; string const SdpConst::kTWCCExtMap = "http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01";
static string const kRembRtcpFb = "goog-remb"; string const SdpConst::kRembRtcpFb = "goog-remb";
static string const kRembExtMap = "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time"; string const SdpConst::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) {
rtcp_fb.erase(kTWCCRtcpFb); rtcp_fb.erase(SdpConst::kTWCCRtcpFb);
extmap.erase(kTWCCExtMap); extmap.erase(SdpConst::kTWCCExtMap);
} else { } else {
rtcp_fb.emplace(kTWCCRtcpFb); rtcp_fb.emplace(SdpConst::kTWCCRtcpFb);
extmap.emplace(kTWCCExtMap); extmap.emplace(SdpConst::kTWCCExtMap);
} }
} }
void RtcConfigure::RtcTrackConfigure::enableREMB(bool enable){ void RtcConfigure::RtcTrackConfigure::enableREMB(bool enable){
if (!enable) { if (!enable) {
rtcp_fb.erase(kRembRtcpFb); rtcp_fb.erase(SdpConst::kRembRtcpFb);
extmap.erase(kRembExtMap); extmap.erase(SdpConst::kRembExtMap);
} else { } else {
rtcp_fb.emplace(kRembRtcpFb); rtcp_fb.emplace(SdpConst::kRembRtcpFb);
extmap.emplace(kRembExtMap); extmap.emplace(SdpConst::kRembExtMap);
} }
} }
...@@ -1290,10 +1290,10 @@ void RtcConfigure::RtcTrackConfigure::setDefaultSetting(TrackType type){ ...@@ -1290,10 +1290,10 @@ 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, kRembRtcpFb}; rtcp_fb = {SdpConst::kTWCCRtcpFb, SdpConst::kRembRtcpFb};
extmap = { extmap = {
kTWCCExtMap, SdpConst::kTWCCExtMap,
kRembExtMap, SdpConst::kRembExtMap,
"urn:ietf:params:rtp-hdrext:ssrc-audio-level", "urn:ietf:params:rtp-hdrext:ssrc-audio-level",
"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",
...@@ -1304,10 +1304,10 @@ void RtcConfigure::RtcTrackConfigure::setDefaultSetting(TrackType type){ ...@@ -1304,10 +1304,10 @@ void RtcConfigure::RtcTrackConfigure::setDefaultSetting(TrackType type){
case TrackVideo: { case TrackVideo: {
//此处调整偏好的编码格式优先级 //此处调整偏好的编码格式优先级
preferred_codec = {CodecH264, CodecH265}; preferred_codec = {CodecH264, CodecH265};
rtcp_fb = {kTWCCRtcpFb, kRembRtcpFb, "nack", "ccm fir", "nack pli"}; rtcp_fb = {SdpConst::kTWCCRtcpFb, SdpConst::kRembRtcpFb, "nack", "ccm fir", "nack pli"};
extmap = { extmap = {
kTWCCExtMap, SdpConst::kTWCCExtMap,
kRembExtMap, SdpConst::kRembExtMap,
"urn:ietf:params:rtp-hdrext:toffset", "urn:ietf:params:rtp-hdrext:toffset",
"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",
......
...@@ -730,5 +730,17 @@ private: ...@@ -730,5 +730,17 @@ private:
RtcCodecPlan::Ptr _rtsp_audio_plan; RtcCodecPlan::Ptr _rtsp_audio_plan;
}; };
class SdpConst {
public:
static string const kTWCCRtcpFb;
static string const kTWCCExtMap;
static string const kRembRtcpFb;
static string const kRembExtMap;
private:
SdpConst() = delete;
~SdpConst() = delete;
};
#endif //ZLMEDIAKIT_SDP_H #endif //ZLMEDIAKIT_SDP_H
...@@ -623,7 +623,7 @@ void WebRtcTransportImp::onSortedRtp(const RtpPayloadInfo &info, RtpPacket::Ptr ...@@ -623,7 +623,7 @@ void WebRtcTransportImp::onSortedRtp(const RtpPayloadInfo &info, RtpPacket::Ptr
//开启remb,则发送remb包调节比特率 //开启remb,则发送remb包调节比特率
GET_CONFIG(size_t, remb_bit_rate, RTC::kRembBitRate); GET_CONFIG(size_t, remb_bit_rate, RTC::kRembBitRate);
if (remb_bit_rate) { if (remb_bit_rate && getSdp(SdpType::answer).supportRtcpFb(SdpConst::kRembRtcpFb)) {
sendRtcpRemb(_recv_video_ssrc, remb_bit_rate); sendRtcpRemb(_recv_video_ssrc, remb_bit_rate);
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论