blob: 668c7c772b28197d71e80cb879eb3423322f0b9d [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;
59 uint32_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.org2f446732013-04-08 11:08:41 +0000170 int32_t SetCSRCs(const uint32_t arrOfCSRC[kRtpCsrcSize],
171 const uint8_t arrLength);
niklase@google.com470e71d2011-07-07 08:21:25 +0000172
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000173 int32_t SetCSRCStatus(const bool include);
niklase@google.com470e71d2011-07-07 08:21:25 +0000174
stefan@webrtc.org9354cc92012-06-07 08:10:14 +0000175 void SetTargetBitrate(unsigned int target_bitrate);
mflodman@webrtc.org117c1192012-01-13 08:52:58 +0000176
asapersson@webrtc.org8098e072014-02-19 11:59:02 +0000177 void GetPacketTypeCounter(RtcpPacketTypeCounter* packet_counter) const;
178
niklase@google.com470e71d2011-07-07 08:21:25 +0000179private:
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000180 int32_t SendToNetwork(const uint8_t* dataBuffer, const uint16_t length);
niklase@google.com470e71d2011-07-07 08:21:25 +0000181
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000182 int32_t WriteAllReportBlocksToBuffer(uint8_t* rtcpbuffer,
183 int pos,
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000184 uint8_t& numberOfReportBlocks,
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000185 const uint32_t NTPsec,
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000186 const uint32_t NTPfrac)
187 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000188
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000189 int32_t WriteReportBlocksToBuffer(
190 uint8_t* rtcpbuffer,
191 int32_t position,
192 const std::map<uint32_t, RTCPReportBlock*>& report_blocks);
193
194 int32_t AddReportBlock(
195 uint32_t SSRC,
196 std::map<uint32_t, RTCPReportBlock*>* report_blocks,
197 const RTCPReportBlock* receiveBlock);
198
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +0000199 bool PrepareReport(const FeedbackState& feedback_state,
200 StreamStatistician* statistician,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000201 RTCPReportBlock* report_block,
202 uint32_t* ntp_secs, uint32_t* ntp_frac);
203
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +0000204 int32_t BuildSR(const FeedbackState& feedback_state,
205 uint8_t* rtcpbuffer,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000206 int& pos,
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +0000207 uint32_t NTPsec,
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000208 uint32_t NTPfrac)
209 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000210
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000211 int32_t BuildRR(uint8_t* rtcpbuffer,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000212 int& pos,
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000213 const uint32_t NTPsec,
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000214 const uint32_t NTPfrac)
215 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000216
217 int PrepareRTCP(
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +0000218 const FeedbackState& feedback_state,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000219 uint32_t packetTypeFlags,
220 int32_t nackSize,
221 const uint16_t* nackList,
222 bool repeat,
223 uint64_t pictureID,
224 uint8_t* rtcp_buffer,
225 int buffer_size);
226
227 bool ShouldSendReportBlocks(uint32_t rtcp_packet_type) const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000228
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000229 int32_t BuildExtendedJitterReport(
230 uint8_t* rtcpbuffer,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000231 int& pos,
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000232 const uint32_t jitterTransmissionTimeOffset)
233 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000234
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000235 int32_t BuildSDEC(uint8_t* rtcpbuffer, int& pos)
236 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
237 int32_t BuildPLI(uint8_t* rtcpbuffer, int& pos)
238 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
239 int32_t BuildREMB(uint8_t* rtcpbuffer, int& pos)
240 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
241 int32_t BuildTMMBR(ModuleRtpRtcpImpl* module, uint8_t* rtcpbuffer, int& pos)
242 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
243 int32_t BuildTMMBN(uint8_t* rtcpbuffer, int& pos)
244 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
245 int32_t BuildAPP(uint8_t* rtcpbuffer, int& pos)
246 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
247 int32_t BuildVoIPMetric(uint8_t* rtcpbuffer, int& pos)
248 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
249 int32_t BuildBYE(uint8_t* rtcpbuffer, int& pos)
250 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
251 int32_t BuildFIR(uint8_t* rtcpbuffer, int& pos, bool repeat)
252 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
253 int32_t BuildSLI(uint8_t* rtcpbuffer, int& pos, const uint8_t pictureID)
254 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000255 int32_t BuildRPSI(uint8_t* rtcpbuffer,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000256 int& pos,
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000257 const uint64_t pictureID,
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000258 const uint8_t payloadType)
259 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000260
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000261 int32_t BuildNACK(uint8_t* rtcpbuffer,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000262 int& pos,
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000263 const int32_t nackSize,
264 const uint16_t* nackList,
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000265 std::string* nackString)
266 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000267 int32_t BuildReceiverReferenceTime(uint8_t* buffer,
268 int& pos,
269 uint32_t ntp_sec,
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000270 uint32_t ntp_frac)
271 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000272 int32_t BuildDlrr(uint8_t* buffer,
273 int& pos,
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000274 const RtcpReceiveTimeInfo& info)
275 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000276
niklase@google.com470e71d2011-07-07 08:21:25 +0000277private:
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000278 const int32_t _id;
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000279 const bool _audio;
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000280 Clock* const _clock;
281 RTCPMethod _method GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000282
henrike@webrtc.org65573f22011-12-13 19:17:27 +0000283 CriticalSectionWrapper* _criticalSectionTransport;
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000284 Transport* _cbTransport GUARDED_BY(_criticalSectionTransport);
niklase@google.com470e71d2011-07-07 08:21:25 +0000285
henrike@webrtc.org65573f22011-12-13 19:17:27 +0000286 CriticalSectionWrapper* _criticalSectionRTCPSender;
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000287 bool _usingNack GUARDED_BY(_criticalSectionRTCPSender);
288 bool _sending GUARDED_BY(_criticalSectionRTCPSender);
289 bool _sendTMMBN GUARDED_BY(_criticalSectionRTCPSender);
290 bool _REMB GUARDED_BY(_criticalSectionRTCPSender);
291 bool _sendREMB GUARDED_BY(_criticalSectionRTCPSender);
292 bool _TMMBR GUARDED_BY(_criticalSectionRTCPSender);
293 bool _IJ GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000294
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000295 int64_t _nextTimeToSendRTCP GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000296
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000297 uint32_t start_timestamp_ GUARDED_BY(_criticalSectionRTCPSender);
298 uint32_t last_rtp_timestamp_ GUARDED_BY(_criticalSectionRTCPSender);
299 int64_t last_frame_capture_time_ms_ GUARDED_BY(_criticalSectionRTCPSender);
300 uint32_t _SSRC GUARDED_BY(_criticalSectionRTCPSender);
301 // SSRC that we receive on our RTP channel
302 uint32_t _remoteSSRC GUARDED_BY(_criticalSectionRTCPSender);
303 char _CNAME[RTCP_CNAME_SIZE] GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000304
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000305 ReceiveStatistics* receive_statistics_
306 GUARDED_BY(_criticalSectionRTCPSender);
307 std::map<uint32_t, RTCPReportBlock*> internal_report_blocks_
308 GUARDED_BY(_criticalSectionRTCPSender);
309 std::map<uint32_t, RTCPReportBlock*> external_report_blocks_
310 GUARDED_BY(_criticalSectionRTCPSender);
311 std::map<uint32_t, RTCPUtility::RTCPCnameInformation*> _csrcCNAMEs
312 GUARDED_BY(_criticalSectionRTCPSender);
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000313
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000314 int32_t _cameraDelayMS GUARDED_BY(_criticalSectionRTCPSender);
stefan@webrtc.org7da34592013-04-09 14:56:29 +0000315
niklase@google.com470e71d2011-07-07 08:21:25 +0000316 // Sent
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000317 uint32_t _lastSendReport[RTCP_NUMBER_OF_SR] GUARDED_BY(
318 _criticalSectionRTCPSender); // allow packet loss and RTT above 1 sec
319 uint32_t _lastRTCPTime[RTCP_NUMBER_OF_SR] GUARDED_BY(
320 _criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000321
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000322 // Sent XR receiver reference time report.
323 // <mid ntp (mid 32 bits of the 64 bits NTP timestamp), send time in ms>.
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000324 std::map<uint32_t, int64_t> last_xr_rr_
325 GUARDED_BY(_criticalSectionRTCPSender);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000326
niklase@google.com470e71d2011-07-07 08:21:25 +0000327 // send CSRCs
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000328 uint8_t _CSRCs GUARDED_BY(_criticalSectionRTCPSender);
329 uint32_t _CSRC[kRtpCsrcSize] GUARDED_BY(_criticalSectionRTCPSender);
330 bool _includeCSRCs GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000331
332 // Full intra request
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000333 uint8_t _sequenceNumberFIR GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000334
stefan@webrtc.org4ef438e2014-07-11 09:55:30 +0000335 // REMB
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000336 uint32_t _rembBitrate GUARDED_BY(_criticalSectionRTCPSender);
pbos@webrtc.org49ff40e2014-11-13 14:42:37 +0000337 std::vector<uint32_t> remb_ssrcs_ GUARDED_BY(_criticalSectionRTCPSender);
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000338
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000339 TMMBRHelp _tmmbrHelp GUARDED_BY(_criticalSectionRTCPSender);
340 uint32_t _tmmbr_Send GUARDED_BY(_criticalSectionRTCPSender);
341 uint32_t _packetOH_Send GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000342
343 // APP
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000344 bool _appSend GUARDED_BY(_criticalSectionRTCPSender);
345 uint8_t _appSubType GUARDED_BY(_criticalSectionRTCPSender);
346 uint32_t _appName GUARDED_BY(_criticalSectionRTCPSender);
347 uint8_t* _appData GUARDED_BY(_criticalSectionRTCPSender);
348 uint16_t _appLength GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000349
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000350 // True if sending of XR Receiver reference time report is enabled.
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000351 bool xrSendReceiverReferenceTimeEnabled_
352 GUARDED_BY(_criticalSectionRTCPSender);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000353
niklase@google.com470e71d2011-07-07 08:21:25 +0000354 // XR VoIP metric
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000355 bool _xrSendVoIPMetric GUARDED_BY(_criticalSectionRTCPSender);
356 RTCPVoIPMetric _xrVoIPMetric GUARDED_BY(_criticalSectionRTCPSender);
edjee@google.com79b02892013-04-04 19:43:34 +0000357
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000358 RtcpPacketTypeCounter packet_type_counter_
359 GUARDED_BY(_criticalSectionRTCPSender);
asapersson@webrtc.org2dd31342014-10-29 12:42:30 +0000360
361 RTCPUtility::NackStats nack_stats_ GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000362};
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +0000363} // namespace webrtc
niklase@google.com470e71d2011-07-07 08:21:25 +0000364
365#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_SENDER_H_