| 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 14 matching lines...) Expand all Loading... |
| 25 RTT(0), | 25 RTT(0), |
| 26 minRTT(0), | 26 minRTT(0), |
| 27 maxRTT(0), | 27 maxRTT(0), |
| 28 avgRTT(0), | 28 avgRTT(0), |
| 29 numAverageCalcs(0) { | 29 numAverageCalcs(0) { |
| 30 memset(&remoteReceiveBlock, 0, sizeof(remoteReceiveBlock)); | 30 memset(&remoteReceiveBlock, 0, sizeof(remoteReceiveBlock)); |
| 31 } | 31 } |
| 32 | 32 |
| 33 RTCPReportBlockInformation::~RTCPReportBlockInformation() {} | 33 RTCPReportBlockInformation::~RTCPReportBlockInformation() {} |
| 34 | 34 |
| 35 RTCPReceiveInformation::RTCPReceiveInformation() = default; | |
| 36 RTCPReceiveInformation::~RTCPReceiveInformation() = default; | |
| 37 | |
| 38 void RTCPReceiveInformation::InsertTmmbrItem(uint32_t sender_ssrc, | |
| 39 const rtcp::TmmbItem& tmmbr_item, | |
| 40 int64_t current_time_ms) { | |
| 41 TimedTmmbrItem* entry = &tmmbr_[sender_ssrc]; | |
| 42 entry->tmmbr_item = rtcp::TmmbItem(sender_ssrc, tmmbr_item.bitrate_bps(), | |
| 43 tmmbr_item.packet_overhead()); | |
| 44 entry->last_updated_ms = current_time_ms; | |
| 45 } | |
| 46 | |
| 47 void RTCPReceiveInformation::GetTmmbrSet( | |
| 48 int64_t current_time_ms, | |
| 49 std::vector<rtcp::TmmbItem>* candidates) { | |
| 50 // Use audio define since we don't know what interval the remote peer use. | |
| 51 int64_t timeouted_ms = current_time_ms - 5 * RTCP_INTERVAL_AUDIO_MS; | |
| 52 for (auto it = tmmbr_.begin(); it != tmmbr_.end();) { | |
| 53 if (it->second.last_updated_ms < timeouted_ms) { | |
| 54 // Erase timeout entries. | |
| 55 it = tmmbr_.erase(it); | |
| 56 } else { | |
| 57 candidates->push_back(it->second.tmmbr_item); | |
| 58 ++it; | |
| 59 } | |
| 60 } | |
| 61 } | |
| 62 | |
| 63 void RTCPReceiveInformation::ClearTmmbr() { | |
| 64 tmmbr_.clear(); | |
| 65 } | |
| 66 | |
| 67 } // namespace RTCPHelp | 35 } // namespace RTCPHelp |
| 68 } // namespace webrtc | 36 } // namespace webrtc |
| OLD | NEW |