Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Unified Diff: webrtc/video/send_statistics_proxy.cc

Issue 1426673002: Add stats for used video codec type for a sent video stream: (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698