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

Unified Diff: webrtc/media/engine/webrtcvoiceengine.cc

Issue 2651883010: Adding C++ versions of currently spec'd "RtpParameters" structs. (Closed)
Patch Set: Update unit tests (due to switch from special-case values to rtc::Optional) Created 3 years, 10 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
Index: webrtc/media/engine/webrtcvoiceengine.cc
diff --git a/webrtc/media/engine/webrtcvoiceengine.cc b/webrtc/media/engine/webrtcvoiceengine.cc
index 65a238f3db7924c6e6d415e6580f9d0024aae64c..7029e5b1f5a4aa7832f5ba3c85732ce50935ee49 100644
--- a/webrtc/media/engine/webrtcvoiceengine.cc
+++ b/webrtc/media/engine/webrtcvoiceengine.cc
@@ -520,10 +520,16 @@ const WebRtcVoiceCodecs::CodecPref WebRtcVoiceCodecs::kCodecPrefs[14] = {
{kDtmfCodecName, 8000, 1, 126, false, {}}
};
+// |max_send_bitrate_bps| is the bitrate from "b=" in SDP.
+// |rtp_max_bitrate_bps| is the bitrate from RtpSender::SetParameters.
rtc::Optional<int> ComputeSendBitrate(int max_send_bitrate_bps,
- int rtp_max_bitrate_bps,
+ rtc::Optional<int> rtp_max_bitrate_bps,
const webrtc::CodecInst& codec_inst) {
- const int bps = MinPositive(max_send_bitrate_bps, rtp_max_bitrate_bps);
+ // If application-configured bitrate is set, take minimum of that and SDP
+ // bitrate.
+ const int bps = rtp_max_bitrate_bps
+ ? MinPositive(max_send_bitrate_bps, *rtp_max_bitrate_bps)
+ : max_send_bitrate_bps;
const int codec_rate = codec_inst.rate;
if (bps <= 0) {
« no previous file with comments | « webrtc/media/engine/webrtcvideoengine2_unittest.cc ('k') | webrtc/media/engine/webrtcvoiceengine_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698