Index: webrtc/video/send_statistics_proxy.cc |
diff --git a/webrtc/video/send_statistics_proxy.cc b/webrtc/video/send_statistics_proxy.cc |
index 32b79023c8495de9a06150197b80b135e1628239..b87b96ee936bdb268f025aff83f4f7269df3511a 100644 |
--- a/webrtc/video/send_statistics_proxy.cc |
+++ b/webrtc/video/send_statistics_proxy.cc |
@@ -20,6 +20,35 @@ |
#include "webrtc/system_wrappers/interface/metrics.h" |
namespace webrtc { |
+namespace { |
+// Used by histograms. Values of entries should not be changed. |
+enum HistogramCodecType { |
+ kVideoVp8 = 0, |
pbos-webrtc
2015/10/26 13:19:03
I'd prefer unknown to be zero, and then set explic
åsapersson
2015/10/26 14:19:53
Done.
|
+ kVideoVp9, |
+ kVideoH264, |
+ kVideoUnknown = 19, |
+ kVideoMax = 20, |
pbos-webrtc
2015/10/26 13:19:03
I think you can pick something larger if this isn'
åsapersson
2015/10/26 14:19:53
Done.
|
+}; |
+ |
+HistogramCodecType PayloadNameToHistogramCodecType( |
+ const std::string& payload_name) { |
+ if (payload_name == "VP8") { |
+ return kVideoVp8; |
+ } else if (payload_name == "VP9") { |
+ return kVideoVp9; |
+ } else if (payload_name == "H264") { |
+ return kVideoH264; |
+ } else { |
+ return kVideoUnknown; |
+ } |
+} |
+ |
+void UpdateCodecTypeHistogram(const std::string& payload_name) { |
+ RTC_HISTOGRAM_ENUMERATION("WebRTC.Video.Encoder.CodecType", |
+ PayloadNameToHistogramCodecType(payload_name), kVideoMax); |
+} |
+} // namespace |
+ |
const int SendStatisticsProxy::kStatsTimeoutMs = 5000; |
@@ -32,6 +61,7 @@ SendStatisticsProxy::SendStatisticsProxy(Clock* clock, |
last_sent_frame_timestamp_(0), |
max_sent_width_per_timestamp_(0), |
max_sent_height_per_timestamp_(0) { |
+ UpdateCodecTypeHistogram(config_.encoder_settings.payload_name); |
} |
SendStatisticsProxy::~SendStatisticsProxy() { |