blob: f66df031bc230482289630695df04b66162c5b67 [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"
pbos@webrtc.orga048d7c2013-05-29 14:27:38 +000024#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
danilchap13deaad2016-05-24 13:25:27 -070029class RTCPReceiver
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
danilchap287e5482016-08-16 15:15:39 -070095 std::vector<rtcp::TmmbItem> TMMBRReceived() const;
niklase@google.com470e71d2011-07-07 08:21:25 +000096
97 bool UpdateRTCPReceiveInformationTimers();
98
danilchap6db6cdc2015-12-15 02:54:47 -080099 int32_t BoundingSet(bool* tmmbrOwner, TMMBRSet* boundingSetRec);
niklase@google.com470e71d2011-07-07 08:21:25 +0000100
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000101 int32_t UpdateTMMBR();
niklase@google.com470e71d2011-07-07 08:21:25 +0000102
sprang@webrtc.orga6ad6e52013-12-05 09:48:44 +0000103 void RegisterRtcpStatisticsCallback(RtcpStatisticsCallback* callback);
104 RtcpStatisticsCallback* GetRtcpStatisticsCallback();
105
niklase@google.com470e71d2011-07-07 08:21:25 +0000106protected:
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000107 RTCPUtility::RTCPCnameInformation* CreateCnameInformation(uint32_t remoteSSRC);
108 RTCPUtility::RTCPCnameInformation* GetCnameInformation(
109 uint32_t remoteSSRC) const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000110
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000111 RTCPHelp::RTCPReceiveInformation* CreateReceiveInformation(
112 uint32_t remoteSSRC);
113 RTCPHelp::RTCPReceiveInformation* GetReceiveInformation(uint32_t remoteSSRC);
niklase@google.com470e71d2011-07-07 08:21:25 +0000114
asapersson@webrtc.orgdf7b65b2015-01-21 13:07:04 +0000115 void UpdateReceiveInformation(
116 RTCPHelp::RTCPReceiveInformation& receiveInformation);
niklase@google.com470e71d2011-07-07 08:21:25 +0000117
asapersson@webrtc.orgdf7b65b2015-01-21 13:07:04 +0000118 void HandleSenderReceiverReport(
119 RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700120 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
121 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000122
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000123 void HandleReportBlock(
124 const RTCPUtility::RTCPPacket& rtcpPacket,
125 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation,
sprang7dc39f32015-10-13 09:17:48 -0700126 uint32_t remoteSSRC)
127 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000128
Erik Språnga38233a2015-07-24 09:58:18 +0200129 void HandleSDES(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700130 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
131 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000132
sprang7dc39f32015-10-13 09:17:48 -0700133 void HandleSDESChunk(RTCPUtility::RTCPParserV2& rtcpParser)
134 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000135
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000136 void HandleXrHeader(RTCPUtility::RTCPParserV2& parser,
sprang7dc39f32015-10-13 09:17:48 -0700137 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
138 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000139
140 void HandleXrReceiveReferenceTime(
141 RTCPUtility::RTCPParserV2& parser,
sprang7dc39f32015-10-13 09:17:48 -0700142 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
143 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000144
145 void HandleXrDlrrReportBlock(
146 RTCPUtility::RTCPParserV2& parser,
sprang7dc39f32015-10-13 09:17:48 -0700147 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
148 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000149
150 void HandleXrDlrrReportBlockItem(
151 const RTCPUtility::RTCPPacket& packet,
sprang7dc39f32015-10-13 09:17:48 -0700152 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
153 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000154
asapersson@webrtc.orgdf7b65b2015-01-21 13:07:04 +0000155 void HandleXRVOIPMetric(
156 RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700157 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
158 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000159
160 void HandleNACK(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700161 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
162 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000163
164 void HandleNACKItem(const RTCPUtility::RTCPPacket& rtcpPacket,
sprang7dc39f32015-10-13 09:17:48 -0700165 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
166 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000167
sprang7dc39f32015-10-13 09:17:48 -0700168 void HandleBYE(RTCPUtility::RTCPParserV2& rtcpParser)
169 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000170
171 void HandlePLI(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700172 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
173 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000174
175 void HandleSLI(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700176 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
177 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000178
179 void HandleSLIItem(const RTCPUtility::RTCPPacket& rtcpPacket,
sprang7dc39f32015-10-13 09:17:48 -0700180 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
181 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000182
183 void HandleRPSI(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700184 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
185 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000186
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000187 void HandlePsfbApp(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700188 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
189 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000190
191 void HandleREMBItem(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700192 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
193 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000194
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000195 void HandleIJ(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700196 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
197 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000198
199 void HandleIJItem(const RTCPUtility::RTCPPacket& rtcpPacket,
sprang7dc39f32015-10-13 09:17:48 -0700200 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
201 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000202
niklase@google.com470e71d2011-07-07 08:21:25 +0000203 void HandleTMMBR(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700204 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
205 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000206
207 void HandleTMMBRItem(RTCPHelp::RTCPReceiveInformation& receiveInfo,
208 const RTCPUtility::RTCPPacket& rtcpPacket,
209 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation,
sprang7dc39f32015-10-13 09:17:48 -0700210 uint32_t senderSSRC)
211 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000212
hta@webrtc.org9d54cd12012-04-30 08:24:55 +0000213 void HandleTMMBN(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700214 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
215 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000216
217 void HandleSR_REQ(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700218 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
219 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000220
221 void HandleTMMBNItem(RTCPHelp::RTCPReceiveInformation& receiveInfo,
sprang7dc39f32015-10-13 09:17:48 -0700222 const RTCPUtility::RTCPPacket& rtcpPacket)
223 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000224
225 void HandleFIR(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700226 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
227 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000228
pwestin@webrtc.orgb2179c22012-05-21 12:00:49 +0000229 void HandleFIRItem(RTCPHelp::RTCPReceiveInformation* receiveInfo,
niklase@google.com470e71d2011-07-07 08:21:25 +0000230 const RTCPUtility::RTCPPacket& rtcpPacket,
sprang7dc39f32015-10-13 09:17:48 -0700231 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
232 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000233
234 void HandleAPP(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700235 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
236 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000237
238 void HandleAPPItem(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700239 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
240 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000241
Erik Språng6b8d3552015-09-24 15:06:57 +0200242 void HandleTransportFeedback(
243 RTCPUtility::RTCPParserV2* rtcp_parser,
sprang7dc39f32015-10-13 09:17:48 -0700244 RTCPHelp::RTCPPacketInformation* rtcp_packet_information)
245 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
Erik Språng6b8d3552015-09-24 15:06:57 +0200246
pwestin@webrtc.org26f8d9c2012-01-19 15:53:09 +0000247 private:
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000248 typedef std::map<uint32_t, RTCPHelp::RTCPReceiveInformation*>
stefan@webrtc.orgb5865072013-02-01 14:33:42 +0000249 ReceivedInfoMap;
asapersson@webrtc.orgcb791412014-12-18 14:30:32 +0000250 // RTCP report block information mapped by remote SSRC.
251 typedef std::map<uint32_t, RTCPHelp::RTCPReportBlockInformation*>
252 ReportBlockInfoMap;
253 // RTCP report block information map mapped by source SSRC.
254 typedef std::map<uint32_t, ReportBlockInfoMap> ReportBlockMap;
255
256 RTCPHelp::RTCPReportBlockInformation* CreateOrGetReportBlockInformation(
257 uint32_t remote_ssrc, uint32_t source_ssrc)
258 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
259 RTCPHelp::RTCPReportBlockInformation* GetReportBlockInformation(
260 uint32_t remote_ssrc, uint32_t source_ssrc) const
261 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
262
Peter Boströmfe7a80c2015-04-23 17:53:17 +0200263 Clock* const _clock;
264 const bool receiver_only_;
asapersson@webrtc.orgcb791412014-12-18 14:30:32 +0000265 int64_t _lastReceived;
266 ModuleRtpRtcpImpl& _rtpRtcp;
niklase@google.com470e71d2011-07-07 08:21:25 +0000267
danilchap7c9426c2016-04-14 03:05:31 -0700268 rtc::CriticalSection _criticalSectionFeedbacks;
mflodman@webrtc.org96abda02015-02-25 13:50:10 +0000269 RtcpBandwidthObserver* const _cbRtcpBandwidthObserver;
270 RtcpIntraFrameObserver* const _cbRtcpIntraFrameObserver;
Erik Språng6b8d3552015-09-24 15:06:57 +0200271 TransportFeedbackObserver* const _cbTransportFeedbackObserver;
niklase@google.com470e71d2011-07-07 08:21:25 +0000272
danilchap7c9426c2016-04-14 03:05:31 -0700273 rtc::CriticalSection _criticalSectionRTCPReceiver;
sprang7dc39f32015-10-13 09:17:48 -0700274 uint32_t main_ssrc_ GUARDED_BY(_criticalSectionRTCPReceiver);
275 uint32_t _remoteSSRC GUARDED_BY(_criticalSectionRTCPReceiver);
276 std::set<uint32_t> registered_ssrcs_ GUARDED_BY(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000277
pwestin@webrtc.org26f8d9c2012-01-19 15:53:09 +0000278 // Received send report
279 RTCPSenderInfo _remoteSenderInfo;
280 // when did we receive the last send report
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000281 uint32_t _lastReceivedSRNTPsecs;
282 uint32_t _lastReceivedSRNTPfrac;
niklase@google.com470e71d2011-07-07 08:21:25 +0000283
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000284 // Received XR receive time report.
285 RtcpReceiveTimeInfo _remoteXRReceiveTimeInfo;
286 // Time when the report was received.
287 uint32_t _lastReceivedXRNTPsecs;
288 uint32_t _lastReceivedXRNTPfrac;
asapersson@webrtc.org7d6bd222013-10-31 12:14:34 +0000289 // Estimated rtt, zero when there is no valid estimate.
Danil Chapovalovc1e55c72016-03-09 15:14:35 +0100290 bool xr_rrtr_status_ GUARDED_BY(_criticalSectionRTCPReceiver);
pkasting@chromium.org16825b12015-01-12 21:51:21 +0000291 int64_t xr_rr_rtt_ms_;
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000292
pwestin@webrtc.org26f8d9c2012-01-19 15:53:09 +0000293 // Received report blocks.
asapersson@webrtc.orgcb791412014-12-18 14:30:32 +0000294 ReportBlockMap _receivedReportBlockMap
295 GUARDED_BY(_criticalSectionRTCPReceiver);
stefan@webrtc.orgb5865072013-02-01 14:33:42 +0000296 ReceivedInfoMap _receivedInfoMap;
asapersson@webrtc.orgcb791412014-12-18 14:30:32 +0000297 std::map<uint32_t, RTCPUtility::RTCPCnameInformation*> _receivedCnameMap;
niklase@google.com470e71d2011-07-07 08:21:25 +0000298
mflodman@webrtc.org2f225ca2013-01-09 13:54:43 +0000299 // The last time we received an RTCP RR.
300 int64_t _lastReceivedRrMs;
301
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.
304 int64_t _lastIncreasedSequenceNumberMs;
stefan@webrtc.org8ca8a712013-04-23 16:48:32 +0000305
pbos@webrtc.orga28a91d2015-02-17 14:45:08 +0000306 RtcpStatisticsCallback* stats_callback_ GUARDED_BY(_criticalSectionFeedbacks);
asapersson@webrtc.org8098e072014-02-19 11:59:02 +0000307
pbos@webrtc.org1d0fa5d2015-02-19 12:47:00 +0000308 RtcpPacketTypeCounterObserver* const packet_type_counter_observer_;
asapersson@webrtc.org8098e072014-02-19 11:59:02 +0000309 RtcpPacketTypeCounter packet_type_counter_;
asapersson@webrtc.org2dd31342014-10-29 12:42:30 +0000310
311 RTCPUtility::NackStats nack_stats_;
Erik Språng6b8d3552015-09-24 15:06:57 +0200312
313 size_t num_skipped_packets_;
314 int64_t last_skipped_packets_warning_;
niklase@google.com470e71d2011-07-07 08:21:25 +0000315};
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +0000316} // namespace webrtc
niklase@google.com470e71d2011-07-07 08:21:25 +0000317#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_RECEIVER_H_