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(
|
||||
IceCandidateType type) {
|
||||
switch (type) {
|
||||
case IceCandidateType::kLocal:
|
||||
case IceCandidateType::kHost:
|
||||
return rtclog::IceCandidatePairConfig::LOCAL;
|
||||
case IceCandidateType::kStun:
|
||||
case IceCandidateType::kSrflx:
|
||||
return rtclog::IceCandidatePairConfig::STUN;
|
||||
case IceCandidateType::kPrflx:
|
||||
return rtclog::IceCandidatePairConfig::PRFLX;
|
||||
|
||||
@ -200,9 +200,9 @@ ConvertToProtoFormat(IceCandidatePairConfigType type) {
|
||||
rtclog2::IceCandidatePairConfig::IceCandidateType ConvertToProtoFormat(
|
||||
IceCandidateType type) {
|
||||
switch (type) {
|
||||
case IceCandidateType::kLocal:
|
||||
case IceCandidateType::kHost:
|
||||
return rtclog2::IceCandidatePairConfig::LOCAL;
|
||||
case IceCandidateType::kStun:
|
||||
case IceCandidateType::kSrflx:
|
||||
return rtclog2::IceCandidatePairConfig::STUN;
|
||||
case IceCandidateType::kPrflx:
|
||||
return rtclog2::IceCandidatePairConfig::PRFLX;
|
||||
|
||||
@ -32,13 +32,15 @@ enum class IceCandidatePairConfigType {
|
||||
kNumValues,
|
||||
};
|
||||
|
||||
// TODO(tommi): Change the names of candidate types to "host", "srflx" for
|
||||
// spec-compliance.
|
||||
// TODO(tommi): Move this definition to candidate.h.
|
||||
enum class IceCandidateType {
|
||||
kLocal,
|
||||
kStun,
|
||||
kHost,
|
||||
kSrflx,
|
||||
kPrflx,
|
||||
kRelay,
|
||||
// TODO(tommi): Legacy names. Remove.
|
||||
kLocal [[deprecated("Use kHost instead")]] = kHost,
|
||||
kStun [[deprecated("Use kSrflx instead ")]] = kSrflx
|
||||
};
|
||||
|
||||
enum class IceCandidatePairProtocol {
|
||||
|
||||
@ -171,10 +171,10 @@ bool GetRuntimeIceCandidateType(
|
||||
IceCandidateType& parsed_type) {
|
||||
switch (log_type) {
|
||||
case rtclog::IceCandidatePairConfig::LOCAL:
|
||||
parsed_type = IceCandidateType::kLocal;
|
||||
parsed_type = IceCandidateType::kHost;
|
||||
break;
|
||||
case rtclog::IceCandidatePairConfig::STUN:
|
||||
parsed_type = IceCandidateType::kStun;
|
||||
parsed_type = IceCandidateType::kSrflx;
|
||||
break;
|
||||
case rtclog::IceCandidatePairConfig::PRFLX:
|
||||
parsed_type = IceCandidateType::kPrflx;
|
||||
@ -813,16 +813,16 @@ IceCandidateType GetRuntimeIceCandidateType(
|
||||
rtclog2::IceCandidatePairConfig::IceCandidateType type) {
|
||||
switch (type) {
|
||||
case rtclog2::IceCandidatePairConfig::LOCAL:
|
||||
return IceCandidateType::kLocal;
|
||||
return IceCandidateType::kHost;
|
||||
case rtclog2::IceCandidatePairConfig::STUN:
|
||||
return IceCandidateType::kStun;
|
||||
return IceCandidateType::kSrflx;
|
||||
case rtclog2::IceCandidatePairConfig::PRFLX:
|
||||
return IceCandidateType::kPrflx;
|
||||
case rtclog2::IceCandidatePairConfig::RELAY:
|
||||
return IceCandidateType::kRelay;
|
||||
default:
|
||||
RTC_DCHECK_NOTREACHED();
|
||||
return IceCandidateType::kLocal;
|
||||
return IceCandidateType::kHost;
|
||||
}
|
||||
}
|
||||
|
||||
@ -831,10 +831,10 @@ bool GetRuntimeIceCandidateType(
|
||||
IceCandidateType& parsed_type) {
|
||||
switch (log_type) {
|
||||
case rtclog2::IceCandidatePairConfig::LOCAL:
|
||||
parsed_type = IceCandidateType::kLocal;
|
||||
parsed_type = IceCandidateType::kHost;
|
||||
break;
|
||||
case rtclog2::IceCandidatePairConfig::STUN:
|
||||
parsed_type = IceCandidateType::kStun;
|
||||
parsed_type = IceCandidateType::kSrflx;
|
||||
break;
|
||||
case rtclog2::IceCandidatePairConfig::PRFLX:
|
||||
parsed_type = IceCandidateType::kPrflx;
|
||||
@ -2270,13 +2270,13 @@ std::vector<InferredRouteChangeEvent> ParsedRtcEventLog::GetRouteChanges()
|
||||
if (candidate.remote_address_family ==
|
||||
IceCandidatePairAddressFamily::kIpv6)
|
||||
route.send_overhead += kIpv6Overhead - kIpv4Overhead;
|
||||
if (candidate.remote_candidate_type != IceCandidateType::kLocal)
|
||||
if (candidate.remote_candidate_type != IceCandidateType::kHost)
|
||||
route.send_overhead += kStunOverhead;
|
||||
route.return_overhead = kUdpOverhead + kSrtpOverhead + kIpv4Overhead;
|
||||
if (candidate.remote_address_family ==
|
||||
IceCandidatePairAddressFamily::kIpv6)
|
||||
route.return_overhead += kIpv6Overhead - kIpv4Overhead;
|
||||
if (candidate.remote_candidate_type != IceCandidateType::kLocal)
|
||||
if (candidate.remote_candidate_type != IceCandidateType::kHost)
|
||||
route.return_overhead += kStunOverhead;
|
||||
route_changes.push_back(route);
|
||||
}
|
||||
|
||||
@ -224,10 +224,10 @@ constexpr uint32_t CandidateTypeCount() {
|
||||
// This switch statement only exists to catch changes to the IceCandidateType
|
||||
// enumeration. If you get an error here, please update the switch statement
|
||||
// and the return value.
|
||||
IceCandidateType type = IceCandidateType::kLocal;
|
||||
IceCandidateType type = IceCandidateType::kHost;
|
||||
switch (type) {
|
||||
case IceCandidateType::kLocal:
|
||||
case IceCandidateType::kStun:
|
||||
case IceCandidateType::kHost:
|
||||
case IceCandidateType::kSrflx:
|
||||
case IceCandidateType::kPrflx:
|
||||
case IceCandidateType::kRelay:
|
||||
break;
|
||||
@ -237,7 +237,7 @@ constexpr uint32_t CandidateTypeCount() {
|
||||
|
||||
std::unique_ptr<RtcEventIceCandidatePairConfig>
|
||||
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");
|
||||
IceCandidateType local_candidate_type =
|
||||
static_cast<IceCandidateType>(prng_.Rand(CandidateTypeCount() - 1));
|
||||
|
||||
@ -77,9 +77,9 @@ inline bool TooLongWithoutResponse(
|
||||
// enum.
|
||||
webrtc::IceCandidateType GetRtcEventLogCandidateType(const Candidate& c) {
|
||||
if (c.is_local()) {
|
||||
return webrtc::IceCandidateType::kLocal;
|
||||
return webrtc::IceCandidateType::kHost;
|
||||
} else if (c.is_stun()) {
|
||||
return webrtc::IceCandidateType::kStun;
|
||||
return webrtc::IceCandidateType::kSrflx;
|
||||
} else if (c.is_prflx()) {
|
||||
return webrtc::IceCandidateType::kPrflx;
|
||||
}
|
||||
|
||||
@ -231,8 +231,8 @@ bool Convert(std::string inputfile,
|
||||
{IceCandidatePairConfigType::kNumValues, "NUM_VALUES"}};
|
||||
|
||||
static const std::map<IceCandidateType, std::string>
|
||||
candidate_type_name{{IceCandidateType::kLocal, "LOCAL"},
|
||||
{IceCandidateType::kStun, "STUN"},
|
||||
candidate_type_name{{IceCandidateType::kHost, "LOCAL"},
|
||||
{IceCandidateType::kSrflx, "STUN"},
|
||||
{IceCandidateType::kPrflx, "PRFLX"},
|
||||
{IceCandidateType::kRelay, "RELAY"}};
|
||||
|
||||
|
||||
@ -261,9 +261,9 @@ const char kNetworkTypeCellular[] = "cellular";
|
||||
|
||||
absl::string_view GetIceCandidateTypeAsString(IceCandidateType type) {
|
||||
switch (type) {
|
||||
case IceCandidateType::kLocal:
|
||||
case IceCandidateType::kHost:
|
||||
return kIceCandidateTypeLocal;
|
||||
case IceCandidateType::kStun:
|
||||
case IceCandidateType::kSrflx:
|
||||
return kIceCandidateTypeStun;
|
||||
case IceCandidateType::kPrflx:
|
||||
return kIceCandidateTypePrflx;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user