From d8bbc7858622b6d9c278469aab701ca0b609cddf Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 15 May 2024 05:35:49 +0200 Subject: Merging upstream version 126.0. Signed-off-by: Daniel Baumann --- third_party/libwebrtc/api/candidate.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'third_party/libwebrtc/api/candidate.cc') diff --git a/third_party/libwebrtc/api/candidate.cc b/third_party/libwebrtc/api/candidate.cc index 90cb326823..865f8e5787 100644 --- a/third_party/libwebrtc/api/candidate.cc +++ b/third_party/libwebrtc/api/candidate.cc @@ -17,6 +17,11 @@ namespace cricket { +const char LOCAL_PORT_TYPE[] = "local"; +const char STUN_PORT_TYPE[] = "stun"; +const char PRFLX_PORT_TYPE[] = "prflx"; +const char RELAY_PORT_TYPE[] = "relay"; + Candidate::Candidate() : id_(rtc::CreateRandomString(8)), component_(0), @@ -57,6 +62,19 @@ Candidate::Candidate(const Candidate&) = default; Candidate::~Candidate() = default; +bool Candidate::is_local() const { + return type_ == LOCAL_PORT_TYPE; +} +bool Candidate::is_stun() const { + return type_ == STUN_PORT_TYPE; +} +bool Candidate::is_prflx() const { + return type_ == PRFLX_PORT_TYPE; +} +bool Candidate::is_relay() const { + return type_ == RELAY_PORT_TYPE; +} + bool Candidate::IsEquivalent(const Candidate& c) const { // We ignore the network name, since that is just debug information, and // the priority and the network cost, since they should be the same if the -- cgit v1.2.3