| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 RTC_HISTOGRAMS_COUNTS_10000( | 358 RTC_HISTOGRAMS_COUNTS_10000( |
| 359 kIndex, uma_prefix_ + "RetransmittedBitrateSentInKbps", | 359 kIndex, uma_prefix_ + "RetransmittedBitrateSentInKbps", |
| 360 static_cast<int>(rtp_rtx.retransmitted.TotalBytes() * 8 / | 360 static_cast<int>(rtp_rtx.retransmitted.TotalBytes() * 8 / |
| 361 elapsed_sec / 1000)); | 361 elapsed_sec / 1000)); |
| 362 if (!rtp_config.rtx.ssrcs.empty()) { | 362 if (!rtp_config.rtx.ssrcs.empty()) { |
| 363 RTC_HISTOGRAMS_COUNTS_10000( | 363 RTC_HISTOGRAMS_COUNTS_10000( |
| 364 kIndex, uma_prefix_ + "RtxBitrateSentInKbps", | 364 kIndex, uma_prefix_ + "RtxBitrateSentInKbps", |
| 365 static_cast<int>(rtx.transmitted.TotalBytes() * 8 / elapsed_sec / | 365 static_cast<int>(rtx.transmitted.TotalBytes() * 8 / elapsed_sec / |
| 366 1000)); | 366 1000)); |
| 367 } | 367 } |
| 368 if (rtp_config.flexfec.flexfec_payload_type != -1 || | 368 if (rtp_config.flexfec.payload_type != -1 || |
| 369 rtp_config.ulpfec.red_payload_type != -1) { | 369 rtp_config.ulpfec.red_payload_type != -1) { |
| 370 RTC_HISTOGRAMS_COUNTS_10000(kIndex, | 370 RTC_HISTOGRAMS_COUNTS_10000(kIndex, |
| 371 uma_prefix_ + "FecBitrateSentInKbps", | 371 uma_prefix_ + "FecBitrateSentInKbps", |
| 372 static_cast<int>(rtp_rtx.fec.TotalBytes() * | 372 static_cast<int>(rtp_rtx.fec.TotalBytes() * |
| 373 8 / elapsed_sec / 1000)); | 373 8 / elapsed_sec / 1000)); |
| 374 } | 374 } |
| 375 } | 375 } |
| 376 } | 376 } |
| 377 } | 377 } |
| 378 | 378 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 | 440 |
| 441 VideoSendStream::StreamStats* SendStatisticsProxy::GetStatsEntry( | 441 VideoSendStream::StreamStats* SendStatisticsProxy::GetStatsEntry( |
| 442 uint32_t ssrc) { | 442 uint32_t ssrc) { |
| 443 std::map<uint32_t, VideoSendStream::StreamStats>::iterator it = | 443 std::map<uint32_t, VideoSendStream::StreamStats>::iterator it = |
| 444 stats_.substreams.find(ssrc); | 444 stats_.substreams.find(ssrc); |
| 445 if (it != stats_.substreams.end()) | 445 if (it != stats_.substreams.end()) |
| 446 return &it->second; | 446 return &it->second; |
| 447 | 447 |
| 448 bool is_media = std::find(rtp_config_.ssrcs.begin(), rtp_config_.ssrcs.end(), | 448 bool is_media = std::find(rtp_config_.ssrcs.begin(), rtp_config_.ssrcs.end(), |
| 449 ssrc) != rtp_config_.ssrcs.end(); | 449 ssrc) != rtp_config_.ssrcs.end(); |
| 450 bool is_flexfec = rtp_config_.flexfec.flexfec_payload_type != -1 && | 450 bool is_flexfec = rtp_config_.flexfec.payload_type != -1 && |
| 451 ssrc == rtp_config_.flexfec.flexfec_ssrc; | 451 ssrc == rtp_config_.flexfec.ssrc; |
| 452 bool is_rtx = | 452 bool is_rtx = |
| 453 std::find(rtp_config_.rtx.ssrcs.begin(), rtp_config_.rtx.ssrcs.end(), | 453 std::find(rtp_config_.rtx.ssrcs.begin(), rtp_config_.rtx.ssrcs.end(), |
| 454 ssrc) != rtp_config_.rtx.ssrcs.end(); | 454 ssrc) != rtp_config_.rtx.ssrcs.end(); |
| 455 if (!is_media && !is_flexfec && !is_rtx) | 455 if (!is_media && !is_flexfec && !is_rtx) |
| 456 return nullptr; | 456 return nullptr; |
| 457 | 457 |
| 458 // Insert new entry and return ptr. | 458 // Insert new entry and return ptr. |
| 459 VideoSendStream::StreamStats* entry = &stats_.substreams[ssrc]; | 459 VideoSendStream::StreamStats* entry = &stats_.substreams[ssrc]; |
| 460 entry->is_rtx = is_rtx; | 460 entry->is_rtx = is_rtx; |
| 461 entry->is_flexfec = is_flexfec; | 461 entry->is_flexfec = is_flexfec; |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 757 } | 757 } |
| 758 | 758 |
| 759 int SendStatisticsProxy::BoolSampleCounter::Fraction( | 759 int SendStatisticsProxy::BoolSampleCounter::Fraction( |
| 760 int64_t min_required_samples, | 760 int64_t min_required_samples, |
| 761 float multiplier) const { | 761 float multiplier) const { |
| 762 if (num_samples < min_required_samples || num_samples == 0) | 762 if (num_samples < min_required_samples || num_samples == 0) |
| 763 return -1; | 763 return -1; |
| 764 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); | 764 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); |
| 765 } | 765 } |
| 766 } // namespace webrtc | 766 } // namespace webrtc |
| OLD | NEW |