blob: c0b8ebdb87b39d6f1eb1c82aebbf99ad11f42e76 [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,
136 const uint8_t numberOfSSRC,
137 const uint32_t* SSRC);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000138
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000139 /*
niklase@google.com470e71d2011-07-07 08:21:25 +0000140 * TMMBR
141 */
142 bool TMMBR() const;
143
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000144 int32_t SetTMMBRStatus(const bool enable);
niklase@google.com470e71d2011-07-07 08:21:25 +0000145
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000146 int32_t SetTMMBN(const TMMBRSet* boundingSet,
147 const uint32_t maxBitrateKbit);
niklase@google.com470e71d2011-07-07 08:21:25 +0000148
niklase@google.com470e71d2011-07-07 08:21:25 +0000149 /*
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000150 * Extended jitter report
151 */
152 bool IJ() const;
153
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000154 int32_t SetIJStatus(const bool enable);
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000155
156 /*
niklase@google.com470e71d2011-07-07 08:21:25 +0000157 *
158 */
159
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000160 int32_t SetApplicationSpecificData(const uint8_t subType,
161 const uint32_t name,
162 const uint8_t* data,
163 const uint16_t length);
niklase@google.com470e71d2011-07-07 08:21:25 +0000164
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000165 int32_t SetRTCPVoIPMetrics(const RTCPVoIPMetric* VoIPMetric);
niklase@google.com470e71d2011-07-07 08:21:25 +0000166
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000167 void SendRtcpXrReceiverReferenceTime(bool enable);
168
asapersson@webrtc.org8d02f5d2013-11-21 08:57:04 +0000169 bool RtcpXrReceiverReferenceTime() const;
170
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000171 int32_t SetCSRCs(const uint32_t arrOfCSRC[kRtpCsrcSize],
172 const uint8_t arrLength);
niklase@google.com470e71d2011-07-07 08:21:25 +0000173
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000174 int32_t SetCSRCStatus(const bool include);
niklase@google.com470e71d2011-07-07 08:21:25 +0000175
stefan@webrtc.org9354cc92012-06-07 08:10:14 +0000176 void SetTargetBitrate(unsigned int target_bitrate);
mflodman@webrtc.org117c1192012-01-13 08:52:58 +0000177
asapersson@webrtc.org8098e072014-02-19 11:59:02 +0000178 void GetPacketTypeCounter(RtcpPacketTypeCounter* packet_counter) const;
179
niklase@google.com470e71d2011-07-07 08:21:25 +0000180private:
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000181 int32_t SendToNetwork(const uint8_t* dataBuffer, const uint16_t length);
niklase@google.com470e71d2011-07-07 08:21:25 +0000182
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000183 int32_t WriteAllReportBlocksToBuffer(uint8_t* rtcpbuffer,
184 int pos,
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000185 uint8_t& numberOfReportBlocks,
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000186 const uint32_t NTPsec,
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000187 const uint32_t NTPfrac)
188 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000189
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000190 int32_t WriteReportBlocksToBuffer(
191 uint8_t* rtcpbuffer,
192 int32_t position,
193 const std::map<uint32_t, RTCPReportBlock*>& report_blocks);
194
195 int32_t AddReportBlock(
196 uint32_t SSRC,
197 std::map<uint32_t, RTCPReportBlock*>* report_blocks,
198 const RTCPReportBlock* receiveBlock);
199
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +0000200 bool PrepareReport(const FeedbackState& feedback_state,
201 StreamStatistician* statistician,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000202 RTCPReportBlock* report_block,
203 uint32_t* ntp_secs, uint32_t* ntp_frac);
204
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +0000205 int32_t BuildSR(const FeedbackState& feedback_state,
206 uint8_t* rtcpbuffer,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000207 int& pos,
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +0000208 uint32_t NTPsec,
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000209 uint32_t NTPfrac)
210 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000211
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000212 int32_t BuildRR(uint8_t* rtcpbuffer,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000213 int& pos,
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000214 const uint32_t NTPsec,
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000215 const uint32_t NTPfrac)
216 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000217
218 int PrepareRTCP(
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +0000219 const FeedbackState& feedback_state,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000220 uint32_t packetTypeFlags,
221 int32_t nackSize,
222 const uint16_t* nackList,
223 bool repeat,
224 uint64_t pictureID,
225 uint8_t* rtcp_buffer,
226 int buffer_size);
227
228 bool ShouldSendReportBlocks(uint32_t rtcp_packet_type) const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000229
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000230 int32_t BuildExtendedJitterReport(
231 uint8_t* rtcpbuffer,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000232 int& pos,
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000233 const uint32_t jitterTransmissionTimeOffset)
234 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000235
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000236 int32_t BuildSDEC(uint8_t* rtcpbuffer, int& pos)
237 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
238 int32_t BuildPLI(uint8_t* rtcpbuffer, int& pos)
239 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
240 int32_t BuildREMB(uint8_t* rtcpbuffer, int& pos)
241 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
242 int32_t BuildTMMBR(ModuleRtpRtcpImpl* module, uint8_t* rtcpbuffer, int& pos)
243 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
244 int32_t BuildTMMBN(uint8_t* rtcpbuffer, int& pos)
245 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
246 int32_t BuildAPP(uint8_t* rtcpbuffer, int& pos)
247 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
248 int32_t BuildVoIPMetric(uint8_t* rtcpbuffer, int& pos)
249 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
250 int32_t BuildBYE(uint8_t* rtcpbuffer, int& pos)
251 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
252 int32_t BuildFIR(uint8_t* rtcpbuffer, int& pos, bool repeat)
253 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
254 int32_t BuildSLI(uint8_t* rtcpbuffer, int& pos, const uint8_t pictureID)
255 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000256 int32_t BuildRPSI(uint8_t* rtcpbuffer,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000257 int& pos,
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000258 const uint64_t pictureID,
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000259 const uint8_t payloadType)
260 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000261
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000262 int32_t BuildNACK(uint8_t* rtcpbuffer,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000263 int& pos,
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000264 const int32_t nackSize,
265 const uint16_t* nackList,
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000266 std::string* nackString)
267 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000268 int32_t BuildReceiverReferenceTime(uint8_t* buffer,
269 int& pos,
270 uint32_t ntp_sec,
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000271 uint32_t ntp_frac)
272 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000273 int32_t BuildDlrr(uint8_t* buffer,
274 int& pos,
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000275 const RtcpReceiveTimeInfo& info)
276 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000277
niklase@google.com470e71d2011-07-07 08:21:25 +0000278private:
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000279 const int32_t _id;
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000280 const bool _audio;
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000281 Clock* const _clock;
282 RTCPMethod _method GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000283
henrike@webrtc.org65573f22011-12-13 19:17:27 +0000284 CriticalSectionWrapper* _criticalSectionTransport;
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000285 Transport* _cbTransport GUARDED_BY(_criticalSectionTransport);
niklase@google.com470e71d2011-07-07 08:21:25 +0000286
henrike@webrtc.org65573f22011-12-13 19:17:27 +0000287 CriticalSectionWrapper* _criticalSectionRTCPSender;
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000288 bool _usingNack GUARDED_BY(_criticalSectionRTCPSender);
289 bool _sending GUARDED_BY(_criticalSectionRTCPSender);
290 bool _sendTMMBN GUARDED_BY(_criticalSectionRTCPSender);
291 bool _REMB GUARDED_BY(_criticalSectionRTCPSender);
292 bool _sendREMB GUARDED_BY(_criticalSectionRTCPSender);
293 bool _TMMBR GUARDED_BY(_criticalSectionRTCPSender);
294 bool _IJ GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000295
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000296 int64_t _nextTimeToSendRTCP GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000297
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000298 uint32_t start_timestamp_ GUARDED_BY(_criticalSectionRTCPSender);
299 uint32_t last_rtp_timestamp_ GUARDED_BY(_criticalSectionRTCPSender);
300 int64_t last_frame_capture_time_ms_ GUARDED_BY(_criticalSectionRTCPSender);
301 uint32_t _SSRC GUARDED_BY(_criticalSectionRTCPSender);
302 // SSRC that we receive on our RTP channel
303 uint32_t _remoteSSRC GUARDED_BY(_criticalSectionRTCPSender);
304 char _CNAME[RTCP_CNAME_SIZE] GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000305
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000306 ReceiveStatistics* receive_statistics_
307 GUARDED_BY(_criticalSectionRTCPSender);
308 std::map<uint32_t, RTCPReportBlock*> internal_report_blocks_
309 GUARDED_BY(_criticalSectionRTCPSender);
310 std::map<uint32_t, RTCPReportBlock*> external_report_blocks_
311 GUARDED_BY(_criticalSectionRTCPSender);
312 std::map<uint32_t, RTCPUtility::RTCPCnameInformation*> _csrcCNAMEs
313 GUARDED_BY(_criticalSectionRTCPSender);
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000314
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000315 int32_t _cameraDelayMS GUARDED_BY(_criticalSectionRTCPSender);
stefan@webrtc.org7da34592013-04-09 14:56:29 +0000316
niklase@google.com470e71d2011-07-07 08:21:25 +0000317 // Sent
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000318 uint32_t _lastSendReport[RTCP_NUMBER_OF_SR] GUARDED_BY(
319 _criticalSectionRTCPSender); // allow packet loss and RTT above 1 sec
320 uint32_t _lastRTCPTime[RTCP_NUMBER_OF_SR] GUARDED_BY(
321 _criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000322
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000323 // Sent XR receiver reference time report.
324 // <mid ntp (mid 32 bits of the 64 bits NTP timestamp), send time in ms>.
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000325 std::map<uint32_t, int64_t> last_xr_rr_
326 GUARDED_BY(_criticalSectionRTCPSender);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000327
niklase@google.com470e71d2011-07-07 08:21:25 +0000328 // send CSRCs
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000329 uint8_t _CSRCs GUARDED_BY(_criticalSectionRTCPSender);
330 uint32_t _CSRC[kRtpCsrcSize] GUARDED_BY(_criticalSectionRTCPSender);
331 bool _includeCSRCs GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000332
333 // Full intra request
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000334 uint8_t _sequenceNumberFIR GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000335
stefan@webrtc.org4ef438e2014-07-11 09:55:30 +0000336 // REMB
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000337 uint8_t _lengthRembSSRC GUARDED_BY(_criticalSectionRTCPSender);
338 uint8_t _sizeRembSSRC GUARDED_BY(_criticalSectionRTCPSender);
339 uint32_t* _rembSSRC GUARDED_BY(_criticalSectionRTCPSender);
340 uint32_t _rembBitrate GUARDED_BY(_criticalSectionRTCPSender);
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000341
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000342 TMMBRHelp _tmmbrHelp GUARDED_BY(_criticalSectionRTCPSender);
343 uint32_t _tmmbr_Send GUARDED_BY(_criticalSectionRTCPSender);
344 uint32_t _packetOH_Send GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000345
346 // APP
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000347 bool _appSend GUARDED_BY(_criticalSectionRTCPSender);
348 uint8_t _appSubType GUARDED_BY(_criticalSectionRTCPSender);
349 uint32_t _appName GUARDED_BY(_criticalSectionRTCPSender);
350 uint8_t* _appData GUARDED_BY(_criticalSectionRTCPSender);
351 uint16_t _appLength GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000352
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000353 // True if sending of XR Receiver reference time report is enabled.
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000354 bool xrSendReceiverReferenceTimeEnabled_
355 GUARDED_BY(_criticalSectionRTCPSender);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000356
niklase@google.com470e71d2011-07-07 08:21:25 +0000357 // XR VoIP metric
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000358 bool _xrSendVoIPMetric GUARDED_BY(_criticalSectionRTCPSender);
359 RTCPVoIPMetric _xrVoIPMetric GUARDED_BY(_criticalSectionRTCPSender);
edjee@google.com79b02892013-04-04 19:43:34 +0000360
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000361 RtcpPacketTypeCounter packet_type_counter_
362 GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000363};
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +0000364} // namespace webrtc
niklase@google.com470e71d2011-07-07 08:21:25 +0000365
366#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_SENDER_H_