Issue #2332 - Hyphenate rtc stats type as per spec

Backport of https://bugzilla.mozilla.org/show_bug.cgi?id=1322503
This commit is contained in:
Basilisk-Dev 2023-10-18 16:30:27 -04:00 • committed by roytam1
commit 9f63203a43
7 changed files with 57 additions and 42 deletions

View file

@ -3602,7 +3602,7 @@ static void ToRTCIceCandidateStats(
cand.mPortNumber.Construct(c->cand_addr.port);
cand.mTransport.Construct(
NS_ConvertASCIItoUTF16(c->cand_addr.transport.c_str()));
if (candidateType == RTCStatsType::Localcandidate) {
if (candidateType == RTCStatsType::Local_candidate) {
cand.mMozLocalTransport.Construct(
NS_ConvertASCIItoUTF16(c->local_addr.transport.c_str()));
}
@ -3636,7 +3636,7 @@ static void RecordIceStats_s(
s.mId.Construct(codeword);
s.mComponentId.Construct(componentId);
s.mTimestamp.Construct(now);
s.mType.Construct(RTCStatsType::Candidatepair);
s.mType.Construct(RTCStatsType::Candidate_pair);
s.mLocalCandidateId.Construct(localCodeword);
s.mRemoteCandidateId.Construct(remoteCodeword);
s.mNominated.Construct(p->nominated);
@ -3649,7 +3649,7 @@ static void RecordIceStats_s(
std::vector<NrIceCandidate> candidates;
if (NS_SUCCEEDED(mediaStream.GetLocalCandidates(&candidates))) {
ToRTCIceCandidateStats(candidates,
RTCStatsType::Localcandidate,
RTCStatsType::Local_candidate,
componentId,
now,
report);
@ -3658,7 +3658,7 @@ static void RecordIceStats_s(
if (NS_SUCCEEDED(mediaStream.GetRemoteCandidates(&candidates))) {
ToRTCIceCandidateStats(candidates,
RTCStatsType::Remotecandidate,
RTCStatsType::Remote_candidate,
componentId,
now,
report);
@ -3710,7 +3710,7 @@ PeerConnectionImpl::ExecuteStatsQuery_s(RTCStatsQuery *query) {
RTCInboundRTPStreamStats s;
s.mTimestamp.Construct(timestamp);
s.mId.Construct(remoteId);
s.mType.Construct(RTCStatsType::Inboundrtp);
s.mType.Construct(RTCStatsType::Inbound_rtp);
if (ssrc.Length()) {
s.mSsrc.Construct(ssrc);
}
@ -3731,7 +3731,7 @@ PeerConnectionImpl::ExecuteStatsQuery_s(RTCStatsQuery *query) {
RTCOutboundRTPStreamStats s;
s.mTimestamp.Construct(query->now);
s.mId.Construct(localId);
s.mType.Construct(RTCStatsType::Outboundrtp);
s.mType.Construct(RTCStatsType::Outbound_rtp);
if (ssrc.Length()) {
s.mSsrc.Construct(ssrc);
}
@ -3784,7 +3784,7 @@ PeerConnectionImpl::ExecuteStatsQuery_s(RTCStatsQuery *query) {
RTCOutboundRTPStreamStats s;
s.mTimestamp.Construct(timestamp);
s.mId.Construct(remoteId);
s.mType.Construct(RTCStatsType::Outboundrtp);
s.mType.Construct(RTCStatsType::Outbound_rtp);
if (ssrc.Length()) {
s.mSsrc.Construct(ssrc);
}
@ -3801,7 +3801,7 @@ PeerConnectionImpl::ExecuteStatsQuery_s(RTCStatsQuery *query) {
RTCInboundRTPStreamStats s;
s.mTimestamp.Construct(query->now);
s.mId.Construct(localId);
s.mType.Construct(RTCStatsType::Inboundrtp);
s.mType.Construct(RTCStatsType::Inbound_rtp);
if (ssrc.Length()) {
s.mSsrc.Construct(ssrc);
}

View file

@ -1066,7 +1066,7 @@ static void StoreLongTermICEStatisticsImpl_m(
uint32_t candBitmask = GetCandidateIpAndTransportMask(&cand);
// Note: shift values need to result in the above enum table
if (cand.mType.Value() == RTCStatsType::Localcandidate) {
if (cand.mType.Value() == RTCStatsType::Local_candidate) {
candBitmask <<= kLocalShift;
}