| Index: webrtc/video/send_statistics_proxy.cc
|
| diff --git a/webrtc/video/send_statistics_proxy.cc b/webrtc/video/send_statistics_proxy.cc
|
| index 551b4b562a43904f6cfe1105d65455b2610126b9..e60614c9b653b30fd546e7deec1c4c875f0ea5b0 100644
|
| --- a/webrtc/video/send_statistics_proxy.cc
|
| +++ b/webrtc/video/send_statistics_proxy.cc
|
| @@ -27,6 +27,8 @@ SendStatisticsProxy::SendStatisticsProxy(Clock* clock,
|
| const VideoSendStream::Config& config)
|
| : clock_(clock),
|
| config_(config),
|
| + input_frame_rate_tracker_(100u, 10u),
|
| + sent_frame_rate_tracker_(100u, 10u),
|
| last_sent_frame_timestamp_(0),
|
| max_sent_width_per_timestamp_(0),
|
| max_sent_height_per_timestamp_(0) {
|
| @@ -38,11 +40,11 @@ SendStatisticsProxy::~SendStatisticsProxy() {
|
|
|
| void SendStatisticsProxy::UpdateHistograms() {
|
| int input_fps =
|
| - static_cast<int>(input_frame_rate_tracker_total_.units_second());
|
| + static_cast<int>(input_frame_rate_tracker_.ComputeTotalRate());
|
| if (input_fps > 0)
|
| RTC_HISTOGRAM_COUNTS_100("WebRTC.Video.InputFramesPerSecond", input_fps);
|
| int sent_fps =
|
| - static_cast<int>(sent_frame_rate_tracker_total_.units_second());
|
| + static_cast<int>(sent_frame_rate_tracker_.ComputeTotalRate());
|
| if (sent_fps > 0)
|
| RTC_HISTOGRAM_COUNTS_100("WebRTC.Video.SentFramesPerSecond", sent_fps);
|
|
|
| @@ -89,7 +91,7 @@ VideoSendStream::Stats SendStatisticsProxy::GetStats() {
|
| rtc::CritScope lock(&crit_);
|
| PurgeOldStats();
|
| stats_.input_frame_rate =
|
| - static_cast<int>(input_frame_rate_tracker_.units_second());
|
| + static_cast<int>(input_frame_rate_tracker_.ComputeRate());
|
| return stats_;
|
| }
|
|
|
| @@ -167,7 +169,7 @@ void SendStatisticsProxy::OnSendEncodedImage(
|
| // are encoded before the next start.
|
| if (last_sent_frame_timestamp_ > 0 &&
|
| encoded_image._timeStamp != last_sent_frame_timestamp_) {
|
| - sent_frame_rate_tracker_total_.Update(1);
|
| + sent_frame_rate_tracker_.AddSamples(1);
|
| sent_width_counter_.Add(max_sent_width_per_timestamp_);
|
| sent_height_counter_.Add(max_sent_height_per_timestamp_);
|
| max_sent_width_per_timestamp_ = 0;
|
| @@ -184,8 +186,7 @@ void SendStatisticsProxy::OnSendEncodedImage(
|
|
|
| void SendStatisticsProxy::OnIncomingFrame(int width, int height) {
|
| rtc::CritScope lock(&crit_);
|
| - input_frame_rate_tracker_.Update(1);
|
| - input_frame_rate_tracker_total_.Update(1);
|
| + input_frame_rate_tracker_.AddSamples(1);
|
| input_width_counter_.Add(width);
|
| input_height_counter_.Add(height);
|
| }
|
|
|