blob: 28c28cb69bb24d49d8fd6467e9bc724a164523a1 [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
danilchap7c9426c2016-04-14 03:05:31 -070018#include "webrtc/base/criticalsection.h"
asapersson@webrtc.orgcb791412014-12-18 14:30:32 +000019#include "webrtc/base/thread_annotations.h"
Henrik Kjellanderff761fb2015-11-04 08:31:52 +010020#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
pbos@webrtc.orga048d7c2013-05-29 14:27:38 +000021#include "webrtc/modules/rtp_rtcp/source/rtcp_receiver_help.h"
22#include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h"
23#include "webrtc/modules/rtp_rtcp/source/rtp_utility.h"
24#include "webrtc/modules/rtp_rtcp/source/tmmbr_help.h"
25#include "webrtc/typedefs.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000026
27namespace webrtc {
pwestin@webrtc.org741da942011-09-20 13:52:04 +000028class ModuleRtpRtcpImpl;
29
pwestin@webrtc.orgcac78782012-04-05 08:30:10 +000030class RTCPReceiver : public TMMBRHelp
niklase@google.com470e71d2011-07-07 08:21:25 +000031{
32public:
Peter Boströmac547a62015-09-17 23:03:57 +020033 RTCPReceiver(Clock* clock,
Peter Boströmfe7a80c2015-04-23 17:53:17 +020034 bool receiver_only,
pbos@webrtc.org1d0fa5d2015-02-19 12:47:00 +000035 RtcpPacketTypeCounterObserver* packet_type_counter_observer,
mflodman@webrtc.org96abda02015-02-25 13:50:10 +000036 RtcpBandwidthObserver* rtcp_bandwidth_observer,
37 RtcpIntraFrameObserver* rtcp_intra_frame_observer,
Erik Språng6b8d3552015-09-24 15:06:57 +020038 TransportFeedbackObserver* transport_feedback_observer,
pbos@webrtc.org1d0fa5d2015-02-19 12:47:00 +000039 ModuleRtpRtcpImpl* owner);
niklase@google.com470e71d2011-07-07 08:21:25 +000040 virtual ~RTCPReceiver();
41
pbos@webrtc.org2f446732013-04-08 11:08:41 +000042 int64_t LastReceived();
43 int64_t LastReceivedReceiverReport() const;
niklase@google.com470e71d2011-07-07 08:21:25 +000044
stefan@webrtc.org28a331e2013-09-17 07:49:56 +000045 void SetSsrcs(uint32_t main_ssrc,
46 const std::set<uint32_t>& registered_ssrcs);
asapersson@webrtc.orgdf7b65b2015-01-21 13:07:04 +000047 void SetRemoteSSRC(uint32_t ssrc);
wu@webrtc.org822fbd82013-08-15 23:38:54 +000048 uint32_t RemoteSSRC() const;
niklase@google.com470e71d2011-07-07 08:21:25 +000049
pbos@webrtc.org2f446732013-04-08 11:08:41 +000050 int32_t IncomingRTCPPacket(
51 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation,
52 RTCPUtility::RTCPParserV2 *rtcpParser);
niklase@google.com470e71d2011-07-07 08:21:25 +000053
asapersson@webrtc.orgdf7b65b2015-01-21 13:07:04 +000054 void TriggerCallbacksFromRTCPPacket(
55 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation);
niklase@google.com470e71d2011-07-07 08:21:25 +000056
57 // get received cname
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +000058 int32_t CNAME(uint32_t remoteSSRC, char cName[RTCP_CNAME_SIZE]) const;
niklase@google.com470e71d2011-07-07 08:21:25 +000059
60 // get received NTP
pbos@webrtc.org2f4b14e2014-07-15 15:25:39 +000061 bool NTP(uint32_t* ReceivedNTPsecs,
62 uint32_t* ReceivedNTPfrac,
63 uint32_t* RTCPArrivalTimeSecs,
64 uint32_t* RTCPArrivalTimeFrac,
65 uint32_t* rtcp_timestamp) const;
niklase@google.com470e71d2011-07-07 08:21:25 +000066
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +000067 bool LastReceivedXrReferenceTimeInfo(RtcpReceiveTimeInfo* info) const;
68
niklase@google.com470e71d2011-07-07 08:21:25 +000069 // get rtt
wu@webrtc.org822fbd82013-08-15 23:38:54 +000070 int32_t RTT(uint32_t remoteSSRC,
pkasting@chromium.org16825b12015-01-12 21:51:21 +000071 int64_t* RTT,
72 int64_t* avgRTT,
73 int64_t* minRTT,
74 int64_t* maxRTT) const;
niklase@google.com470e71d2011-07-07 08:21:25 +000075
pbos@webrtc.org2f446732013-04-08 11:08:41 +000076 int32_t SenderInfoReceived(RTCPSenderInfo* senderInfo) const;
niklase@google.com470e71d2011-07-07 08:21:25 +000077
Danil Chapovalovc1e55c72016-03-09 15:14:35 +010078 void SetRtcpXrRrtrStatus(bool enable);
pkasting@chromium.org16825b12015-01-12 21:51:21 +000079 bool GetAndResetXrRrRtt(int64_t* rtt_ms);
asapersson@webrtc.org7d6bd222013-10-31 12:14:34 +000080
niklase@google.com470e71d2011-07-07 08:21:25 +000081 // get statistics
pbos@webrtc.org2f446732013-04-08 11:08:41 +000082 int32_t StatisticsReceived(
perkj@webrtc.orgce5990c2012-01-11 13:00:08 +000083 std::vector<RTCPReportBlock>* receiveBlocks) const;
84
mflodman@webrtc.org2f225ca2013-01-09 13:54:43 +000085 // Returns true if we haven't received an RTCP RR for several RTCP
86 // intervals, but only triggers true once.
87 bool RtcpRrTimeout(int64_t rtcp_interval_ms);
88
89 // Returns true if we haven't received an RTCP RR telling the receive side
90 // has not received RTP packets for too long, i.e. extended highest sequence
91 // number hasn't increased for several RTCP intervals. The function only
92 // returns true once until a new RR is received.
93 bool RtcpRrSequenceNumberTimeout(int64_t rtcp_interval_ms);
94
niklase@google.com470e71d2011-07-07 08:21:25 +000095 // Get TMMBR
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +000096 int32_t TMMBRReceived(uint32_t size,
97 uint32_t accNumCandidates,
pbos@webrtc.org2f446732013-04-08 11:08:41 +000098 TMMBRSet* candidateSet) const;
niklase@google.com470e71d2011-07-07 08:21:25 +000099
100 bool UpdateRTCPReceiveInformationTimers();
101
danilchap6db6cdc2015-12-15 02:54:47 -0800102 int32_t BoundingSet(bool* tmmbrOwner, TMMBRSet* boundingSetRec);
niklase@google.com470e71d2011-07-07 08:21:25 +0000103
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000104 int32_t UpdateTMMBR();
niklase@google.com470e71d2011-07-07 08:21:25 +0000105
sprang@webrtc.orga6ad6e52013-12-05 09:48:44 +0000106 void RegisterRtcpStatisticsCallback(RtcpStatisticsCallback* callback);
107 RtcpStatisticsCallback* GetRtcpStatisticsCallback();
108
niklase@google.com470e71d2011-07-07 08:21:25 +0000109protected:
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000110 RTCPUtility::RTCPCnameInformation* CreateCnameInformation(uint32_t remoteSSRC);
111 RTCPUtility::RTCPCnameInformation* GetCnameInformation(
112 uint32_t remoteSSRC) const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000113
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000114 RTCPHelp::RTCPReceiveInformation* CreateReceiveInformation(
115 uint32_t remoteSSRC);
116 RTCPHelp::RTCPReceiveInformation* GetReceiveInformation(uint32_t remoteSSRC);
niklase@google.com470e71d2011-07-07 08:21:25 +0000117
asapersson@webrtc.orgdf7b65b2015-01-21 13:07:04 +0000118 void UpdateReceiveInformation(
119 RTCPHelp::RTCPReceiveInformation& receiveInformation);
niklase@google.com470e71d2011-07-07 08:21:25 +0000120
asapersson@webrtc.orgdf7b65b2015-01-21 13:07:04 +0000121 void HandleSenderReceiverReport(
122 RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700123 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
124 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000125
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000126 void HandleReportBlock(
127 const RTCPUtility::RTCPPacket& rtcpPacket,
128 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation,
sprang7dc39f32015-10-13 09:17:48 -0700129 uint32_t remoteSSRC)
130 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000131
Erik Språnga38233a2015-07-24 09:58:18 +0200132 void HandleSDES(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700133 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
134 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000135
sprang7dc39f32015-10-13 09:17:48 -0700136 void HandleSDESChunk(RTCPUtility::RTCPParserV2& rtcpParser)
137 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000138
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000139 void HandleXrHeader(RTCPUtility::RTCPParserV2& parser,
sprang7dc39f32015-10-13 09:17:48 -0700140 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
141 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000142
143 void HandleXrReceiveReferenceTime(
144 RTCPUtility::RTCPParserV2& parser,
sprang7dc39f32015-10-13 09:17:48 -0700145 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
146 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000147
148 void HandleXrDlrrReportBlock(
149 RTCPUtility::RTCPParserV2& parser,
sprang7dc39f32015-10-13 09:17:48 -0700150 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
151 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000152
153 void HandleXrDlrrReportBlockItem(
154 const RTCPUtility::RTCPPacket& packet,
sprang7dc39f32015-10-13 09:17:48 -0700155 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
156 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000157
asapersson@webrtc.orgdf7b65b2015-01-21 13:07:04 +0000158 void HandleXRVOIPMetric(
159 RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700160 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
161 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000162
163 void HandleNACK(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700164 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
165 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000166
167 void HandleNACKItem(const RTCPUtility::RTCPPacket& rtcpPacket,
sprang7dc39f32015-10-13 09:17:48 -0700168 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
169 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000170
sprang7dc39f32015-10-13 09:17:48 -0700171 void HandleBYE(RTCPUtility::RTCPParserV2& rtcpParser)
172 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000173
174 void HandlePLI(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700175 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
176 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000177
178 void HandleSLI(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700179 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
180 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000181
182 void HandleSLIItem(const RTCPUtility::RTCPPacket& rtcpPacket,
sprang7dc39f32015-10-13 09:17:48 -0700183 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
184 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000185
186 void HandleRPSI(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700187 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
188 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000189
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000190 void HandlePsfbApp(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700191 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
192 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000193
194 void HandleREMBItem(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700195 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
196 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000197
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000198 void HandleIJ(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700199 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
200 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000201
202 void HandleIJItem(const RTCPUtility::RTCPPacket& rtcpPacket,
sprang7dc39f32015-10-13 09:17:48 -0700203 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
204 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000205
niklase@google.com470e71d2011-07-07 08:21:25 +0000206 void HandleTMMBR(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700207 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
208 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000209
210 void HandleTMMBRItem(RTCPHelp::RTCPReceiveInformation& receiveInfo,
211 const RTCPUtility::RTCPPacket& rtcpPacket,
212 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation,
sprang7dc39f32015-10-13 09:17:48 -0700213 uint32_t senderSSRC)
214 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000215
hta@webrtc.org9d54cd12012-04-30 08:24:55 +0000216 void HandleTMMBN(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700217 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
218 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000219
220 void HandleSR_REQ(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700221 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
222 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000223
224 void HandleTMMBNItem(RTCPHelp::RTCPReceiveInformation& receiveInfo,
sprang7dc39f32015-10-13 09:17:48 -0700225 const RTCPUtility::RTCPPacket& rtcpPacket)
226 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000227
228 void HandleFIR(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700229 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
230 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000231
pwestin@webrtc.orgb2179c22012-05-21 12:00:49 +0000232 void HandleFIRItem(RTCPHelp::RTCPReceiveInformation* receiveInfo,
niklase@google.com470e71d2011-07-07 08:21:25 +0000233 const RTCPUtility::RTCPPacket& rtcpPacket,
sprang7dc39f32015-10-13 09:17:48 -0700234 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
235 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000236
237 void HandleAPP(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700238 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
239 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000240
241 void HandleAPPItem(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700242 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
243 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000244
Erik Språng6b8d3552015-09-24 15:06:57 +0200245 void HandleTransportFeedback(
246 RTCPUtility::RTCPParserV2* rtcp_parser,
sprang7dc39f32015-10-13 09:17:48 -0700247 RTCPHelp::RTCPPacketInformation* rtcp_packet_information)
248 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
Erik Språng6b8d3552015-09-24 15:06:57 +0200249
pwestin@webrtc.org26f8d9c2012-01-19 15:53:09 +0000250 private:
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000251 typedef std::map<uint32_t, RTCPHelp::RTCPReceiveInformation*>
stefan@webrtc.orgb5865072013-02-01 14:33:42 +0000252 ReceivedInfoMap;
asapersson@webrtc.orgcb791412014-12-18 14:30:32 +0000253 // RTCP report block information mapped by remote SSRC.
254 typedef std::map<uint32_t, RTCPHelp::RTCPReportBlockInformation*>
255 ReportBlockInfoMap;
256 // RTCP report block information map mapped by source SSRC.
257 typedef std::map<uint32_t, ReportBlockInfoMap> ReportBlockMap;
258
259 RTCPHelp::RTCPReportBlockInformation* CreateOrGetReportBlockInformation(
260 uint32_t remote_ssrc, uint32_t source_ssrc)
261 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
262 RTCPHelp::RTCPReportBlockInformation* GetReportBlockInformation(
263 uint32_t remote_ssrc, uint32_t source_ssrc) const
264 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
265
Peter Boströmfe7a80c2015-04-23 17:53:17 +0200266 Clock* const _clock;
267 const bool receiver_only_;
asapersson@webrtc.orgcb791412014-12-18 14:30:32 +0000268 int64_t _lastReceived;
269 ModuleRtpRtcpImpl& _rtpRtcp;
niklase@google.com470e71d2011-07-07 08:21:25 +0000270
danilchap7c9426c2016-04-14 03:05:31 -0700271 rtc::CriticalSection _criticalSectionFeedbacks;
mflodman@webrtc.org96abda02015-02-25 13:50:10 +0000272 RtcpBandwidthObserver* const _cbRtcpBandwidthObserver;
273 RtcpIntraFrameObserver* const _cbRtcpIntraFrameObserver;
Erik Språng6b8d3552015-09-24 15:06:57 +0200274 TransportFeedbackObserver* const _cbTransportFeedbackObserver;
niklase@google.com470e71d2011-07-07 08:21:25 +0000275
danilchap7c9426c2016-04-14 03:05:31 -0700276 rtc::CriticalSection _criticalSectionRTCPReceiver;
sprang7dc39f32015-10-13 09:17:48 -0700277 uint32_t main_ssrc_ GUARDED_BY(_criticalSectionRTCPReceiver);
278 uint32_t _remoteSSRC GUARDED_BY(_criticalSectionRTCPReceiver);
279 std::set<uint32_t> registered_ssrcs_ GUARDED_BY(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000280
pwestin@webrtc.org26f8d9c2012-01-19 15:53:09 +0000281 // Received send report
282 RTCPSenderInfo _remoteSenderInfo;
283 // when did we receive the last send report
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000284 uint32_t _lastReceivedSRNTPsecs;
285 uint32_t _lastReceivedSRNTPfrac;
niklase@google.com470e71d2011-07-07 08:21:25 +0000286
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000287 // Received XR receive time report.
288 RtcpReceiveTimeInfo _remoteXRReceiveTimeInfo;
289 // Time when the report was received.
290 uint32_t _lastReceivedXRNTPsecs;
291 uint32_t _lastReceivedXRNTPfrac;
asapersson@webrtc.org7d6bd222013-10-31 12:14:34 +0000292 // Estimated rtt, zero when there is no valid estimate.
Danil Chapovalovc1e55c72016-03-09 15:14:35 +0100293 bool xr_rrtr_status_ GUARDED_BY(_criticalSectionRTCPReceiver);
pkasting@chromium.org16825b12015-01-12 21:51:21 +0000294 int64_t xr_rr_rtt_ms_;
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000295
pwestin@webrtc.org26f8d9c2012-01-19 15:53:09 +0000296 // Received report blocks.
asapersson@webrtc.orgcb791412014-12-18 14:30:32 +0000297 ReportBlockMap _receivedReportBlockMap
298 GUARDED_BY(_criticalSectionRTCPReceiver);
stefan@webrtc.orgb5865072013-02-01 14:33:42 +0000299 ReceivedInfoMap _receivedInfoMap;
asapersson@webrtc.orgcb791412014-12-18 14:30:32 +0000300 std::map<uint32_t, RTCPUtility::RTCPCnameInformation*> _receivedCnameMap;
niklase@google.com470e71d2011-07-07 08:21:25 +0000301
mflodman@webrtc.org2f225ca2013-01-09 13:54:43 +0000302 // The last time we received an RTCP RR.
303 int64_t _lastReceivedRrMs;
304
asapersson@webrtc.orgcb791412014-12-18 14:30:32 +0000305 // The time we last received an RTCP RR telling we have successfully
mflodman@webrtc.org2f225ca2013-01-09 13:54:43 +0000306 // delivered RTP packet to the remote side.
307 int64_t _lastIncreasedSequenceNumberMs;
stefan@webrtc.org8ca8a712013-04-23 16:48:32 +0000308
pbos@webrtc.orga28a91d2015-02-17 14:45:08 +0000309 RtcpStatisticsCallback* stats_callback_ GUARDED_BY(_criticalSectionFeedbacks);
asapersson@webrtc.org8098e072014-02-19 11:59:02 +0000310
pbos@webrtc.org1d0fa5d2015-02-19 12:47:00 +0000311 RtcpPacketTypeCounterObserver* const packet_type_counter_observer_;
asapersson@webrtc.org8098e072014-02-19 11:59:02 +0000312 RtcpPacketTypeCounter packet_type_counter_;
asapersson@webrtc.org2dd31342014-10-29 12:42:30 +0000313
314 RTCPUtility::NackStats nack_stats_;
Erik Språng6b8d3552015-09-24 15:06:57 +0200315
316 size_t num_skipped_packets_;
317 int64_t last_skipped_packets_warning_;
niklase@google.com470e71d2011-07-07 08:21:25 +0000318};
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +0000319} // namespace webrtc
niklase@google.com470e71d2011-07-07 08:21:25 +0000320#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_RECEIVER_H_