do not set rtp datachannel b=AS for SCTP
the limit is ignored anyway. Also rename rtp datachannel bandwidth limit constant. BUG=webrtc:6625 Change-Id: If7b26691ced8148955e98c86b9bed692b2e55e8e Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/189972 Reviewed-by: Harald Alvestrand <hta@webrtc.org> Reviewed-by: Tommi <tommi@webrtc.org> Commit-Queue: Tommi <tommi@webrtc.org> Cr-Commit-Position: refs/heads/master@{#32479}
This commit is contained in:
committed by
Commit Bot
parent
3d25935127
commit
afee708f66
@ -14,7 +14,7 @@ namespace cricket {
|
||||
|
||||
const int kVideoCodecClockrate = 90000;
|
||||
const int kDataCodecClockrate = 90000;
|
||||
const int kDataMaxBandwidth = 30720; // bps
|
||||
const int kRtpDataMaxBandwidth = 30720; // bps
|
||||
|
||||
const float kHighSystemCpuThreshold = 0.85f;
|
||||
const float kLowSystemCpuThreshold = 0.65f;
|
||||
|
||||
@ -21,7 +21,7 @@ namespace cricket {
|
||||
|
||||
extern const int kVideoCodecClockrate;
|
||||
extern const int kDataCodecClockrate;
|
||||
extern const int kDataMaxBandwidth; // bps
|
||||
extern const int kRtpDataMaxBandwidth; // bps
|
||||
|
||||
// Default CPU thresholds.
|
||||
extern const float kHighSystemCpuThreshold;
|
||||
|
||||
@ -62,7 +62,7 @@ RtpDataMediaChannel::RtpDataMediaChannel(const MediaConfig& config)
|
||||
void RtpDataMediaChannel::Construct() {
|
||||
sending_ = false;
|
||||
receiving_ = false;
|
||||
send_limiter_.reset(new rtc::DataRateLimiter(kDataMaxBandwidth / 8, 1.0));
|
||||
send_limiter_.reset(new rtc::DataRateLimiter(kRtpDataMaxBandwidth / 8, 1.0));
|
||||
}
|
||||
|
||||
RtpDataMediaChannel::~RtpDataMediaChannel() {
|
||||
@ -245,7 +245,7 @@ void RtpDataMediaChannel::OnPacketReceived(rtc::CopyOnWriteBuffer packet,
|
||||
|
||||
bool RtpDataMediaChannel::SetMaxSendBandwidth(int bps) {
|
||||
if (bps <= 0) {
|
||||
bps = kDataMaxBandwidth;
|
||||
bps = kRtpDataMaxBandwidth;
|
||||
}
|
||||
send_limiter_.reset(new rtc::DataRateLimiter(bps / 8, 1.0));
|
||||
RTC_LOG(LS_INFO) << "RtpDataMediaChannel::SetSendBandwidth to " << bps
|
||||
|
||||
@ -2377,7 +2377,7 @@ bool MediaSessionDescriptionFactory::AddRtpDataContentForOffer(
|
||||
return false;
|
||||
}
|
||||
|
||||
data->set_bandwidth(kDataMaxBandwidth);
|
||||
data->set_bandwidth(kRtpDataMaxBandwidth);
|
||||
SetMediaProtocol(secure_transport, data.get());
|
||||
desc->AddContent(media_description_options.mid, MediaProtocolType::kRtp,
|
||||
media_description_options.stopped, std::move(data));
|
||||
@ -2773,8 +2773,8 @@ bool MediaSessionDescriptionFactory::AddDataContentForAnswer(
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!rejected) {
|
||||
data_answer->set_bandwidth(kDataMaxBandwidth);
|
||||
if (!rejected && session_options.data_channel_type == DCT_RTP) {
|
||||
data_answer->set_bandwidth(kRtpDataMaxBandwidth);
|
||||
} else {
|
||||
// RFC 3264
|
||||
// The answer MUST contain the same number of m-lines as the offer.
|
||||
|
||||
@ -958,7 +958,7 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateRtpDataOffer) {
|
||||
EXPECT_EQ(MEDIA_TYPE_DATA, dcd->type());
|
||||
EXPECT_EQ(f1_.rtp_data_codecs(), dcd->codecs());
|
||||
EXPECT_EQ(0U, dcd->first_ssrc()); // no sender is attached.
|
||||
EXPECT_EQ(cricket::kDataMaxBandwidth,
|
||||
EXPECT_EQ(cricket::kRtpDataMaxBandwidth,
|
||||
dcd->bandwidth()); // default bandwidth (auto)
|
||||
EXPECT_TRUE(dcd->rtcp_mux()); // rtcp-mux defaults on
|
||||
ASSERT_CRYPTO(dcd, 1U, kDefaultSrtpCryptoSuite);
|
||||
@ -2483,7 +2483,7 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateMultiStreamVideoOffer) {
|
||||
ASSERT_EQ(1U, data_streams[1].ssrcs.size());
|
||||
EXPECT_NE(0U, data_streams[1].ssrcs[0]);
|
||||
|
||||
EXPECT_EQ(cricket::kDataMaxBandwidth,
|
||||
EXPECT_EQ(cricket::kRtpDataMaxBandwidth,
|
||||
dcd->bandwidth()); // default bandwidth (auto)
|
||||
EXPECT_TRUE(dcd->rtcp_mux()); // rtcp-mux defaults on
|
||||
ASSERT_CRYPTO(dcd, 1U, kDefaultSrtpCryptoSuite);
|
||||
@ -2843,7 +2843,7 @@ TEST_F(MediaSessionDescriptionFactoryTest, TestCreateMultiStreamVideoAnswer) {
|
||||
ASSERT_EQ(1U, data_streams[1].ssrcs.size());
|
||||
EXPECT_NE(0U, data_streams[1].ssrcs[0]);
|
||||
|
||||
EXPECT_EQ(cricket::kDataMaxBandwidth,
|
||||
EXPECT_EQ(cricket::kRtpDataMaxBandwidth,
|
||||
dcd->bandwidth()); // default bandwidth (auto)
|
||||
EXPECT_TRUE(dcd->rtcp_mux()); // rtcp-mux defaults on
|
||||
|
||||
|
||||
@ -3044,11 +3044,11 @@ bool ParseContent(const std::string& message,
|
||||
// the first place and provides another way to get around the limitation.
|
||||
if (media_type == cricket::MEDIA_TYPE_DATA &&
|
||||
cricket::IsRtpProtocol(protocol) &&
|
||||
(b > cricket::kDataMaxBandwidth / 1000 ||
|
||||
(b > cricket::kRtpDataMaxBandwidth / 1000 ||
|
||||
bandwidth_type == kTransportSpecificBandwidth)) {
|
||||
rtc::StringBuilder description;
|
||||
description << "RTP-based data channels may not send more than "
|
||||
<< cricket::kDataMaxBandwidth / 1000 << "kbps.";
|
||||
<< cricket::kRtpDataMaxBandwidth / 1000 << "kbps.";
|
||||
return ParseFailed(line, description.str(), error);
|
||||
}
|
||||
// Convert values. Prevent integer overflow.
|
||||
|
||||
Reference in New Issue
Block a user