Report negotiated SDP semantics for local answers also

Bug: chromium:811683
Change-Id: I8c51a3a1f58190c9dcd849ef451254ce230ea710
Reviewed-on: https://webrtc-review.googlesource.com/57128
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22216}
This commit is contained in:
Steve Anton
2018-02-23 10:31:30 -08:00
committed by Commit Bot
parent 12c8110e8c
commit 0ffaaa26f9
2 changed files with 39 additions and 27 deletions

View File

@ -1835,6 +1835,8 @@ void PeerConnection::SetLocalDescription(
network_thread()->Invoke<void>(
RTC_FROM_HERE, rtc::Bind(&cricket::PortAllocator::DiscardCandidatePool,
port_allocator_.get()));
// Make UMA notes about what was agreed to.
ReportNegotiatedSdpSemantics(*local_description());
}
}
@ -2074,33 +2076,7 @@ void PeerConnection::SetRemoteDescription(
RTC_FROM_HERE, rtc::Bind(&cricket::PortAllocator::DiscardCandidatePool,
port_allocator_.get()));
// Make UMA notes about what was agreed to.
if (uma_observer_) {
switch (remote_description()->description()->msid_signaling()) {
case 0:
uma_observer_->IncrementEnumCounter(kEnumCounterSdpSemanticNegotiated,
kSdpSemanticNegotiatedNone,
kSdpSemanticNegotiatedMax);
break;
case cricket::kMsidSignalingMediaSection:
uma_observer_->IncrementEnumCounter(kEnumCounterSdpSemanticNegotiated,
kSdpSemanticNegotiatedUnifiedPlan,
kSdpSemanticNegotiatedMax);
break;
case cricket::kMsidSignalingSsrcAttribute:
uma_observer_->IncrementEnumCounter(kEnumCounterSdpSemanticNegotiated,
kSdpSemanticNegotiatedPlanB,
kSdpSemanticNegotiatedMax);
break;
case cricket::kMsidSignalingMediaSection |
cricket::kMsidSignalingSsrcAttribute:
uma_observer_->IncrementEnumCounter(kEnumCounterSdpSemanticNegotiated,
kSdpSemanticNegotiatedMixed,
kSdpSemanticNegotiatedMax);
break;
default:
RTC_NOTREACHED();
}
}
ReportNegotiatedSdpSemantics(*remote_description());
}
observer->OnSetRemoteDescriptionComplete(RTCError::OK());
@ -5746,6 +5722,38 @@ std::string PeerConnection::GetSessionErrorMsg() {
return desc.str();
}
void PeerConnection::ReportNegotiatedSdpSemantics(
const SessionDescriptionInterface& answer) {
if (!uma_observer_) {
return;
}
switch (answer.description()->msid_signaling()) {
case 0:
uma_observer_->IncrementEnumCounter(kEnumCounterSdpSemanticNegotiated,
kSdpSemanticNegotiatedNone,
kSdpSemanticNegotiatedMax);
break;
case cricket::kMsidSignalingMediaSection:
uma_observer_->IncrementEnumCounter(kEnumCounterSdpSemanticNegotiated,
kSdpSemanticNegotiatedUnifiedPlan,
kSdpSemanticNegotiatedMax);
break;
case cricket::kMsidSignalingSsrcAttribute:
uma_observer_->IncrementEnumCounter(kEnumCounterSdpSemanticNegotiated,
kSdpSemanticNegotiatedPlanB,
kSdpSemanticNegotiatedMax);
break;
case cricket::kMsidSignalingMediaSection |
cricket::kMsidSignalingSsrcAttribute:
uma_observer_->IncrementEnumCounter(kEnumCounterSdpSemanticNegotiated,
kSdpSemanticNegotiatedMixed,
kSdpSemanticNegotiatedMax);
break;
default:
RTC_NOTREACHED();
}
}
// We need to check the local/remote description for the Transport instead of
// the session, because a new Transport added during renegotiation may have
// them unset while the session has them set from the previous negotiation.

View File

@ -851,6 +851,10 @@ class PeerConnection : public PeerConnectionInternal,
const char* SessionErrorToString(SessionError error) const;
std::string GetSessionErrorMsg();
// Report inferred negotiated SDP semantics from a local/remote answer to the
// UMA observer.
void ReportNegotiatedSdpSemantics(const SessionDescriptionInterface& answer);
// Invoked when TransportController connection completion is signaled.
// Reports stats for all transports in use.
void ReportTransportStats();