Index: webrtc/media/base/mediachannel.h |
diff --git a/webrtc/media/base/mediachannel.h b/webrtc/media/base/mediachannel.h |
index f92a7326323d64c6774c059b51e8724854e8ae7f..1fb8e23c8352ac0101d8929bd54c4c5334061919 100644 |
--- a/webrtc/media/base/mediachannel.h |
+++ b/webrtc/media/base/mediachannel.h |
@@ -21,6 +21,7 @@ |
#include "webrtc/base/dscp.h" |
#include "webrtc/base/logging.h" |
#include "webrtc/base/optional.h" |
+#include "webrtc/base/optional_ios.h" |
#include "webrtc/base/sigslot.h" |
#include "webrtc/base/socket.h" |
#include "webrtc/base/window.h" |
@@ -81,14 +82,15 @@ static std::string VectorToString(const std::vector<T>& vals) { |
} |
template <typename T> |
-static T MinPositive(T a, T b) { |
- if (a <= 0) { |
+static rtc::Optional<T> OptionalMin(rtc::Optional<T> a, rtc::Optional<T> b) { |
+ if (!a) { |
return b; |
} |
- if (b <= 0) { |
+ if (!b) { |
return a; |
} |
- return std::min(a, b); |
+ |
+ return rtc::Optional<T>(std::min(*a, *b)); |
} |
// Construction-time settings, passed to |
@@ -844,12 +846,12 @@ struct RtpSendParameters : RtpParameters<Codec> { |
ost << "{"; |
ost << "codecs: " << VectorToString(this->codecs) << ", "; |
ost << "extensions: " << VectorToString(this->extensions) << ", "; |
- ost << "max_bandwidth_bps: " << max_bandwidth_bps << ", "; |
+ ost << "max_bitrate_bps: " << max_bitrate_bps << ", "; |
ost << "}"; |
return ost.str(); |
} |
- int max_bandwidth_bps = -1; |
+ rtc::Optional<int> max_bitrate_bps; |
}; |
struct AudioSendParameters : RtpSendParameters<AudioCodec> { |
@@ -858,7 +860,7 @@ struct AudioSendParameters : RtpSendParameters<AudioCodec> { |
ost << "{"; |
ost << "codecs: " << VectorToString(this->codecs) << ", "; |
ost << "extensions: " << VectorToString(this->extensions) << ", "; |
- ost << "max_bandwidth_bps: " << max_bandwidth_bps << ", "; |
+ ost << "max_bitrate_bps: " << max_bitrate_bps << ", "; |
ost << "options: " << options.ToString(); |
ost << "}"; |
return ost.str(); |
@@ -1064,7 +1066,7 @@ struct DataSendParameters : RtpSendParameters<DataCodec> { |
// Options and extensions aren't used. |
ost << "{"; |
ost << "codecs: " << VectorToString(codecs) << ", "; |
- ost << "max_bandwidth_bps: " << max_bandwidth_bps; |
+ ost << "max_bitrate_bps: " << max_bitrate_bps; |
ost << "}"; |
return ost.str(); |
} |