blob: a9f602f8454100701ee62fa27647f7474fbe06a5 [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>
danilchapb8b6fbb2015-12-10 05:05:27 -080018#include <vector>
perkj@webrtc.orgce5990c2012-01-11 13:00:08 +000019
Danil Chapovalov443f2662020-03-11 12:24:40 +010020#include "api/array_view.h"
Henrik Boströmf2047872019-05-16 13:32:20 +020021#include "modules/rtp_rtcp/include/report_block_data.h"
Niels Möller53382cb2018-11-27 14:05:08 +010022#include "modules/rtp_rtcp/include/rtcp_statistics.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020023#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
24#include "modules/rtp_rtcp/source/rtcp_nack_stats.h"
25#include "modules/rtp_rtcp/source/rtcp_packet/dlrr.h"
Tomas Gunnarssonf25761d2020-06-03 22:55:33 +020026#include "modules/rtp_rtcp/source/rtp_rtcp_interface.h"
Markus Handelle7c015e2020-07-07 11:44:28 +020027#include "rtc_base/synchronization/mutex.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020028#include "rtc_base/thread_annotations.h"
29#include "system_wrappers/include/ntp_time.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000030
31namespace webrtc {
spranga790d832016-12-02 07:29:44 -080032class VideoBitrateAllocationObserver;
danilchap59cb2bd2016-08-29 11:08:47 -070033namespace rtcp {
danilchap1b1863a2016-09-20 01:39:54 -070034class CommonHeader;
danilchap1b1863a2016-09-20 01:39:54 -070035class ReportBlock;
36class Rrtr;
spranga790d832016-12-02 07:29:44 -080037class TargetBitrate;
danilchap59cb2bd2016-08-29 11:08:47 -070038class TmmbItem;
39} // namespace rtcp
pwestin@webrtc.org741da942011-09-20 13:52:04 +000040
Danil Chapovalov443f2662020-03-11 12:24:40 +010041class RTCPReceiver final {
danilchapda161d72016-08-19 07:29:46 -070042 public:
danilchap59cb2bd2016-08-29 11:08:47 -070043 class ModuleRtpRtcp {
44 public:
45 virtual void SetTmmbn(std::vector<rtcp::TmmbItem> bounding_set) = 0;
46 virtual void OnRequestSendReport() = 0;
47 virtual void OnReceivedNack(
48 const std::vector<uint16_t>& nack_sequence_numbers) = 0;
49 virtual void OnReceivedRtcpReportBlocks(
50 const ReportBlockList& report_blocks) = 0;
51
52 protected:
53 virtual ~ModuleRtpRtcp() = default;
54 };
55
Tomas Gunnarssonf25761d2020-06-03 22:55:33 +020056 RTCPReceiver(const RtpRtcpInterface::Configuration& config,
57 ModuleRtpRtcp* owner);
Danil Chapovalov443f2662020-03-11 12:24:40 +010058 ~RTCPReceiver();
niklase@google.com470e71d2011-07-07 08:21:25 +000059
Danil Chapovalov443f2662020-03-11 12:24:40 +010060 void IncomingPacket(const uint8_t* packet, size_t packet_size) {
61 IncomingPacket(rtc::MakeArrayView(packet, packet_size));
62 }
63 void IncomingPacket(rtc::ArrayView<const uint8_t> packet);
danilchap59cb2bd2016-08-29 11:08:47 -070064
Danil Chapovalov760c4b42017-09-27 13:25:24 +020065 int64_t LastReceivedReportBlockMs() const;
niklase@google.com470e71d2011-07-07 08:21:25 +000066
danilchapda161d72016-08-19 07:29:46 -070067 void SetRemoteSSRC(uint32_t ssrc);
68 uint32_t RemoteSSRC() const;
niklase@google.com470e71d2011-07-07 08:21:25 +000069
danilchap8bab7962016-12-20 02:46:46 -080070 // Get received NTP.
Alessio Bazzica048adc72021-03-10 15:05:55 +010071 // The types for the arguments below derive from the specification:
72 // - `remote_sender_packet_count`: `RTCSentRtpStreamStats.packetsSent` [1]
73 // - `remote_sender_octet_count`: `RTCSentRtpStreamStats.bytesSent` [1]
74 // - `remote_sender_reports_count`:
75 // `RTCRemoteOutboundRtpStreamStats.reportsSent` [2]
76 // [1] https://www.w3.org/TR/webrtc-stats/#remoteoutboundrtpstats-dict*
77 // [2] https://www.w3.org/TR/webrtc-stats/#dom-rtcsentrtpstreamstats
danilchap8bab7962016-12-20 02:46:46 -080078 bool NTP(uint32_t* received_ntp_secs,
79 uint32_t* received_ntp_frac,
80 uint32_t* rtcp_arrival_time_secs,
81 uint32_t* rtcp_arrival_time_frac,
Alessio Bazzica048adc72021-03-10 15:05:55 +010082 uint32_t* rtcp_timestamp,
83 uint32_t* remote_sender_packet_count,
84 uint64_t* remote_sender_octet_count,
85 uint64_t* remote_sender_reports_count) const;
niklase@google.com470e71d2011-07-07 08:21:25 +000086
Mirta Dvornicicb1f063d2018-04-16 11:16:21 +020087 std::vector<rtcp::ReceiveTimeInfo> ConsumeReceivedXrReferenceTimeInfo();
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +000088
danilchap28b03eb2016-10-05 06:59:44 -070089 // Get rtt.
90 int32_t RTT(uint32_t remote_ssrc,
91 int64_t* last_rtt_ms,
92 int64_t* avg_rtt_ms,
93 int64_t* min_rtt_ms,
94 int64_t* max_rtt_ms) const;
niklase@google.com470e71d2011-07-07 08:21:25 +000095
danilchapda161d72016-08-19 07:29:46 -070096 bool GetAndResetXrRrRtt(int64_t* rtt_ms);
asapersson@webrtc.org7d6bd222013-10-31 12:14:34 +000097
Tomas Gunnarssonba0ba712020-07-01 08:53:21 +020098 // Called once per second on the worker thread to do rtt calculations.
99 // Returns an optional rtt value if one is available.
100 absl::optional<TimeDelta> OnPeriodicRttUpdate(Timestamp newer_than,
101 bool sending);
102
Henrik Boströmf2047872019-05-16 13:32:20 +0200103 // A snapshot of Report Blocks with additional data of interest to statistics.
104 // Within this list, the sender-source SSRC pair is unique and per-pair the
105 // ReportBlockData represents the latest Report Block that was received for
106 // that pair.
107 std::vector<ReportBlockData> GetLatestReportBlockData() const;
perkj@webrtc.orgce5990c2012-01-11 13:00:08 +0000108
danilchapda161d72016-08-19 07:29:46 -0700109 // Returns true if we haven't received an RTCP RR for several RTCP
110 // intervals, but only triggers true once.
Jiawei Ou8b5d9d82018-11-15 16:44:37 -0800111 bool RtcpRrTimeout();
mflodman@webrtc.org2f225ca2013-01-09 13:54:43 +0000112
danilchapda161d72016-08-19 07:29:46 -0700113 // Returns true if we haven't received an RTCP RR telling the receive side
114 // has not received RTP packets for too long, i.e. extended highest sequence
115 // number hasn't increased for several RTCP intervals. The function only
116 // returns true once until a new RR is received.
Jiawei Ou8b5d9d82018-11-15 16:44:37 -0800117 bool RtcpRrSequenceNumberTimeout();
mflodman@webrtc.org2f225ca2013-01-09 13:54:43 +0000118
danilchap7851bda2016-09-29 15:28:07 -0700119 std::vector<rtcp::TmmbItem> TmmbrReceived();
danilchap9bf610e2017-02-20 06:03:01 -0800120 // Return true if new bandwidth should be set.
121 bool UpdateTmmbrTimers();
danilchapda161d72016-08-19 07:29:46 -0700122 std::vector<rtcp::TmmbItem> BoundingSet(bool* tmmbr_owner);
danilchap9bf610e2017-02-20 06:03:01 -0800123 // Set new bandwidth and notify remote clients about it.
124 void NotifyTmmbrUpdated();
niklase@google.com470e71d2011-07-07 08:21:25 +0000125
danilchapdd128922016-09-13 12:23:29 -0700126 private:
Victor Boivie306b1392021-04-27 10:33:58 +0200127 // A lightweight inlined set of local SSRCs.
128 class RegisteredSsrcs {
129 public:
130 static constexpr size_t kMaxSsrcs = 3;
131 // Initializes the set of registered local SSRCS by extracting them from the
132 // provided `config`.
133 explicit RegisteredSsrcs(const RtpRtcpInterface::Configuration& config);
134
135 // Indicates if `ssrc` is in the set of registered local SSRCs.
136 bool contains(uint32_t ssrc) const {
137 return absl::c_linear_search(ssrcs_, ssrc);
138 }
139
140 private:
141 absl::InlinedVector<uint32_t, kMaxSsrcs> ssrcs_;
142 };
143
danilchap92ea6012016-09-23 10:36:03 -0700144 struct PacketInformation;
danilchap9bf610e2017-02-20 06:03:01 -0800145 struct TmmbrInformation;
Mirta Dvornicicb1f063d2018-04-16 11:16:21 +0200146 struct RrtrInformation;
danilchapefa966b2017-02-17 06:23:15 -0800147 struct LastFirStatus;
danilchap28b03eb2016-10-05 06:59:44 -0700148 // RTCP report blocks mapped by remote SSRC.
Henrik Boströmf2047872019-05-16 13:32:20 +0200149 using ReportBlockDataMap = std::map<uint32_t, ReportBlockData>;
danilchap28b03eb2016-10-05 06:59:44 -0700150 // RTCP report blocks map mapped by source SSRC.
Henrik Boströmf2047872019-05-16 13:32:20 +0200151 using ReportBlockMap = std::map<uint32_t, ReportBlockDataMap>;
danilchapdd128922016-09-13 12:23:29 -0700152
Danil Chapovalov443f2662020-03-11 12:24:40 +0100153 bool ParseCompoundPacket(rtc::ArrayView<const uint8_t> packet,
danilchap92ea6012016-09-23 10:36:03 -0700154 PacketInformation* packet_information);
danilchapdd128922016-09-13 12:23:29 -0700155
danilchap8bab7962016-12-20 02:46:46 -0800156 void TriggerCallbacksFromRtcpPacket(
danilchap92ea6012016-09-23 10:36:03 -0700157 const PacketInformation& packet_information);
danilchapdd128922016-09-13 12:23:29 -0700158
danilchapec067e92017-02-21 05:38:19 -0800159 TmmbrInformation* FindOrCreateTmmbrInfo(uint32_t remote_ssrc)
danilchap56359be2017-09-07 07:53:45 -0700160 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
danilchapec067e92017-02-21 05:38:19 -0800161 // Update TmmbrInformation (if present) is alive.
162 void UpdateTmmbrRemoteIsAlive(uint32_t remote_ssrc)
danilchap56359be2017-09-07 07:53:45 -0700163 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
danilchap9bf610e2017-02-20 06:03:01 -0800164 TmmbrInformation* GetTmmbrInformation(uint32_t remote_ssrc)
danilchap56359be2017-09-07 07:53:45 -0700165 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000166
danilchap92ea6012016-09-23 10:36:03 -0700167 void HandleSenderReport(const rtcp::CommonHeader& rtcp_block,
168 PacketInformation* packet_information)
danilchap56359be2017-09-07 07:53:45 -0700169 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
Danil Chapovalov91511f12016-09-15 16:24:02 +0200170
danilchap92ea6012016-09-23 10:36:03 -0700171 void HandleReceiverReport(const rtcp::CommonHeader& rtcp_block,
172 PacketInformation* packet_information)
danilchap56359be2017-09-07 07:53:45 -0700173 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000174
danilchap1b1863a2016-09-20 01:39:54 -0700175 void HandleReportBlock(const rtcp::ReportBlock& report_block,
danilchap92ea6012016-09-23 10:36:03 -0700176 PacketInformation* packet_information,
danilchap8bab7962016-12-20 02:46:46 -0800177 uint32_t remote_ssrc)
danilchap56359be2017-09-07 07:53:45 -0700178 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000179
danilchap8bab7962016-12-20 02:46:46 -0800180 void HandleSdes(const rtcp::CommonHeader& rtcp_block,
danilchap92ea6012016-09-23 10:36:03 -0700181 PacketInformation* packet_information)
danilchap56359be2017-09-07 07:53:45 -0700182 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000183
danilchap1b1863a2016-09-20 01:39:54 -0700184 void HandleXr(const rtcp::CommonHeader& rtcp_block,
danilchap92ea6012016-09-23 10:36:03 -0700185 PacketInformation* packet_information)
danilchap56359be2017-09-07 07:53:45 -0700186 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000187
danilchap92ea6012016-09-23 10:36:03 -0700188 void HandleXrReceiveReferenceTime(uint32_t sender_ssrc,
189 const rtcp::Rrtr& rrtr)
danilchap56359be2017-09-07 07:53:45 -0700190 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000191
danilchap92ea6012016-09-23 10:36:03 -0700192 void HandleXrDlrrReportBlock(const rtcp::ReceiveTimeInfo& rti)
danilchap56359be2017-09-07 07:53:45 -0700193 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
danilchapda161d72016-08-19 07:29:46 -0700194
sprangb32aaf92017-08-28 05:49:12 -0700195 void HandleXrTargetBitrate(uint32_t ssrc,
196 const rtcp::TargetBitrate& target_bitrate,
spranga790d832016-12-02 07:29:44 -0800197 PacketInformation* packet_information)
danilchap56359be2017-09-07 07:53:45 -0700198 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
spranga790d832016-12-02 07:29:44 -0800199
danilchap8bab7962016-12-20 02:46:46 -0800200 void HandleNack(const rtcp::CommonHeader& rtcp_block,
danilchap92ea6012016-09-23 10:36:03 -0700201 PacketInformation* packet_information)
danilchap56359be2017-09-07 07:53:45 -0700202 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
danilchapda161d72016-08-19 07:29:46 -0700203
Sebastian Janssone1795f42019-07-24 11:38:03 +0200204 void HandleApp(const rtcp::CommonHeader& rtcp_block,
205 PacketInformation* packet_information)
206 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
207
danilchap8bab7962016-12-20 02:46:46 -0800208 void HandleBye(const rtcp::CommonHeader& rtcp_block)
danilchap56359be2017-09-07 07:53:45 -0700209 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
danilchapda161d72016-08-19 07:29:46 -0700210
danilchap8bab7962016-12-20 02:46:46 -0800211 void HandlePli(const rtcp::CommonHeader& rtcp_block,
danilchap92ea6012016-09-23 10:36:03 -0700212 PacketInformation* packet_information)
danilchap56359be2017-09-07 07:53:45 -0700213 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
danilchapda161d72016-08-19 07:29:46 -0700214
danilchap1b1863a2016-09-20 01:39:54 -0700215 void HandlePsfbApp(const rtcp::CommonHeader& rtcp_block,
danilchap92ea6012016-09-23 10:36:03 -0700216 PacketInformation* packet_information)
danilchap56359be2017-09-07 07:53:45 -0700217 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
danilchapda161d72016-08-19 07:29:46 -0700218
danilchap8bab7962016-12-20 02:46:46 -0800219 void HandleTmmbr(const rtcp::CommonHeader& rtcp_block,
danilchap92ea6012016-09-23 10:36:03 -0700220 PacketInformation* packet_information)
danilchap56359be2017-09-07 07:53:45 -0700221 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000222
danilchap8bab7962016-12-20 02:46:46 -0800223 void HandleTmmbn(const rtcp::CommonHeader& rtcp_block,
danilchap92ea6012016-09-23 10:36:03 -0700224 PacketInformation* packet_information)
danilchap56359be2017-09-07 07:53:45 -0700225 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000226
danilchap8bab7962016-12-20 02:46:46 -0800227 void HandleSrReq(const rtcp::CommonHeader& rtcp_block,
228 PacketInformation* packet_information)
danilchap56359be2017-09-07 07:53:45 -0700229 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000230
danilchap8bab7962016-12-20 02:46:46 -0800231 void HandleFir(const rtcp::CommonHeader& rtcp_block,
danilchap92ea6012016-09-23 10:36:03 -0700232 PacketInformation* packet_information)
danilchap56359be2017-09-07 07:53:45 -0700233 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
danilchapda161d72016-08-19 07:29:46 -0700234
danilchap92ea6012016-09-23 10:36:03 -0700235 void HandleTransportFeedback(const rtcp::CommonHeader& rtcp_block,
236 PacketInformation* packet_information)
danilchap56359be2017-09-07 07:53:45 -0700237 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
Erik Språng6b8d3552015-09-24 15:06:57 +0200238
Tomas Gunnarssonba0ba712020-07-01 08:53:21 +0200239 bool RtcpRrTimeoutLocked(Timestamp now)
240 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
241
242 bool RtcpRrSequenceNumberTimeoutLocked(Timestamp now)
243 RTC_EXCLUSIVE_LOCKS_REQUIRED(rtcp_receiver_lock_);
244
danilchap8bab7962016-12-20 02:46:46 -0800245 Clock* const clock_;
Peter Boströmfe7a80c2015-04-23 17:53:17 +0200246 const bool receiver_only_;
danilchap8bab7962016-12-20 02:46:46 -0800247 ModuleRtpRtcp* const rtp_rtcp_;
Erik Språng6841d252019-10-15 14:29:11 +0200248 const uint32_t main_ssrc_;
Victor Boivie306b1392021-04-27 10:33:58 +0200249 // The set of registered local SSRCs.
250 const RegisteredSsrcs registered_ssrcs_;
niklase@google.com470e71d2011-07-07 08:21:25 +0000251
spranga790d832016-12-02 07:29:44 -0800252 RtcpBandwidthObserver* const rtcp_bandwidth_observer_;
253 RtcpIntraFrameObserver* const rtcp_intra_frame_observer_;
Elad Alon0a8562e2019-04-09 11:55:13 +0200254 RtcpLossNotificationObserver* const rtcp_loss_notification_observer_;
Sebastian Janssone1795f42019-07-24 11:38:03 +0200255 NetworkStateEstimateObserver* const network_state_estimate_observer_;
spranga790d832016-12-02 07:29:44 -0800256 TransportFeedbackObserver* const transport_feedback_observer_;
257 VideoBitrateAllocationObserver* const bitrate_allocation_observer_;
Tomas Gunnarssonba0ba712020-07-01 08:53:21 +0200258 const TimeDelta report_interval_;
niklase@google.com470e71d2011-07-07 08:21:25 +0000259
Markus Handelle7c015e2020-07-07 11:44:28 +0200260 mutable Mutex rtcp_receiver_lock_;
danilchap56359be2017-09-07 07:53:45 -0700261 uint32_t remote_ssrc_ RTC_GUARDED_BY(rtcp_receiver_lock_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000262
danilchap8bab7962016-12-20 02:46:46 -0800263 // Received sender report.
danilchap56359be2017-09-07 07:53:45 -0700264 NtpTime remote_sender_ntp_time_ RTC_GUARDED_BY(rtcp_receiver_lock_);
265 uint32_t remote_sender_rtp_time_ RTC_GUARDED_BY(rtcp_receiver_lock_);
danilchap0b4b7272016-10-06 09:24:45 -0700266 // When did we receive the last send report.
danilchap56359be2017-09-07 07:53:45 -0700267 NtpTime last_received_sr_ntp_ RTC_GUARDED_BY(rtcp_receiver_lock_);
Alessio Bazzica048adc72021-03-10 15:05:55 +0100268 uint32_t remote_sender_packet_count_ RTC_GUARDED_BY(rtcp_receiver_lock_);
269 uint64_t remote_sender_octet_count_ RTC_GUARDED_BY(rtcp_receiver_lock_);
270 uint64_t remote_sender_reports_count_ RTC_GUARDED_BY(rtcp_receiver_lock_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000271
Mirta Dvornicicb1f063d2018-04-16 11:16:21 +0200272 // Received RRTR information in ascending receive time order.
273 std::list<RrtrInformation> received_rrtrs_
274 RTC_GUARDED_BY(rtcp_receiver_lock_);
275 // Received RRTR information mapped by remote ssrc.
276 std::map<uint32_t, std::list<RrtrInformation>::iterator>
277 received_rrtrs_ssrc_it_ RTC_GUARDED_BY(rtcp_receiver_lock_);
278
asapersson@webrtc.org7d6bd222013-10-31 12:14:34 +0000279 // Estimated rtt, zero when there is no valid estimate.
Niels Möllerbe810cb2020-12-02 14:25:03 +0100280 const bool xr_rrtr_status_;
pkasting@chromium.org16825b12015-01-12 21:51:21 +0000281 int64_t xr_rr_rtt_ms_;
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000282
danilchap56359be2017-09-07 07:53:45 -0700283 int64_t oldest_tmmbr_info_ms_ RTC_GUARDED_BY(rtcp_receiver_lock_);
danilchap9bf610e2017-02-20 06:03:01 -0800284 // Mapped by remote ssrc.
285 std::map<uint32_t, TmmbrInformation> tmmbr_infos_
danilchap56359be2017-09-07 07:53:45 -0700286 RTC_GUARDED_BY(rtcp_receiver_lock_);
danilchap9bf610e2017-02-20 06:03:01 -0800287
danilchap56359be2017-09-07 07:53:45 -0700288 ReportBlockMap received_report_blocks_ RTC_GUARDED_BY(rtcp_receiver_lock_);
289 std::map<uint32_t, LastFirStatus> last_fir_
290 RTC_GUARDED_BY(rtcp_receiver_lock_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000291
Danil Chapovalov760c4b42017-09-27 13:25:24 +0200292 // The last time we received an RTCP Report block for this module.
Tomas Gunnarssonba0ba712020-07-01 08:53:21 +0200293 Timestamp last_received_rb_ RTC_GUARDED_BY(rtcp_receiver_lock_) =
294 Timestamp::PlusInfinity();
mflodman@webrtc.org2f225ca2013-01-09 13:54:43 +0000295
asapersson@webrtc.orgcb791412014-12-18 14:30:32 +0000296 // The time we last received an RTCP RR telling we have successfully
mflodman@webrtc.org2f225ca2013-01-09 13:54:43 +0000297 // delivered RTP packet to the remote side.
Tomas Gunnarssonba0ba712020-07-01 08:53:21 +0200298 Timestamp last_increased_sequence_number_ = Timestamp::PlusInfinity();
stefan@webrtc.org8ca8a712013-04-23 16:48:32 +0000299
Danil Chapovalovbd74d5c2020-03-12 09:22:44 +0100300 RtcpStatisticsCallback* const stats_callback_;
301 RtcpCnameCallback* const cname_callback_;
Henrik Boströmf2047872019-05-16 13:32:20 +0200302 // TODO(hbos): Remove RtcpStatisticsCallback in favor of
303 // ReportBlockDataObserver; the ReportBlockData contains a superset of the
304 // RtcpStatistics data.
Danil Chapovalovbd74d5c2020-03-12 09:22:44 +0100305 ReportBlockDataObserver* const report_block_data_observer_;
asapersson@webrtc.org8098e072014-02-19 11:59:02 +0000306
pbos@webrtc.org1d0fa5d2015-02-19 12:47:00 +0000307 RtcpPacketTypeCounterObserver* const packet_type_counter_observer_;
asapersson@webrtc.org8098e072014-02-19 11:59:02 +0000308 RtcpPacketTypeCounter packet_type_counter_;
asapersson@webrtc.org2dd31342014-10-29 12:42:30 +0000309
danilchap84432382017-02-09 05:21:42 -0800310 RtcpNackStats nack_stats_;
Erik Språng6b8d3552015-09-24 15:06:57 +0200311
312 size_t num_skipped_packets_;
danilchap8bab7962016-12-20 02:46:46 -0800313 int64_t last_skipped_packets_warning_ms_;
niklase@google.com470e71d2011-07-07 08:21:25 +0000314};
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +0000315} // namespace webrtc
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200316#endif // MODULES_RTP_RTCP_SOURCE_RTCP_RECEIVER_H_