Rename kLocal to kHost and kStun to kSrflx
Bug: none Change-Id: I92845014024e5780365057e81b613b0882724d1d Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/336740 Reviewed-by: Björn Terelius <terelius@webrtc.org> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org> Cr-Commit-Position: refs/heads/main@{#41652}
This commit is contained in:
parent
d071dc1725
commit
2c169aef97
@ -131,9 +131,9 @@ ConvertIceCandidatePairConfigType(IceCandidatePairConfigType type) {
|
|||||||
rtclog::IceCandidatePairConfig::IceCandidateType ConvertIceCandidateType(
|
rtclog::IceCandidatePairConfig::IceCandidateType ConvertIceCandidateType(
|
||||||
IceCandidateType type) {
|
IceCandidateType type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case IceCandidateType::kLocal:
|
case IceCandidateType::kHost:
|
||||||
return rtclog::IceCandidatePairConfig::LOCAL;
|
return rtclog::IceCandidatePairConfig::LOCAL;
|
||||||
case IceCandidateType::kStun:
|
case IceCandidateType::kSrflx:
|
||||||
return rtclog::IceCandidatePairConfig::STUN;
|
return rtclog::IceCandidatePairConfig::STUN;
|
||||||
case IceCandidateType::kPrflx:
|
case IceCandidateType::kPrflx:
|
||||||
return rtclog::IceCandidatePairConfig::PRFLX;
|
return rtclog::IceCandidatePairConfig::PRFLX;
|
||||||
|
|||||||
@ -200,9 +200,9 @@ ConvertToProtoFormat(IceCandidatePairConfigType type) {
|
|||||||
rtclog2::IceCandidatePairConfig::IceCandidateType ConvertToProtoFormat(
|
rtclog2::IceCandidatePairConfig::IceCandidateType ConvertToProtoFormat(
|
||||||
IceCandidateType type) {
|
IceCandidateType type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case IceCandidateType::kLocal:
|
case IceCandidateType::kHost:
|
||||||
return rtclog2::IceCandidatePairConfig::LOCAL;
|
return rtclog2::IceCandidatePairConfig::LOCAL;
|
||||||
case IceCandidateType::kStun:
|
case IceCandidateType::kSrflx:
|
||||||
return rtclog2::IceCandidatePairConfig::STUN;
|
return rtclog2::IceCandidatePairConfig::STUN;
|
||||||
case IceCandidateType::kPrflx:
|
case IceCandidateType::kPrflx:
|
||||||
return rtclog2::IceCandidatePairConfig::PRFLX;
|
return rtclog2::IceCandidatePairConfig::PRFLX;
|
||||||
|
|||||||
@ -32,13 +32,15 @@ enum class IceCandidatePairConfigType {
|
|||||||
kNumValues,
|
kNumValues,
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO(tommi): Change the names of candidate types to "host", "srflx" for
|
// TODO(tommi): Move this definition to candidate.h.
|
||||||
// spec-compliance.
|
|
||||||
enum class IceCandidateType {
|
enum class IceCandidateType {
|
||||||
kLocal,
|
kHost,
|
||||||
kStun,
|
kSrflx,
|
||||||
kPrflx,
|
kPrflx,
|
||||||
kRelay,
|
kRelay,
|
||||||
|
// TODO(tommi): Legacy names. Remove.
|
||||||
|
kLocal [[deprecated("Use kHost instead")]] = kHost,
|
||||||
|
kStun [[deprecated("Use kSrflx instead ")]] = kSrflx
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class IceCandidatePairProtocol {
|
enum class IceCandidatePairProtocol {
|
||||||
|
|||||||
@ -171,10 +171,10 @@ bool GetRuntimeIceCandidateType(
|
|||||||
IceCandidateType& parsed_type) {
|
IceCandidateType& parsed_type) {
|
||||||
switch (log_type) {
|
switch (log_type) {
|
||||||
case rtclog::IceCandidatePairConfig::LOCAL:
|
case rtclog::IceCandidatePairConfig::LOCAL:
|
||||||
parsed_type = IceCandidateType::kLocal;
|
parsed_type = IceCandidateType::kHost;
|
||||||
break;
|
break;
|
||||||
case rtclog::IceCandidatePairConfig::STUN:
|
case rtclog::IceCandidatePairConfig::STUN:
|
||||||
parsed_type = IceCandidateType::kStun;
|
parsed_type = IceCandidateType::kSrflx;
|
||||||
break;
|
break;
|
||||||
case rtclog::IceCandidatePairConfig::PRFLX:
|
case rtclog::IceCandidatePairConfig::PRFLX:
|
||||||
parsed_type = IceCandidateType::kPrflx;
|
parsed_type = IceCandidateType::kPrflx;
|
||||||
@ -813,16 +813,16 @@ IceCandidateType GetRuntimeIceCandidateType(
|
|||||||
rtclog2::IceCandidatePairConfig::IceCandidateType type) {
|
rtclog2::IceCandidatePairConfig::IceCandidateType type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case rtclog2::IceCandidatePairConfig::LOCAL:
|
case rtclog2::IceCandidatePairConfig::LOCAL:
|
||||||
return IceCandidateType::kLocal;
|
return IceCandidateType::kHost;
|
||||||
case rtclog2::IceCandidatePairConfig::STUN:
|
case rtclog2::IceCandidatePairConfig::STUN:
|
||||||
return IceCandidateType::kStun;
|
return IceCandidateType::kSrflx;
|
||||||
case rtclog2::IceCandidatePairConfig::PRFLX:
|
case rtclog2::IceCandidatePairConfig::PRFLX:
|
||||||
return IceCandidateType::kPrflx;
|
return IceCandidateType::kPrflx;
|
||||||
case rtclog2::IceCandidatePairConfig::RELAY:
|
case rtclog2::IceCandidatePairConfig::RELAY:
|
||||||
return IceCandidateType::kRelay;
|
return IceCandidateType::kRelay;
|
||||||
default:
|
default:
|
||||||
RTC_DCHECK_NOTREACHED();
|
RTC_DCHECK_NOTREACHED();
|
||||||
return IceCandidateType::kLocal;
|
return IceCandidateType::kHost;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -831,10 +831,10 @@ bool GetRuntimeIceCandidateType(
|
|||||||
IceCandidateType& parsed_type) {
|
IceCandidateType& parsed_type) {
|
||||||
switch (log_type) {
|
switch (log_type) {
|
||||||
case rtclog2::IceCandidatePairConfig::LOCAL:
|
case rtclog2::IceCandidatePairConfig::LOCAL:
|
||||||
parsed_type = IceCandidateType::kLocal;
|
parsed_type = IceCandidateType::kHost;
|
||||||
break;
|
break;
|
||||||
case rtclog2::IceCandidatePairConfig::STUN:
|
case rtclog2::IceCandidatePairConfig::STUN:
|
||||||
parsed_type = IceCandidateType::kStun;
|
parsed_type = IceCandidateType::kSrflx;
|
||||||
break;
|
break;
|
||||||
case rtclog2::IceCandidatePairConfig::PRFLX:
|
case rtclog2::IceCandidatePairConfig::PRFLX:
|
||||||
parsed_type = IceCandidateType::kPrflx;
|
parsed_type = IceCandidateType::kPrflx;
|
||||||
@ -2270,13 +2270,13 @@ std::vector<InferredRouteChangeEvent> ParsedRtcEventLog::GetRouteChanges()
|
|||||||
if (candidate.remote_address_family ==
|
if (candidate.remote_address_family ==
|
||||||
IceCandidatePairAddressFamily::kIpv6)
|
IceCandidatePairAddressFamily::kIpv6)
|
||||||
route.send_overhead += kIpv6Overhead - kIpv4Overhead;
|
route.send_overhead += kIpv6Overhead - kIpv4Overhead;
|
||||||
if (candidate.remote_candidate_type != IceCandidateType::kLocal)
|
if (candidate.remote_candidate_type != IceCandidateType::kHost)
|
||||||
route.send_overhead += kStunOverhead;
|
route.send_overhead += kStunOverhead;
|
||||||
route.return_overhead = kUdpOverhead + kSrtpOverhead + kIpv4Overhead;
|
route.return_overhead = kUdpOverhead + kSrtpOverhead + kIpv4Overhead;
|
||||||
if (candidate.remote_address_family ==
|
if (candidate.remote_address_family ==
|
||||||
IceCandidatePairAddressFamily::kIpv6)
|
IceCandidatePairAddressFamily::kIpv6)
|
||||||
route.return_overhead += kIpv6Overhead - kIpv4Overhead;
|
route.return_overhead += kIpv6Overhead - kIpv4Overhead;
|
||||||
if (candidate.remote_candidate_type != IceCandidateType::kLocal)
|
if (candidate.remote_candidate_type != IceCandidateType::kHost)
|
||||||
route.return_overhead += kStunOverhead;
|
route.return_overhead += kStunOverhead;
|
||||||
route_changes.push_back(route);
|
route_changes.push_back(route);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -224,10 +224,10 @@ constexpr uint32_t CandidateTypeCount() {
|
|||||||
// This switch statement only exists to catch changes to the IceCandidateType
|
// This switch statement only exists to catch changes to the IceCandidateType
|
||||||
// enumeration. If you get an error here, please update the switch statement
|
// enumeration. If you get an error here, please update the switch statement
|
||||||
// and the return value.
|
// and the return value.
|
||||||
IceCandidateType type = IceCandidateType::kLocal;
|
IceCandidateType type = IceCandidateType::kHost;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case IceCandidateType::kLocal:
|
case IceCandidateType::kHost:
|
||||||
case IceCandidateType::kStun:
|
case IceCandidateType::kSrflx:
|
||||||
case IceCandidateType::kPrflx:
|
case IceCandidateType::kPrflx:
|
||||||
case IceCandidateType::kRelay:
|
case IceCandidateType::kRelay:
|
||||||
break;
|
break;
|
||||||
@ -237,7 +237,7 @@ constexpr uint32_t CandidateTypeCount() {
|
|||||||
|
|
||||||
std::unique_ptr<RtcEventIceCandidatePairConfig>
|
std::unique_ptr<RtcEventIceCandidatePairConfig>
|
||||||
EventGenerator::NewIceCandidatePairConfig() {
|
EventGenerator::NewIceCandidatePairConfig() {
|
||||||
static_assert(static_cast<int>(IceCandidateType::kLocal) == 0,
|
static_assert(static_cast<int>(IceCandidateType::kHost) == 0,
|
||||||
"Expect kLocal to be the first enum value, equal to 0");
|
"Expect kLocal to be the first enum value, equal to 0");
|
||||||
IceCandidateType local_candidate_type =
|
IceCandidateType local_candidate_type =
|
||||||
static_cast<IceCandidateType>(prng_.Rand(CandidateTypeCount() - 1));
|
static_cast<IceCandidateType>(prng_.Rand(CandidateTypeCount() - 1));
|
||||||
|
|||||||
@ -77,9 +77,9 @@ inline bool TooLongWithoutResponse(
|
|||||||
// enum.
|
// enum.
|
||||||
webrtc::IceCandidateType GetRtcEventLogCandidateType(const Candidate& c) {
|
webrtc::IceCandidateType GetRtcEventLogCandidateType(const Candidate& c) {
|
||||||
if (c.is_local()) {
|
if (c.is_local()) {
|
||||||
return webrtc::IceCandidateType::kLocal;
|
return webrtc::IceCandidateType::kHost;
|
||||||
} else if (c.is_stun()) {
|
} else if (c.is_stun()) {
|
||||||
return webrtc::IceCandidateType::kStun;
|
return webrtc::IceCandidateType::kSrflx;
|
||||||
} else if (c.is_prflx()) {
|
} else if (c.is_prflx()) {
|
||||||
return webrtc::IceCandidateType::kPrflx;
|
return webrtc::IceCandidateType::kPrflx;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -231,8 +231,8 @@ bool Convert(std::string inputfile,
|
|||||||
{IceCandidatePairConfigType::kNumValues, "NUM_VALUES"}};
|
{IceCandidatePairConfigType::kNumValues, "NUM_VALUES"}};
|
||||||
|
|
||||||
static const std::map<IceCandidateType, std::string>
|
static const std::map<IceCandidateType, std::string>
|
||||||
candidate_type_name{{IceCandidateType::kLocal, "LOCAL"},
|
candidate_type_name{{IceCandidateType::kHost, "LOCAL"},
|
||||||
{IceCandidateType::kStun, "STUN"},
|
{IceCandidateType::kSrflx, "STUN"},
|
||||||
{IceCandidateType::kPrflx, "PRFLX"},
|
{IceCandidateType::kPrflx, "PRFLX"},
|
||||||
{IceCandidateType::kRelay, "RELAY"}};
|
{IceCandidateType::kRelay, "RELAY"}};
|
||||||
|
|
||||||
|
|||||||
@ -261,9 +261,9 @@ const char kNetworkTypeCellular[] = "cellular";
|
|||||||
|
|
||||||
absl::string_view GetIceCandidateTypeAsString(IceCandidateType type) {
|
absl::string_view GetIceCandidateTypeAsString(IceCandidateType type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case IceCandidateType::kLocal:
|
case IceCandidateType::kHost:
|
||||||
return kIceCandidateTypeLocal;
|
return kIceCandidateTypeLocal;
|
||||||
case IceCandidateType::kStun:
|
case IceCandidateType::kSrflx:
|
||||||
return kIceCandidateTypeStun;
|
return kIceCandidateTypeStun;
|
||||||
case IceCandidateType::kPrflx:
|
case IceCandidateType::kPrflx:
|
||||||
return kIceCandidateTypePrflx;
|
return kIceCandidateTypePrflx;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user