RTP_Emulation: Add f_rtpem_stats_compare() to match a pair of stats

Change-Id: I1682bc16a05f096976b7e68b6115850fc152f7aa
This commit is contained in:
Harald Welte 2018-03-29 08:51:20 +02:00
parent 1af4033a7b
commit 5c49ba4393
1 changed files with 12 additions and 0 deletions

View File

@ -188,6 +188,18 @@ function f_rtpem_stats_get(RTPEM_CTRL_PT pt, boolean rtcp := false) return Rtpem
return stats;
}
function f_rtpem_stats_compare(RtpemStats a, RtpemStats b) return boolean {
log("stats A: ", a);
log("stats B: ", b);
if (a.num_pkts_tx != b.num_pkts_rx or
a.num_pkts_rx != b.num_pkts_tx or
a.bytes_payload_tx != b.bytes_payload_rx or
a.bytes_payload_rx != b.bytes_payload_tx) {
return false;
}
return true;
}
template PDU_RTP ts_RTP(BIT32_BO_LAST ssrc, INT7b pt, LIN2_BO_LAST seq, uint32_t ts,