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

Unified Diff: webrtc/video/send_statistics_proxy.cc

Issue 2430603003: Implement qpSum stat for video send ssrc stats. (Closed)
Patch Set: Change qp_sum to rtc::Optional<uint64_t>. Created 4 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 | « webrtc/media/engine/webrtcvideoengine2_unittest.cc ('k') | webrtc/video/send_statistics_proxy_unittest.cc » ('j') | 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 6bebd46212fb18dc5c3d1f08753dcef3c81f07ad..370f11983210c09ffcf26106407afc11d4b5d96e 100644
--- a/webrtc/video/send_statistics_proxy.cc
+++ b/webrtc/video/send_statistics_proxy.cc
@@ -495,17 +495,24 @@ void SendStatisticsProxy::OnSendEncodedImage(
}
}
- if (encoded_image.qp_ != -1 && codec_info) {
- if (codec_info->codecType == kVideoCodecVP8) {
- int spatial_idx = (rtp_config_.ssrcs.size() == 1)
- ? -1
- : static_cast<int>(simulcast_idx);
- uma_container_->qp_counters_[spatial_idx].vp8.Add(encoded_image.qp_);
- } else if (codec_info->codecType == kVideoCodecVP9) {
- int spatial_idx = (codec_info->codecSpecific.VP9.num_spatial_layers == 1)
- ? -1
- : codec_info->codecSpecific.VP9.spatial_idx;
- uma_container_->qp_counters_[spatial_idx].vp9.Add(encoded_image.qp_);
+ if (encoded_image.qp_ != -1) {
+ if (!stats_.qp_sum)
+ stats_.qp_sum = rtc::Optional<uint64_t>(0);
+ *stats_.qp_sum += encoded_image.qp_;
+
+ if (codec_info) {
+ if (codec_info->codecType == kVideoCodecVP8) {
+ int spatial_idx = (rtp_config_.ssrcs.size() == 1)
+ ? -1
+ : static_cast<int>(simulcast_idx);
+ uma_container_->qp_counters_[spatial_idx].vp8.Add(encoded_image.qp_);
+ } else if (codec_info->codecType == kVideoCodecVP9) {
+ int spatial_idx =
+ (codec_info->codecSpecific.VP9.num_spatial_layers == 1)
+ ? -1
+ : codec_info->codecSpecific.VP9.spatial_idx;
+ uma_container_->qp_counters_[spatial_idx].vp9.Add(encoded_image.qp_);
+ }
hta-webrtc 2016/10/27 12:22:35 I don't understand the code here - it seems that f
hbos 2016/10/28 09:25:13 This confuses me too.
}
}
« no previous file with comments | « webrtc/media/engine/webrtcvideoengine2_unittest.cc ('k') | webrtc/video/send_statistics_proxy_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698