diff --git a/pc/peer_connection.cc b/pc/peer_connection.cc index eb68a5be90..b5af73580c 100644 --- a/pc/peer_connection.cc +++ b/pc/peer_connection.cc @@ -2269,12 +2269,13 @@ bool PeerConnection::ValidateBundleSettings(const SessionDescription* desc) { } void PeerConnection::ReportSdpFormatReceived( - const SessionDescriptionInterface& remote_offer) { + const SessionDescriptionInterface& remote_description) { int num_audio_mlines = 0; int num_video_mlines = 0; int num_audio_tracks = 0; int num_video_tracks = 0; - for (const ContentInfo& content : remote_offer.description()->contents()) { + for (const ContentInfo& content : + remote_description.description()->contents()) { cricket::MediaType media_type = content.media_description()->type(); int num_tracks = std::max( 1, static_cast(content.media_description()->streams().size())); @@ -2294,7 +2295,7 @@ void PeerConnection::ReportSdpFormatReceived( } else if (num_audio_tracks > 0 || num_video_tracks > 0) { format = kSdpFormatReceivedSimple; } - switch (remote_offer.GetType()) { + switch (remote_description.GetType()) { case SdpType::kOffer: // Historically only offers were counted. RTC_HISTOGRAM_ENUMERATION("WebRTC.PeerConnection.SdpFormatReceived", @@ -2306,7 +2307,7 @@ void PeerConnection::ReportSdpFormatReceived( break; default: RTC_LOG(LS_ERROR) << "Can not report SdpFormatReceived for " - << SdpTypeToString(remote_offer.GetType()); + << SdpTypeToString(remote_description.GetType()); break; } } diff --git a/pc/peer_connection.h b/pc/peer_connection.h index 8768ebb133..65d893e59e 100644 --- a/pc/peer_connection.h +++ b/pc/peer_connection.h @@ -379,8 +379,9 @@ class PeerConnection : public PeerConnectionInternal, void SetIceConnectionState(IceConnectionState new_state); void NoteUsageEvent(UsageEvent event); - // Report the UMA metric SdpFormatReceived for the given remote offer. - void ReportSdpFormatReceived(const SessionDescriptionInterface& remote_offer); + // Report the UMA metric SdpFormatReceived for the given remote description. + void ReportSdpFormatReceived( + const SessionDescriptionInterface& remote_description); // Returns true if the PeerConnection is configured to use Unified Plan // semantics for creating offers/answers and setting local/remote