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

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: address comments 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..33821afcc2d117d809d19b71b5696f08b1d69372 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 {
+ kVideoUnknown = 0,
+ kVideoVp8 = 1,
+ kVideoVp9 = 2,
+ kVideoH264 = 3,
+ kVideoMax = 64,
+};
+
+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