Chromium Code Reviews

Unified Diff: webrtc/video/send_statistics_proxy.cc

Issue 2430603003: Implement qpSum stat for video send ssrc stats. (Closed)
Patch Set: Statscollector send ssrc unittest for qp_sum Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
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..9656678c5a8a7efeabef629c1ed01f6bf734ae66 100644
--- a/webrtc/video/send_statistics_proxy.cc
+++ b/webrtc/video/send_statistics_proxy.cc
@@ -495,17 +495,22 @@ 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) {
+ 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_);
+ }
hbos 2016/10/20 17:08:21 We should perhaps add QP counters for H264 as well
sakal 2016/10/21 08:59:43 I think it would be better you filed the bug since
}
}

Powered by Google App Engine