Remove RTCRemoteInboundRtpStreamStats duplicate members.
The RTCReceivedRtpStreamStats hierarchy, which inherit from RTCRtpStreamStats, already contain members ssrc, kind, codec_id and transport_id so there's no need to list them inside RTCRemoteInboundrtpStreamStats. This CL removes duplicates so that we don't DCHECK-crash on Android, and adds a unit test ensuring we never accidentally list the same member twice. Bug: webrtc:12658 Change-Id: I27925eadddc6224bf6d6a91784ed7cafd7a4cfb3 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/214343 Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Henrik Boström <hbos@webrtc.org> Cr-Commit-Position: refs/heads/master@{#33649}
This commit is contained in:
parent
628d91cd0d
commit
943ad970f4
@ -1285,6 +1285,20 @@ TEST_F(RTCStatsIntegrationTest, GetStatsReferencedIds) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(RTCStatsIntegrationTest, GetStatsContainsNoDuplicateMembers) {
|
||||
StartCall();
|
||||
|
||||
rtc::scoped_refptr<const RTCStatsReport> report = GetStatsFromCallee();
|
||||
for (const RTCStats& stats : *report) {
|
||||
std::set<std::string> member_names;
|
||||
for (const auto* member : stats.Members()) {
|
||||
EXPECT_TRUE(member_names.find(member->name()) == member_names.end())
|
||||
<< member->name() << " is a duplicate!";
|
||||
member_names.insert(member->name());
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // WEBRTC_HAVE_SCTP
|
||||
|
||||
} // namespace
|
||||
|
||||
@ -894,10 +894,6 @@ RTCOutboundRTPStreamStats::~RTCOutboundRTPStreamStats() {}
|
||||
WEBRTC_RTCSTATS_IMPL(
|
||||
RTCRemoteInboundRtpStreamStats, RTCReceivedRtpStreamStats,
|
||||
"remote-inbound-rtp",
|
||||
&ssrc,
|
||||
&kind,
|
||||
&transport_id,
|
||||
&codec_id,
|
||||
&local_id,
|
||||
&round_trip_time,
|
||||
&fraction_lost,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user