blob: 475ab1e26f70cf4db01cb35a5a50c6d0ee5a0e25 [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
11#ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_RECEIVER_H_
12#define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_RECEIVER_H_
13
pwestin@webrtc.org26f8d9c2012-01-19 15:53:09 +000014#include <map>
stefan@webrtc.org28a331e2013-09-17 07:49:56 +000015#include <set>
danilchapb8b6fbb2015-12-10 05:05:27 -080016#include <vector>
perkj@webrtc.orgce5990c2012-01-11 13:00:08 +000017
asapersson@webrtc.orgcb791412014-12-18 14:30:32 +000018#include "webrtc/base/thread_annotations.h"
Henrik Kjellanderff761fb2015-11-04 08:31:52 +010019#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
pbos@webrtc.orga048d7c2013-05-29 14:27:38 +000020#include "webrtc/modules/rtp_rtcp/source/rtcp_receiver_help.h"
21#include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h"
22#include "webrtc/modules/rtp_rtcp/source/rtp_utility.h"
23#include "webrtc/modules/rtp_rtcp/source/tmmbr_help.h"
24#include "webrtc/typedefs.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000025
26namespace webrtc {
pwestin@webrtc.org741da942011-09-20 13:52:04 +000027class ModuleRtpRtcpImpl;
28
pwestin@webrtc.orgcac78782012-04-05 08:30:10 +000029class RTCPReceiver : public TMMBRHelp
niklase@google.com470e71d2011-07-07 08:21:25 +000030{
31public:
Peter Boströmac547a62015-09-17 23:03:57 +020032 RTCPReceiver(Clock* clock,
Peter Boströmfe7a80c2015-04-23 17:53:17 +020033 bool receiver_only,
pbos@webrtc.org1d0fa5d2015-02-19 12:47:00 +000034 RtcpPacketTypeCounterObserver* packet_type_counter_observer,
mflodman@webrtc.org96abda02015-02-25 13:50:10 +000035 RtcpBandwidthObserver* rtcp_bandwidth_observer,
36 RtcpIntraFrameObserver* rtcp_intra_frame_observer,
Erik Språng6b8d3552015-09-24 15:06:57 +020037 TransportFeedbackObserver* transport_feedback_observer,
pbos@webrtc.org1d0fa5d2015-02-19 12:47:00 +000038 ModuleRtpRtcpImpl* owner);
niklase@google.com470e71d2011-07-07 08:21:25 +000039 virtual ~RTCPReceiver();
40
pbos@webrtc.org2f446732013-04-08 11:08:41 +000041 int64_t LastReceived();
42 int64_t LastReceivedReceiverReport() const;
niklase@google.com470e71d2011-07-07 08:21:25 +000043
stefan@webrtc.org28a331e2013-09-17 07:49:56 +000044 void SetSsrcs(uint32_t main_ssrc,
45 const std::set<uint32_t>& registered_ssrcs);
asapersson@webrtc.orgdf7b65b2015-01-21 13:07:04 +000046 void SetRemoteSSRC(uint32_t ssrc);
wu@webrtc.org822fbd82013-08-15 23:38:54 +000047 uint32_t RemoteSSRC() const;
niklase@google.com470e71d2011-07-07 08:21:25 +000048
pbos@webrtc.org2f446732013-04-08 11:08:41 +000049 int32_t IncomingRTCPPacket(
50 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation,
51 RTCPUtility::RTCPParserV2 *rtcpParser);
niklase@google.com470e71d2011-07-07 08:21:25 +000052
asapersson@webrtc.orgdf7b65b2015-01-21 13:07:04 +000053 void TriggerCallbacksFromRTCPPacket(
54 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation);
niklase@google.com470e71d2011-07-07 08:21:25 +000055
56 // get received cname
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +000057 int32_t CNAME(uint32_t remoteSSRC, char cName[RTCP_CNAME_SIZE]) const;
niklase@google.com470e71d2011-07-07 08:21:25 +000058
59 // get received NTP
pbos@webrtc.org2f4b14e2014-07-15 15:25:39 +000060 bool NTP(uint32_t* ReceivedNTPsecs,
61 uint32_t* ReceivedNTPfrac,
62 uint32_t* RTCPArrivalTimeSecs,
63 uint32_t* RTCPArrivalTimeFrac,
64 uint32_t* rtcp_timestamp) const;
niklase@google.com470e71d2011-07-07 08:21:25 +000065
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +000066 bool LastReceivedXrReferenceTimeInfo(RtcpReceiveTimeInfo* info) const;
67
niklase@google.com470e71d2011-07-07 08:21:25 +000068 // get rtt
wu@webrtc.org822fbd82013-08-15 23:38:54 +000069 int32_t RTT(uint32_t remoteSSRC,
pkasting@chromium.org16825b12015-01-12 21:51:21 +000070 int64_t* RTT,
71 int64_t* avgRTT,
72 int64_t* minRTT,
73 int64_t* maxRTT) const;
niklase@google.com470e71d2011-07-07 08:21:25 +000074
pbos@webrtc.org2f446732013-04-08 11:08:41 +000075 int32_t SenderInfoReceived(RTCPSenderInfo* senderInfo) const;
niklase@google.com470e71d2011-07-07 08:21:25 +000076
Danil Chapovalovc1e55c72016-03-09 15:14:35 +010077 void SetRtcpXrRrtrStatus(bool enable);
pkasting@chromium.org16825b12015-01-12 21:51:21 +000078 bool GetAndResetXrRrRtt(int64_t* rtt_ms);
asapersson@webrtc.org7d6bd222013-10-31 12:14:34 +000079
niklase@google.com470e71d2011-07-07 08:21:25 +000080 // get statistics
pbos@webrtc.org2f446732013-04-08 11:08:41 +000081 int32_t StatisticsReceived(
perkj@webrtc.orgce5990c2012-01-11 13:00:08 +000082 std::vector<RTCPReportBlock>* receiveBlocks) const;
83
mflodman@webrtc.org2f225ca2013-01-09 13:54:43 +000084 // Returns true if we haven't received an RTCP RR for several RTCP
85 // intervals, but only triggers true once.
86 bool RtcpRrTimeout(int64_t rtcp_interval_ms);
87
88 // Returns true if we haven't received an RTCP RR telling the receive side
89 // has not received RTP packets for too long, i.e. extended highest sequence
90 // number hasn't increased for several RTCP intervals. The function only
91 // returns true once until a new RR is received.
92 bool RtcpRrSequenceNumberTimeout(int64_t rtcp_interval_ms);
93
niklase@google.com470e71d2011-07-07 08:21:25 +000094 // Get TMMBR
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +000095 int32_t TMMBRReceived(uint32_t size,
96 uint32_t accNumCandidates,
pbos@webrtc.org2f446732013-04-08 11:08:41 +000097 TMMBRSet* candidateSet) const;
niklase@google.com470e71d2011-07-07 08:21:25 +000098
99 bool UpdateRTCPReceiveInformationTimers();
100
danilchap6db6cdc2015-12-15 02:54:47 -0800101 int32_t BoundingSet(bool* tmmbrOwner, TMMBRSet* boundingSetRec);
niklase@google.com470e71d2011-07-07 08:21:25 +0000102
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000103 int32_t UpdateTMMBR();
niklase@google.com470e71d2011-07-07 08:21:25 +0000104
sprang@webrtc.orga6ad6e52013-12-05 09:48:44 +0000105 void RegisterRtcpStatisticsCallback(RtcpStatisticsCallback* callback);
106 RtcpStatisticsCallback* GetRtcpStatisticsCallback();
107
niklase@google.com470e71d2011-07-07 08:21:25 +0000108protected:
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000109 RTCPUtility::RTCPCnameInformation* CreateCnameInformation(uint32_t remoteSSRC);
110 RTCPUtility::RTCPCnameInformation* GetCnameInformation(
111 uint32_t remoteSSRC) const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000112
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000113 RTCPHelp::RTCPReceiveInformation* CreateReceiveInformation(
114 uint32_t remoteSSRC);
115 RTCPHelp::RTCPReceiveInformation* GetReceiveInformation(uint32_t remoteSSRC);
niklase@google.com470e71d2011-07-07 08:21:25 +0000116
asapersson@webrtc.orgdf7b65b2015-01-21 13:07:04 +0000117 void UpdateReceiveInformation(
118 RTCPHelp::RTCPReceiveInformation& receiveInformation);
niklase@google.com470e71d2011-07-07 08:21:25 +0000119
asapersson@webrtc.orgdf7b65b2015-01-21 13:07:04 +0000120 void HandleSenderReceiverReport(
121 RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700122 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
123 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000124
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000125 void HandleReportBlock(
126 const RTCPUtility::RTCPPacket& rtcpPacket,
127 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation,
sprang7dc39f32015-10-13 09:17:48 -0700128 uint32_t remoteSSRC)
129 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000130
Erik Språnga38233a2015-07-24 09:58:18 +0200131 void HandleSDES(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700132 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
133 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000134
sprang7dc39f32015-10-13 09:17:48 -0700135 void HandleSDESChunk(RTCPUtility::RTCPParserV2& rtcpParser)
136 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000137
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000138 void HandleXrHeader(RTCPUtility::RTCPParserV2& parser,
sprang7dc39f32015-10-13 09:17:48 -0700139 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
140 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000141
142 void HandleXrReceiveReferenceTime(
143 RTCPUtility::RTCPParserV2& parser,
sprang7dc39f32015-10-13 09:17:48 -0700144 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
145 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000146
147 void HandleXrDlrrReportBlock(
148 RTCPUtility::RTCPParserV2& parser,
sprang7dc39f32015-10-13 09:17:48 -0700149 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
150 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000151
152 void HandleXrDlrrReportBlockItem(
153 const RTCPUtility::RTCPPacket& packet,
sprang7dc39f32015-10-13 09:17:48 -0700154 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
155 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000156
asapersson@webrtc.orgdf7b65b2015-01-21 13:07:04 +0000157 void HandleXRVOIPMetric(
158 RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700159 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
160 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000161
162 void HandleNACK(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700163 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
164 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000165
166 void HandleNACKItem(const RTCPUtility::RTCPPacket& rtcpPacket,
sprang7dc39f32015-10-13 09:17:48 -0700167 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
168 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000169
sprang7dc39f32015-10-13 09:17:48 -0700170 void HandleBYE(RTCPUtility::RTCPParserV2& rtcpParser)
171 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000172
173 void HandlePLI(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700174 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
175 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000176
177 void HandleSLI(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700178 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
179 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000180
181 void HandleSLIItem(const RTCPUtility::RTCPPacket& rtcpPacket,
sprang7dc39f32015-10-13 09:17:48 -0700182 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
183 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000184
185 void HandleRPSI(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700186 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
187 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000188
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000189 void HandlePsfbApp(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700190 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
191 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000192
193 void HandleREMBItem(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700194 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
195 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000196
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000197 void HandleIJ(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700198 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
199 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000200
201 void HandleIJItem(const RTCPUtility::RTCPPacket& rtcpPacket,
sprang7dc39f32015-10-13 09:17:48 -0700202 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
203 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000204
niklase@google.com470e71d2011-07-07 08:21:25 +0000205 void HandleTMMBR(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700206 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
207 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000208
209 void HandleTMMBRItem(RTCPHelp::RTCPReceiveInformation& receiveInfo,
210 const RTCPUtility::RTCPPacket& rtcpPacket,
211 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation,
sprang7dc39f32015-10-13 09:17:48 -0700212 uint32_t senderSSRC)
213 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000214
hta@webrtc.org9d54cd12012-04-30 08:24:55 +0000215 void HandleTMMBN(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700216 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
217 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000218
219 void HandleSR_REQ(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700220 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
221 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000222
223 void HandleTMMBNItem(RTCPHelp::RTCPReceiveInformation& receiveInfo,
sprang7dc39f32015-10-13 09:17:48 -0700224 const RTCPUtility::RTCPPacket& rtcpPacket)
225 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000226
227 void HandleFIR(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700228 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
229 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000230
pwestin@webrtc.orgb2179c22012-05-21 12:00:49 +0000231 void HandleFIRItem(RTCPHelp::RTCPReceiveInformation* receiveInfo,
niklase@google.com470e71d2011-07-07 08:21:25 +0000232 const RTCPUtility::RTCPPacket& rtcpPacket,
sprang7dc39f32015-10-13 09:17:48 -0700233 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
234 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000235
236 void HandleAPP(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700237 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
238 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000239
240 void HandleAPPItem(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700241 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
242 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000243
Erik Språng6b8d3552015-09-24 15:06:57 +0200244 void HandleTransportFeedback(
245 RTCPUtility::RTCPParserV2* rtcp_parser,
sprang7dc39f32015-10-13 09:17:48 -0700246 RTCPHelp::RTCPPacketInformation* rtcp_packet_information)
247 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
Erik Språng6b8d3552015-09-24 15:06:57 +0200248
pwestin@webrtc.org26f8d9c2012-01-19 15:53:09 +0000249 private:
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000250 typedef std::map<uint32_t, RTCPHelp::RTCPReceiveInformation*>
stefan@webrtc.orgb5865072013-02-01 14:33:42 +0000251 ReceivedInfoMap;
asapersson@webrtc.orgcb791412014-12-18 14:30:32 +0000252 // RTCP report block information mapped by remote SSRC.
253 typedef std::map<uint32_t, RTCPHelp::RTCPReportBlockInformation*>
254 ReportBlockInfoMap;
255 // RTCP report block information map mapped by source SSRC.
256 typedef std::map<uint32_t, ReportBlockInfoMap> ReportBlockMap;
257
258 RTCPHelp::RTCPReportBlockInformation* CreateOrGetReportBlockInformation(
259 uint32_t remote_ssrc, uint32_t source_ssrc)
260 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
261 RTCPHelp::RTCPReportBlockInformation* GetReportBlockInformation(
262 uint32_t remote_ssrc, uint32_t source_ssrc) const
263 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
264
Peter Boströmfe7a80c2015-04-23 17:53:17 +0200265 Clock* const _clock;
266 const bool receiver_only_;
asapersson@webrtc.orgcb791412014-12-18 14:30:32 +0000267 int64_t _lastReceived;
268 ModuleRtpRtcpImpl& _rtpRtcp;
niklase@google.com470e71d2011-07-07 08:21:25 +0000269
pwestin@webrtc.org26f8d9c2012-01-19 15:53:09 +0000270 CriticalSectionWrapper* _criticalSectionFeedbacks;
mflodman@webrtc.org96abda02015-02-25 13:50:10 +0000271 RtcpBandwidthObserver* const _cbRtcpBandwidthObserver;
272 RtcpIntraFrameObserver* const _cbRtcpIntraFrameObserver;
Erik Språng6b8d3552015-09-24 15:06:57 +0200273 TransportFeedbackObserver* const _cbTransportFeedbackObserver;
niklase@google.com470e71d2011-07-07 08:21:25 +0000274
pwestin@webrtc.org26f8d9c2012-01-19 15:53:09 +0000275 CriticalSectionWrapper* _criticalSectionRTCPReceiver;
sprang7dc39f32015-10-13 09:17:48 -0700276 uint32_t main_ssrc_ GUARDED_BY(_criticalSectionRTCPReceiver);
277 uint32_t _remoteSSRC GUARDED_BY(_criticalSectionRTCPReceiver);
278 std::set<uint32_t> registered_ssrcs_ GUARDED_BY(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000279
pwestin@webrtc.org26f8d9c2012-01-19 15:53:09 +0000280 // Received send report
281 RTCPSenderInfo _remoteSenderInfo;
282 // when did we receive the last send report
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000283 uint32_t _lastReceivedSRNTPsecs;
284 uint32_t _lastReceivedSRNTPfrac;
niklase@google.com470e71d2011-07-07 08:21:25 +0000285
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000286 // Received XR receive time report.
287 RtcpReceiveTimeInfo _remoteXRReceiveTimeInfo;
288 // Time when the report was received.
289 uint32_t _lastReceivedXRNTPsecs;
290 uint32_t _lastReceivedXRNTPfrac;
asapersson@webrtc.org7d6bd222013-10-31 12:14:34 +0000291 // Estimated rtt, zero when there is no valid estimate.
Danil Chapovalovc1e55c72016-03-09 15:14:35 +0100292 bool xr_rrtr_status_ GUARDED_BY(_criticalSectionRTCPReceiver);
pkasting@chromium.org16825b12015-01-12 21:51:21 +0000293 int64_t xr_rr_rtt_ms_;
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000294
pwestin@webrtc.org26f8d9c2012-01-19 15:53:09 +0000295 // Received report blocks.
asapersson@webrtc.orgcb791412014-12-18 14:30:32 +0000296 ReportBlockMap _receivedReportBlockMap
297 GUARDED_BY(_criticalSectionRTCPReceiver);
stefan@webrtc.orgb5865072013-02-01 14:33:42 +0000298 ReceivedInfoMap _receivedInfoMap;
asapersson@webrtc.orgcb791412014-12-18 14:30:32 +0000299 std::map<uint32_t, RTCPUtility::RTCPCnameInformation*> _receivedCnameMap;
niklase@google.com470e71d2011-07-07 08:21:25 +0000300
mflodman@webrtc.org2f225ca2013-01-09 13:54:43 +0000301 // The last time we received an RTCP RR.
302 int64_t _lastReceivedRrMs;
303
asapersson@webrtc.orgcb791412014-12-18 14:30:32 +0000304 // The time we last received an RTCP RR telling we have successfully
mflodman@webrtc.org2f225ca2013-01-09 13:54:43 +0000305 // delivered RTP packet to the remote side.
306 int64_t _lastIncreasedSequenceNumberMs;
stefan@webrtc.org8ca8a712013-04-23 16:48:32 +0000307
pbos@webrtc.orga28a91d2015-02-17 14:45:08 +0000308 RtcpStatisticsCallback* stats_callback_ GUARDED_BY(_criticalSectionFeedbacks);
asapersson@webrtc.org8098e072014-02-19 11:59:02 +0000309
pbos@webrtc.org1d0fa5d2015-02-19 12:47:00 +0000310 RtcpPacketTypeCounterObserver* const packet_type_counter_observer_;
asapersson@webrtc.org8098e072014-02-19 11:59:02 +0000311 RtcpPacketTypeCounter packet_type_counter_;
asapersson@webrtc.org2dd31342014-10-29 12:42:30 +0000312
313 RTCPUtility::NackStats nack_stats_;
Erik Språng6b8d3552015-09-24 15:06:57 +0200314
315 size_t num_skipped_packets_;
316 int64_t last_skipped_packets_warning_;
niklase@google.com470e71d2011-07-07 08:21:25 +0000317};
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +0000318} // namespace webrtc
niklase@google.com470e71d2011-07-07 08:21:25 +0000319#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_RECEIVER_H_