1 /* 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. 3 * 4 * Use of this source code is governed by a BSD-style license 5 * that can be found in the LICENSE file in the root of the source 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 #include "logging/rtc_event_log/events/rtc_event_ice_candidate_pair_config.h" 12 13 #include "absl/memory/memory.h" 14 15 namespace webrtc { 16 IceCandidatePairDescription()17IceCandidatePairDescription::IceCandidatePairDescription() { 18 local_candidate_type = IceCandidateType::kUnknown; 19 local_relay_protocol = IceCandidatePairProtocol::kUnknown; 20 local_network_type = IceCandidateNetworkType::kUnknown; 21 local_address_family = IceCandidatePairAddressFamily::kUnknown; 22 remote_candidate_type = IceCandidateType::kUnknown; 23 remote_address_family = IceCandidatePairAddressFamily::kUnknown; 24 candidate_pair_protocol = IceCandidatePairProtocol::kUnknown; 25 } 26 IceCandidatePairDescription(const IceCandidatePairDescription & other)27IceCandidatePairDescription::IceCandidatePairDescription( 28 const IceCandidatePairDescription& other) { 29 local_candidate_type = other.local_candidate_type; 30 local_relay_protocol = other.local_relay_protocol; 31 local_network_type = other.local_network_type; 32 local_address_family = other.local_address_family; 33 remote_candidate_type = other.remote_candidate_type; 34 remote_address_family = other.remote_address_family; 35 candidate_pair_protocol = other.candidate_pair_protocol; 36 } 37 ~IceCandidatePairDescription()38IceCandidatePairDescription::~IceCandidatePairDescription() {} 39 RtcEventIceCandidatePairConfig(IceCandidatePairConfigType type,uint32_t candidate_pair_id,const IceCandidatePairDescription & candidate_pair_desc)40RtcEventIceCandidatePairConfig::RtcEventIceCandidatePairConfig( 41 IceCandidatePairConfigType type, 42 uint32_t candidate_pair_id, 43 const IceCandidatePairDescription& candidate_pair_desc) 44 : type_(type), 45 candidate_pair_id_(candidate_pair_id), 46 candidate_pair_desc_(candidate_pair_desc) {} 47 RtcEventIceCandidatePairConfig(const RtcEventIceCandidatePairConfig & other)48RtcEventIceCandidatePairConfig::RtcEventIceCandidatePairConfig( 49 const RtcEventIceCandidatePairConfig& other) 50 : RtcEvent(other.timestamp_us_), 51 type_(other.type_), 52 candidate_pair_id_(other.candidate_pair_id_), 53 candidate_pair_desc_(other.candidate_pair_desc_) {} 54 55 RtcEventIceCandidatePairConfig::~RtcEventIceCandidatePairConfig() = default; 56 GetType() const57RtcEvent::Type RtcEventIceCandidatePairConfig::GetType() const { 58 return RtcEvent::Type::IceCandidatePairConfig; 59 } 60 61 // The ICE candidate pair config event is not equivalent to a RtcEventLog config 62 // event. IsConfigEvent() const63bool RtcEventIceCandidatePairConfig::IsConfigEvent() const { 64 return false; 65 } 66 67 std::unique_ptr<RtcEventIceCandidatePairConfig> Copy() const68RtcEventIceCandidatePairConfig::Copy() const { 69 return absl::WrapUnique<RtcEventIceCandidatePairConfig>( 70 new RtcEventIceCandidatePairConfig(*this)); 71 } 72 73 } // namespace webrtc 74