blob: b4025f7d78519c7e1e9323544053608d839437fe [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
danilchap2b616392016-08-18 06:17:42 -070099 std::vector<rtcp::TmmbItem> BoundingSet(bool* tmmbr_owner);
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 HandleSenderReceiverReport(
116 RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700117 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
118 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000119
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000120 void HandleReportBlock(
121 const RTCPUtility::RTCPPacket& rtcpPacket,
122 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation,
sprang7dc39f32015-10-13 09:17:48 -0700123 uint32_t remoteSSRC)
124 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000125
Erik Språnga38233a2015-07-24 09:58:18 +0200126 void HandleSDES(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700127 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
128 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000129
sprang7dc39f32015-10-13 09:17:48 -0700130 void HandleSDESChunk(RTCPUtility::RTCPParserV2& rtcpParser)
131 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000132
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000133 void HandleXrHeader(RTCPUtility::RTCPParserV2& parser,
sprang7dc39f32015-10-13 09:17:48 -0700134 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
135 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000136
137 void HandleXrReceiveReferenceTime(
138 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 HandleXrDlrrReportBlock(
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 HandleXrDlrrReportBlockItem(
148 const RTCPUtility::RTCPPacket& packet,
sprang7dc39f32015-10-13 09:17:48 -0700149 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
150 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000151
asapersson@webrtc.orgdf7b65b2015-01-21 13:07:04 +0000152 void HandleXRVOIPMetric(
153 RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700154 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
155 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000156
157 void HandleNACK(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700158 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
159 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000160
161 void HandleNACKItem(const RTCPUtility::RTCPPacket& rtcpPacket,
sprang7dc39f32015-10-13 09:17:48 -0700162 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
163 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000164
sprang7dc39f32015-10-13 09:17:48 -0700165 void HandleBYE(RTCPUtility::RTCPParserV2& rtcpParser)
166 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000167
168 void HandlePLI(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700169 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
170 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000171
172 void HandleSLI(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700173 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
174 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000175
176 void HandleSLIItem(const RTCPUtility::RTCPPacket& rtcpPacket,
sprang7dc39f32015-10-13 09:17:48 -0700177 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
178 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000179
180 void HandleRPSI(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700181 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
182 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000183
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000184 void HandlePsfbApp(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700185 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
186 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000187
188 void HandleREMBItem(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700189 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
190 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000191
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000192 void HandleIJ(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700193 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
194 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000195
196 void HandleIJItem(const RTCPUtility::RTCPPacket& rtcpPacket,
sprang7dc39f32015-10-13 09:17:48 -0700197 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
198 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000199
niklase@google.com470e71d2011-07-07 08:21:25 +0000200 void HandleTMMBR(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700201 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
202 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000203
204 void HandleTMMBRItem(RTCPHelp::RTCPReceiveInformation& receiveInfo,
205 const RTCPUtility::RTCPPacket& rtcpPacket,
206 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation,
sprang7dc39f32015-10-13 09:17:48 -0700207 uint32_t senderSSRC)
208 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000209
hta@webrtc.org9d54cd12012-04-30 08:24:55 +0000210 void HandleTMMBN(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700211 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
212 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000213
214 void HandleSR_REQ(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700215 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
216 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000217
218 void HandleTMMBNItem(RTCPHelp::RTCPReceiveInformation& receiveInfo,
sprang7dc39f32015-10-13 09:17:48 -0700219 const RTCPUtility::RTCPPacket& rtcpPacket)
220 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000221
222 void HandleFIR(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700223 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
224 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000225
pwestin@webrtc.orgb2179c22012-05-21 12:00:49 +0000226 void HandleFIRItem(RTCPHelp::RTCPReceiveInformation* receiveInfo,
niklase@google.com470e71d2011-07-07 08:21:25 +0000227 const RTCPUtility::RTCPPacket& rtcpPacket,
sprang7dc39f32015-10-13 09:17:48 -0700228 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
229 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000230
231 void HandleAPP(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700232 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
233 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000234
235 void HandleAPPItem(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700236 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
237 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000238
Erik Språng6b8d3552015-09-24 15:06:57 +0200239 void HandleTransportFeedback(
240 RTCPUtility::RTCPParserV2* rtcp_parser,
sprang7dc39f32015-10-13 09:17:48 -0700241 RTCPHelp::RTCPPacketInformation* rtcp_packet_information)
242 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
Erik Språng6b8d3552015-09-24 15:06:57 +0200243
pwestin@webrtc.org26f8d9c2012-01-19 15:53:09 +0000244 private:
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000245 typedef std::map<uint32_t, RTCPHelp::RTCPReceiveInformation*>
stefan@webrtc.orgb5865072013-02-01 14:33:42 +0000246 ReceivedInfoMap;
asapersson@webrtc.orgcb791412014-12-18 14:30:32 +0000247 // RTCP report block information mapped by remote SSRC.
248 typedef std::map<uint32_t, RTCPHelp::RTCPReportBlockInformation*>
249 ReportBlockInfoMap;
250 // RTCP report block information map mapped by source SSRC.
251 typedef std::map<uint32_t, ReportBlockInfoMap> ReportBlockMap;
252
253 RTCPHelp::RTCPReportBlockInformation* CreateOrGetReportBlockInformation(
254 uint32_t remote_ssrc, uint32_t source_ssrc)
255 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
256 RTCPHelp::RTCPReportBlockInformation* GetReportBlockInformation(
257 uint32_t remote_ssrc, uint32_t source_ssrc) const
258 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
259
Peter Boströmfe7a80c2015-04-23 17:53:17 +0200260 Clock* const _clock;
261 const bool receiver_only_;
asapersson@webrtc.orgcb791412014-12-18 14:30:32 +0000262 int64_t _lastReceived;
263 ModuleRtpRtcpImpl& _rtpRtcp;
niklase@google.com470e71d2011-07-07 08:21:25 +0000264
danilchap7c9426c2016-04-14 03:05:31 -0700265 rtc::CriticalSection _criticalSectionFeedbacks;
mflodman@webrtc.org96abda02015-02-25 13:50:10 +0000266 RtcpBandwidthObserver* const _cbRtcpBandwidthObserver;
267 RtcpIntraFrameObserver* const _cbRtcpIntraFrameObserver;
Erik Språng6b8d3552015-09-24 15:06:57 +0200268 TransportFeedbackObserver* const _cbTransportFeedbackObserver;
niklase@google.com470e71d2011-07-07 08:21:25 +0000269
danilchap7c9426c2016-04-14 03:05:31 -0700270 rtc::CriticalSection _criticalSectionRTCPReceiver;
sprang7dc39f32015-10-13 09:17:48 -0700271 uint32_t main_ssrc_ GUARDED_BY(_criticalSectionRTCPReceiver);
272 uint32_t _remoteSSRC GUARDED_BY(_criticalSectionRTCPReceiver);
273 std::set<uint32_t> registered_ssrcs_ GUARDED_BY(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000274
pwestin@webrtc.org26f8d9c2012-01-19 15:53:09 +0000275 // Received send report
276 RTCPSenderInfo _remoteSenderInfo;
277 // when did we receive the last send report
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000278 uint32_t _lastReceivedSRNTPsecs;
279 uint32_t _lastReceivedSRNTPfrac;
niklase@google.com470e71d2011-07-07 08:21:25 +0000280
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000281 // Received XR receive time report.
282 RtcpReceiveTimeInfo _remoteXRReceiveTimeInfo;
283 // Time when the report was received.
284 uint32_t _lastReceivedXRNTPsecs;
285 uint32_t _lastReceivedXRNTPfrac;
asapersson@webrtc.org7d6bd222013-10-31 12:14:34 +0000286 // Estimated rtt, zero when there is no valid estimate.
Danil Chapovalovc1e55c72016-03-09 15:14:35 +0100287 bool xr_rrtr_status_ GUARDED_BY(_criticalSectionRTCPReceiver);
pkasting@chromium.org16825b12015-01-12 21:51:21 +0000288 int64_t xr_rr_rtt_ms_;
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000289
pwestin@webrtc.org26f8d9c2012-01-19 15:53:09 +0000290 // Received report blocks.
asapersson@webrtc.orgcb791412014-12-18 14:30:32 +0000291 ReportBlockMap _receivedReportBlockMap
292 GUARDED_BY(_criticalSectionRTCPReceiver);
stefan@webrtc.orgb5865072013-02-01 14:33:42 +0000293 ReceivedInfoMap _receivedInfoMap;
asapersson@webrtc.orgcb791412014-12-18 14:30:32 +0000294 std::map<uint32_t, RTCPUtility::RTCPCnameInformation*> _receivedCnameMap;
niklase@google.com470e71d2011-07-07 08:21:25 +0000295
mflodman@webrtc.org2f225ca2013-01-09 13:54:43 +0000296 // The last time we received an RTCP RR.
297 int64_t _lastReceivedRrMs;
298
asapersson@webrtc.orgcb791412014-12-18 14:30:32 +0000299 // The time we last received an RTCP RR telling we have successfully
mflodman@webrtc.org2f225ca2013-01-09 13:54:43 +0000300 // delivered RTP packet to the remote side.
301 int64_t _lastIncreasedSequenceNumberMs;
stefan@webrtc.org8ca8a712013-04-23 16:48:32 +0000302
pbos@webrtc.orga28a91d2015-02-17 14:45:08 +0000303 RtcpStatisticsCallback* stats_callback_ GUARDED_BY(_criticalSectionFeedbacks);
asapersson@webrtc.org8098e072014-02-19 11:59:02 +0000304
pbos@webrtc.org1d0fa5d2015-02-19 12:47:00 +0000305 RtcpPacketTypeCounterObserver* const packet_type_counter_observer_;
asapersson@webrtc.org8098e072014-02-19 11:59:02 +0000306 RtcpPacketTypeCounter packet_type_counter_;
asapersson@webrtc.org2dd31342014-10-29 12:42:30 +0000307
308 RTCPUtility::NackStats nack_stats_;
Erik Språng6b8d3552015-09-24 15:06:57 +0200309
310 size_t num_skipped_packets_;
311 int64_t last_skipped_packets_warning_;
niklase@google.com470e71d2011-07-07 08:21:25 +0000312};
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +0000313} // namespace webrtc
niklase@google.com470e71d2011-07-07 08:21:25 +0000314#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_RECEIVER_H_