mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-10-30 16:27:36 +08:00
完善remb相关控制代码
This commit is contained in:
parent
6292824e34
commit
521d9f906b
@ -1394,6 +1394,29 @@ void RtcConfigure::enableTWCC(bool enable, TrackType type){
|
||||
}
|
||||
}
|
||||
|
||||
void RtcConfigure::enableREMB(bool enable, TrackType type){
|
||||
switch (type) {
|
||||
case TrackAudio: {
|
||||
audio.enableREMB(enable);
|
||||
break;
|
||||
}
|
||||
case TrackVideo: {
|
||||
video.enableREMB(enable);
|
||||
break;
|
||||
}
|
||||
case TrackApplication: {
|
||||
application.enableREMB(enable);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
audio.enableREMB(enable);
|
||||
video.enableREMB(enable);
|
||||
application.enableREMB(enable);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
shared_ptr<RtcSession> RtcConfigure::createAnswer(const RtcSession &offer){
|
||||
shared_ptr<RtcSession> ret = std::make_shared<RtcSession>();
|
||||
ret->version = offer.version;
|
||||
|
@ -719,6 +719,7 @@ public:
|
||||
void setPlayRtspInfo(const string &sdp);
|
||||
|
||||
void enableTWCC(bool enable = true, TrackType type = TrackInvalid);
|
||||
void enableREMB(bool enable = true, TrackType type = TrackInvalid);
|
||||
|
||||
private:
|
||||
void matchMedia(shared_ptr<RtcSession> &ret, TrackType type, const vector<RtcMedia> &medias, const RtcTrackConfigure &configure);
|
||||
|
@ -187,7 +187,13 @@ void WebRtcTransport::onCheckSdp(SdpType type, RtcSession &sdp){
|
||||
void WebRtcTransport::onRtcConfigure(RtcConfigure &configure) const {
|
||||
//开启remb后关闭twcc,因为开启twcc后remb无效
|
||||
GET_CONFIG(size_t, remb_bit_rate, RTC::kRembBitRate);
|
||||
configure.enableTWCC(!remb_bit_rate);
|
||||
if (remb_bit_rate) {
|
||||
configure.enableREMB(true);
|
||||
configure.enableTWCC(false);
|
||||
} else {
|
||||
configure.enableREMB(false);
|
||||
configure.enableTWCC(true);
|
||||
}
|
||||
}
|
||||
|
||||
std::string WebRtcTransport::getAnswerSdp(const string &offer){
|
||||
|
Loading…
Reference in New Issue
Block a user