Create helper for constructing empty LoggedPacketInfo for testing.

Bug: b/318801494
Change-Id: Ie063ac3a63276f5fbc14794b6aba8e7b839cc910
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/338740
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41705}
This commit is contained in:
Bjorn Terelius 2024-02-08 23:33:11 +01:00 committed by WebRTC LUCI CQ
parent 5ba4f2ab58
commit 15062c8739

View File

@ -71,12 +71,15 @@ enum PacketDirection { kIncomingPacket = 0, kOutgoingPacket };
enum class LoggedMediaType : uint8_t { kUnknown, kAudio, kVideo }; enum class LoggedMediaType : uint8_t { kUnknown, kAudio, kVideo };
struct LoggedPacketInfo { struct LoggedPacketInfo {
static LoggedPacketInfo CreateEmptyForTesting() { return LoggedPacketInfo(); }
LoggedPacketInfo(const LoggedRtpPacket& rtp, LoggedPacketInfo(const LoggedRtpPacket& rtp,
LoggedMediaType media_type, LoggedMediaType media_type,
bool rtx, bool rtx,
Timestamp capture_time); Timestamp capture_time);
LoggedPacketInfo(const LoggedPacketInfo&); LoggedPacketInfo(const LoggedPacketInfo&);
~LoggedPacketInfo(); ~LoggedPacketInfo();
int64_t log_time_ms() const { return log_packet_time.ms(); } int64_t log_time_ms() const { return log_packet_time.ms(); }
int64_t log_time_us() const { return log_packet_time.us(); } int64_t log_time_us() const { return log_packet_time.us(); }
uint32_t ssrc; uint32_t ssrc;
@ -114,6 +117,12 @@ struct LoggedPacketInfo {
// time, and this is instead calculated as the difference in reported receive // time, and this is instead calculated as the difference in reported receive
// time between this packet and the last packet in the same feedback message. // time between this packet and the last packet in the same feedback message.
TimeDelta feedback_hold_duration = TimeDelta::MinusInfinity(); TimeDelta feedback_hold_duration = TimeDelta::MinusInfinity();
private:
LoggedPacketInfo()
: capture_time(Timestamp::MinusInfinity()),
log_packet_time(Timestamp::MinusInfinity()),
reported_send_time(Timestamp::MinusInfinity()) {}
}; };
struct InferredRouteChangeEvent { struct InferredRouteChangeEvent {