| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 864 } | 864 } |
| 865 if (minIntervalMs > RTCP_INTERVAL_VIDEO_MS) | 865 if (minIntervalMs > RTCP_INTERVAL_VIDEO_MS) |
| 866 minIntervalMs = RTCP_INTERVAL_VIDEO_MS; | 866 minIntervalMs = RTCP_INTERVAL_VIDEO_MS; |
| 867 } | 867 } |
| 868 // The interval between RTCP packets is varied randomly over the | 868 // The interval between RTCP packets is varied randomly over the |
| 869 // range [1/2,3/2] times the calculated interval. | 869 // range [1/2,3/2] times the calculated interval. |
| 870 uint32_t timeToNext = | 870 uint32_t timeToNext = |
| 871 random_.Rand(minIntervalMs * 1 / 2, minIntervalMs * 3 / 2); | 871 random_.Rand(minIntervalMs * 1 / 2, minIntervalMs * 3 / 2); |
| 872 next_time_to_send_rtcp_ = clock_->TimeInMilliseconds() + timeToNext; | 872 next_time_to_send_rtcp_ = clock_->TimeInMilliseconds() + timeToNext; |
| 873 | 873 |
| 874 StatisticianMap statisticians = | 874 if (receive_statistics_) { |
| 875 receive_statistics_->GetActiveStatisticians(); | 875 StatisticianMap statisticians = |
| 876 RTC_DCHECK(report_blocks_.empty()); | 876 receive_statistics_->GetActiveStatisticians(); |
| 877 for (auto& it : statisticians) { | 877 RTC_DCHECK(report_blocks_.empty()); |
| 878 AddReportBlock(feedback_state, it.first, it.second); | 878 for (auto& it : statisticians) { |
| 879 AddReportBlock(feedback_state, it.first, it.second); |
| 880 } |
| 879 } | 881 } |
| 880 } | 882 } |
| 881 } | 883 } |
| 882 | 884 |
| 883 bool RTCPSender::AddReportBlock(const FeedbackState& feedback_state, | 885 bool RTCPSender::AddReportBlock(const FeedbackState& feedback_state, |
| 884 uint32_t ssrc, | 886 uint32_t ssrc, |
| 885 StreamStatistician* statistician) { | 887 StreamStatistician* statistician) { |
| 886 // Do we have receive statistics to send? | 888 // Do we have receive statistics to send? |
| 887 RtcpStatistics stats; | 889 RtcpStatistics stats; |
| 888 if (!statistician->GetStatistics(&stats, true)) | 890 if (!statistician->GetStatistics(&stats, true)) |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1038 // but we can't because of an incorrect warning (C4822) in MVS 2013. | 1040 // but we can't because of an incorrect warning (C4822) in MVS 2013. |
| 1039 } sender(transport_, event_log_); | 1041 } sender(transport_, event_log_); |
| 1040 | 1042 |
| 1041 RTC_DCHECK_LE(max_payload_length_, static_cast<size_t>(IP_PACKET_SIZE)); | 1043 RTC_DCHECK_LE(max_payload_length_, static_cast<size_t>(IP_PACKET_SIZE)); |
| 1042 uint8_t buffer[IP_PACKET_SIZE]; | 1044 uint8_t buffer[IP_PACKET_SIZE]; |
| 1043 return packet.BuildExternalBuffer(buffer, max_payload_length_, &sender) && | 1045 return packet.BuildExternalBuffer(buffer, max_payload_length_, &sender) && |
| 1044 !sender.send_failure_; | 1046 !sender.send_failure_; |
| 1045 } | 1047 } |
| 1046 | 1048 |
| 1047 } // namespace webrtc | 1049 } // namespace webrtc |
| OLD | NEW |