blob: 918d349392281b3b27c8e733fbc1ff738eaebbf9 [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
pwestin@webrtc.orgf6bb77a2012-01-24 17:16:59 +00002 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
niklase@google.com470e71d2011-07-07 08:21:25 +00003 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#ifndef MODULES_RTP_RTCP_SOURCE_RTCP_RECEIVER_H_
12#define MODULES_RTP_RTCP_SOURCE_RTCP_RECEIVER_H_
niklase@google.com470e71d2011-07-07 08:21:25 +000013
Mirta Dvornicicb1f063d2018-04-16 11:16:21 +020014#include <list>
pwestin@webrtc.org26f8d9c2012-01-19 15:53:09 +000015#include <map>
stefan@webrtc.org28a331e2013-09-17 07:49:56 +000016#include <set>
danilchap95321242016-09-27 07:05:32 -070017#include <string>
Victor Boivie0c563a42021-04-27 10:24:01 +020018#include <unordered_map>
danilchapb8b6fbb2015-12-10 05:05:27 -080019#include <vector>
perkj@webrtc.orgce5990c2012-01-11 13:00:08 +000020
Danil Chapovalov443f2662020-03-11 12:24:40 +010021#include "api/array_view.h"
Henrik Boströmf2047872019-05-16 13:32:20 +020022#include "modules/rtp_rtcp/include/report_block_data.h"
Niels Möller53382cb2018-11-27 14:05:08 +010023#include "modules/rtp_rtcp/include/rtcp_statistics.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020024#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
25#include "modules/rtp_rtcp/source/rtcp_nack_stats.h"
26#include "modules/rtp_rtcp/source/rtcp_packet/dlrr.h"
Tomas Gunnarssonf25761d2020-06-03 22:55:33 +020027#include "modules/rtp_rtcp/source/rtp_rtcp_interface.h"
Markus Handelle7c015e2020-07-07 11:44:28 +020028#include "rtc_base/synchronization/mutex.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020029#include "rtc_base/thread_annotations.h"
30#include "system_wrappers/include/ntp_time.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000031
32namespace webrtc {
spranga790d832016-12-02 07:29:44 -080033class VideoBitrateAllocationObserver;
danilchap59cb2bd2016-08-29 11:08:47 -070034namespace rtcp {
danilchap1b1863a2016-09-20 01:39:54 -070035class CommonHeader;
danilchap1b1863a2016-09-20 01:39:54 -070036class ReportBlock;
37class Rrtr;
spranga790d832016-12-02 07:29:44 -080038class TargetBitrate;
danilchap59cb2bd2016-08-29 11:08:47 -070039class TmmbItem;
40} // namespace rtcp
pwestin@webrtc.org741da942011-09-20 13:52:04 +000041
Danil Chapovalov443f2662020-03-11 12:24:40 +010042class RTCPReceiver final {
danilchapda161d72016-08-19 07:29:46 -070043 public:
danilchap59cb2bd2016-08-29 11:08:47 -070044 class ModuleRtpRtcp {
45 public:
46 virtual void SetTmmbn(std::vector<rtcp::TmmbItem> bounding_set) = 0;
47 virtual void OnRequestSendReport() = 0;
48 virtual void OnReceivedNack(
49 const std::vector<uint16_t>& nack_sequence_numbers) = 0;
50 virtual void OnReceivedRtcpReportBlocks(
51 const ReportBlockList& report_blocks) = 0;
52
53 protected:
54 virtual ~ModuleRtpRtcp() = default;
55 };
56
Tomas Gunnarssonf25761d2020-06-03 22:55:33 +020057 RTCPReceiver(const RtpRtcpInterface::Configuration& config,
58 ModuleRtpRtcp* owner);
Danil Chapovalov443f2662020-03-11 12:24:40 +010059 ~RTCPReceiver();
niklase@google.com470e71d2011-07-07 08:21:25 +000060
Danil Chapovalov443f2662020-03-11 12:24:40 +010061 void IncomingPacket(const uint8_t* packet, size_t packet_size) {
62 IncomingPacket(rtc::MakeArrayView(packet, packet_size));
63 }
64 void IncomingPacket(rtc::ArrayView<const uint8_t> packet);
danilchap59cb2bd2016-08-29 11:08:47 -070065
Danil Chapovalov760c4b42017-09-27 13:25:24 +020066 int64_t LastReceivedReportBlockMs() const;
niklase@google.com470e71d2011-07-07 08:21:25 +000067
danilchapda161d72016-08-19 07:29:46 -070068 void SetRemoteSSRC(uint32_t ssrc);
69 uint32_t RemoteSSRC() const;
niklase@google.com470e71d2011-07-07 08:21:25 +000070
danilchap8bab7962016-12-20 02:46:46 -080071 // Get received NTP.
Alessio Bazzica048adc72021-03-10 15:05:55 +010072 // The types for the arguments below derive from the specification:
73 // - `remote_sender_packet_count`: `RTCSentRtpStreamStats.packetsSent` [1]
74 // - `remote_sender_octet_count`: `RTCSentRtpStreamStats.bytesSent` [1]
75 // - `remote_sender_reports_count`:
76 // `RTCRemoteOutboundRtpStreamStats.reportsSent` [2]
77 // [1] https://www.w3.org/TR/webrtc-stats/#remoteoutboundrtpstats-dict*
78 // [2] https://www.w3.org/TR/webrtc-stats/#dom-rtcsentrtpstreamstats
danilchap8bab7962016-12-20 02:46:46 -080079 bool NTP(uint32_t* received_ntp_secs,
80 uint32_t* received_ntp_frac,
81 uint32_t* rtcp_arrival_time_secs,
82 uint32_t* rtcp_arrival_time_frac,
Alessio Bazzica048adc72021-03-10 15:05:55 +010083 uint32_t* rtcp_timestamp,
84 uint32_t* remote_sender_packet_count,
85 uint64_t* remote_sender_octet_count,
86 uint64_t* remote_sender_reports_count) const;
niklase@google.com470e71d2011-07-07 08:21:25 +000087
Mirta Dvornicicb1f063d2018-04-16 11:16:21 +020088 std::vector<rtcp::ReceiveTimeInfo> ConsumeReceivedXrReferenceTimeInfo();
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +000089
danilchap28b03eb2016-10-05 06:59:44 -070090 // Get rtt.
91 int32_t RTT(uint32_t remote_ssrc,
92 int64_t* last_rtt_ms,
93 int64_t* avg_rtt_ms,
94 int64_t* min_rtt_ms,
95 int64_t* max_rtt_ms) const;
niklase@google.com470e71d2011-07-07 08:21:25 +000096
danilchapda161d72016-08-19 07:29:46 -070097 bool GetAndResetXrRrRtt(int64_t* rtt_ms);
asapersson@webrtc.org7d6bd222013-10-31 12:14:34 +000098
Tomas Gunnarssonba0ba712020-07-01 08:53:21 +020099 // Called once per second on the worker thread to do rtt calculations.
100 // Returns an optional rtt value if one is available.
101 absl::optional<TimeDelta> OnPeriodicRttUpdate(Timestamp newer_than,
102 bool sending);
103
Henrik Boströmf2047872019-05-16 13:32:20 +0200104 // A snapshot of Report Blocks with additional data of interest to statistics.
105 // Within this list, the sender-source SSRC pair is unique and per-pair the
106 // ReportBlockData represents the latest Report Block that was received for
107 // that pair.
108 std::vector<ReportBlockData> GetLatestReportBlockData() const;
perkj@webrtc.orgce5990c2012-01-11 13:00:08 +0000109
danilchapda161d72016-08-19 07:29:46 -0700110 // Returns true if we haven't received an RTCP RR for several RTCP
111 // intervals, but only triggers true once.
Jiawei Ou8b5d9d82018-11-15 16:44:37 -0800112 bool RtcpRrTimeout();
mflodman@webrtc.org2f225ca2013-01-09 13:54:43 +0000113
danilchapda161d72016-08-19 07:29:46 -0700114 // Returns true if we haven't received an RTCP RR telling the receive side
115 // has not received RTP packets for too long, i.e. extended highest sequence
116 // number hasn't increased for several RTCP intervals. The function only
117 // returns true once until a new RR is received.
Jiawei Ou8b5d9d82018-11-15 16:44:37 -0800118 bool RtcpRrSequenceNumberTimeout();
mflodman@webrtc.org2f225ca2013-01-09 13:54:43 +0000119
danilchap7851bda2016-09-29 15:28:07 -0700120 std::vector<rtcp::TmmbItem> TmmbrReceived();
danilchap9bf610e2017-02-20 06:03:01 -0800121 // Return true if new bandwidth should be set.
122 bool UpdateTmmbrTimers();
danilchapda161d72016-08-19 07:29:46 -0700123 std::vector<rtcp::TmmbItem> BoundingSet(bool* tmmbr_owner);
danilchap9bf610e2017-02-20 06:03:01 -0800124 // Set new bandwidth and notify remote clients about it.
125 void NotifyTmmbrUpdated();
niklase@google.com470e71d2011-07-07 08:21:25 +0000126
danilchapdd128922016-09-13 12:23:29 -0700127 private:
Victor Boivie306b1392021-04-27 10:33:58 +0200128 // A lightweight inlined set of local SSRCs.
129 class RegisteredSsrcs {
130 public:
131 static constexpr size_t kMaxSsrcs = 3;
132 // Initializes the set of registered local SSRCS by extracting them from the
133 // provided `config`.
134 explicit RegisteredSsrcs(const RtpRtcpInterface::Configuration& config);
135
136 // Indicates if `ssrc` is in the set of registered local SSRCs.
137 bool contains(uint32_t ssrc) const {
138 return absl::c_linear_search(ssrcs_, ssrc);
139 }
140
141 private:
142 absl::InlinedVector<uint32_t, kMaxSsrcs> ssrcs_;
143 };
144
danilchap92ea6012016-09-23 10:36:03 -0700145 struct PacketInformation;
danilchap9bf610e2017-02-20 06:03:01 -0800146 struct TmmbrInformation;
Mirta Dvornicicb1f063d2018-04-16 11:16:21 +0200147 struct RrtrInformation;
danilchapefa966b2017-02-17 06:23:15 -0800148 struct LastFirStatus;
Victor Boivie0c563a42021-04-27 10:24:01 +0200149
150 // TODO(boivie): `ReportBlockDataMap` and `ReportBlockMap` should be converted
151 // to std::unordered_map, but as there are too many tests that assume a
152 // specific order, it's not easily done.
153
danilchap28b03eb2016-10-05 06:59:44 -0700154 // RTCP report blocks mapped by remote SSRC.
Henrik Boströmf2047872019-05-16 13:32:20 +0200155 using ReportBlockDataMap = std::map<uint32_t, ReportBlockData>;
danilchap28b03eb2016-10-05 06:59:44 -0700156 // RTCP report blocks map mapped by source SSRC.
Henrik Boströmf2047872019-05-16 13:32:20 +0200157 using ReportBlockMap = std::map<uint32_t, ReportBlockDataMap>;
danilchapdd128922016-09-13 12:23:29 -0700158
Danil Chapovalov443f2662020-03-11 12:24:40 +0100159 bool ParseCompoundPacket(rtc::ArrayView<const uint8_t> packet,
danilchap92ea6012016-09-23 10:36:03 -0700160 PacketInformation* packet_information);
danilchapdd128922016-09-13 12:23:29 -0700161
danilchap8bab7962016-12-20 02:46:46 -0800162 void TriggerCallbacksFromRtcpPacket(
danilchap92ea6012016-09-23 10:36:03 -0700163 const PacketInformation& packet_information);
danilchapdd128922016-09-13 12:23:29 -0700164
danilchapec067e92017-02-21 05:38:19 -0800165 TmmbrInformation* FindOrCreateTmmbrInfo(uint32_t remote_ssrc)
danilchap56359be2017-09-07 07:53:45 -0700166 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
danilchapec067e92017-02-21 05:38:19 -0800167 // Update TmmbrInformation (if present) is alive.
168 void UpdateTmmbrRemoteIsAlive(uint32_t remote_ssrc)
danilchap56359be2017-09-07 07:53:45 -0700169 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
danilchap9bf610e2017-02-20 06:03:01 -0800170 TmmbrInformation* GetTmmbrInformation(uint32_t remote_ssrc)
danilchap56359be2017-09-07 07:53:45 -0700171 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000172
danilchap92ea6012016-09-23 10:36:03 -0700173 void HandleSenderReport(const rtcp::CommonHeader& rtcp_block,
174 PacketInformation* packet_information)
danilchap56359be2017-09-07 07:53:45 -0700175 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
Danil Chapovalov91511f12016-09-15 16:24:02 +0200176
danilchap92ea6012016-09-23 10:36:03 -0700177 void HandleReceiverReport(const rtcp::CommonHeader& rtcp_block,
178 PacketInformation* packet_information)
danilchap56359be2017-09-07 07:53:45 -0700179 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000180
danilchap1b1863a2016-09-20 01:39:54 -0700181 void HandleReportBlock(const rtcp::ReportBlock& report_block,
danilchap92ea6012016-09-23 10:36:03 -0700182 PacketInformation* packet_information,
danilchap8bab7962016-12-20 02:46:46 -0800183 uint32_t remote_ssrc)
danilchap56359be2017-09-07 07:53:45 -0700184 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000185
danilchap8bab7962016-12-20 02:46:46 -0800186 void HandleSdes(const rtcp::CommonHeader& rtcp_block,
danilchap92ea6012016-09-23 10:36:03 -0700187 PacketInformation* packet_information)
danilchap56359be2017-09-07 07:53:45 -0700188 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000189
danilchap1b1863a2016-09-20 01:39:54 -0700190 void HandleXr(const rtcp::CommonHeader& rtcp_block,
danilchap92ea6012016-09-23 10:36:03 -0700191 PacketInformation* packet_information)
danilchap56359be2017-09-07 07:53:45 -0700192 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000193
danilchap92ea6012016-09-23 10:36:03 -0700194 void HandleXrReceiveReferenceTime(uint32_t sender_ssrc,
195 const rtcp::Rrtr& rrtr)
danilchap56359be2017-09-07 07:53:45 -0700196 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000197
danilchap92ea6012016-09-23 10:36:03 -0700198 void HandleXrDlrrReportBlock(const rtcp::ReceiveTimeInfo& rti)
danilchap56359be2017-09-07 07:53:45 -0700199 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
danilchapda161d72016-08-19 07:29:46 -0700200
sprangb32aaf92017-08-28 05:49:12 -0700201 void HandleXrTargetBitrate(uint32_t ssrc,
202 const rtcp::TargetBitrate& target_bitrate,
spranga790d832016-12-02 07:29:44 -0800203 PacketInformation* packet_information)
danilchap56359be2017-09-07 07:53:45 -0700204 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
spranga790d832016-12-02 07:29:44 -0800205
danilchap8bab7962016-12-20 02:46:46 -0800206 void HandleNack(const rtcp::CommonHeader& rtcp_block,
danilchap92ea6012016-09-23 10:36:03 -0700207 PacketInformation* packet_information)
danilchap56359be2017-09-07 07:53:45 -0700208 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
danilchapda161d72016-08-19 07:29:46 -0700209
Sebastian Janssone1795f42019-07-24 11:38:03 +0200210 void HandleApp(const rtcp::CommonHeader& rtcp_block,
211 PacketInformation* packet_information)
212 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
213
danilchap8bab7962016-12-20 02:46:46 -0800214 void HandleBye(const rtcp::CommonHeader& rtcp_block)
danilchap56359be2017-09-07 07:53:45 -0700215 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
danilchapda161d72016-08-19 07:29:46 -0700216
danilchap8bab7962016-12-20 02:46:46 -0800217 void HandlePli(const rtcp::CommonHeader& rtcp_block,
danilchap92ea6012016-09-23 10:36:03 -0700218 PacketInformation* packet_information)
danilchap56359be2017-09-07 07:53:45 -0700219 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
danilchapda161d72016-08-19 07:29:46 -0700220
danilchap1b1863a2016-09-20 01:39:54 -0700221 void HandlePsfbApp(const rtcp::CommonHeader& rtcp_block,
danilchap92ea6012016-09-23 10:36:03 -0700222 PacketInformation* packet_information)
danilchap56359be2017-09-07 07:53:45 -0700223 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
danilchapda161d72016-08-19 07:29:46 -0700224
danilchap8bab7962016-12-20 02:46:46 -0800225 void HandleTmmbr(const rtcp::CommonHeader& rtcp_block,
danilchap92ea6012016-09-23 10:36:03 -0700226 PacketInformation* packet_information)
danilchap56359be2017-09-07 07:53:45 -0700227 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000228
danilchap8bab7962016-12-20 02:46:46 -0800229 void HandleTmmbn(const rtcp::CommonHeader& rtcp_block,
danilchap92ea6012016-09-23 10:36:03 -0700230 PacketInformation* packet_information)
danilchap56359be2017-09-07 07:53:45 -0700231 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000232
danilchap8bab7962016-12-20 02:46:46 -0800233 void HandleSrReq(const rtcp::CommonHeader& rtcp_block,
234 PacketInformation* packet_information)
danilchap56359be2017-09-07 07:53:45 -0700235 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000236
danilchap8bab7962016-12-20 02:46:46 -0800237 void HandleFir(const rtcp::CommonHeader& rtcp_block,
danilchap92ea6012016-09-23 10:36:03 -0700238 PacketInformation* packet_information)
danilchap56359be2017-09-07 07:53:45 -0700239 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
danilchapda161d72016-08-19 07:29:46 -0700240
danilchap92ea6012016-09-23 10:36:03 -0700241 void HandleTransportFeedback(const rtcp::CommonHeader& rtcp_block,
242 PacketInformation* packet_information)
danilchap56359be2017-09-07 07:53:45 -0700243 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
Erik Språng6b8d3552015-09-24 15:06:57 +0200244
Tomas Gunnarssonba0ba712020-07-01 08:53:21 +0200245 bool RtcpRrTimeoutLocked(Timestamp now)
246 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
247
248 bool RtcpRrSequenceNumberTimeoutLocked(Timestamp now)
249 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
250
danilchap8bab7962016-12-20 02:46:46 -0800251 Clock* const clock_;
Peter Boströmfe7a80c2015-04-23 17:53:17 +0200252 const bool receiver_only_;
danilchap8bab7962016-12-20 02:46:46 -0800253 ModuleRtpRtcp* const rtp_rtcp_;
Erik Språng6841d252019-10-15 14:29:11 +0200254 const uint32_t main_ssrc_;
Victor Boivie306b1392021-04-27 10:33:58 +0200255 // The set of registered local SSRCs.
256 const RegisteredSsrcs registered_ssrcs_;
niklase@google.com470e71d2011-07-07 08:21:25 +0000257
spranga790d832016-12-02 07:29:44 -0800258 RtcpBandwidthObserver* const rtcp_bandwidth_observer_;
259 RtcpIntraFrameObserver* const rtcp_intra_frame_observer_;
Elad Alon0a8562e2019-04-09 11:55:13 +0200260 RtcpLossNotificationObserver* const rtcp_loss_notification_observer_;
Sebastian Janssone1795f42019-07-24 11:38:03 +0200261 NetworkStateEstimateObserver* const network_state_estimate_observer_;
spranga790d832016-12-02 07:29:44 -0800262 TransportFeedbackObserver* const transport_feedback_observer_;
263 VideoBitrateAllocationObserver* const bitrate_allocation_observer_;
Tomas Gunnarssonba0ba712020-07-01 08:53:21 +0200264 const TimeDelta report_interval_;
niklase@google.com470e71d2011-07-07 08:21:25 +0000265
Markus Handelle7c015e2020-07-07 11:44:28 +0200266 mutable Mutex rtcp_receiver_lock_;
danilchap56359be2017-09-07 07:53:45 -0700267 uint32_t remote_ssrc_ RTC_GUARDED_BY(rtcp_receiver_lock_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000268
danilchap8bab7962016-12-20 02:46:46 -0800269 // Received sender report.
danilchap56359be2017-09-07 07:53:45 -0700270 NtpTime remote_sender_ntp_time_ RTC_GUARDED_BY(rtcp_receiver_lock_);
271 uint32_t remote_sender_rtp_time_ RTC_GUARDED_BY(rtcp_receiver_lock_);
danilchap0b4b7272016-10-06 09:24:45 -0700272 // When did we receive the last send report.
danilchap56359be2017-09-07 07:53:45 -0700273 NtpTime last_received_sr_ntp_ RTC_GUARDED_BY(rtcp_receiver_lock_);
Alessio Bazzica048adc72021-03-10 15:05:55 +0100274 uint32_t remote_sender_packet_count_ RTC_GUARDED_BY(rtcp_receiver_lock_);
275 uint64_t remote_sender_octet_count_ RTC_GUARDED_BY(rtcp_receiver_lock_);
276 uint64_t remote_sender_reports_count_ RTC_GUARDED_BY(rtcp_receiver_lock_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000277
Mirta Dvornicicb1f063d2018-04-16 11:16:21 +0200278 // Received RRTR information in ascending receive time order.
279 std::list<RrtrInformation> received_rrtrs_
280 RTC_GUARDED_BY(rtcp_receiver_lock_);
281 // Received RRTR information mapped by remote ssrc.
Victor Boivie0c563a42021-04-27 10:24:01 +0200282 std::unordered_map<uint32_t, std::list<RrtrInformation>::iterator>
Mirta Dvornicicb1f063d2018-04-16 11:16:21 +0200283 received_rrtrs_ssrc_it_ RTC_GUARDED_BY(rtcp_receiver_lock_);
284
asapersson@webrtc.org7d6bd222013-10-31 12:14:34 +0000285 // Estimated rtt, zero when there is no valid estimate.
Niels Möllerbe810cb2020-12-02 14:25:03 +0100286 const bool xr_rrtr_status_;
pkasting@chromium.org16825b12015-01-12 21:51:21 +0000287 int64_t xr_rr_rtt_ms_;
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000288
danilchap56359be2017-09-07 07:53:45 -0700289 int64_t oldest_tmmbr_info_ms_ RTC_GUARDED_BY(rtcp_receiver_lock_);
danilchap9bf610e2017-02-20 06:03:01 -0800290 // Mapped by remote ssrc.
Victor Boivie0c563a42021-04-27 10:24:01 +0200291 std::unordered_map<uint32_t, TmmbrInformation> tmmbr_infos_
danilchap56359be2017-09-07 07:53:45 -0700292 RTC_GUARDED_BY(rtcp_receiver_lock_);
danilchap9bf610e2017-02-20 06:03:01 -0800293
danilchap56359be2017-09-07 07:53:45 -0700294 ReportBlockMap received_report_blocks_ RTC_GUARDED_BY(rtcp_receiver_lock_);
Victor Boivie0c563a42021-04-27 10:24:01 +0200295 std::unordered_map<uint32_t, LastFirStatus> last_fir_
danilchap56359be2017-09-07 07:53:45 -0700296 RTC_GUARDED_BY(rtcp_receiver_lock_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000297
Danil Chapovalov760c4b42017-09-27 13:25:24 +0200298 // The last time we received an RTCP Report block for this module.
Tomas Gunnarssonba0ba712020-07-01 08:53:21 +0200299 Timestamp last_received_rb_ RTC_GUARDED_BY(rtcp_receiver_lock_) =
300 Timestamp::PlusInfinity();
mflodman@webrtc.org2f225ca2013-01-09 13:54:43 +0000301
asapersson@webrtc.orgcb791412014-12-18 14:30:32 +0000302 // The time we last received an RTCP RR telling we have successfully
mflodman@webrtc.org2f225ca2013-01-09 13:54:43 +0000303 // delivered RTP packet to the remote side.
Tomas Gunnarssonba0ba712020-07-01 08:53:21 +0200304 Timestamp last_increased_sequence_number_ = Timestamp::PlusInfinity();
stefan@webrtc.org8ca8a712013-04-23 16:48:32 +0000305
Danil Chapovalovbd74d5c2020-03-12 09:22:44 +0100306 RtcpStatisticsCallback* const stats_callback_;
307 RtcpCnameCallback* const cname_callback_;
Henrik Boströmf2047872019-05-16 13:32:20 +0200308 // TODO(hbos): Remove RtcpStatisticsCallback in favor of
309 // ReportBlockDataObserver; the ReportBlockData contains a superset of the
310 // RtcpStatistics data.
Danil Chapovalovbd74d5c2020-03-12 09:22:44 +0100311 ReportBlockDataObserver* const report_block_data_observer_;
asapersson@webrtc.org8098e072014-02-19 11:59:02 +0000312
pbos@webrtc.org1d0fa5d2015-02-19 12:47:00 +0000313 RtcpPacketTypeCounterObserver* const packet_type_counter_observer_;
asapersson@webrtc.org8098e072014-02-19 11:59:02 +0000314 RtcpPacketTypeCounter packet_type_counter_;
asapersson@webrtc.org2dd31342014-10-29 12:42:30 +0000315
danilchap84432382017-02-09 05:21:42 -0800316 RtcpNackStats nack_stats_;
Erik Språng6b8d3552015-09-24 15:06:57 +0200317
318 size_t num_skipped_packets_;
danilchap8bab7962016-12-20 02:46:46 -0800319 int64_t last_skipped_packets_warning_ms_;
niklase@google.com470e71d2011-07-07 08:21:25 +0000320};
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +0000321} // namespace webrtc
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200322#endif // MODULES_RTP_RTCP_SOURCE_RTCP_RECEIVER_H_