Add an ICE switch reason for a switch requested by an application.
Also added an enum for unknown reason.
New value uses a macro-like name rather than a constant-like name for consistency.
Bug: chromium:1369096, webrtc:14131
Change-Id: Ib315584ec40d8c1cd9a6f0ff44587c0d92c735d5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/292341
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Sameer Vijaykar <samvi@google.com>
Cr-Commit-Position: refs/heads/main@{#39262}
diff --git a/p2p/base/ice_switch_reason.cc b/p2p/base/ice_switch_reason.cc
index 61f0fa7..67fe335 100644
--- a/p2p/base/ice_switch_reason.cc
+++ b/p2p/base/ice_switch_reason.cc
@@ -36,6 +36,9 @@
return "selected candidate pair destroyed";
case IceSwitchReason::ICE_CONTROLLER_RECHECK:
return "ice-controller-request-recheck";
+ case IceSwitchReason::APPLICATION_REQUESTED:
+ return "application requested";
+ case IceSwitchReason::UNKNOWN:
default:
return "unknown";
}
diff --git a/p2p/base/ice_switch_reason.h b/p2p/base/ice_switch_reason.h
index 65f49d3..669e5dc 100644
--- a/p2p/base/ice_switch_reason.h
+++ b/p2p/base/ice_switch_reason.h
@@ -18,6 +18,7 @@
namespace cricket {
enum class IceSwitchReason {
+ UNKNOWN,
REMOTE_CANDIDATE_GENERATION_CHANGE,
NETWORK_PREFERENCE_CHANGE,
NEW_CONNECTION_FROM_LOCAL_CANDIDATE,
@@ -31,6 +32,8 @@
// P2PTransportChannel to recheck a switch periodically without an event
// taking place.
ICE_CONTROLLER_RECHECK,
+ // The webrtc application requested a connection switch.
+ APPLICATION_REQUESTED,
};
RTC_EXPORT std::string IceSwitchReasonToString(IceSwitchReason reason);