Add transaction id to candidate pair event log parser and encoder.

Covered by these tests:
RandomSeeds/RtcEventLogEncoderTest.RtcEventIceCandidatePair/*
RtcEventLogTest/RtcEventLogSession.*

Bug: webrtc:9972
Change-Id: I05473176357804e7ad0dedb51a659ab9481a4e4a
Reviewed-on: https://webrtc-review.googlesource.com/c/110103
Commit-Queue: Zach Stein <zstein@webrtc.org>
Reviewed-by: Elad Alon <eladalon@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25867}
This commit is contained in:
Zach Stein 2018-11-27 12:44:54 -08:00 committed by Commit Bot
parent 846dfdfd01
commit b3033c448f
5 changed files with 14 additions and 2 deletions

View File

@ -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?
}

View File

@ -572,6 +572,9 @@ message IceCandidatePairEvent {
// required
optional uint32 candidate_pair_id = 3;
// required
optional uint32 transaction_id = 4;
}
message DtlsTransportStateEvent {

View File

@ -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);

View File

@ -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 {

View File

@ -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,