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 | 9532124 | 2016-09-27 07:05:32 -0700 | [diff] [blame] | 16 | #include <string> |
danilchap | b8b6fbb | 2015-12-10 05:05:27 -0800 | [diff] [blame] | 17 | #include <vector> |
perkj@webrtc.org | ce5990c | 2012-01-11 13:00:08 +0000 | [diff] [blame] | 18 | |
danilchap | 7c9426c | 2016-04-14 03:05:31 -0700 | [diff] [blame] | 19 | #include "webrtc/base/criticalsection.h" |
asapersson@webrtc.org | cb79141 | 2014-12-18 14:30:32 +0000 | [diff] [blame] | 20 | #include "webrtc/base/thread_annotations.h" |
Henrik Kjellander | ff761fb | 2015-11-04 08:31:52 +0100 | [diff] [blame] | 21 | #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
danilchap | 798896a | 2016-09-28 02:54:25 -0700 | [diff] [blame] | 22 | #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/dlrr.h" |
pbos@webrtc.org | a048d7c | 2013-05-29 14:27:38 +0000 | [diff] [blame] | 23 | #include "webrtc/modules/rtp_rtcp/source/rtcp_receiver_help.h" |
| 24 | #include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h" |
pbos@webrtc.org | a048d7c | 2013-05-29 14:27:38 +0000 | [diff] [blame] | 25 | #include "webrtc/typedefs.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 26 | |
| 27 | namespace webrtc { |
danilchap | 59cb2bd | 2016-08-29 11:08:47 -0700 | [diff] [blame] | 28 | namespace rtcp { |
danilchap | 1b1863a | 2016-09-20 01:39:54 -0700 | [diff] [blame] | 29 | class CommonHeader; |
danilchap | 1b1863a | 2016-09-20 01:39:54 -0700 | [diff] [blame] | 30 | class ReportBlock; |
| 31 | class Rrtr; |
danilchap | 59cb2bd | 2016-08-29 11:08:47 -0700 | [diff] [blame] | 32 | class TmmbItem; |
| 33 | } // namespace rtcp |
pwestin@webrtc.org | 741da94 | 2011-09-20 13:52:04 +0000 | [diff] [blame] | 34 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 35 | class RTCPReceiver { |
| 36 | public: |
danilchap | 59cb2bd | 2016-08-29 11:08:47 -0700 | [diff] [blame] | 37 | class ModuleRtpRtcp { |
| 38 | public: |
| 39 | virtual void SetTmmbn(std::vector<rtcp::TmmbItem> bounding_set) = 0; |
| 40 | virtual void OnRequestSendReport() = 0; |
| 41 | virtual void OnReceivedNack( |
| 42 | const std::vector<uint16_t>& nack_sequence_numbers) = 0; |
| 43 | virtual void OnReceivedRtcpReportBlocks( |
| 44 | const ReportBlockList& report_blocks) = 0; |
| 45 | |
| 46 | protected: |
| 47 | virtual ~ModuleRtpRtcp() = default; |
| 48 | }; |
| 49 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 50 | RTCPReceiver(Clock* clock, |
| 51 | bool receiver_only, |
| 52 | RtcpPacketTypeCounterObserver* packet_type_counter_observer, |
| 53 | RtcpBandwidthObserver* rtcp_bandwidth_observer, |
| 54 | RtcpIntraFrameObserver* rtcp_intra_frame_observer, |
| 55 | TransportFeedbackObserver* transport_feedback_observer, |
danilchap | 59cb2bd | 2016-08-29 11:08:47 -0700 | [diff] [blame] | 56 | ModuleRtpRtcp* owner); |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 57 | virtual ~RTCPReceiver(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 58 | |
danilchap | 59cb2bd | 2016-08-29 11:08:47 -0700 | [diff] [blame] | 59 | bool IncomingPacket(const uint8_t* packet, size_t packet_size); |
| 60 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 61 | int64_t LastReceivedReceiverReport() const; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 62 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 63 | void SetSsrcs(uint32_t main_ssrc, const std::set<uint32_t>& registered_ssrcs); |
| 64 | void SetRemoteSSRC(uint32_t ssrc); |
| 65 | uint32_t RemoteSSRC() const; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 66 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 67 | // get received cname |
| 68 | 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] | 69 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 70 | // get received NTP |
| 71 | bool NTP(uint32_t* ReceivedNTPsecs, |
| 72 | uint32_t* ReceivedNTPfrac, |
| 73 | uint32_t* RTCPArrivalTimeSecs, |
| 74 | uint32_t* RTCPArrivalTimeFrac, |
| 75 | uint32_t* rtcp_timestamp) const; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 76 | |
danilchap | 798896a | 2016-09-28 02:54:25 -0700 | [diff] [blame] | 77 | bool LastReceivedXrReferenceTimeInfo(rtcp::ReceiveTimeInfo* info) const; |
asapersson@webrtc.org | 8469f7b | 2013-10-02 13:15:34 +0000 | [diff] [blame] | 78 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 79 | // get rtt |
| 80 | int32_t RTT(uint32_t remoteSSRC, |
| 81 | int64_t* RTT, |
| 82 | int64_t* avgRTT, |
| 83 | int64_t* minRTT, |
| 84 | int64_t* maxRTT) const; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 85 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 86 | int32_t SenderInfoReceived(RTCPSenderInfo* senderInfo) const; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 87 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 88 | void SetRtcpXrRrtrStatus(bool enable); |
| 89 | bool GetAndResetXrRrRtt(int64_t* rtt_ms); |
asapersson@webrtc.org | 7d6bd22 | 2013-10-31 12:14:34 +0000 | [diff] [blame] | 90 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 91 | // get statistics |
| 92 | int32_t StatisticsReceived(std::vector<RTCPReportBlock>* receiveBlocks) const; |
perkj@webrtc.org | ce5990c | 2012-01-11 13:00:08 +0000 | [diff] [blame] | 93 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 94 | // Returns true if we haven't received an RTCP RR for several RTCP |
| 95 | // intervals, but only triggers true once. |
| 96 | bool RtcpRrTimeout(int64_t rtcp_interval_ms); |
mflodman@webrtc.org | 2f225ca | 2013-01-09 13:54:43 +0000 | [diff] [blame] | 97 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 98 | // Returns true if we haven't received an RTCP RR telling the receive side |
| 99 | // has not received RTP packets for too long, i.e. extended highest sequence |
| 100 | // number hasn't increased for several RTCP intervals. The function only |
| 101 | // returns true once until a new RR is received. |
| 102 | bool RtcpRrSequenceNumberTimeout(int64_t rtcp_interval_ms); |
mflodman@webrtc.org | 2f225ca | 2013-01-09 13:54:43 +0000 | [diff] [blame] | 103 | |
danilchap | 7851bda | 2016-09-29 15:28:07 -0700 | [diff] [blame^] | 104 | std::vector<rtcp::TmmbItem> TmmbrReceived(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 105 | |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 106 | bool UpdateRTCPReceiveInformationTimers(); |
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 | std::vector<rtcp::TmmbItem> BoundingSet(bool* tmmbr_owner); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 109 | |
danilchap | 853ecb2 | 2016-08-22 08:26:15 -0700 | [diff] [blame] | 110 | void UpdateTmmbr(); |
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 RegisterRtcpStatisticsCallback(RtcpStatisticsCallback* callback); |
| 113 | RtcpStatisticsCallback* GetRtcpStatisticsCallback(); |
sprang@webrtc.org | a6ad6e5 | 2013-12-05 09:48:44 +0000 | [diff] [blame] | 114 | |
danilchap | dd12892 | 2016-09-13 12:23:29 -0700 | [diff] [blame] | 115 | private: |
danilchap | 92ea601 | 2016-09-23 10:36:03 -0700 | [diff] [blame] | 116 | struct PacketInformation; |
danilchap | 7851bda | 2016-09-29 15:28:07 -0700 | [diff] [blame^] | 117 | struct ReceiveInformation; |
| 118 | // Mapped by remote ssrc. |
| 119 | using ReceivedInfoMap = std::map<uint32_t, ReceiveInformation>; |
danilchap | dd12892 | 2016-09-13 12:23:29 -0700 | [diff] [blame] | 120 | // RTCP report block information mapped by remote SSRC. |
| 121 | using ReportBlockInfoMap = |
| 122 | std::map<uint32_t, RTCPHelp::RTCPReportBlockInformation*>; |
| 123 | // RTCP report block information map mapped by source SSRC. |
| 124 | using ReportBlockMap = std::map<uint32_t, ReportBlockInfoMap>; |
| 125 | |
danilchap | 1b1863a | 2016-09-20 01:39:54 -0700 | [diff] [blame] | 126 | bool ParseCompoundPacket(const uint8_t* packet_begin, |
| 127 | const uint8_t* packet_end, |
danilchap | 92ea601 | 2016-09-23 10:36:03 -0700 | [diff] [blame] | 128 | PacketInformation* packet_information); |
danilchap | dd12892 | 2016-09-13 12:23:29 -0700 | [diff] [blame] | 129 | |
| 130 | void TriggerCallbacksFromRTCPPacket( |
danilchap | 92ea601 | 2016-09-23 10:36:03 -0700 | [diff] [blame] | 131 | const PacketInformation& packet_information); |
danilchap | dd12892 | 2016-09-13 12:23:29 -0700 | [diff] [blame] | 132 | |
danilchap | 7851bda | 2016-09-29 15:28:07 -0700 | [diff] [blame^] | 133 | void CreateReceiveInformation(uint32_t remote_ssrc) |
| 134 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
| 135 | ReceiveInformation* GetReceiveInformation(uint32_t remote_ssrc) |
| 136 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 137 | |
danilchap | 92ea601 | 2016-09-23 10:36:03 -0700 | [diff] [blame] | 138 | void HandleSenderReport(const rtcp::CommonHeader& rtcp_block, |
| 139 | PacketInformation* packet_information) |
Danil Chapovalov | 91511f1 | 2016-09-15 16:24:02 +0200 | [diff] [blame] | 140 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
| 141 | |
danilchap | 92ea601 | 2016-09-23 10:36:03 -0700 | [diff] [blame] | 142 | void HandleReceiverReport(const rtcp::CommonHeader& rtcp_block, |
| 143 | PacketInformation* packet_information) |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 144 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 145 | |
danilchap | 1b1863a | 2016-09-20 01:39:54 -0700 | [diff] [blame] | 146 | void HandleReportBlock(const rtcp::ReportBlock& report_block, |
danilchap | 92ea601 | 2016-09-23 10:36:03 -0700 | [diff] [blame] | 147 | PacketInformation* packet_information, |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 148 | uint32_t remoteSSRC) |
| 149 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 150 | |
danilchap | 1b1863a | 2016-09-20 01:39:54 -0700 | [diff] [blame] | 151 | void HandleSDES(const rtcp::CommonHeader& rtcp_block, |
danilchap | 92ea601 | 2016-09-23 10:36:03 -0700 | [diff] [blame] | 152 | PacketInformation* packet_information) |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 153 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 154 | |
danilchap | 1b1863a | 2016-09-20 01:39:54 -0700 | [diff] [blame] | 155 | void HandleXr(const rtcp::CommonHeader& rtcp_block, |
danilchap | 92ea601 | 2016-09-23 10:36:03 -0700 | [diff] [blame] | 156 | PacketInformation* packet_information) |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 157 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 158 | |
danilchap | 92ea601 | 2016-09-23 10:36:03 -0700 | [diff] [blame] | 159 | void HandleXrReceiveReferenceTime(uint32_t sender_ssrc, |
| 160 | const rtcp::Rrtr& rrtr) |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 161 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 162 | |
danilchap | 92ea601 | 2016-09-23 10:36:03 -0700 | [diff] [blame] | 163 | void HandleXrDlrrReportBlock(const rtcp::ReceiveTimeInfo& rti) |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 164 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
| 165 | |
danilchap | 1b1863a | 2016-09-20 01:39:54 -0700 | [diff] [blame] | 166 | void HandleNACK(const rtcp::CommonHeader& rtcp_block, |
danilchap | 92ea601 | 2016-09-23 10:36:03 -0700 | [diff] [blame] | 167 | PacketInformation* packet_information) |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 168 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
| 169 | |
danilchap | 1b1863a | 2016-09-20 01:39:54 -0700 | [diff] [blame] | 170 | void HandleBYE(const rtcp::CommonHeader& rtcp_block) |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 171 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
| 172 | |
danilchap | 1b1863a | 2016-09-20 01:39:54 -0700 | [diff] [blame] | 173 | void HandlePLI(const rtcp::CommonHeader& rtcp_block, |
danilchap | 92ea601 | 2016-09-23 10:36:03 -0700 | [diff] [blame] | 174 | PacketInformation* packet_information) |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 175 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
| 176 | |
danilchap | 1b1863a | 2016-09-20 01:39:54 -0700 | [diff] [blame] | 177 | void HandleSLI(const rtcp::CommonHeader& rtcp_block, |
danilchap | 92ea601 | 2016-09-23 10:36:03 -0700 | [diff] [blame] | 178 | PacketInformation* packet_information) |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 179 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
| 180 | |
danilchap | 1b1863a | 2016-09-20 01:39:54 -0700 | [diff] [blame] | 181 | void HandleRPSI(const rtcp::CommonHeader& rtcp_block, |
danilchap | 92ea601 | 2016-09-23 10:36:03 -0700 | [diff] [blame] | 182 | PacketInformation* packet_information) |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 183 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
| 184 | |
danilchap | 1b1863a | 2016-09-20 01:39:54 -0700 | [diff] [blame] | 185 | void HandlePsfbApp(const rtcp::CommonHeader& rtcp_block, |
danilchap | 92ea601 | 2016-09-23 10:36:03 -0700 | [diff] [blame] | 186 | PacketInformation* packet_information) |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 187 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
| 188 | |
danilchap | 1b1863a | 2016-09-20 01:39:54 -0700 | [diff] [blame] | 189 | void HandleTMMBR(const rtcp::CommonHeader& rtcp_block, |
danilchap | 92ea601 | 2016-09-23 10:36:03 -0700 | [diff] [blame] | 190 | PacketInformation* packet_information) |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 191 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 192 | |
danilchap | 1b1863a | 2016-09-20 01:39:54 -0700 | [diff] [blame] | 193 | void HandleTMMBN(const rtcp::CommonHeader& rtcp_block, |
danilchap | 92ea601 | 2016-09-23 10:36:03 -0700 | [diff] [blame] | 194 | PacketInformation* packet_information) |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 195 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 196 | |
danilchap | 1b1863a | 2016-09-20 01:39:54 -0700 | [diff] [blame] | 197 | void HandleSR_REQ(const rtcp::CommonHeader& rtcp_block, |
danilchap | 92ea601 | 2016-09-23 10:36:03 -0700 | [diff] [blame] | 198 | PacketInformation* packet_information) |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 199 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 200 | |
danilchap | 1b1863a | 2016-09-20 01:39:54 -0700 | [diff] [blame] | 201 | void HandleFIR(const rtcp::CommonHeader& rtcp_block, |
danilchap | 92ea601 | 2016-09-23 10:36:03 -0700 | [diff] [blame] | 202 | PacketInformation* packet_information) |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 203 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
| 204 | |
danilchap | 92ea601 | 2016-09-23 10:36:03 -0700 | [diff] [blame] | 205 | void HandleTransportFeedback(const rtcp::CommonHeader& rtcp_block, |
| 206 | PacketInformation* packet_information) |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 207 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
Erik Språng | 6b8d355 | 2015-09-24 15:06:57 +0200 | [diff] [blame] | 208 | |
asapersson@webrtc.org | cb79141 | 2014-12-18 14:30:32 +0000 | [diff] [blame] | 209 | RTCPHelp::RTCPReportBlockInformation* CreateOrGetReportBlockInformation( |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 210 | uint32_t remote_ssrc, |
| 211 | uint32_t source_ssrc) |
| 212 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
asapersson@webrtc.org | cb79141 | 2014-12-18 14:30:32 +0000 | [diff] [blame] | 213 | RTCPHelp::RTCPReportBlockInformation* GetReportBlockInformation( |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 214 | uint32_t remote_ssrc, |
| 215 | uint32_t source_ssrc) const |
| 216 | EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
asapersson@webrtc.org | cb79141 | 2014-12-18 14:30:32 +0000 | [diff] [blame] | 217 | |
Peter Boström | fe7a80c | 2015-04-23 17:53:17 +0200 | [diff] [blame] | 218 | Clock* const _clock; |
| 219 | const bool receiver_only_; |
danilchap | 59cb2bd | 2016-08-29 11:08:47 -0700 | [diff] [blame] | 220 | ModuleRtpRtcp& _rtpRtcp; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 221 | |
danilchap | 7c9426c | 2016-04-14 03:05:31 -0700 | [diff] [blame] | 222 | rtc::CriticalSection _criticalSectionFeedbacks; |
mflodman@webrtc.org | 96abda0 | 2015-02-25 13:50:10 +0000 | [diff] [blame] | 223 | RtcpBandwidthObserver* const _cbRtcpBandwidthObserver; |
| 224 | RtcpIntraFrameObserver* const _cbRtcpIntraFrameObserver; |
Erik Språng | 6b8d355 | 2015-09-24 15:06:57 +0200 | [diff] [blame] | 225 | TransportFeedbackObserver* const _cbTransportFeedbackObserver; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 226 | |
danilchap | 7c9426c | 2016-04-14 03:05:31 -0700 | [diff] [blame] | 227 | rtc::CriticalSection _criticalSectionRTCPReceiver; |
sprang | 7dc39f3 | 2015-10-13 09:17:48 -0700 | [diff] [blame] | 228 | uint32_t main_ssrc_ GUARDED_BY(_criticalSectionRTCPReceiver); |
| 229 | uint32_t _remoteSSRC GUARDED_BY(_criticalSectionRTCPReceiver); |
| 230 | std::set<uint32_t> registered_ssrcs_ GUARDED_BY(_criticalSectionRTCPReceiver); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 231 | |
pwestin@webrtc.org | 26f8d9c | 2012-01-19 15:53:09 +0000 | [diff] [blame] | 232 | // Received send report |
| 233 | RTCPSenderInfo _remoteSenderInfo; |
| 234 | // when did we receive the last send report |
pbos@webrtc.org | 2f44673 | 2013-04-08 11:08:41 +0000 | [diff] [blame] | 235 | uint32_t _lastReceivedSRNTPsecs; |
| 236 | uint32_t _lastReceivedSRNTPfrac; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 237 | |
asapersson@webrtc.org | 8469f7b | 2013-10-02 13:15:34 +0000 | [diff] [blame] | 238 | // Received XR receive time report. |
danilchap | 798896a | 2016-09-28 02:54:25 -0700 | [diff] [blame] | 239 | rtcp::ReceiveTimeInfo remote_time_info_; |
asapersson@webrtc.org | 8469f7b | 2013-10-02 13:15:34 +0000 | [diff] [blame] | 240 | // Time when the report was received. |
| 241 | uint32_t _lastReceivedXRNTPsecs; |
| 242 | uint32_t _lastReceivedXRNTPfrac; |
asapersson@webrtc.org | 7d6bd22 | 2013-10-31 12:14:34 +0000 | [diff] [blame] | 243 | // Estimated rtt, zero when there is no valid estimate. |
Danil Chapovalov | c1e55c7 | 2016-03-09 15:14:35 +0100 | [diff] [blame] | 244 | bool xr_rrtr_status_ GUARDED_BY(_criticalSectionRTCPReceiver); |
pkasting@chromium.org | 16825b1 | 2015-01-12 21:51:21 +0000 | [diff] [blame] | 245 | int64_t xr_rr_rtt_ms_; |
asapersson@webrtc.org | 8469f7b | 2013-10-02 13:15:34 +0000 | [diff] [blame] | 246 | |
pwestin@webrtc.org | 26f8d9c | 2012-01-19 15:53:09 +0000 | [diff] [blame] | 247 | // Received report blocks. |
asapersson@webrtc.org | cb79141 | 2014-12-18 14:30:32 +0000 | [diff] [blame] | 248 | ReportBlockMap _receivedReportBlockMap |
| 249 | GUARDED_BY(_criticalSectionRTCPReceiver); |
danilchap | 7851bda | 2016-09-29 15:28:07 -0700 | [diff] [blame^] | 250 | ReceivedInfoMap received_infos_ GUARDED_BY(_criticalSectionRTCPReceiver); |
danilchap | 9532124 | 2016-09-27 07:05:32 -0700 | [diff] [blame] | 251 | std::map<uint32_t, std::string> received_cnames_ |
| 252 | GUARDED_BY(_criticalSectionRTCPReceiver); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 253 | |
mflodman@webrtc.org | 2f225ca | 2013-01-09 13:54:43 +0000 | [diff] [blame] | 254 | // The last time we received an RTCP RR. |
| 255 | int64_t _lastReceivedRrMs; |
| 256 | |
asapersson@webrtc.org | cb79141 | 2014-12-18 14:30:32 +0000 | [diff] [blame] | 257 | // 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] | 258 | // delivered RTP packet to the remote side. |
| 259 | int64_t _lastIncreasedSequenceNumberMs; |
stefan@webrtc.org | 8ca8a71 | 2013-04-23 16:48:32 +0000 | [diff] [blame] | 260 | |
pbos@webrtc.org | a28a91d | 2015-02-17 14:45:08 +0000 | [diff] [blame] | 261 | RtcpStatisticsCallback* stats_callback_ GUARDED_BY(_criticalSectionFeedbacks); |
asapersson@webrtc.org | 8098e07 | 2014-02-19 11:59:02 +0000 | [diff] [blame] | 262 | |
pbos@webrtc.org | 1d0fa5d | 2015-02-19 12:47:00 +0000 | [diff] [blame] | 263 | RtcpPacketTypeCounterObserver* const packet_type_counter_observer_; |
asapersson@webrtc.org | 8098e07 | 2014-02-19 11:59:02 +0000 | [diff] [blame] | 264 | RtcpPacketTypeCounter packet_type_counter_; |
asapersson@webrtc.org | 2dd3134 | 2014-10-29 12:42:30 +0000 | [diff] [blame] | 265 | |
| 266 | RTCPUtility::NackStats nack_stats_; |
Erik Språng | 6b8d355 | 2015-09-24 15:06:57 +0200 | [diff] [blame] | 267 | |
| 268 | size_t num_skipped_packets_; |
| 269 | int64_t last_skipped_packets_warning_; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 270 | }; |
pbos@webrtc.org | d900e8b | 2013-07-03 15:12:26 +0000 | [diff] [blame] | 271 | } // namespace webrtc |
danilchap | da161d7 | 2016-08-19 07:29:46 -0700 | [diff] [blame] | 272 | #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_RECEIVER_H_ |