blob: 0cb08aa2e96da7356e595ed57ff322dd0d1206dd [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_SENDER_H_
12#define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_SENDER_H_
13
pwestin@webrtc.org26f8d9c2012-01-19 15:53:09 +000014#include <map>
edjee@google.com79b02892013-04-04 19:43:34 +000015#include <sstream>
16#include <string>
pwestin@webrtc.org26f8d9c2012-01-19 15:53:09 +000017
pbos@webrtc.org38344ed2014-09-24 06:05:00 +000018#include "webrtc/base/thread_annotations.h"
pbos@webrtc.orga048d7c2013-05-29 14:27:38 +000019#include "webrtc/modules/remote_bitrate_estimator/include/bwe_defines.h"
20#include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h"
wu@webrtc.org822fbd82013-08-15 23:38:54 +000021#include "webrtc/modules/rtp_rtcp/interface/receive_statistics.h"
pbos@webrtc.orga048d7c2013-05-29 14:27:38 +000022#include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h"
23#include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h"
24#include "webrtc/modules/rtp_rtcp/source/rtp_utility.h"
25#include "webrtc/modules/rtp_rtcp/source/tmmbr_help.h"
26#include "webrtc/system_wrappers/interface/scoped_ptr.h"
27#include "webrtc/typedefs.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000028
29namespace webrtc {
pwestin@webrtc.org741da942011-09-20 13:52:04 +000030
wu@webrtc.org822fbd82013-08-15 23:38:54 +000031class ModuleRtpRtcpImpl;
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +000032class RTCPReceiver;
pwestin@webrtc.org741da942011-09-20 13:52:04 +000033
edjee@google.com79b02892013-04-04 19:43:34 +000034class NACKStringBuilder
35{
36public:
37 NACKStringBuilder();
pbos@webrtc.orgf3e4cee2013-07-31 15:17:19 +000038 ~NACKStringBuilder();
39
pbos@webrtc.org2f446732013-04-08 11:08:41 +000040 void PushNACK(uint16_t nack);
edjee@google.com79b02892013-04-04 19:43:34 +000041 std::string GetResult();
42
43private:
44 std::ostringstream _stream;
45 int _count;
pbos@webrtc.org2f446732013-04-08 11:08:41 +000046 uint16_t _prevNack;
edjee@google.com79b02892013-04-04 19:43:34 +000047 bool _consecutive;
48};
49
niklase@google.com470e71d2011-07-07 08:21:25 +000050class RTCPSender
51{
52public:
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +000053 struct FeedbackState {
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +000054 FeedbackState();
55
56 uint8_t send_payload_type;
57 uint32_t frequency_hz;
pbos@webrtc.org2f4b14e2014-07-15 15:25:39 +000058 uint32_t packets_sent;
pkasting@chromium.org4591fbd2014-11-20 22:28:14 +000059 size_t media_bytes_sent;
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +000060 uint32_t send_bitrate;
61
62 uint32_t last_rr_ntp_secs;
63 uint32_t last_rr_ntp_frac;
64 uint32_t remote_sr;
65
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +000066 bool has_last_xr_rr;
67 RtcpReceiveTimeInfo last_xr_rr;
68
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +000069 // Used when generating TMMBR.
70 ModuleRtpRtcpImpl* module;
71 };
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +000072 RTCPSender(int32_t id,
73 bool audio,
74 Clock* clock,
75 ReceiveStatistics* receive_statistics);
niklase@google.com470e71d2011-07-07 08:21:25 +000076 virtual ~RTCPSender();
77
pbos@webrtc.org2f446732013-04-08 11:08:41 +000078 int32_t RegisterSendTransport(Transport* outgoingTransport);
niklase@google.com470e71d2011-07-07 08:21:25 +000079
80 RTCPMethod Status() const;
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +000081 void SetRTCPStatus(RTCPMethod method);
niklase@google.com470e71d2011-07-07 08:21:25 +000082
83 bool Sending() const;
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +000084 int32_t SetSendingStatus(const FeedbackState& feedback_state,
85 bool enabled); // combine the functions
niklase@google.com470e71d2011-07-07 08:21:25 +000086
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +000087 int32_t SetNackStatus(bool enable);
niklase@google.com470e71d2011-07-07 08:21:25 +000088
stefan@webrtc.org7c3523c2012-09-11 07:00:42 +000089 void SetStartTimestamp(uint32_t start_timestamp);
90
91 void SetLastRtpTime(uint32_t rtp_timestamp,
92 int64_t capture_time_ms);
93
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +000094 void SetSSRC(uint32_t ssrc);
niklase@google.com470e71d2011-07-07 08:21:25 +000095
wu@webrtc.org822fbd82013-08-15 23:38:54 +000096 void SetRemoteSSRC(uint32_t ssrc);
niklase@google.com470e71d2011-07-07 08:21:25 +000097
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +000098 int32_t SetCameraDelay(int32_t delayMS);
stefan@webrtc.org7da34592013-04-09 14:56:29 +000099
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000100 int32_t SetCNAME(const char cName[RTCP_CNAME_SIZE]);
niklase@google.com470e71d2011-07-07 08:21:25 +0000101
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000102 int32_t AddMixedCNAME(uint32_t SSRC, const char cName[RTCP_CNAME_SIZE]);
niklase@google.com470e71d2011-07-07 08:21:25 +0000103
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000104 int32_t RemoveMixedCNAME(uint32_t SSRC);
niklase@google.com470e71d2011-07-07 08:21:25 +0000105
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000106 uint32_t SendTimeOfSendReport(uint32_t sendReport);
niklase@google.com470e71d2011-07-07 08:21:25 +0000107
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000108 bool SendTimeOfXrRrReport(uint32_t mid_ntp, int64_t* time_ms) const;
109
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000110 bool TimeToSendRTCPReport(bool sendKeyframeBeforeRTP = false) const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000111
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000112 uint32_t LastSendReport(uint32_t& lastRTCPTime);
niklase@google.com470e71d2011-07-07 08:21:25 +0000113
wu@webrtc.org822fbd82013-08-15 23:38:54 +0000114 int32_t SendRTCP(
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +0000115 const FeedbackState& feedback_state,
wu@webrtc.org822fbd82013-08-15 23:38:54 +0000116 uint32_t rtcpPacketTypeFlags,
wu@webrtc.org822fbd82013-08-15 23:38:54 +0000117 int32_t nackSize = 0,
118 const uint16_t* nackList = 0,
119 bool repeat = false,
120 uint64_t pictureID = 0);
niklase@google.com470e71d2011-07-07 08:21:25 +0000121
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000122 int32_t AddExternalReportBlock(
123 uint32_t SSRC,
124 const RTCPReportBlock* receiveBlock);
niklase@google.com470e71d2011-07-07 08:21:25 +0000125
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000126 int32_t RemoveExternalReportBlock(uint32_t SSRC);
niklase@google.com470e71d2011-07-07 08:21:25 +0000127
128 /*
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000129 * REMB
130 */
131 bool REMB() const;
132
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000133 void SetREMBStatus(bool enable);
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000134
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000135 void SetREMBData(uint32_t bitrate, const std::vector<uint32_t>& ssrcs);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000136
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000137 /*
niklase@google.com470e71d2011-07-07 08:21:25 +0000138 * TMMBR
139 */
140 bool TMMBR() const;
141
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000142 void SetTMMBRStatus(bool enable);
niklase@google.com470e71d2011-07-07 08:21:25 +0000143
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000144 int32_t SetTMMBN(const TMMBRSet* boundingSet, uint32_t maxBitrateKbit);
niklase@google.com470e71d2011-07-07 08:21:25 +0000145
niklase@google.com470e71d2011-07-07 08:21:25 +0000146 /*
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000147 * Extended jitter report
148 */
149 bool IJ() const;
150
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000151 void SetIJStatus(bool enable);
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000152
153 /*
niklase@google.com470e71d2011-07-07 08:21:25 +0000154 *
155 */
156
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000157 int32_t SetApplicationSpecificData(uint8_t subType,
158 uint32_t name,
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000159 const uint8_t* data,
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000160 uint16_t length);
niklase@google.com470e71d2011-07-07 08:21:25 +0000161
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000162 int32_t SetRTCPVoIPMetrics(const RTCPVoIPMetric* VoIPMetric);
niklase@google.com470e71d2011-07-07 08:21:25 +0000163
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000164 void SendRtcpXrReceiverReferenceTime(bool enable);
165
asapersson@webrtc.org8d02f5d2013-11-21 08:57:04 +0000166 bool RtcpXrReceiverReferenceTime() const;
167
pbos@webrtc.org9334ac22014-11-24 08:25:50 +0000168 void SetCsrcs(const std::vector<uint32_t>& csrcs);
niklase@google.com470e71d2011-07-07 08:21:25 +0000169
stefan@webrtc.org9354cc92012-06-07 08:10:14 +0000170 void SetTargetBitrate(unsigned int target_bitrate);
mflodman@webrtc.org117c1192012-01-13 08:52:58 +0000171
asapersson@webrtc.org8098e072014-02-19 11:59:02 +0000172 void GetPacketTypeCounter(RtcpPacketTypeCounter* packet_counter) const;
173
niklase@google.com470e71d2011-07-07 08:21:25 +0000174private:
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000175 int32_t SendToNetwork(const uint8_t* dataBuffer, size_t length);
niklase@google.com470e71d2011-07-07 08:21:25 +0000176
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000177 int32_t WriteAllReportBlocksToBuffer(uint8_t* rtcpbuffer,
178 int pos,
179 uint8_t& numberOfReportBlocks,
180 uint32_t NTPsec,
181 uint32_t NTPfrac)
182 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000183
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000184 int32_t WriteReportBlocksToBuffer(
185 uint8_t* rtcpbuffer,
186 int32_t position,
187 const std::map<uint32_t, RTCPReportBlock*>& report_blocks);
188
189 int32_t AddReportBlock(
190 uint32_t SSRC,
191 std::map<uint32_t, RTCPReportBlock*>* report_blocks,
192 const RTCPReportBlock* receiveBlock);
193
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +0000194 bool PrepareReport(const FeedbackState& feedback_state,
195 StreamStatistician* statistician,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000196 RTCPReportBlock* report_block,
197 uint32_t* ntp_secs, uint32_t* ntp_frac);
198
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +0000199 int32_t BuildSR(const FeedbackState& feedback_state,
200 uint8_t* rtcpbuffer,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000201 int& pos,
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +0000202 uint32_t NTPsec,
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000203 uint32_t NTPfrac)
204 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000205
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000206 int32_t BuildRR(uint8_t* rtcpbuffer,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000207 int& pos,
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000208 uint32_t NTPsec,
209 uint32_t NTPfrac)
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000210 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000211
212 int PrepareRTCP(
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +0000213 const FeedbackState& feedback_state,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000214 uint32_t packetTypeFlags,
215 int32_t nackSize,
216 const uint16_t* nackList,
217 bool repeat,
218 uint64_t pictureID,
219 uint8_t* rtcp_buffer,
220 int buffer_size);
221
222 bool ShouldSendReportBlocks(uint32_t rtcp_packet_type) const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000223
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000224 int32_t BuildExtendedJitterReport(uint8_t* rtcpbuffer,
225 int& pos,
226 uint32_t jitterTransmissionTimeOffset)
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000227 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000228
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000229 int32_t BuildSDEC(uint8_t* rtcpbuffer, int& pos)
230 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
231 int32_t BuildPLI(uint8_t* rtcpbuffer, int& pos)
232 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
233 int32_t BuildREMB(uint8_t* rtcpbuffer, int& pos)
234 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
235 int32_t BuildTMMBR(ModuleRtpRtcpImpl* module, uint8_t* rtcpbuffer, int& pos)
236 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
237 int32_t BuildTMMBN(uint8_t* rtcpbuffer, int& pos)
238 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
239 int32_t BuildAPP(uint8_t* rtcpbuffer, int& pos)
240 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
241 int32_t BuildVoIPMetric(uint8_t* rtcpbuffer, int& pos)
242 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
243 int32_t BuildBYE(uint8_t* rtcpbuffer, int& pos)
244 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
245 int32_t BuildFIR(uint8_t* rtcpbuffer, int& pos, bool repeat)
246 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000247 int32_t BuildSLI(uint8_t* rtcpbuffer, int& pos, uint8_t pictureID)
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000248 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000249 int32_t BuildRPSI(uint8_t* rtcpbuffer,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000250 int& pos,
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000251 uint64_t pictureID,
252 uint8_t payloadType)
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000253 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000254
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000255 int32_t BuildNACK(uint8_t* rtcpbuffer,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000256 int& pos,
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000257 int32_t nackSize,
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000258 const uint16_t* nackList,
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000259 std::string* nackString)
260 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000261 int32_t BuildReceiverReferenceTime(uint8_t* buffer,
262 int& pos,
263 uint32_t ntp_sec,
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000264 uint32_t ntp_frac)
265 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000266 int32_t BuildDlrr(uint8_t* buffer,
267 int& pos,
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000268 const RtcpReceiveTimeInfo& info)
269 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000270
niklase@google.com470e71d2011-07-07 08:21:25 +0000271private:
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000272 const int32_t _id;
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000273 const bool _audio;
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000274 Clock* const _clock;
275 RTCPMethod _method GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000276
henrike@webrtc.org65573f22011-12-13 19:17:27 +0000277 CriticalSectionWrapper* _criticalSectionTransport;
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000278 Transport* _cbTransport GUARDED_BY(_criticalSectionTransport);
niklase@google.com470e71d2011-07-07 08:21:25 +0000279
henrike@webrtc.org65573f22011-12-13 19:17:27 +0000280 CriticalSectionWrapper* _criticalSectionRTCPSender;
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000281 bool _usingNack GUARDED_BY(_criticalSectionRTCPSender);
282 bool _sending GUARDED_BY(_criticalSectionRTCPSender);
283 bool _sendTMMBN GUARDED_BY(_criticalSectionRTCPSender);
284 bool _REMB GUARDED_BY(_criticalSectionRTCPSender);
285 bool _sendREMB GUARDED_BY(_criticalSectionRTCPSender);
286 bool _TMMBR GUARDED_BY(_criticalSectionRTCPSender);
287 bool _IJ GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000288
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000289 int64_t _nextTimeToSendRTCP GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000290
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000291 uint32_t start_timestamp_ GUARDED_BY(_criticalSectionRTCPSender);
292 uint32_t last_rtp_timestamp_ GUARDED_BY(_criticalSectionRTCPSender);
293 int64_t last_frame_capture_time_ms_ GUARDED_BY(_criticalSectionRTCPSender);
294 uint32_t _SSRC GUARDED_BY(_criticalSectionRTCPSender);
295 // SSRC that we receive on our RTP channel
296 uint32_t _remoteSSRC GUARDED_BY(_criticalSectionRTCPSender);
297 char _CNAME[RTCP_CNAME_SIZE] GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000298
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000299 ReceiveStatistics* receive_statistics_
300 GUARDED_BY(_criticalSectionRTCPSender);
301 std::map<uint32_t, RTCPReportBlock*> internal_report_blocks_
302 GUARDED_BY(_criticalSectionRTCPSender);
303 std::map<uint32_t, RTCPReportBlock*> external_report_blocks_
304 GUARDED_BY(_criticalSectionRTCPSender);
305 std::map<uint32_t, RTCPUtility::RTCPCnameInformation*> _csrcCNAMEs
306 GUARDED_BY(_criticalSectionRTCPSender);
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000307
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000308 int32_t _cameraDelayMS GUARDED_BY(_criticalSectionRTCPSender);
stefan@webrtc.org7da34592013-04-09 14:56:29 +0000309
niklase@google.com470e71d2011-07-07 08:21:25 +0000310 // Sent
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000311 uint32_t _lastSendReport[RTCP_NUMBER_OF_SR] GUARDED_BY(
312 _criticalSectionRTCPSender); // allow packet loss and RTT above 1 sec
313 uint32_t _lastRTCPTime[RTCP_NUMBER_OF_SR] GUARDED_BY(
314 _criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000315
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000316 // Sent XR receiver reference time report.
317 // <mid ntp (mid 32 bits of the 64 bits NTP timestamp), send time in ms>.
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000318 std::map<uint32_t, int64_t> last_xr_rr_
319 GUARDED_BY(_criticalSectionRTCPSender);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000320
niklase@google.com470e71d2011-07-07 08:21:25 +0000321 // send CSRCs
pbos@webrtc.org9334ac22014-11-24 08:25:50 +0000322 std::vector<uint32_t> csrcs_ GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000323
324 // Full intra request
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000325 uint8_t _sequenceNumberFIR GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000326
stefan@webrtc.org4ef438e2014-07-11 09:55:30 +0000327 // REMB
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000328 uint32_t _rembBitrate GUARDED_BY(_criticalSectionRTCPSender);
pbos@webrtc.org49ff40e2014-11-13 14:42:37 +0000329 std::vector<uint32_t> remb_ssrcs_ GUARDED_BY(_criticalSectionRTCPSender);
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000330
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000331 TMMBRHelp _tmmbrHelp GUARDED_BY(_criticalSectionRTCPSender);
332 uint32_t _tmmbr_Send GUARDED_BY(_criticalSectionRTCPSender);
333 uint32_t _packetOH_Send GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000334
335 // APP
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000336 bool _appSend GUARDED_BY(_criticalSectionRTCPSender);
337 uint8_t _appSubType GUARDED_BY(_criticalSectionRTCPSender);
338 uint32_t _appName GUARDED_BY(_criticalSectionRTCPSender);
339 uint8_t* _appData GUARDED_BY(_criticalSectionRTCPSender);
340 uint16_t _appLength GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000341
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000342 // True if sending of XR Receiver reference time report is enabled.
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000343 bool xrSendReceiverReferenceTimeEnabled_
344 GUARDED_BY(_criticalSectionRTCPSender);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000345
niklase@google.com470e71d2011-07-07 08:21:25 +0000346 // XR VoIP metric
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000347 bool _xrSendVoIPMetric GUARDED_BY(_criticalSectionRTCPSender);
348 RTCPVoIPMetric _xrVoIPMetric GUARDED_BY(_criticalSectionRTCPSender);
edjee@google.com79b02892013-04-04 19:43:34 +0000349
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000350 RtcpPacketTypeCounter packet_type_counter_
351 GUARDED_BY(_criticalSectionRTCPSender);
asapersson@webrtc.org2dd31342014-10-29 12:42:30 +0000352
353 RTCPUtility::NackStats nack_stats_ GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000354};
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +0000355} // namespace webrtc
niklase@google.com470e71d2011-07-07 08:21:25 +0000356
357#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_SENDER_H_