diff --git a/logging/rtc_event_log/encoder/rtc_event_log_encoder_new_format.cc b/logging/rtc_event_log/encoder/rtc_event_log_encoder_new_format.cc index 5aa9c83b50..6116d8d1e2 100644 --- a/logging/rtc_event_log/encoder/rtc_event_log_encoder_new_format.cc +++ b/logging/rtc_event_log/encoder/rtc_event_log_encoder_new_format.cc @@ -1390,6 +1390,7 @@ void RtcEventLogEncoderNewFormat::EncodeIceCandidatePairEvent( proto_batch->set_event_type(ConvertToProtoFormat(base_event->type())); proto_batch->set_candidate_pair_id(base_event->candidate_pair_id()); + proto_batch->set_transaction_id(base_event->transaction_id()); } // TODO(terelius): Should we delta-compress this event type? } diff --git a/logging/rtc_event_log/rtc_event_log2.proto b/logging/rtc_event_log/rtc_event_log2.proto index 5ef52a65e0..a8f2f9d9ac 100644 --- a/logging/rtc_event_log/rtc_event_log2.proto +++ b/logging/rtc_event_log/rtc_event_log2.proto @@ -572,6 +572,9 @@ message IceCandidatePairEvent { // required optional uint32 candidate_pair_id = 3; + + // required + optional uint32 transaction_id = 4; } message DtlsTransportStateEvent { diff --git a/logging/rtc_event_log/rtc_event_log_parser_new.cc b/logging/rtc_event_log/rtc_event_log_parser_new.cc index 19decff78b..d0b20380ab 100644 --- a/logging/rtc_event_log/rtc_event_log_parser_new.cc +++ b/logging/rtc_event_log/rtc_event_log_parser_new.cc @@ -2393,6 +2393,8 @@ void ParsedRtcEventLogNew::StoreIceCandidateEvent( ice_event.type = GetRuntimeIceCandidatePairEventType(proto.event_type()); RTC_CHECK(proto.has_candidate_pair_id()); ice_event.candidate_pair_id = proto.candidate_pair_id(); + RTC_CHECK(proto.has_transaction_id()); + ice_event.transaction_id = proto.transaction_id(); ice_candidate_pair_events_.push_back(ice_event); diff --git a/logging/rtc_event_log/rtc_event_log_parser_new.h b/logging/rtc_event_log/rtc_event_log_parser_new.h index 49d2ae907b..98d02ad699 100644 --- a/logging/rtc_event_log/rtc_event_log_parser_new.h +++ b/logging/rtc_event_log/rtc_event_log_parser_new.h @@ -223,10 +223,12 @@ struct LoggedIceCandidatePairEvent { LoggedIceCandidatePairEvent() = default; LoggedIceCandidatePairEvent(int64_t timestamp_us, IceCandidatePairEventType type, - uint32_t candidate_pair_id) + uint32_t candidate_pair_id, + uint32_t transaction_id) : timestamp_us(timestamp_us), type(type), - candidate_pair_id(candidate_pair_id) {} + candidate_pair_id(candidate_pair_id), + transaction_id(transaction_id) {} int64_t log_time_us() const { return timestamp_us; } int64_t log_time_ms() const { return timestamp_us / 1000; } @@ -234,6 +236,7 @@ struct LoggedIceCandidatePairEvent { int64_t timestamp_us; IceCandidatePairEventType type; uint32_t candidate_pair_id; + uint32_t transaction_id; }; struct LoggedRtpPacket { diff --git a/logging/rtc_event_log/rtc_event_log_unittest_helper.cc b/logging/rtc_event_log/rtc_event_log_unittest_helper.cc index 9ee345c22d..249d601c3f 100644 --- a/logging/rtc_event_log/rtc_event_log_unittest_helper.cc +++ b/logging/rtc_event_log/rtc_event_log_unittest_helper.cc @@ -653,6 +653,9 @@ void EventVerifier::VerifyLoggedIceCandidatePairEvent( EXPECT_EQ(original_event.type(), logged_event.type); EXPECT_EQ(original_event.candidate_pair_id(), logged_event.candidate_pair_id); + if (encoding_type_ == RtcEventLog::EncodingType::NewFormat) { + EXPECT_EQ(original_event.transaction_id(), logged_event.transaction_id); + } } void VerifyLoggedRtpHeader(const RtpPacket& original_header,