Revert "Reland "Refactor AnalyzerConfig to use Timestamps instead of microseconds.""

This reverts commit 7a992e21b9c3ff03aa34488a9c91fa580ca4faa6.

Reason for revert: Breaks downstream build due to type change.

Original change's description:
> Reland "Refactor AnalyzerConfig to use Timestamps instead of microseconds."
>
> This is a reland of 43fb16921b29ecd3a2d87876dda75c575e05f66a
>
> Original change's description:
> > Refactor AnalyzerConfig to use Timestamps instead of microseconds.
> >
> > Add optional offset-to-UTC parameter to output. This allows aligning
> > the x-axis in the generated charts to other UTC-based logs.
> >
> > Bug: b/215140373
> > Change-Id: I65bcd295718acbb8c94e363907c1abc458067bfd
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250203
> > Reviewed-by: Kristoffer Erlandsson <kerl@google.com>
> > Commit-Queue: Björn Terelius <terelius@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#35992}
>
> Bug: b/215140373
> Change-Id: Id2b88cc4b8078a97275d49a617581cbbd02d2c6f
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/252380
> Reviewed-by: Kristoffer Erlandsson <kerl@google.com>
> Commit-Queue: Björn Terelius <terelius@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#36066}

Bug: b/215140373
Change-Id: I951ac26b8176e58da18e93835f13f6b9deb6d4fa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/252443
Auto-Submit: Björn Terelius <terelius@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36068}
This commit is contained in:
Björn Terelius
2022-02-24 15:46:57 +00:00
committed by WebRTC LUCI CQ
parent 3ed1dbb56e
commit 7306c75c12
36 changed files with 129 additions and 203 deletions

View File

@ -41,7 +41,6 @@ struct LoggedRtpPacket {
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp log_time() const { return timestamp; }
Timestamp timestamp;
// TODO(terelius): This allocates space for 15 CSRCs even if none are used.
@ -58,7 +57,6 @@ struct LoggedRtpPacketIncoming {
: rtp(timestamp, header, header_length, total_length) {}
int64_t log_time_us() const { return rtp.timestamp.us(); }
int64_t log_time_ms() const { return rtp.timestamp.ms(); }
Timestamp log_time() const { return rtp.timestamp; }
LoggedRtpPacket rtp;
};
@ -71,7 +69,6 @@ struct LoggedRtpPacketOutgoing {
: rtp(timestamp, header, header_length, total_length) {}
int64_t log_time_us() const { return rtp.timestamp.us(); }
int64_t log_time_ms() const { return rtp.timestamp.ms(); }
Timestamp log_time() const { return rtp.timestamp; }
LoggedRtpPacket rtp;
};
@ -90,7 +87,6 @@ struct LoggedRtcpPacket {
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp log_time() const { return timestamp; }
Timestamp timestamp;
std::vector<uint8_t> raw_data;
@ -105,7 +101,6 @@ struct LoggedRtcpPacketIncoming {
int64_t log_time_us() const { return rtcp.timestamp.us(); }
int64_t log_time_ms() const { return rtcp.timestamp.ms(); }
Timestamp log_time() const { return rtcp.timestamp; }
LoggedRtcpPacket rtcp;
};
@ -119,7 +114,6 @@ struct LoggedRtcpPacketOutgoing {
int64_t log_time_us() const { return rtcp.timestamp.us(); }
int64_t log_time_ms() const { return rtcp.timestamp.ms(); }
Timestamp log_time() const { return rtcp.timestamp; }
LoggedRtcpPacket rtcp;
};
@ -132,7 +126,6 @@ struct LoggedRtcpPacketReceiverReport {
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp log_time() const { return timestamp; }
Timestamp timestamp = Timestamp::MinusInfinity();
rtcp::ReceiverReport rr;
@ -146,7 +139,6 @@ struct LoggedRtcpPacketSenderReport {
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp log_time() const { return timestamp; }
Timestamp timestamp = Timestamp::MinusInfinity();
rtcp::SenderReport sr;
@ -157,7 +149,6 @@ struct LoggedRtcpPacketExtendedReports {
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp log_time() const { return timestamp; }
Timestamp timestamp = Timestamp::MinusInfinity();
rtcp::ExtendedReports xr;
@ -170,7 +161,6 @@ struct LoggedRtcpPacketRemb {
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp log_time() const { return timestamp; }
Timestamp timestamp = Timestamp::MinusInfinity();
rtcp::Remb remb;
@ -183,7 +173,6 @@ struct LoggedRtcpPacketNack {
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp log_time() const { return timestamp; }
Timestamp timestamp = Timestamp::MinusInfinity();
rtcp::Nack nack;
@ -194,7 +183,6 @@ struct LoggedRtcpPacketFir {
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp log_time() const { return timestamp; }
Timestamp timestamp = Timestamp::MinusInfinity();
rtcp::Fir fir;
@ -205,7 +193,6 @@ struct LoggedRtcpPacketPli {
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp log_time() const { return timestamp; }
Timestamp timestamp = Timestamp::MinusInfinity();
rtcp::Pli pli;
@ -222,7 +209,6 @@ struct LoggedRtcpPacketTransportFeedback {
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp log_time() const { return timestamp; }
Timestamp timestamp = Timestamp::MinusInfinity();
rtcp::TransportFeedback transport_feedback;
@ -237,7 +223,6 @@ struct LoggedRtcpPacketLossNotification {
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp log_time() const { return timestamp; }
Timestamp timestamp = Timestamp::MinusInfinity();
rtcp::LossNotification loss_notification;
@ -248,7 +233,6 @@ struct LoggedRtcpPacketBye {
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp log_time() const { return timestamp; }
Timestamp timestamp = Timestamp::MinusInfinity();
rtcp::Bye bye;

View File

@ -32,7 +32,6 @@ struct LoggedAlrStateEvent {
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp log_time() const { return timestamp; }
Timestamp timestamp = Timestamp::MinusInfinity();
bool in_alr;

View File

@ -31,7 +31,6 @@ struct LoggedAudioNetworkAdaptationEvent {
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp log_time() const { return timestamp; }
Timestamp timestamp = Timestamp::MinusInfinity();
AudioEncoderRuntimeConfig config;

View File

@ -32,7 +32,6 @@ struct LoggedAudioPlayoutEvent {
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp log_time() const { return timestamp; }
Timestamp timestamp = Timestamp::MinusInfinity();
uint32_t ssrc;

View File

@ -30,7 +30,6 @@ struct LoggedAudioRecvConfig {
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp log_time() const { return timestamp; }
Timestamp timestamp = Timestamp::MinusInfinity();
rtclog::StreamConfig config;

View File

@ -29,7 +29,6 @@ struct LoggedAudioSendConfig {
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp log_time() const { return timestamp; }
Timestamp timestamp = Timestamp::MinusInfinity();
rtclog::StreamConfig config;

View File

@ -35,7 +35,6 @@ struct LoggedStartEvent {
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp log_time() const { return timestamp; }
Timestamp utc_time() const { return utc_start_time; }

View File

@ -76,7 +76,6 @@ struct LoggedBweDelayBasedUpdate {
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp log_time() const { return timestamp; }
Timestamp timestamp = Timestamp::MinusInfinity();
int32_t bitrate_bps;

View File

@ -37,7 +37,6 @@ struct LoggedBweLossBasedUpdate {
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp log_time() const { return timestamp; }
Timestamp timestamp = Timestamp::MinusInfinity();
int32_t bitrate_bps;

View File

@ -26,7 +26,6 @@ namespace webrtc {
struct LoggedDtlsTransportState {
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp log_time() const { return timestamp; }
Timestamp timestamp = Timestamp::MinusInfinity();
DtlsTransportState dtls_transport_state;

View File

@ -28,7 +28,6 @@ struct LoggedDtlsWritableState {
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp log_time() const { return timestamp; }
Timestamp timestamp = Timestamp::MinusInfinity();
bool writable;

View File

@ -32,7 +32,6 @@ struct LoggedStopEvent {
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp log_time() const { return timestamp; }
Timestamp timestamp = Timestamp::PlusInfinity();
};

View File

@ -29,7 +29,6 @@ namespace webrtc {
struct LoggedFrameDecoded {
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp log_time() const { return timestamp; }
Timestamp timestamp = Timestamp::MinusInfinity();
int64_t render_time_ms;

View File

@ -36,7 +36,6 @@ struct LoggedGenericAckReceived {
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp log_time() const { return timestamp; }
Timestamp timestamp = Timestamp::MinusInfinity();
int64_t packet_number;

View File

@ -33,7 +33,6 @@ struct LoggedGenericPacketReceived {
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp log_time() const { return timestamp; }
Timestamp timestamp = Timestamp::MinusInfinity();
int64_t packet_number;

View File

@ -37,7 +37,6 @@ struct LoggedGenericPacketSent {
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp log_time() const { return timestamp; }
size_t packet_length() const {
return payload_length + padding_length + overhead_length;

View File

@ -45,7 +45,6 @@ struct LoggedIceCandidatePairEvent {
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp log_time() const { return timestamp; }
Timestamp timestamp = Timestamp::MinusInfinity();
IceCandidatePairEventType type;

View File

@ -72,7 +72,6 @@ enum class IceCandidateNetworkType {
struct LoggedIceCandidatePairConfig {
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp log_time() const { return timestamp; }
Timestamp timestamp = Timestamp::MinusInfinity();
IceCandidatePairConfigType type;

View File

@ -39,7 +39,6 @@ struct LoggedBweProbeClusterCreatedEvent {
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp log_time() const { return timestamp; }
Timestamp timestamp = Timestamp::MinusInfinity();
int32_t id;

View File

@ -40,7 +40,6 @@ struct LoggedBweProbeFailureEvent {
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp log_time() const { return timestamp; }
Timestamp timestamp = Timestamp::MinusInfinity();
int32_t id;

View File

@ -33,7 +33,6 @@ struct LoggedBweProbeSuccessEvent {
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp log_time() const { return timestamp; }
Timestamp timestamp = Timestamp::MinusInfinity();
int32_t id;

View File

@ -28,7 +28,6 @@ struct LoggedRemoteEstimateEvent {
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp log_time() const { return timestamp; }
Timestamp timestamp = Timestamp::MinusInfinity();
absl::optional<DataRate> link_capacity_lower;

View File

@ -29,7 +29,6 @@ struct LoggedRouteChangeEvent {
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp log_time() const { return timestamp; }
Timestamp timestamp = Timestamp::MinusInfinity();
bool connected;

View File

@ -30,7 +30,6 @@ struct LoggedVideoRecvConfig {
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp log_time() const { return timestamp; }
Timestamp timestamp = Timestamp::MinusInfinity();
rtclog::StreamConfig config;

View File

@ -30,7 +30,6 @@ struct LoggedVideoSendConfig {
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp log_time() const { return timestamp; }
Timestamp timestamp = Timestamp::MinusInfinity();
rtclog::StreamConfig config;

View File

@ -1110,8 +1110,8 @@ void ParsedRtcEventLog::Clear() {
last_incoming_rtcp_packet_.clear();
first_timestamp_ = Timestamp::PlusInfinity();
last_timestamp_ = Timestamp::MinusInfinity();
first_timestamp_ = std::numeric_limits<int64_t>::max();
last_timestamp_ = std::numeric_limits<int64_t>::min();
first_log_segment_ = LogSegment(0, std::numeric_limits<int64_t>::max());
incoming_rtp_extensions_maps_.clear();
@ -1232,8 +1232,8 @@ ParsedRtcEventLog::ParseStatus ParsedRtcEventLog::ParseStream(
// stream configurations and starting/stopping the log.
// TODO(terelius): Figure out if we actually need to find the first and last
// timestamp in the parser. It seems like this could be done by the caller.
first_timestamp_ = Timestamp::PlusInfinity();
last_timestamp_ = Timestamp::MinusInfinity();
first_timestamp_ = std::numeric_limits<int64_t>::max();
last_timestamp_ = std::numeric_limits<int64_t>::min();
StoreFirstAndLastTimestamp(alr_state_events());
StoreFirstAndLastTimestamp(route_change_events());
for (const auto& audio_stream : audio_playout_events()) {
@ -1272,8 +1272,7 @@ ParsedRtcEventLog::ParseStatus ParsedRtcEventLog::ParseStream(
// event, we could use the timestamp of the the last previous regular event.
auto start_iter = start_log_events().begin();
auto stop_iter = stop_log_events().begin();
int64_t start_us =
first_timestamp().us_or(std::numeric_limits<int64_t>::max());
int64_t start_us = first_timestamp();
int64_t next_start_us = std::numeric_limits<int64_t>::max();
int64_t stop_us = std::numeric_limits<int64_t>::max();
if (start_iter != start_log_events().end()) {
@ -1287,14 +1286,15 @@ ParsedRtcEventLog::ParseStatus ParsedRtcEventLog::ParseStream(
}
stop_us = std::min(stop_us, next_start_us);
if (stop_us == std::numeric_limits<int64_t>::max() &&
!last_timestamp().IsMinusInfinity()) {
stop_us = last_timestamp().us();
last_timestamp() != std::numeric_limits<int64_t>::min()) {
stop_us = last_timestamp();
}
RTC_PARSE_CHECK_OR_RETURN_LE(start_us, stop_us);
first_log_segment_ = LogSegment(start_us, stop_us);
if (first_timestamp_ > last_timestamp_) {
first_timestamp_ = last_timestamp_ = Timestamp::Zero();
if (first_timestamp_ == std::numeric_limits<int64_t>::max() &&
last_timestamp_ == std::numeric_limits<int64_t>::min()) {
first_timestamp_ = last_timestamp_ = 0;
}
return status;
@ -1563,8 +1563,8 @@ template <typename T>
void ParsedRtcEventLog::StoreFirstAndLastTimestamp(const std::vector<T>& v) {
if (v.empty())
return;
first_timestamp_ = std::min(first_timestamp_, v.front().log_time());
last_timestamp_ = std::max(last_timestamp_, v.back().log_time());
first_timestamp_ = std::min(first_timestamp_, v.front().log_time_us());
last_timestamp_ = std::max(last_timestamp_, v.back().log_time_us());
}
ParsedRtcEventLog::ParseStatus ParsedRtcEventLog::StoreParsedLegacyEvent(

View File

@ -643,8 +643,8 @@ class ParsedRtcEventLog {
return decoded_frames_;
}
Timestamp first_timestamp() const { return first_timestamp_; }
Timestamp last_timestamp() const { return last_timestamp_; }
int64_t first_timestamp() const { return first_timestamp_; }
int64_t last_timestamp() const { return last_timestamp_; }
const LogSegment& first_log_segment() const { return first_log_segment_; }
@ -889,8 +889,8 @@ class ParsedRtcEventLog {
std::vector<uint8_t> last_incoming_rtcp_packet_;
Timestamp first_timestamp_ = Timestamp::PlusInfinity();
Timestamp last_timestamp_ = Timestamp::MinusInfinity();
int64_t first_timestamp_;
int64_t last_timestamp_;
LogSegment first_log_segment_ =
LogSegment(0, std::numeric_limits<int64_t>::max());

View File

@ -785,8 +785,8 @@ void RtcEventLogSession::ReadAndVerifyLog() {
parsed_generic_acks_received[i]);
}
EXPECT_EQ(first_timestamp_ms_, parsed_log.first_timestamp().ms());
EXPECT_EQ(last_timestamp_ms_, parsed_log.last_timestamp().ms());
EXPECT_EQ(first_timestamp_ms_, parsed_log.first_timestamp() / 1000);
EXPECT_EQ(last_timestamp_ms_, parsed_log.last_timestamp() / 1000);
EXPECT_EQ(parsed_log.first_log_segment().start_time_ms(),
std::min(start_time_us_ / 1000, first_timestamp_ms_));