PeerConnection[Interface]::GetStats(RTCStatsCollectorCallback*) added.
New file structure and targets:
rtc_stats_api
webrtc/api/stats/rtcstats.h
webrtc/api/stats/rtcstats_objects.h
webrtc/api/stats/rtcstatsreport.h
rtc_stats (dep on rtc_stats_api)
webrtc/stats/rtcstats.cc
webrtc/stats/rtcstats_objects.cc
webrtc/stats/rtcstatsreport.cc
libjingle_peerconnection (dep on rtc_stats)
webrtc/api/rtcstatscollector.cc
webrtc/api/rtcstatscollector.h
Placing rtc_stats_api headers in this separate target instead of
libjingle_peerconnection avoids a circular dependency
libjingle_peerconnection -> rtc_stats -> libjingle_peerconnection
Code changes:
PeerConnectionInterface::GetStats(RTCStatsCollectorCallback*) added for
the new stats collection API. Implemented by PeerConnection.
BUG=chromium:627816
Review-Url: https://codereview.webrtc.org/2331373004
Cr-Commit-Position: refs/heads/master@{#14246}
diff --git a/webrtc/api/peerconnection.cc b/webrtc/api/peerconnection.cc
index bdd33d7..144b1c6 100644
--- a/webrtc/api/peerconnection.cc
+++ b/webrtc/api/peerconnection.cc
@@ -632,6 +632,7 @@
configuration.redetermine_role_on_ice_restart))));
stats_.reset(new StatsCollector(this));
+ stats_collector_ = RTCStatsCollector::Create(this);
enable_ice_renomination_ = configuration.enable_ice_renomination;
@@ -888,6 +889,11 @@
return true;
}
+void PeerConnection::GetStats(RTCStatsCollectorCallback* callback) {
+ RTC_DCHECK(stats_collector_);
+ stats_collector_->GetStatsReport(callback);
+}
+
PeerConnectionInterface::SignalingState PeerConnection::signaling_state() {
return signaling_state_;
}