Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Unified Diff: webrtc/media/base/rtpdataengine.cc

Issue 1813763005: Updated structures and functions for setting the max bitrate limit to take rtc::Optional<int> Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Code review feedback Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/media/base/rtpdataengine.h ('k') | webrtc/media/base/rtpdataengine_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/base/rtpdataengine.cc
diff --git a/webrtc/media/base/rtpdataengine.cc b/webrtc/media/base/rtpdataengine.cc
index ae3617455573754271c16d94dcd6125083aaa991..04e558c1cb3bd8fd3be1c848c40d07122bbc74a5 100644
--- a/webrtc/media/base/rtpdataengine.cc
+++ b/webrtc/media/base/rtpdataengine.cc
@@ -139,7 +139,7 @@ bool RtpDataMediaChannel::SetSendCodecs(const std::vector<DataCodec>& codecs) {
bool RtpDataMediaChannel::SetSendParameters(const DataSendParameters& params) {
return (SetSendCodecs(params.codecs) &&
- SetMaxSendBandwidth(params.max_bandwidth_bps));
+ SetMaxSendBandwidth(params.max_bitrate_bps));
}
bool RtpDataMediaChannel::SetRecvParameters(const DataRecvParameters& params) {
@@ -265,9 +265,10 @@ void RtpDataMediaChannel::OnPacketReceived(
SignalDataReceived(params, data, data_len);
}
-bool RtpDataMediaChannel::SetMaxSendBandwidth(int bps) {
- if (bps <= 0) {
- bps = kDataMaxBandwidth;
+bool RtpDataMediaChannel::SetMaxSendBandwidth(rtc::Optional<int> bitrate) {
+ int bps = kDataMaxBandwidth;
+ if (bitrate && *bitrate > 0) {
+ bps = *bitrate;
}
send_limiter_.reset(new rtc::RateLimiter(bps / 8, 1.0));
LOG(LS_INFO) << "RtpDataMediaChannel::SetSendBandwidth to " << bps << "bps.";
« no previous file with comments | « webrtc/media/base/rtpdataengine.h ('k') | webrtc/media/base/rtpdataengine_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698