Chromium Code Reviews| 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.
|
| } |
| } |