blob: fcc79b64b4efa9319d656002a9cd49a97822adb9 [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
asapersson@webrtc.org9ffd8fe2015-01-21 08:22:50 +000034class NACKStringBuilder {
35 public:
36 NACKStringBuilder();
37 ~NACKStringBuilder();
pbos@webrtc.orgf3e4cee2013-07-31 15:17:19 +000038
asapersson@webrtc.org9ffd8fe2015-01-21 08:22:50 +000039 void PushNACK(uint16_t nack);
40 std::string GetResult();
edjee@google.com79b02892013-04-04 19:43:34 +000041
asapersson@webrtc.org9ffd8fe2015-01-21 08:22:50 +000042 private:
43 std::ostringstream _stream;
44 int _count;
45 uint16_t _prevNack;
46 bool _consecutive;
edjee@google.com79b02892013-04-04 19:43:34 +000047};
48
asapersson@webrtc.org9ffd8fe2015-01-21 08:22:50 +000049class RTCPSender {
niklase@google.com470e71d2011-07-07 08:21:25 +000050public:
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +000051 struct FeedbackState {
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +000052 FeedbackState();
53
54 uint8_t send_payload_type;
55 uint32_t frequency_hz;
pbos@webrtc.org2f4b14e2014-07-15 15:25:39 +000056 uint32_t packets_sent;
pkasting@chromium.org4591fbd2014-11-20 22:28:14 +000057 size_t media_bytes_sent;
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +000058 uint32_t send_bitrate;
59
60 uint32_t last_rr_ntp_secs;
61 uint32_t last_rr_ntp_frac;
62 uint32_t remote_sr;
63
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +000064 bool has_last_xr_rr;
65 RtcpReceiveTimeInfo last_xr_rr;
66
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +000067 // Used when generating TMMBR.
68 ModuleRtpRtcpImpl* module;
69 };
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +000070 RTCPSender(int32_t id,
71 bool audio,
72 Clock* clock,
73 ReceiveStatistics* receive_statistics);
niklase@google.com470e71d2011-07-07 08:21:25 +000074 virtual ~RTCPSender();
75
pbos@webrtc.org2f446732013-04-08 11:08:41 +000076 int32_t RegisterSendTransport(Transport* outgoingTransport);
niklase@google.com470e71d2011-07-07 08:21:25 +000077
78 RTCPMethod Status() const;
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +000079 void SetRTCPStatus(RTCPMethod method);
niklase@google.com470e71d2011-07-07 08:21:25 +000080
81 bool Sending() const;
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +000082 int32_t SetSendingStatus(const FeedbackState& feedback_state,
83 bool enabled); // combine the functions
niklase@google.com470e71d2011-07-07 08:21:25 +000084
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +000085 int32_t SetNackStatus(bool enable);
niklase@google.com470e71d2011-07-07 08:21:25 +000086
stefan@webrtc.org7c3523c2012-09-11 07:00:42 +000087 void SetStartTimestamp(uint32_t start_timestamp);
88
89 void SetLastRtpTime(uint32_t rtp_timestamp,
90 int64_t capture_time_ms);
91
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +000092 void SetSSRC(uint32_t ssrc);
niklase@google.com470e71d2011-07-07 08:21:25 +000093
wu@webrtc.org822fbd82013-08-15 23:38:54 +000094 void SetRemoteSSRC(uint32_t ssrc);
niklase@google.com470e71d2011-07-07 08:21:25 +000095
pbos@webrtc.org2f446732013-04-08 11:08:41 +000096 int32_t SetCNAME(const char cName[RTCP_CNAME_SIZE]);
niklase@google.com470e71d2011-07-07 08:21:25 +000097
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +000098 int32_t AddMixedCNAME(uint32_t SSRC, const char cName[RTCP_CNAME_SIZE]);
niklase@google.com470e71d2011-07-07 08:21:25 +000099
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000100 int32_t RemoveMixedCNAME(uint32_t SSRC);
niklase@google.com470e71d2011-07-07 08:21:25 +0000101
pkasting@chromium.org16825b12015-01-12 21:51:21 +0000102 int64_t SendTimeOfSendReport(uint32_t sendReport);
niklase@google.com470e71d2011-07-07 08:21:25 +0000103
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000104 bool SendTimeOfXrRrReport(uint32_t mid_ntp, int64_t* time_ms) const;
105
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000106 bool TimeToSendRTCPReport(bool sendKeyframeBeforeRTP = false) const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000107
pkasting@chromium.org16825b12015-01-12 21:51:21 +0000108 uint32_t LastSendReport(int64_t& lastRTCPTime);
niklase@google.com470e71d2011-07-07 08:21:25 +0000109
wu@webrtc.org822fbd82013-08-15 23:38:54 +0000110 int32_t SendRTCP(
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +0000111 const FeedbackState& feedback_state,
wu@webrtc.org822fbd82013-08-15 23:38:54 +0000112 uint32_t rtcpPacketTypeFlags,
wu@webrtc.org822fbd82013-08-15 23:38:54 +0000113 int32_t nackSize = 0,
114 const uint16_t* nackList = 0,
115 bool repeat = false,
116 uint64_t pictureID = 0);
niklase@google.com470e71d2011-07-07 08:21:25 +0000117
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000118 int32_t AddExternalReportBlock(
asapersson@webrtc.org9ffd8fe2015-01-21 08:22:50 +0000119 uint32_t SSRC,
120 const RTCPReportBlock* receiveBlock);
niklase@google.com470e71d2011-07-07 08:21:25 +0000121
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000122 int32_t RemoveExternalReportBlock(uint32_t SSRC);
niklase@google.com470e71d2011-07-07 08:21:25 +0000123
124 /*
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000125 * REMB
126 */
127 bool REMB() const;
128
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000129 void SetREMBStatus(bool enable);
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000130
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000131 void SetREMBData(uint32_t bitrate, const std::vector<uint32_t>& ssrcs);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000132
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000133 /*
niklase@google.com470e71d2011-07-07 08:21:25 +0000134 * TMMBR
135 */
136 bool TMMBR() const;
137
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000138 void SetTMMBRStatus(bool enable);
niklase@google.com470e71d2011-07-07 08:21:25 +0000139
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000140 int32_t SetTMMBN(const TMMBRSet* boundingSet, uint32_t maxBitrateKbit);
niklase@google.com470e71d2011-07-07 08:21:25 +0000141
niklase@google.com470e71d2011-07-07 08:21:25 +0000142 /*
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000143 * Extended jitter report
144 */
145 bool IJ() const;
146
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000147 void SetIJStatus(bool enable);
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000148
149 /*
niklase@google.com470e71d2011-07-07 08:21:25 +0000150 *
151 */
152
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000153 int32_t SetApplicationSpecificData(uint8_t subType,
154 uint32_t name,
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000155 const uint8_t* data,
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000156 uint16_t length);
niklase@google.com470e71d2011-07-07 08:21:25 +0000157
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000158 int32_t SetRTCPVoIPMetrics(const RTCPVoIPMetric* VoIPMetric);
niklase@google.com470e71d2011-07-07 08:21:25 +0000159
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000160 void SendRtcpXrReceiverReferenceTime(bool enable);
161
asapersson@webrtc.org8d02f5d2013-11-21 08:57:04 +0000162 bool RtcpXrReceiverReferenceTime() const;
163
pbos@webrtc.org9334ac22014-11-24 08:25:50 +0000164 void SetCsrcs(const std::vector<uint32_t>& csrcs);
niklase@google.com470e71d2011-07-07 08:21:25 +0000165
stefan@webrtc.org9354cc92012-06-07 08:10:14 +0000166 void SetTargetBitrate(unsigned int target_bitrate);
mflodman@webrtc.org117c1192012-01-13 08:52:58 +0000167
asapersson@webrtc.org8098e072014-02-19 11:59:02 +0000168 void GetPacketTypeCounter(RtcpPacketTypeCounter* packet_counter) const;
169
niklase@google.com470e71d2011-07-07 08:21:25 +0000170private:
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000171 int32_t SendToNetwork(const uint8_t* dataBuffer, size_t length);
niklase@google.com470e71d2011-07-07 08:21:25 +0000172
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000173 int32_t WriteAllReportBlocksToBuffer(uint8_t* rtcpbuffer,
174 int pos,
175 uint8_t& numberOfReportBlocks,
176 uint32_t NTPsec,
177 uint32_t NTPfrac)
178 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000179
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000180 int32_t WriteReportBlocksToBuffer(
181 uint8_t* rtcpbuffer,
182 int32_t position,
183 const std::map<uint32_t, RTCPReportBlock*>& report_blocks);
184
185 int32_t AddReportBlock(
186 uint32_t SSRC,
187 std::map<uint32_t, RTCPReportBlock*>* report_blocks,
188 const RTCPReportBlock* receiveBlock);
189
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +0000190 bool PrepareReport(const FeedbackState& feedback_state,
191 StreamStatistician* statistician,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000192 RTCPReportBlock* report_block,
193 uint32_t* ntp_secs, uint32_t* ntp_frac);
194
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +0000195 int32_t BuildSR(const FeedbackState& feedback_state,
196 uint8_t* rtcpbuffer,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000197 int& pos,
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +0000198 uint32_t NTPsec,
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000199 uint32_t NTPfrac)
200 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000201
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000202 int32_t BuildRR(uint8_t* rtcpbuffer,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000203 int& pos,
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000204 uint32_t NTPsec,
205 uint32_t NTPfrac)
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000206 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000207
208 int PrepareRTCP(
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +0000209 const FeedbackState& feedback_state,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000210 uint32_t packetTypeFlags,
211 int32_t nackSize,
212 const uint16_t* nackList,
213 bool repeat,
214 uint64_t pictureID,
215 uint8_t* rtcp_buffer,
216 int buffer_size);
217
218 bool ShouldSendReportBlocks(uint32_t rtcp_packet_type) const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000219
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000220 int32_t BuildExtendedJitterReport(uint8_t* rtcpbuffer,
221 int& pos,
222 uint32_t jitterTransmissionTimeOffset)
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000223 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000224
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000225 int32_t BuildSDEC(uint8_t* rtcpbuffer, int& pos)
226 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
227 int32_t BuildPLI(uint8_t* rtcpbuffer, int& pos)
228 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
229 int32_t BuildREMB(uint8_t* rtcpbuffer, int& pos)
230 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
231 int32_t BuildTMMBR(ModuleRtpRtcpImpl* module, uint8_t* rtcpbuffer, int& pos)
232 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
233 int32_t BuildTMMBN(uint8_t* rtcpbuffer, int& pos)
234 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
235 int32_t BuildAPP(uint8_t* rtcpbuffer, int& pos)
236 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
237 int32_t BuildVoIPMetric(uint8_t* rtcpbuffer, int& pos)
238 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
239 int32_t BuildBYE(uint8_t* rtcpbuffer, int& pos)
240 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
241 int32_t BuildFIR(uint8_t* rtcpbuffer, int& pos, bool repeat)
242 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000243 int32_t BuildSLI(uint8_t* rtcpbuffer, int& pos, uint8_t pictureID)
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000244 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000245 int32_t BuildRPSI(uint8_t* rtcpbuffer,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000246 int& pos,
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000247 uint64_t pictureID,
248 uint8_t payloadType)
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000249 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000250
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000251 int32_t BuildNACK(uint8_t* rtcpbuffer,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000252 int& pos,
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000253 int32_t nackSize,
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000254 const uint16_t* nackList,
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000255 std::string* nackString)
256 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000257 int32_t BuildReceiverReferenceTime(uint8_t* buffer,
258 int& pos,
259 uint32_t ntp_sec,
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000260 uint32_t ntp_frac)
261 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000262 int32_t BuildDlrr(uint8_t* buffer,
263 int& pos,
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000264 const RtcpReceiveTimeInfo& info)
265 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000266
niklase@google.com470e71d2011-07-07 08:21:25 +0000267private:
asapersson@webrtc.org9ffd8fe2015-01-21 08:22:50 +0000268 const int32_t _id;
269 const bool _audio;
270 Clock* const _clock;
271 RTCPMethod _method GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000272
henrike@webrtc.org65573f22011-12-13 19:17:27 +0000273 CriticalSectionWrapper* _criticalSectionTransport;
asapersson@webrtc.org9ffd8fe2015-01-21 08:22:50 +0000274 Transport* _cbTransport GUARDED_BY(_criticalSectionTransport);
niklase@google.com470e71d2011-07-07 08:21:25 +0000275
henrike@webrtc.org65573f22011-12-13 19:17:27 +0000276 CriticalSectionWrapper* _criticalSectionRTCPSender;
asapersson@webrtc.org9ffd8fe2015-01-21 08:22:50 +0000277 bool _usingNack GUARDED_BY(_criticalSectionRTCPSender);
278 bool _sending GUARDED_BY(_criticalSectionRTCPSender);
279 bool _sendTMMBN GUARDED_BY(_criticalSectionRTCPSender);
280 bool _REMB GUARDED_BY(_criticalSectionRTCPSender);
281 bool _sendREMB GUARDED_BY(_criticalSectionRTCPSender);
282 bool _TMMBR GUARDED_BY(_criticalSectionRTCPSender);
283 bool _IJ GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000284
asapersson@webrtc.org9ffd8fe2015-01-21 08:22:50 +0000285 int64_t _nextTimeToSendRTCP GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000286
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000287 uint32_t start_timestamp_ GUARDED_BY(_criticalSectionRTCPSender);
288 uint32_t last_rtp_timestamp_ GUARDED_BY(_criticalSectionRTCPSender);
289 int64_t last_frame_capture_time_ms_ GUARDED_BY(_criticalSectionRTCPSender);
290 uint32_t _SSRC GUARDED_BY(_criticalSectionRTCPSender);
291 // SSRC that we receive on our RTP channel
292 uint32_t _remoteSSRC GUARDED_BY(_criticalSectionRTCPSender);
293 char _CNAME[RTCP_CNAME_SIZE] GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000294
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000295 ReceiveStatistics* receive_statistics_
296 GUARDED_BY(_criticalSectionRTCPSender);
297 std::map<uint32_t, RTCPReportBlock*> internal_report_blocks_
298 GUARDED_BY(_criticalSectionRTCPSender);
299 std::map<uint32_t, RTCPReportBlock*> external_report_blocks_
300 GUARDED_BY(_criticalSectionRTCPSender);
301 std::map<uint32_t, RTCPUtility::RTCPCnameInformation*> _csrcCNAMEs
302 GUARDED_BY(_criticalSectionRTCPSender);
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000303
niklase@google.com470e71d2011-07-07 08:21:25 +0000304 // Sent
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000305 uint32_t _lastSendReport[RTCP_NUMBER_OF_SR] GUARDED_BY(
306 _criticalSectionRTCPSender); // allow packet loss and RTT above 1 sec
pkasting@chromium.org16825b12015-01-12 21:51:21 +0000307 int64_t _lastRTCPTime[RTCP_NUMBER_OF_SR] GUARDED_BY(
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000308 _criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000309
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000310 // Sent XR receiver reference time report.
311 // <mid ntp (mid 32 bits of the 64 bits NTP timestamp), send time in ms>.
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000312 std::map<uint32_t, int64_t> last_xr_rr_
313 GUARDED_BY(_criticalSectionRTCPSender);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000314
niklase@google.com470e71d2011-07-07 08:21:25 +0000315 // send CSRCs
pbos@webrtc.org9334ac22014-11-24 08:25:50 +0000316 std::vector<uint32_t> csrcs_ GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000317
318 // Full intra request
asapersson@webrtc.org9ffd8fe2015-01-21 08:22:50 +0000319 uint8_t _sequenceNumberFIR GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000320
stefan@webrtc.org4ef438e2014-07-11 09:55:30 +0000321 // REMB
asapersson@webrtc.org9ffd8fe2015-01-21 08:22:50 +0000322 uint32_t _rembBitrate GUARDED_BY(_criticalSectionRTCPSender);
323 std::vector<uint32_t> remb_ssrcs_ GUARDED_BY(_criticalSectionRTCPSender);
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000324
asapersson@webrtc.org9ffd8fe2015-01-21 08:22:50 +0000325 TMMBRHelp _tmmbrHelp GUARDED_BY(_criticalSectionRTCPSender);
326 uint32_t _tmmbr_Send GUARDED_BY(_criticalSectionRTCPSender);
327 uint32_t _packetOH_Send GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000328
329 // APP
asapersson@webrtc.org9ffd8fe2015-01-21 08:22:50 +0000330 bool _appSend GUARDED_BY(_criticalSectionRTCPSender);
331 uint8_t _appSubType GUARDED_BY(_criticalSectionRTCPSender);
332 uint32_t _appName GUARDED_BY(_criticalSectionRTCPSender);
333 uint8_t* _appData GUARDED_BY(_criticalSectionRTCPSender);
334 uint16_t _appLength GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000335
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000336 // True if sending of XR Receiver reference time report is enabled.
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000337 bool xrSendReceiverReferenceTimeEnabled_
338 GUARDED_BY(_criticalSectionRTCPSender);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000339
niklase@google.com470e71d2011-07-07 08:21:25 +0000340 // XR VoIP metric
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000341 bool _xrSendVoIPMetric GUARDED_BY(_criticalSectionRTCPSender);
342 RTCPVoIPMetric _xrVoIPMetric GUARDED_BY(_criticalSectionRTCPSender);
edjee@google.com79b02892013-04-04 19:43:34 +0000343
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000344 RtcpPacketTypeCounter packet_type_counter_
345 GUARDED_BY(_criticalSectionRTCPSender);
asapersson@webrtc.org2dd31342014-10-29 12:42:30 +0000346
347 RTCPUtility::NackStats nack_stats_ GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000348};
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +0000349} // namespace webrtc
niklase@google.com470e71d2011-07-07 08:21:25 +0000350
351#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_SENDER_H_