blob: f06a2fec3ed62913c4a63be0b7b797718e9579c6 [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.org2f446732013-04-08 11:08:41 +000072 RTCPSender(const int32_t id, const bool audio,
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +000073 Clock* clock,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +000074 ReceiveStatistics* receive_statistics);
niklase@google.com470e71d2011-07-07 08:21:25 +000075 virtual ~RTCPSender();
76
pbos@webrtc.org2f446732013-04-08 11:08:41 +000077 int32_t RegisterSendTransport(Transport* outgoingTransport);
niklase@google.com470e71d2011-07-07 08:21:25 +000078
79 RTCPMethod Status() const;
pbos@webrtc.org2f446732013-04-08 11:08:41 +000080 int32_t SetRTCPStatus(const RTCPMethod method);
niklase@google.com470e71d2011-07-07 08:21:25 +000081
82 bool Sending() const;
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +000083 int32_t SetSendingStatus(const FeedbackState& feedback_state,
84 bool enabled); // combine the functions
niklase@google.com470e71d2011-07-07 08:21:25 +000085
pbos@webrtc.org2f446732013-04-08 11:08:41 +000086 int32_t SetNackStatus(const bool enable);
niklase@google.com470e71d2011-07-07 08:21:25 +000087
stefan@webrtc.org7c3523c2012-09-11 07:00:42 +000088 void SetStartTimestamp(uint32_t start_timestamp);
89
90 void SetLastRtpTime(uint32_t rtp_timestamp,
91 int64_t capture_time_ms);
92
pbos@webrtc.org2f446732013-04-08 11:08:41 +000093 void SetSSRC( const uint32_t ssrc);
niklase@google.com470e71d2011-07-07 08:21:25 +000094
wu@webrtc.org822fbd82013-08-15 23:38:54 +000095 void SetRemoteSSRC(uint32_t ssrc);
niklase@google.com470e71d2011-07-07 08:21:25 +000096
stefan@webrtc.org7da34592013-04-09 14:56:29 +000097 int32_t SetCameraDelay(const int32_t delayMS);
98
pbos@webrtc.org2f446732013-04-08 11:08:41 +000099 int32_t SetCNAME(const char cName[RTCP_CNAME_SIZE]);
niklase@google.com470e71d2011-07-07 08:21:25 +0000100
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000101 int32_t AddMixedCNAME(const uint32_t SSRC,
102 const char cName[RTCP_CNAME_SIZE]);
niklase@google.com470e71d2011-07-07 08:21:25 +0000103
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000104 int32_t RemoveMixedCNAME(const uint32_t SSRC);
niklase@google.com470e71d2011-07-07 08:21:25 +0000105
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000106 uint32_t SendTimeOfSendReport(const 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
niklase@google.com470e71d2011-07-07 08:21:25 +0000110 bool TimeToSendRTCPReport(const bool sendKeyframeBeforeRTP = false) const;
111
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.org2f446732013-04-08 11:08:41 +0000133 int32_t SetREMBStatus(const bool enable);
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000134
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000135 int32_t SetREMBData(const uint32_t bitrate,
pbos@webrtc.org49ff40e2014-11-13 14:42:37 +0000136 const std::vector<uint32_t>& ssrcs);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000137
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000138 /*
niklase@google.com470e71d2011-07-07 08:21:25 +0000139 * TMMBR
140 */
141 bool TMMBR() const;
142
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000143 int32_t SetTMMBRStatus(const bool enable);
niklase@google.com470e71d2011-07-07 08:21:25 +0000144
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000145 int32_t SetTMMBN(const TMMBRSet* boundingSet,
146 const uint32_t maxBitrateKbit);
niklase@google.com470e71d2011-07-07 08:21:25 +0000147
niklase@google.com470e71d2011-07-07 08:21:25 +0000148 /*
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000149 * Extended jitter report
150 */
151 bool IJ() const;
152
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000153 int32_t SetIJStatus(const bool enable);
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000154
155 /*
niklase@google.com470e71d2011-07-07 08:21:25 +0000156 *
157 */
158
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000159 int32_t SetApplicationSpecificData(const uint8_t subType,
160 const uint32_t name,
161 const uint8_t* data,
162 const uint16_t length);
niklase@google.com470e71d2011-07-07 08:21:25 +0000163
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000164 int32_t SetRTCPVoIPMetrics(const RTCPVoIPMetric* VoIPMetric);
niklase@google.com470e71d2011-07-07 08:21:25 +0000165
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000166 void SendRtcpXrReceiverReferenceTime(bool enable);
167
asapersson@webrtc.org8d02f5d2013-11-21 08:57:04 +0000168 bool RtcpXrReceiverReferenceTime() const;
169
pbos@webrtc.org9334ac22014-11-24 08:25:50 +0000170 void SetCsrcs(const std::vector<uint32_t>& csrcs);
niklase@google.com470e71d2011-07-07 08:21:25 +0000171
stefan@webrtc.org9354cc92012-06-07 08:10:14 +0000172 void SetTargetBitrate(unsigned int target_bitrate);
mflodman@webrtc.org117c1192012-01-13 08:52:58 +0000173
asapersson@webrtc.org8098e072014-02-19 11:59:02 +0000174 void GetPacketTypeCounter(RtcpPacketTypeCounter* packet_counter) const;
175
niklase@google.com470e71d2011-07-07 08:21:25 +0000176private:
pkasting@chromium.org4591fbd2014-11-20 22:28:14 +0000177 int32_t SendToNetwork(const uint8_t* dataBuffer, const size_t length);
niklase@google.com470e71d2011-07-07 08:21:25 +0000178
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000179 int32_t WriteAllReportBlocksToBuffer(uint8_t* rtcpbuffer,
180 int pos,
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000181 uint8_t& numberOfReportBlocks,
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000182 const uint32_t NTPsec,
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000183 const uint32_t NTPfrac)
184 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000185
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000186 int32_t WriteReportBlocksToBuffer(
187 uint8_t* rtcpbuffer,
188 int32_t position,
189 const std::map<uint32_t, RTCPReportBlock*>& report_blocks);
190
191 int32_t AddReportBlock(
192 uint32_t SSRC,
193 std::map<uint32_t, RTCPReportBlock*>* report_blocks,
194 const RTCPReportBlock* receiveBlock);
195
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +0000196 bool PrepareReport(const FeedbackState& feedback_state,
197 StreamStatistician* statistician,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000198 RTCPReportBlock* report_block,
199 uint32_t* ntp_secs, uint32_t* ntp_frac);
200
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +0000201 int32_t BuildSR(const FeedbackState& feedback_state,
202 uint8_t* rtcpbuffer,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000203 int& pos,
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +0000204 uint32_t NTPsec,
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000205 uint32_t NTPfrac)
206 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000207
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000208 int32_t BuildRR(uint8_t* rtcpbuffer,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000209 int& pos,
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000210 const uint32_t NTPsec,
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000211 const uint32_t NTPfrac)
212 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000213
214 int PrepareRTCP(
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +0000215 const FeedbackState& feedback_state,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000216 uint32_t packetTypeFlags,
217 int32_t nackSize,
218 const uint16_t* nackList,
219 bool repeat,
220 uint64_t pictureID,
221 uint8_t* rtcp_buffer,
222 int buffer_size);
223
224 bool ShouldSendReportBlocks(uint32_t rtcp_packet_type) const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000225
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000226 int32_t BuildExtendedJitterReport(
227 uint8_t* rtcpbuffer,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000228 int& pos,
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000229 const uint32_t jitterTransmissionTimeOffset)
230 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000231
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000232 int32_t BuildSDEC(uint8_t* rtcpbuffer, int& pos)
233 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
234 int32_t BuildPLI(uint8_t* rtcpbuffer, int& pos)
235 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
236 int32_t BuildREMB(uint8_t* rtcpbuffer, int& pos)
237 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
238 int32_t BuildTMMBR(ModuleRtpRtcpImpl* module, uint8_t* rtcpbuffer, int& pos)
239 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
240 int32_t BuildTMMBN(uint8_t* rtcpbuffer, int& pos)
241 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
242 int32_t BuildAPP(uint8_t* rtcpbuffer, int& pos)
243 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
244 int32_t BuildVoIPMetric(uint8_t* rtcpbuffer, int& pos)
245 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
246 int32_t BuildBYE(uint8_t* rtcpbuffer, int& pos)
247 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
248 int32_t BuildFIR(uint8_t* rtcpbuffer, int& pos, bool repeat)
249 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
250 int32_t BuildSLI(uint8_t* rtcpbuffer, int& pos, const uint8_t pictureID)
251 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000252 int32_t BuildRPSI(uint8_t* rtcpbuffer,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000253 int& pos,
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000254 const uint64_t pictureID,
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000255 const uint8_t payloadType)
256 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000257
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000258 int32_t BuildNACK(uint8_t* rtcpbuffer,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000259 int& pos,
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000260 const int32_t nackSize,
261 const uint16_t* nackList,
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000262 std::string* nackString)
263 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000264 int32_t BuildReceiverReferenceTime(uint8_t* buffer,
265 int& pos,
266 uint32_t ntp_sec,
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000267 uint32_t ntp_frac)
268 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000269 int32_t BuildDlrr(uint8_t* buffer,
270 int& pos,
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000271 const RtcpReceiveTimeInfo& info)
272 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000273
niklase@google.com470e71d2011-07-07 08:21:25 +0000274private:
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000275 const int32_t _id;
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000276 const bool _audio;
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000277 Clock* const _clock;
278 RTCPMethod _method GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000279
henrike@webrtc.org65573f22011-12-13 19:17:27 +0000280 CriticalSectionWrapper* _criticalSectionTransport;
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000281 Transport* _cbTransport GUARDED_BY(_criticalSectionTransport);
niklase@google.com470e71d2011-07-07 08:21:25 +0000282
henrike@webrtc.org65573f22011-12-13 19:17:27 +0000283 CriticalSectionWrapper* _criticalSectionRTCPSender;
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000284 bool _usingNack GUARDED_BY(_criticalSectionRTCPSender);
285 bool _sending GUARDED_BY(_criticalSectionRTCPSender);
286 bool _sendTMMBN GUARDED_BY(_criticalSectionRTCPSender);
287 bool _REMB GUARDED_BY(_criticalSectionRTCPSender);
288 bool _sendREMB GUARDED_BY(_criticalSectionRTCPSender);
289 bool _TMMBR GUARDED_BY(_criticalSectionRTCPSender);
290 bool _IJ GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000291
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000292 int64_t _nextTimeToSendRTCP GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000293
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000294 uint32_t start_timestamp_ GUARDED_BY(_criticalSectionRTCPSender);
295 uint32_t last_rtp_timestamp_ GUARDED_BY(_criticalSectionRTCPSender);
296 int64_t last_frame_capture_time_ms_ GUARDED_BY(_criticalSectionRTCPSender);
297 uint32_t _SSRC GUARDED_BY(_criticalSectionRTCPSender);
298 // SSRC that we receive on our RTP channel
299 uint32_t _remoteSSRC GUARDED_BY(_criticalSectionRTCPSender);
300 char _CNAME[RTCP_CNAME_SIZE] GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000301
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000302 ReceiveStatistics* receive_statistics_
303 GUARDED_BY(_criticalSectionRTCPSender);
304 std::map<uint32_t, RTCPReportBlock*> internal_report_blocks_
305 GUARDED_BY(_criticalSectionRTCPSender);
306 std::map<uint32_t, RTCPReportBlock*> external_report_blocks_
307 GUARDED_BY(_criticalSectionRTCPSender);
308 std::map<uint32_t, RTCPUtility::RTCPCnameInformation*> _csrcCNAMEs
309 GUARDED_BY(_criticalSectionRTCPSender);
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000310
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000311 int32_t _cameraDelayMS GUARDED_BY(_criticalSectionRTCPSender);
stefan@webrtc.org7da34592013-04-09 14:56:29 +0000312
niklase@google.com470e71d2011-07-07 08:21:25 +0000313 // Sent
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000314 uint32_t _lastSendReport[RTCP_NUMBER_OF_SR] GUARDED_BY(
315 _criticalSectionRTCPSender); // allow packet loss and RTT above 1 sec
316 uint32_t _lastRTCPTime[RTCP_NUMBER_OF_SR] GUARDED_BY(
317 _criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000318
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000319 // Sent XR receiver reference time report.
320 // <mid ntp (mid 32 bits of the 64 bits NTP timestamp), send time in ms>.
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000321 std::map<uint32_t, int64_t> last_xr_rr_
322 GUARDED_BY(_criticalSectionRTCPSender);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000323
niklase@google.com470e71d2011-07-07 08:21:25 +0000324 // send CSRCs
pbos@webrtc.org9334ac22014-11-24 08:25:50 +0000325 std::vector<uint32_t> csrcs_ GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000326
327 // Full intra request
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000328 uint8_t _sequenceNumberFIR GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000329
stefan@webrtc.org4ef438e2014-07-11 09:55:30 +0000330 // REMB
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000331 uint32_t _rembBitrate GUARDED_BY(_criticalSectionRTCPSender);
pbos@webrtc.org49ff40e2014-11-13 14:42:37 +0000332 std::vector<uint32_t> remb_ssrcs_ GUARDED_BY(_criticalSectionRTCPSender);
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000333
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000334 TMMBRHelp _tmmbrHelp GUARDED_BY(_criticalSectionRTCPSender);
335 uint32_t _tmmbr_Send GUARDED_BY(_criticalSectionRTCPSender);
336 uint32_t _packetOH_Send GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000337
338 // APP
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000339 bool _appSend GUARDED_BY(_criticalSectionRTCPSender);
340 uint8_t _appSubType GUARDED_BY(_criticalSectionRTCPSender);
341 uint32_t _appName GUARDED_BY(_criticalSectionRTCPSender);
342 uint8_t* _appData GUARDED_BY(_criticalSectionRTCPSender);
343 uint16_t _appLength GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000344
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000345 // True if sending of XR Receiver reference time report is enabled.
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000346 bool xrSendReceiverReferenceTimeEnabled_
347 GUARDED_BY(_criticalSectionRTCPSender);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000348
niklase@google.com470e71d2011-07-07 08:21:25 +0000349 // XR VoIP metric
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000350 bool _xrSendVoIPMetric GUARDED_BY(_criticalSectionRTCPSender);
351 RTCPVoIPMetric _xrVoIPMetric GUARDED_BY(_criticalSectionRTCPSender);
edjee@google.com79b02892013-04-04 19:43:34 +0000352
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000353 RtcpPacketTypeCounter packet_type_counter_
354 GUARDED_BY(_criticalSectionRTCPSender);
asapersson@webrtc.org2dd31342014-10-29 12:42:30 +0000355
356 RTCPUtility::NackStats nack_stats_ GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000357};
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +0000358} // namespace webrtc
niklase@google.com470e71d2011-07-07 08:21:25 +0000359
360#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_SENDER_H_