blob: 272397675b4bcd0ef2234760ddc21d01df064b93 [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>
perkj@webrtc.orgce5990c2012-01-11 13:00:08 +000015#include <vector>
stefan@webrtc.org28a331e2013-09-17 07:49:56 +000016#include <set>
perkj@webrtc.orgce5990c2012-01-11 13:00:08 +000017
asapersson@webrtc.orgcb791412014-12-18 14:30:32 +000018#include "webrtc/base/thread_annotations.h"
pbos@webrtc.orga048d7c2013-05-29 14:27:38 +000019#include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h"
20#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
pbosda903ea2015-10-02 02:36:56 -070041 RtcpMode Status() const;
42 void SetRTCPStatus(RtcpMode method);
niklase@google.com470e71d2011-07-07 08:21:25 +000043
pbos@webrtc.org2f446732013-04-08 11:08:41 +000044 int64_t LastReceived();
45 int64_t LastReceivedReceiverReport() const;
niklase@google.com470e71d2011-07-07 08:21:25 +000046
stefan@webrtc.org28a331e2013-09-17 07:49:56 +000047 void SetSsrcs(uint32_t main_ssrc,
48 const std::set<uint32_t>& registered_ssrcs);
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +000049 void SetRelaySSRC(uint32_t ssrc);
asapersson@webrtc.orgdf7b65b2015-01-21 13:07:04 +000050 void SetRemoteSSRC(uint32_t ssrc);
wu@webrtc.org822fbd82013-08-15 23:38:54 +000051 uint32_t RemoteSSRC() const;
niklase@google.com470e71d2011-07-07 08:21:25 +000052
pbos@webrtc.org2f446732013-04-08 11:08:41 +000053 uint32_t RelaySSRC() const;
niklase@google.com470e71d2011-07-07 08:21:25 +000054
pbos@webrtc.org2f446732013-04-08 11:08:41 +000055 int32_t IncomingRTCPPacket(
56 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation,
57 RTCPUtility::RTCPParserV2 *rtcpParser);
niklase@google.com470e71d2011-07-07 08:21:25 +000058
asapersson@webrtc.orgdf7b65b2015-01-21 13:07:04 +000059 void TriggerCallbacksFromRTCPPacket(
60 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation);
niklase@google.com470e71d2011-07-07 08:21:25 +000061
62 // get received cname
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +000063 int32_t CNAME(uint32_t remoteSSRC, char cName[RTCP_CNAME_SIZE]) const;
niklase@google.com470e71d2011-07-07 08:21:25 +000064
65 // get received NTP
pbos@webrtc.org2f4b14e2014-07-15 15:25:39 +000066 bool NTP(uint32_t* ReceivedNTPsecs,
67 uint32_t* ReceivedNTPfrac,
68 uint32_t* RTCPArrivalTimeSecs,
69 uint32_t* RTCPArrivalTimeFrac,
70 uint32_t* rtcp_timestamp) const;
niklase@google.com470e71d2011-07-07 08:21:25 +000071
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +000072 bool LastReceivedXrReferenceTimeInfo(RtcpReceiveTimeInfo* info) const;
73
niklase@google.com470e71d2011-07-07 08:21:25 +000074 // get rtt
wu@webrtc.org822fbd82013-08-15 23:38:54 +000075 int32_t RTT(uint32_t remoteSSRC,
pkasting@chromium.org16825b12015-01-12 21:51:21 +000076 int64_t* RTT,
77 int64_t* avgRTT,
78 int64_t* minRTT,
79 int64_t* maxRTT) const;
niklase@google.com470e71d2011-07-07 08:21:25 +000080
pbos@webrtc.org2f446732013-04-08 11:08:41 +000081 int32_t SenderInfoReceived(RTCPSenderInfo* senderInfo) const;
niklase@google.com470e71d2011-07-07 08:21:25 +000082
pkasting@chromium.org16825b12015-01-12 21:51:21 +000083 bool GetAndResetXrRrRtt(int64_t* rtt_ms);
asapersson@webrtc.org7d6bd222013-10-31 12:14:34 +000084
niklase@google.com470e71d2011-07-07 08:21:25 +000085 // get statistics
pbos@webrtc.org2f446732013-04-08 11:08:41 +000086 int32_t StatisticsReceived(
perkj@webrtc.orgce5990c2012-01-11 13:00:08 +000087 std::vector<RTCPReportBlock>* receiveBlocks) const;
88
mflodman@webrtc.org2f225ca2013-01-09 13:54:43 +000089 // Returns true if we haven't received an RTCP RR for several RTCP
90 // intervals, but only triggers true once.
91 bool RtcpRrTimeout(int64_t rtcp_interval_ms);
92
93 // Returns true if we haven't received an RTCP RR telling the receive side
94 // has not received RTP packets for too long, i.e. extended highest sequence
95 // number hasn't increased for several RTCP intervals. The function only
96 // returns true once until a new RR is received.
97 bool RtcpRrSequenceNumberTimeout(int64_t rtcp_interval_ms);
98
niklase@google.com470e71d2011-07-07 08:21:25 +000099 // Get TMMBR
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000100 int32_t TMMBRReceived(uint32_t size,
101 uint32_t accNumCandidates,
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000102 TMMBRSet* candidateSet) const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000103
104 bool UpdateRTCPReceiveInformationTimers();
105
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000106 int32_t BoundingSet(bool &tmmbrOwner, TMMBRSet* boundingSetRec);
niklase@google.com470e71d2011-07-07 08:21:25 +0000107
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000108 int32_t UpdateTMMBR();
niklase@google.com470e71d2011-07-07 08:21:25 +0000109
sprang@webrtc.orga6ad6e52013-12-05 09:48:44 +0000110 void RegisterRtcpStatisticsCallback(RtcpStatisticsCallback* callback);
111 RtcpStatisticsCallback* GetRtcpStatisticsCallback();
112
niklase@google.com470e71d2011-07-07 08:21:25 +0000113protected:
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000114 RTCPUtility::RTCPCnameInformation* CreateCnameInformation(uint32_t remoteSSRC);
115 RTCPUtility::RTCPCnameInformation* GetCnameInformation(
116 uint32_t remoteSSRC) const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000117
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000118 RTCPHelp::RTCPReceiveInformation* CreateReceiveInformation(
119 uint32_t remoteSSRC);
120 RTCPHelp::RTCPReceiveInformation* GetReceiveInformation(uint32_t remoteSSRC);
niklase@google.com470e71d2011-07-07 08:21:25 +0000121
asapersson@webrtc.orgdf7b65b2015-01-21 13:07:04 +0000122 void UpdateReceiveInformation(
123 RTCPHelp::RTCPReceiveInformation& receiveInformation);
niklase@google.com470e71d2011-07-07 08:21:25 +0000124
asapersson@webrtc.orgdf7b65b2015-01-21 13:07:04 +0000125 void HandleSenderReceiverReport(
126 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
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000130 void HandleReportBlock(
131 const RTCPUtility::RTCPPacket& rtcpPacket,
132 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation,
sprang7dc39f32015-10-13 09:17:48 -0700133 uint32_t remoteSSRC)
134 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000135
Erik Språnga38233a2015-07-24 09:58:18 +0200136 void HandleSDES(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700137 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
138 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000139
sprang7dc39f32015-10-13 09:17:48 -0700140 void HandleSDESChunk(RTCPUtility::RTCPParserV2& rtcpParser)
141 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000142
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000143 void HandleXrHeader(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 HandleXrReceiveReferenceTime(
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 HandleXrDlrrReportBlock(
153 RTCPUtility::RTCPParserV2& parser,
sprang7dc39f32015-10-13 09:17:48 -0700154 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
155 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000156
157 void HandleXrDlrrReportBlockItem(
158 const RTCPUtility::RTCPPacket& packet,
sprang7dc39f32015-10-13 09:17:48 -0700159 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
160 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000161
asapersson@webrtc.orgdf7b65b2015-01-21 13:07:04 +0000162 void HandleXRVOIPMetric(
163 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 HandleNACK(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700168 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
169 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000170
171 void HandleNACKItem(const RTCPUtility::RTCPPacket& rtcpPacket,
sprang7dc39f32015-10-13 09:17:48 -0700172 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
173 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000174
sprang7dc39f32015-10-13 09:17:48 -0700175 void HandleBYE(RTCPUtility::RTCPParserV2& rtcpParser)
176 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000177
178 void HandlePLI(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 HandleSLI(RTCPUtility::RTCPParserV2& rtcpParser,
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 HandleSLIItem(const RTCPUtility::RTCPPacket& rtcpPacket,
sprang7dc39f32015-10-13 09:17:48 -0700187 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
188 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000189
190 void HandleRPSI(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700191 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
192 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000193
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000194 void HandlePsfbApp(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
198 void HandleREMBItem(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700199 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
200 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000201
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000202 void HandleIJ(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700203 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
204 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000205
206 void HandleIJItem(const RTCPUtility::RTCPPacket& rtcpPacket,
sprang7dc39f32015-10-13 09:17:48 -0700207 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
208 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000209
niklase@google.com470e71d2011-07-07 08:21:25 +0000210 void HandleTMMBR(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 HandleTMMBRItem(RTCPHelp::RTCPReceiveInformation& receiveInfo,
215 const RTCPUtility::RTCPPacket& rtcpPacket,
216 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation,
sprang7dc39f32015-10-13 09:17:48 -0700217 uint32_t senderSSRC)
218 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000219
hta@webrtc.org9d54cd12012-04-30 08:24:55 +0000220 void HandleTMMBN(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 HandleSR_REQ(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700225 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
226 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000227
228 void HandleTMMBNItem(RTCPHelp::RTCPReceiveInformation& receiveInfo,
sprang7dc39f32015-10-13 09:17:48 -0700229 const RTCPUtility::RTCPPacket& rtcpPacket)
230 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000231
232 void HandleFIR(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700233 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
234 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000235
pwestin@webrtc.orgb2179c22012-05-21 12:00:49 +0000236 void HandleFIRItem(RTCPHelp::RTCPReceiveInformation* receiveInfo,
niklase@google.com470e71d2011-07-07 08:21:25 +0000237 const RTCPUtility::RTCPPacket& rtcpPacket,
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 HandleAPP(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
245 void HandleAPPItem(RTCPUtility::RTCPParserV2& rtcpParser,
sprang7dc39f32015-10-13 09:17:48 -0700246 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
247 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000248
Erik Språng6b8d3552015-09-24 15:06:57 +0200249 void HandleTransportFeedback(
250 RTCPUtility::RTCPParserV2* rtcp_parser,
sprang7dc39f32015-10-13 09:17:48 -0700251 RTCPHelp::RTCPPacketInformation* rtcp_packet_information)
252 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
Erik Språng6b8d3552015-09-24 15:06:57 +0200253
pwestin@webrtc.org26f8d9c2012-01-19 15:53:09 +0000254 private:
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000255 typedef std::map<uint32_t, RTCPHelp::RTCPReceiveInformation*>
stefan@webrtc.orgb5865072013-02-01 14:33:42 +0000256 ReceivedInfoMap;
asapersson@webrtc.orgcb791412014-12-18 14:30:32 +0000257 // RTCP report block information mapped by remote SSRC.
258 typedef std::map<uint32_t, RTCPHelp::RTCPReportBlockInformation*>
259 ReportBlockInfoMap;
260 // RTCP report block information map mapped by source SSRC.
261 typedef std::map<uint32_t, ReportBlockInfoMap> ReportBlockMap;
262
263 RTCPHelp::RTCPReportBlockInformation* CreateOrGetReportBlockInformation(
264 uint32_t remote_ssrc, uint32_t source_ssrc)
265 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
266 RTCPHelp::RTCPReportBlockInformation* GetReportBlockInformation(
267 uint32_t remote_ssrc, uint32_t source_ssrc) const
268 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
269
Peter Boströmfe7a80c2015-04-23 17:53:17 +0200270 Clock* const _clock;
271 const bool receiver_only_;
pbosda903ea2015-10-02 02:36:56 -0700272 RtcpMode _method;
asapersson@webrtc.orgcb791412014-12-18 14:30:32 +0000273 int64_t _lastReceived;
274 ModuleRtpRtcpImpl& _rtpRtcp;
niklase@google.com470e71d2011-07-07 08:21:25 +0000275
pwestin@webrtc.org26f8d9c2012-01-19 15:53:09 +0000276 CriticalSectionWrapper* _criticalSectionFeedbacks;
mflodman@webrtc.org96abda02015-02-25 13:50:10 +0000277 RtcpBandwidthObserver* const _cbRtcpBandwidthObserver;
278 RtcpIntraFrameObserver* const _cbRtcpIntraFrameObserver;
Erik Språng6b8d3552015-09-24 15:06:57 +0200279 TransportFeedbackObserver* const _cbTransportFeedbackObserver;
niklase@google.com470e71d2011-07-07 08:21:25 +0000280
pwestin@webrtc.org26f8d9c2012-01-19 15:53:09 +0000281 CriticalSectionWrapper* _criticalSectionRTCPReceiver;
sprang7dc39f32015-10-13 09:17:48 -0700282 uint32_t main_ssrc_ GUARDED_BY(_criticalSectionRTCPReceiver);
283 uint32_t _remoteSSRC GUARDED_BY(_criticalSectionRTCPReceiver);
284 std::set<uint32_t> registered_ssrcs_ GUARDED_BY(_criticalSectionRTCPReceiver);
niklase@google.com470e71d2011-07-07 08:21:25 +0000285
pwestin@webrtc.org26f8d9c2012-01-19 15:53:09 +0000286 // Received send report
287 RTCPSenderInfo _remoteSenderInfo;
288 // when did we receive the last send report
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000289 uint32_t _lastReceivedSRNTPsecs;
290 uint32_t _lastReceivedSRNTPfrac;
niklase@google.com470e71d2011-07-07 08:21:25 +0000291
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000292 // Received XR receive time report.
293 RtcpReceiveTimeInfo _remoteXRReceiveTimeInfo;
294 // Time when the report was received.
295 uint32_t _lastReceivedXRNTPsecs;
296 uint32_t _lastReceivedXRNTPfrac;
asapersson@webrtc.org7d6bd222013-10-31 12:14:34 +0000297 // Estimated rtt, zero when there is no valid estimate.
pkasting@chromium.org16825b12015-01-12 21:51:21 +0000298 int64_t xr_rr_rtt_ms_;
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000299
pwestin@webrtc.org26f8d9c2012-01-19 15:53:09 +0000300 // Received report blocks.
asapersson@webrtc.orgcb791412014-12-18 14:30:32 +0000301 ReportBlockMap _receivedReportBlockMap
302 GUARDED_BY(_criticalSectionRTCPReceiver);
stefan@webrtc.orgb5865072013-02-01 14:33:42 +0000303 ReceivedInfoMap _receivedInfoMap;
asapersson@webrtc.orgcb791412014-12-18 14:30:32 +0000304 std::map<uint32_t, RTCPUtility::RTCPCnameInformation*> _receivedCnameMap;
niklase@google.com470e71d2011-07-07 08:21:25 +0000305
asapersson@webrtc.orgcb791412014-12-18 14:30:32 +0000306 uint32_t _packetTimeOutMS;
mflodman@webrtc.orgd7d46882012-02-14 12:49:59 +0000307
mflodman@webrtc.org2f225ca2013-01-09 13:54:43 +0000308 // The last time we received an RTCP RR.
309 int64_t _lastReceivedRrMs;
310
asapersson@webrtc.orgcb791412014-12-18 14:30:32 +0000311 // The time we last received an RTCP RR telling we have successfully
mflodman@webrtc.org2f225ca2013-01-09 13:54:43 +0000312 // delivered RTP packet to the remote side.
313 int64_t _lastIncreasedSequenceNumberMs;
stefan@webrtc.org8ca8a712013-04-23 16:48:32 +0000314
pbos@webrtc.orga28a91d2015-02-17 14:45:08 +0000315 RtcpStatisticsCallback* stats_callback_ GUARDED_BY(_criticalSectionFeedbacks);
asapersson@webrtc.org8098e072014-02-19 11:59:02 +0000316
pbos@webrtc.org1d0fa5d2015-02-19 12:47:00 +0000317 RtcpPacketTypeCounterObserver* const packet_type_counter_observer_;
asapersson@webrtc.org8098e072014-02-19 11:59:02 +0000318 RtcpPacketTypeCounter packet_type_counter_;
asapersson@webrtc.org2dd31342014-10-29 12:42:30 +0000319
320 RTCPUtility::NackStats nack_stats_;
Erik Språng6b8d3552015-09-24 15:06:57 +0200321
322 size_t num_skipped_packets_;
323 int64_t last_skipped_packets_warning_;
niklase@google.com470e71d2011-07-07 08:21:25 +0000324};
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +0000325} // namespace webrtc
niklase@google.com470e71d2011-07-07 08:21:25 +0000326#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_RECEIVER_H_