niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 1 | /* |
pwestin@webrtc.org | f6bb77a | 2012-01-24 17:16:59 +0000 | [diff] [blame] | 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 3 | * |
| 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.org | 26f8d9c | 2012-01-19 15:53:09 +0000 | [diff] [blame] | 14 | #include <map> |
stefan@webrtc.org | 28a331e | 2013-09-17 07:49:56 +0000 | [diff] [blame] | 15 | #include <set> |
danilchap | b8b6fbb | 2015-12-10 05:05:27 -0800 | [diff] [blame] | 16 | #include <vector> |
perkj@webrtc.org | ce5990c | 2012-01-11 13:00:08 +0000 | [diff] [blame] | 17 | |
danilchap | 7c9426c | 2016-04-14 03:05:31 -0700 | [diff] [blame] | 18 | #include "webrtc/base/criticalsection.h" |
asapersson@webrtc.org | cb79141 | 2014-12-18 14:30:32 +0000 | [diff] [blame] | 19 | #include "webrtc/base/thread_annotations.h" |
Henrik Kjellander | ff761fb | 2015-11-04 08:31:52 +0100 | [diff] [blame] | 20 | #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
pbos@webrtc.org | a048d7c | 2013-05-29 14:27:38 +0000 | [diff] [blame] | 21 | #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.org | a048d7c | 2013-05-29 14:27:38 +0000 | [diff] [blame] | 24 | #include "webrtc/typedefs.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 25 | |
| 26 | namespace webrtc { |
pwestin@webrtc.org | 741da94 | 2011-09-20 13:52:04 +0000 | [diff] [blame] | 27 | class ModuleRtpRtcpImpl; |
| 28 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 29 | class RTCPReceiver { |
| 30 | public: |
| 31 | RTCPReceiver(Clock* clock, |
| 32 | bool receiver_only, |
| 33 | RtcpPacketTypeCounterObserver* packet_type_counter_observer, |
| 34 | RtcpBandwidthObserver* rtcp_bandwidth_observer, |
| 35 | RtcpIntraFrameObserver* rtcp_intra_frame_observer, |
| 36 | TransportFeedbackObserver* transport_feedback_observer, |
| 37 | ModuleRtpRtcpImpl* owner); |
| 38 | virtual ~RTCPReceiver(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 39 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 40 | int64_t LastReceived(); |
| 41 | int64_t LastReceivedReceiverReport() const; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 42 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 43 | void SetSsrcs(uint32_t main_ssrc, const std::set<uint32_t>& registered_ssrcs); |
| 44 | void SetRemoteSSRC(uint32_t ssrc); |
| 45 | uint32_t RemoteSSRC() const; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 46 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 47 | int32_t IncomingRTCPPacket( |
| 48 | RTCPHelp::RTCPPacketInformation& rtcpPacketInformation, |
| 49 | RTCPUtility::RTCPParserV2* rtcpParser); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 50 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 51 | void TriggerCallbacksFromRTCPPacket( |
| 52 | RTCPHelp::RTCPPacketInformation& rtcpPacketInformation); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 53 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 54 | // get received cname |
| 55 | int32_t CNAME(uint32_t remoteSSRC, char cName[RTCP_CNAME_SIZE]) const; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 56 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 57 | // get received NTP |
| 58 | bool NTP(uint32_t* ReceivedNTPsecs, |
| 59 | uint32_t* ReceivedNTPfrac, |
| 60 | uint32_t* RTCPArrivalTimeSecs, |
| 61 | uint32_t* RTCPArrivalTimeFrac, |
| 62 | uint32_t* rtcp_timestamp) const; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 63 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 64 | bool LastReceivedXrReferenceTimeInfo(RtcpReceiveTimeInfo* info) const; |
asapersson@webrtc.org | 8469f7b | 2013-10-02 13:15:34 +0000 | [diff] [blame] | 65 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 66 | // get rtt |
| 67 | int32_t RTT(uint32_t remoteSSRC, |
| 68 | int64_t* RTT, |
| 69 | int64_t* avgRTT, |
| 70 | int64_t* minRTT, |
| 71 | int64_t* maxRTT) const; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 72 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 73 | int32_t SenderInfoReceived(RTCPSenderInfo* senderInfo) const; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 74 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 75 | void SetRtcpXrRrtrStatus(bool enable); |
| 76 | bool GetAndResetXrRrRtt(int64_t* rtt_ms); |
asapersson@webrtc.org | 7d6bd22 | 2013-10-31 12:14:34 +0000 | [diff] [blame] | 77 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 78 | // get statistics |
| 79 | int32_t StatisticsReceived(std::vector<RTCPReportBlock>* receiveBlocks) const; |
perkj@webrtc.org | ce5990c | 2012-01-11 13:00:08 +0000 | [diff] [blame] | 80 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 81 | // Returns true if we haven't received an RTCP RR for several RTCP |
| 82 | // intervals, but only triggers true once. |
| 83 | bool RtcpRrTimeout(int64_t rtcp_interval_ms); |
mflodman@webrtc.org | 2f225ca | 2013-01-09 13:54:43 +0000 | [diff] [blame] | 84 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 85 | // Returns true if we haven't received an RTCP RR telling the receive side |
| 86 | // has not received RTP packets for too long, i.e. extended highest sequence |
| 87 | // number hasn't increased for several RTCP intervals. The function only |
| 88 | // returns true once until a new RR is received. |
| 89 | bool RtcpRrSequenceNumberTimeout(int64_t rtcp_interval_ms); |
mflodman@webrtc.org | 2f225ca | 2013-01-09 13:54:43 +0000 | [diff] [blame] | 90 | |
danilchap | 853ecb2 | 2016-08-22 08:26:15 -0700 | [diff] [blame^] | 91 | std::vector<rtcp::TmmbItem> TmmbrReceived() const; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 92 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 93 | bool UpdateRTCPReceiveInformationTimers(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 94 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 95 | std::vector<rtcp::TmmbItem> BoundingSet(bool* tmmbr_owner); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 96 | |
danilchap | 853ecb2 | 2016-08-22 08:26:15 -0700 | [diff] [blame^] | 97 | void UpdateTmmbr(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 98 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 99 | void RegisterRtcpStatisticsCallback(RtcpStatisticsCallback* callback); |
| 100 | RtcpStatisticsCallback* GetRtcpStatisticsCallback(); |
sprang@webrtc.org | a6ad6e5 | 2013-12-05 09:48:44 +0000 | [diff] [blame] | 101 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 102 | protected: |
| 103 | RTCPUtility::RTCPCnameInformation* CreateCnameInformation( |
| 104 | uint32_t remoteSSRC); |
| 105 | RTCPUtility::RTCPCnameInformation* GetCnameInformation( |
| 106 | uint32_t remoteSSRC) const; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 107 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 108 | RTCPHelp::RTCPReceiveInformation* CreateReceiveInformation( |
| 109 | uint32_t remoteSSRC); |
| 110 | RTCPHelp::RTCPReceiveInformation* GetReceiveInformation(uint32_t remoteSSRC); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 111 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 112 | void HandleSenderReceiverReport( |
| 113 | RTCPUtility::RTCPParserV2& rtcpParser, |
| 114 | RTCPHelp::RTCPPacketInformation& rtcpPacketInformation) |
| 115 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 116 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 117 | void HandleReportBlock(const RTCPUtility::RTCPPacket& rtcpPacket, |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 118 | RTCPHelp::RTCPPacketInformation& rtcpPacketInformation, |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 119 | uint32_t remoteSSRC) |
| 120 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 121 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 122 | void HandleSDES(RTCPUtility::RTCPParserV2& rtcpParser, |
| 123 | RTCPHelp::RTCPPacketInformation& rtcpPacketInformation) |
| 124 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 125 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 126 | void HandleSDESChunk(RTCPUtility::RTCPParserV2& rtcpParser) |
| 127 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
| 128 | |
| 129 | void HandleXrHeader(RTCPUtility::RTCPParserV2& parser, |
sprang | 7dc39f3 | 2015-10-13 09:17:48 -0700 | [diff] [blame] | 130 | RTCPHelp::RTCPPacketInformation& rtcpPacketInformation) |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 131 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 132 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 133 | void HandleXrReceiveReferenceTime( |
| 134 | RTCPUtility::RTCPParserV2& parser, |
| 135 | RTCPHelp::RTCPPacketInformation& rtcpPacketInformation) |
| 136 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 137 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 138 | void HandleXrDlrrReportBlock( |
| 139 | RTCPUtility::RTCPParserV2& parser, |
| 140 | RTCPHelp::RTCPPacketInformation& rtcpPacketInformation) |
| 141 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
| 142 | |
| 143 | void HandleXrDlrrReportBlockItem( |
| 144 | const RTCPUtility::RTCPPacket& packet, |
| 145 | RTCPHelp::RTCPPacketInformation& rtcpPacketInformation) |
| 146 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
| 147 | |
| 148 | void HandleXRVOIPMetric( |
| 149 | RTCPUtility::RTCPParserV2& rtcpParser, |
| 150 | RTCPHelp::RTCPPacketInformation& rtcpPacketInformation) |
| 151 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
| 152 | |
| 153 | void HandleNACK(RTCPUtility::RTCPParserV2& rtcpParser, |
| 154 | RTCPHelp::RTCPPacketInformation& rtcpPacketInformation) |
| 155 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
| 156 | |
| 157 | void HandleNACKItem(const RTCPUtility::RTCPPacket& rtcpPacket, |
| 158 | RTCPHelp::RTCPPacketInformation& rtcpPacketInformation) |
| 159 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
| 160 | |
| 161 | void HandleBYE(RTCPUtility::RTCPParserV2& rtcpParser) |
| 162 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
| 163 | |
| 164 | void HandlePLI(RTCPUtility::RTCPParserV2& rtcpParser, |
| 165 | RTCPHelp::RTCPPacketInformation& rtcpPacketInformation) |
| 166 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
| 167 | |
| 168 | void HandleSLI(RTCPUtility::RTCPParserV2& rtcpParser, |
| 169 | RTCPHelp::RTCPPacketInformation& rtcpPacketInformation) |
| 170 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
| 171 | |
| 172 | void HandleSLIItem(const RTCPUtility::RTCPPacket& rtcpPacket, |
| 173 | RTCPHelp::RTCPPacketInformation& rtcpPacketInformation) |
| 174 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
| 175 | |
| 176 | void HandleRPSI(RTCPUtility::RTCPParserV2& rtcpParser, |
| 177 | RTCPHelp::RTCPPacketInformation& rtcpPacketInformation) |
| 178 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
| 179 | |
| 180 | void HandlePsfbApp(RTCPUtility::RTCPParserV2& rtcpParser, |
| 181 | RTCPHelp::RTCPPacketInformation& rtcpPacketInformation) |
| 182 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
| 183 | |
| 184 | void HandleREMBItem(RTCPUtility::RTCPParserV2& rtcpParser, |
| 185 | RTCPHelp::RTCPPacketInformation& rtcpPacketInformation) |
| 186 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
| 187 | |
| 188 | void HandleIJ(RTCPUtility::RTCPParserV2& rtcpParser, |
| 189 | RTCPHelp::RTCPPacketInformation& rtcpPacketInformation) |
| 190 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
| 191 | |
| 192 | void HandleIJItem(const RTCPUtility::RTCPPacket& rtcpPacket, |
| 193 | RTCPHelp::RTCPPacketInformation& rtcpPacketInformation) |
| 194 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
| 195 | |
| 196 | void HandleTMMBR(RTCPUtility::RTCPParserV2& rtcpParser, |
sprang | 7dc39f3 | 2015-10-13 09:17:48 -0700 | [diff] [blame] | 197 | RTCPHelp::RTCPPacketInformation& rtcpPacketInformation) |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 198 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 199 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 200 | void HandleTMMBRItem(RTCPHelp::RTCPReceiveInformation& receiveInfo, |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 201 | const RTCPUtility::RTCPPacket& rtcpPacket, |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 202 | RTCPHelp::RTCPPacketInformation& rtcpPacketInformation, |
| 203 | uint32_t senderSSRC) |
| 204 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 205 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 206 | void HandleTMMBN(RTCPUtility::RTCPParserV2& rtcpParser, |
sprang | 7dc39f3 | 2015-10-13 09:17:48 -0700 | [diff] [blame] | 207 | RTCPHelp::RTCPPacketInformation& rtcpPacketInformation) |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 208 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 209 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 210 | void HandleSR_REQ(RTCPUtility::RTCPParserV2& rtcpParser, |
| 211 | RTCPHelp::RTCPPacketInformation& rtcpPacketInformation) |
| 212 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 213 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 214 | void HandleTMMBNItem(RTCPHelp::RTCPReceiveInformation& receiveInfo, |
| 215 | const RTCPUtility::RTCPPacket& rtcpPacket) |
| 216 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
| 217 | |
| 218 | void HandleFIR(RTCPUtility::RTCPParserV2& rtcpParser, |
| 219 | RTCPHelp::RTCPPacketInformation& rtcpPacketInformation) |
| 220 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
| 221 | |
| 222 | void HandleFIRItem(RTCPHelp::RTCPReceiveInformation* receiveInfo, |
| 223 | const RTCPUtility::RTCPPacket& rtcpPacket, |
| 224 | RTCPHelp::RTCPPacketInformation& rtcpPacketInformation) |
| 225 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
| 226 | |
| 227 | void HandleAPP(RTCPUtility::RTCPParserV2& rtcpParser, |
| 228 | RTCPHelp::RTCPPacketInformation& rtcpPacketInformation) |
| 229 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
| 230 | |
| 231 | void HandleAPPItem(RTCPUtility::RTCPParserV2& rtcpParser, |
| 232 | RTCPHelp::RTCPPacketInformation& rtcpPacketInformation) |
| 233 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
| 234 | |
| 235 | void HandleTransportFeedback( |
| 236 | RTCPUtility::RTCPParserV2* rtcp_parser, |
| 237 | RTCPHelp::RTCPPacketInformation* rtcp_packet_information) |
| 238 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
Erik Språng | 6b8d355 | 2015-09-24 15:06:57 +0200 | [diff] [blame] | 239 | |
pwestin@webrtc.org | 26f8d9c | 2012-01-19 15:53:09 +0000 | [diff] [blame] | 240 | private: |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 241 | typedef std::map<uint32_t, RTCPHelp::RTCPReceiveInformation*> ReceivedInfoMap; |
asapersson@webrtc.org | cb79141 | 2014-12-18 14:30:32 +0000 | [diff] [blame] | 242 | // RTCP report block information mapped by remote SSRC. |
| 243 | typedef std::map<uint32_t, RTCPHelp::RTCPReportBlockInformation*> |
| 244 | ReportBlockInfoMap; |
| 245 | // RTCP report block information map mapped by source SSRC. |
| 246 | typedef std::map<uint32_t, ReportBlockInfoMap> ReportBlockMap; |
| 247 | |
| 248 | RTCPHelp::RTCPReportBlockInformation* CreateOrGetReportBlockInformation( |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 249 | uint32_t remote_ssrc, |
| 250 | uint32_t source_ssrc) |
| 251 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
asapersson@webrtc.org | cb79141 | 2014-12-18 14:30:32 +0000 | [diff] [blame] | 252 | RTCPHelp::RTCPReportBlockInformation* GetReportBlockInformation( |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 253 | uint32_t remote_ssrc, |
| 254 | uint32_t source_ssrc) const |
| 255 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
asapersson@webrtc.org | cb79141 | 2014-12-18 14:30:32 +0000 | [diff] [blame] | 256 | |
Peter Boström | fe7a80c | 2015-04-23 17:53:17 +0200 | [diff] [blame] | 257 | Clock* const _clock; |
| 258 | const bool receiver_only_; |
asapersson@webrtc.org | cb79141 | 2014-12-18 14:30:32 +0000 | [diff] [blame] | 259 | int64_t _lastReceived; |
| 260 | ModuleRtpRtcpImpl& _rtpRtcp; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 261 | |
danilchap | 7c9426c | 2016-04-14 03:05:31 -0700 | [diff] [blame] | 262 | rtc::CriticalSection _criticalSectionFeedbacks; |
mflodman@webrtc.org | 96abda0 | 2015-02-25 13:50:10 +0000 | [diff] [blame] | 263 | RtcpBandwidthObserver* const _cbRtcpBandwidthObserver; |
| 264 | RtcpIntraFrameObserver* const _cbRtcpIntraFrameObserver; |
Erik Språng | 6b8d355 | 2015-09-24 15:06:57 +0200 | [diff] [blame] | 265 | TransportFeedbackObserver* const _cbTransportFeedbackObserver; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 266 | |
danilchap | 7c9426c | 2016-04-14 03:05:31 -0700 | [diff] [blame] | 267 | rtc::CriticalSection _criticalSectionRTCPReceiver; |
sprang | 7dc39f3 | 2015-10-13 09:17:48 -0700 | [diff] [blame] | 268 | uint32_t main_ssrc_ GUARDED_BY(_criticalSectionRTCPReceiver); |
| 269 | uint32_t _remoteSSRC GUARDED_BY(_criticalSectionRTCPReceiver); |
| 270 | std::set<uint32_t> registered_ssrcs_ GUARDED_BY(_criticalSectionRTCPReceiver); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 271 | |
pwestin@webrtc.org | 26f8d9c | 2012-01-19 15:53:09 +0000 | [diff] [blame] | 272 | // Received send report |
| 273 | RTCPSenderInfo _remoteSenderInfo; |
| 274 | // when did we receive the last send report |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 275 | uint32_t _lastReceivedSRNTPsecs; |
| 276 | uint32_t _lastReceivedSRNTPfrac; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 277 | |
asapersson@webrtc.org | 8469f7b | 2013-10-02 13:15:34 +0000 | [diff] [blame] | 278 | // Received XR receive time report. |
| 279 | RtcpReceiveTimeInfo _remoteXRReceiveTimeInfo; |
| 280 | // Time when the report was received. |
| 281 | uint32_t _lastReceivedXRNTPsecs; |
| 282 | uint32_t _lastReceivedXRNTPfrac; |
asapersson@webrtc.org | 7d6bd22 | 2013-10-31 12:14:34 +0000 | [diff] [blame] | 283 | // Estimated rtt, zero when there is no valid estimate. |
Danil Chapovalov | c1e55c7 | 2016-03-09 15:14:35 +0100 | [diff] [blame] | 284 | bool xr_rrtr_status_ GUARDED_BY(_criticalSectionRTCPReceiver); |
pkasting@chromium.org | 16825b1 | 2015-01-12 21:51:21 +0000 | [diff] [blame] | 285 | int64_t xr_rr_rtt_ms_; |
asapersson@webrtc.org | 8469f7b | 2013-10-02 13:15:34 +0000 | [diff] [blame] | 286 | |
pwestin@webrtc.org | 26f8d9c | 2012-01-19 15:53:09 +0000 | [diff] [blame] | 287 | // Received report blocks. |
asapersson@webrtc.org | cb79141 | 2014-12-18 14:30:32 +0000 | [diff] [blame] | 288 | ReportBlockMap _receivedReportBlockMap |
| 289 | GUARDED_BY(_criticalSectionRTCPReceiver); |
stefan@webrtc.org | b586507 | 2013-02-01 14:33:42 +0000 | [diff] [blame] | 290 | ReceivedInfoMap _receivedInfoMap; |
asapersson@webrtc.org | cb79141 | 2014-12-18 14:30:32 +0000 | [diff] [blame] | 291 | std::map<uint32_t, RTCPUtility::RTCPCnameInformation*> _receivedCnameMap; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 292 | |
mflodman@webrtc.org | 2f225ca | 2013-01-09 13:54:43 +0000 | [diff] [blame] | 293 | // The last time we received an RTCP RR. |
| 294 | int64_t _lastReceivedRrMs; |
| 295 | |
asapersson@webrtc.org | cb79141 | 2014-12-18 14:30:32 +0000 | [diff] [blame] | 296 | // The time we last received an RTCP RR telling we have successfully |
mflodman@webrtc.org | 2f225ca | 2013-01-09 13:54:43 +0000 | [diff] [blame] | 297 | // delivered RTP packet to the remote side. |
| 298 | int64_t _lastIncreasedSequenceNumberMs; |
stefan@webrtc.org | 8ca8a71 | 2013-04-23 16:48:32 +0000 | [diff] [blame] | 299 | |
pbos@webrtc.org | a28a91d | 2015-02-17 14:45:08 +0000 | [diff] [blame] | 300 | RtcpStatisticsCallback* stats_callback_ GUARDED_BY(_criticalSectionFeedbacks); |
asapersson@webrtc.org | 8098e07 | 2014-02-19 11:59:02 +0000 | [diff] [blame] | 301 | |
pbos@webrtc.org | 1d0fa5d | 2015-02-19 12:47:00 +0000 | [diff] [blame] | 302 | RtcpPacketTypeCounterObserver* const packet_type_counter_observer_; |
asapersson@webrtc.org | 8098e07 | 2014-02-19 11:59:02 +0000 | [diff] [blame] | 303 | RtcpPacketTypeCounter packet_type_counter_; |
asapersson@webrtc.org | 2dd3134 | 2014-10-29 12:42:30 +0000 | [diff] [blame] | 304 | |
| 305 | RTCPUtility::NackStats nack_stats_; |
Erik Språng | 6b8d355 | 2015-09-24 15:06:57 +0200 | [diff] [blame] | 306 | |
| 307 | size_t num_skipped_packets_; |
| 308 | int64_t last_skipped_packets_warning_; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 309 | }; |
pbos@webrtc.org | d900e8b | 2013-07-03 15:12:26 +0000 | [diff] [blame] | 310 | } // namespace webrtc |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 311 | #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_RECEIVER_H_ |