Index: webrtc/video/send_statistics_proxy.cc |
diff --git a/webrtc/video/send_statistics_proxy.cc b/webrtc/video/send_statistics_proxy.cc |
index fe60f1eaa5f9937441a9fbfc289d868109a0b18c..551b4b562a43904f6cfe1105d65455b2610126b9 100644 |
--- a/webrtc/video/send_statistics_proxy.cc |
+++ b/webrtc/video/send_statistics_proxy.cc |
@@ -46,7 +46,7 @@ void SendStatisticsProxy::UpdateHistograms() { |
if (sent_fps > 0) |
RTC_HISTOGRAM_COUNTS_100("WebRTC.Video.SentFramesPerSecond", sent_fps); |
- const int kMinRequiredSamples = 100; |
+ const int kMinRequiredSamples = 200; |
int in_width = input_width_counter_.Avg(kMinRequiredSamples); |
int in_height = input_height_counter_.Avg(kMinRequiredSamples); |
if (in_width != -1) { |
@@ -59,6 +59,9 @@ void SendStatisticsProxy::UpdateHistograms() { |
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.SentWidthInPixels", sent_width); |
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.SentHeightInPixels", sent_height); |
} |
+ int encode_ms = encode_time_counter_.Avg(kMinRequiredSamples); |
+ if (encode_ms != -1) |
+ RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.EncodeTimeInMs", encode_ms); |
} |
void SendStatisticsProxy::OutgoingRate(const int video_channel, |
@@ -72,6 +75,7 @@ void SendStatisticsProxy::OutgoingRate(const int video_channel, |
void SendStatisticsProxy::CpuOveruseMetricsUpdated( |
const CpuOveruseMetrics& metrics) { |
rtc::CritScope lock(&crit_); |
+ // TODO(asapersson): Change to use OnEncodedFrame() for avg_encode_time_ms. |
stats_.avg_encode_time_ms = metrics.avg_encode_time_ms; |
stats_.encode_usage_percent = metrics.encode_usage_percent; |
} |
@@ -186,6 +190,11 @@ void SendStatisticsProxy::OnIncomingFrame(int width, int height) { |
input_height_counter_.Add(height); |
} |
+void SendStatisticsProxy::OnEncodedFrame(int encode_time_ms) { |
+ rtc::CritScope lock(&crit_); |
+ encode_time_counter_.Add(encode_time_ms); |
+} |
+ |
void SendStatisticsProxy::RtcpPacketTypesCounterUpdated( |
uint32_t ssrc, |
const RtcpPacketTypeCounter& packet_counter) { |