blob: 13bdade33e69222549e8f336a92028199d8d49cc [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,
pbos@webrtc.org1d0fa5d2015-02-19 12:47:00 +000073 ReceiveStatistics* receive_statistics,
74 RtcpPacketTypeCounterObserver* packet_type_counter_observer);
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.orgd16e8392014-12-19 13:49:55 +000080 void SetRTCPStatus(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.orgd16e8392014-12-19 13:49:55 +000086 int32_t SetNackStatus(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.orgd16e8392014-12-19 13:49:55 +000093 void SetSSRC(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
pbos@webrtc.org2f446732013-04-08 11:08:41 +000097 int32_t SetCNAME(const char cName[RTCP_CNAME_SIZE]);
niklase@google.com470e71d2011-07-07 08:21:25 +000098
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +000099 int32_t AddMixedCNAME(uint32_t SSRC, const char cName[RTCP_CNAME_SIZE]);
niklase@google.com470e71d2011-07-07 08:21:25 +0000100
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000101 int32_t RemoveMixedCNAME(uint32_t SSRC);
niklase@google.com470e71d2011-07-07 08:21:25 +0000102
pkasting@chromium.org16825b12015-01-12 21:51:21 +0000103 int64_t SendTimeOfSendReport(uint32_t sendReport);
niklase@google.com470e71d2011-07-07 08:21:25 +0000104
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000105 bool SendTimeOfXrRrReport(uint32_t mid_ntp, int64_t* time_ms) const;
106
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000107 bool TimeToSendRTCPReport(bool sendKeyframeBeforeRTP = false) const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000108
pkasting@chromium.org16825b12015-01-12 21:51:21 +0000109 uint32_t LastSendReport(int64_t& lastRTCPTime);
niklase@google.com470e71d2011-07-07 08:21:25 +0000110
wu@webrtc.org822fbd82013-08-15 23:38:54 +0000111 int32_t SendRTCP(
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +0000112 const FeedbackState& feedback_state,
wu@webrtc.org822fbd82013-08-15 23:38:54 +0000113 uint32_t rtcpPacketTypeFlags,
wu@webrtc.org822fbd82013-08-15 23:38:54 +0000114 int32_t nackSize = 0,
115 const uint16_t* nackList = 0,
116 bool repeat = false,
117 uint64_t pictureID = 0);
niklase@google.com470e71d2011-07-07 08:21:25 +0000118
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000119 int32_t AddExternalReportBlock(
asapersson@webrtc.org9ffd8fe2015-01-21 08:22:50 +0000120 uint32_t SSRC,
121 const RTCPReportBlock* receiveBlock);
niklase@google.com470e71d2011-07-07 08:21:25 +0000122
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000123 int32_t RemoveExternalReportBlock(uint32_t SSRC);
niklase@google.com470e71d2011-07-07 08:21:25 +0000124
125 /*
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000126 * REMB
127 */
128 bool REMB() const;
129
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000130 void SetREMBStatus(bool enable);
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000131
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000132 void SetREMBData(uint32_t bitrate, const std::vector<uint32_t>& ssrcs);
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000133
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000134 /*
niklase@google.com470e71d2011-07-07 08:21:25 +0000135 * TMMBR
136 */
137 bool TMMBR() const;
138
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000139 void SetTMMBRStatus(bool enable);
niklase@google.com470e71d2011-07-07 08:21:25 +0000140
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000141 int32_t SetTMMBN(const TMMBRSet* boundingSet, uint32_t maxBitrateKbit);
niklase@google.com470e71d2011-07-07 08:21:25 +0000142
niklase@google.com470e71d2011-07-07 08:21:25 +0000143 /*
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000144 * Extended jitter report
145 */
146 bool IJ() const;
147
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000148 void SetIJStatus(bool enable);
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000149
150 /*
niklase@google.com470e71d2011-07-07 08:21:25 +0000151 *
152 */
153
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000154 int32_t SetApplicationSpecificData(uint8_t subType,
155 uint32_t name,
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000156 const uint8_t* data,
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000157 uint16_t length);
niklase@google.com470e71d2011-07-07 08:21:25 +0000158
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000159 int32_t SetRTCPVoIPMetrics(const RTCPVoIPMetric* VoIPMetric);
niklase@google.com470e71d2011-07-07 08:21:25 +0000160
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000161 void SendRtcpXrReceiverReferenceTime(bool enable);
162
asapersson@webrtc.org8d02f5d2013-11-21 08:57:04 +0000163 bool RtcpXrReceiverReferenceTime() const;
164
pbos@webrtc.org9334ac22014-11-24 08:25:50 +0000165 void SetCsrcs(const std::vector<uint32_t>& csrcs);
niklase@google.com470e71d2011-07-07 08:21:25 +0000166
stefan@webrtc.org9354cc92012-06-07 08:10:14 +0000167 void SetTargetBitrate(unsigned int target_bitrate);
mflodman@webrtc.org117c1192012-01-13 08:52:58 +0000168
niklase@google.com470e71d2011-07-07 08:21:25 +0000169private:
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000170 int32_t SendToNetwork(const uint8_t* dataBuffer, size_t length);
niklase@google.com470e71d2011-07-07 08:21:25 +0000171
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000172 int32_t WriteAllReportBlocksToBuffer(uint8_t* rtcpbuffer,
173 int pos,
174 uint8_t& numberOfReportBlocks,
175 uint32_t NTPsec,
176 uint32_t NTPfrac)
177 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000178
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000179 int32_t WriteReportBlocksToBuffer(
180 uint8_t* rtcpbuffer,
181 int32_t position,
182 const std::map<uint32_t, RTCPReportBlock*>& report_blocks);
183
184 int32_t AddReportBlock(
185 uint32_t SSRC,
186 std::map<uint32_t, RTCPReportBlock*>* report_blocks,
187 const RTCPReportBlock* receiveBlock);
188
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +0000189 bool PrepareReport(const FeedbackState& feedback_state,
190 StreamStatistician* statistician,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000191 RTCPReportBlock* report_block,
192 uint32_t* ntp_secs, uint32_t* ntp_frac);
193
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +0000194 int32_t BuildSR(const FeedbackState& feedback_state,
195 uint8_t* rtcpbuffer,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000196 int& pos,
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +0000197 uint32_t NTPsec,
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000198 uint32_t NTPfrac)
199 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000200
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000201 int32_t BuildRR(uint8_t* rtcpbuffer,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000202 int& pos,
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000203 uint32_t NTPsec,
204 uint32_t NTPfrac)
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000205 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000206
207 int PrepareRTCP(
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +0000208 const FeedbackState& feedback_state,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000209 uint32_t packetTypeFlags,
210 int32_t nackSize,
211 const uint16_t* nackList,
212 bool repeat,
213 uint64_t pictureID,
214 uint8_t* rtcp_buffer,
215 int buffer_size);
216
217 bool ShouldSendReportBlocks(uint32_t rtcp_packet_type) const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000218
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000219 int32_t BuildExtendedJitterReport(uint8_t* rtcpbuffer,
220 int& pos,
221 uint32_t jitterTransmissionTimeOffset)
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000222 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000223
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000224 int32_t BuildSDEC(uint8_t* rtcpbuffer, int& pos)
225 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
226 int32_t BuildPLI(uint8_t* rtcpbuffer, int& pos)
227 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
228 int32_t BuildREMB(uint8_t* rtcpbuffer, int& pos)
229 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
230 int32_t BuildTMMBR(ModuleRtpRtcpImpl* module, uint8_t* rtcpbuffer, int& pos)
231 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
232 int32_t BuildTMMBN(uint8_t* rtcpbuffer, int& pos)
233 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
234 int32_t BuildAPP(uint8_t* rtcpbuffer, int& pos)
235 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
236 int32_t BuildVoIPMetric(uint8_t* rtcpbuffer, int& pos)
237 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
238 int32_t BuildBYE(uint8_t* rtcpbuffer, int& pos)
239 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
240 int32_t BuildFIR(uint8_t* rtcpbuffer, int& pos, bool repeat)
241 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000242 int32_t BuildSLI(uint8_t* rtcpbuffer, int& pos, uint8_t pictureID)
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000243 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000244 int32_t BuildRPSI(uint8_t* rtcpbuffer,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000245 int& pos,
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000246 uint64_t pictureID,
247 uint8_t payloadType)
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000248 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000249
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000250 int32_t BuildNACK(uint8_t* rtcpbuffer,
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000251 int& pos,
pbos@webrtc.orgd16e8392014-12-19 13:49:55 +0000252 int32_t nackSize,
pbos@webrtc.org2f446732013-04-08 11:08:41 +0000253 const uint16_t* nackList,
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000254 std::string* nackString)
255 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000256 int32_t BuildReceiverReferenceTime(uint8_t* buffer,
257 int& pos,
258 uint32_t ntp_sec,
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000259 uint32_t ntp_frac)
260 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000261 int32_t BuildDlrr(uint8_t* buffer,
262 int& pos,
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000263 const RtcpReceiveTimeInfo& info)
264 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPSender);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000265
niklase@google.com470e71d2011-07-07 08:21:25 +0000266private:
asapersson@webrtc.org9ffd8fe2015-01-21 08:22:50 +0000267 const int32_t _id;
268 const bool _audio;
269 Clock* const _clock;
270 RTCPMethod _method GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000271
henrike@webrtc.org65573f22011-12-13 19:17:27 +0000272 CriticalSectionWrapper* _criticalSectionTransport;
asapersson@webrtc.org9ffd8fe2015-01-21 08:22:50 +0000273 Transport* _cbTransport GUARDED_BY(_criticalSectionTransport);
niklase@google.com470e71d2011-07-07 08:21:25 +0000274
henrike@webrtc.org65573f22011-12-13 19:17:27 +0000275 CriticalSectionWrapper* _criticalSectionRTCPSender;
asapersson@webrtc.org9ffd8fe2015-01-21 08:22:50 +0000276 bool _usingNack GUARDED_BY(_criticalSectionRTCPSender);
277 bool _sending GUARDED_BY(_criticalSectionRTCPSender);
278 bool _sendTMMBN GUARDED_BY(_criticalSectionRTCPSender);
279 bool _REMB GUARDED_BY(_criticalSectionRTCPSender);
280 bool _sendREMB GUARDED_BY(_criticalSectionRTCPSender);
281 bool _TMMBR GUARDED_BY(_criticalSectionRTCPSender);
282 bool _IJ GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000283
asapersson@webrtc.org9ffd8fe2015-01-21 08:22:50 +0000284 int64_t _nextTimeToSendRTCP GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000285
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000286 uint32_t start_timestamp_ GUARDED_BY(_criticalSectionRTCPSender);
287 uint32_t last_rtp_timestamp_ GUARDED_BY(_criticalSectionRTCPSender);
288 int64_t last_frame_capture_time_ms_ GUARDED_BY(_criticalSectionRTCPSender);
289 uint32_t _SSRC GUARDED_BY(_criticalSectionRTCPSender);
290 // SSRC that we receive on our RTP channel
291 uint32_t _remoteSSRC GUARDED_BY(_criticalSectionRTCPSender);
292 char _CNAME[RTCP_CNAME_SIZE] GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000293
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000294 ReceiveStatistics* receive_statistics_
295 GUARDED_BY(_criticalSectionRTCPSender);
296 std::map<uint32_t, RTCPReportBlock*> internal_report_blocks_
297 GUARDED_BY(_criticalSectionRTCPSender);
298 std::map<uint32_t, RTCPReportBlock*> external_report_blocks_
299 GUARDED_BY(_criticalSectionRTCPSender);
300 std::map<uint32_t, RTCPUtility::RTCPCnameInformation*> _csrcCNAMEs
301 GUARDED_BY(_criticalSectionRTCPSender);
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000302
niklase@google.com470e71d2011-07-07 08:21:25 +0000303 // Sent
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000304 uint32_t _lastSendReport[RTCP_NUMBER_OF_SR] GUARDED_BY(
305 _criticalSectionRTCPSender); // allow packet loss and RTT above 1 sec
pkasting@chromium.org16825b12015-01-12 21:51:21 +0000306 int64_t _lastRTCPTime[RTCP_NUMBER_OF_SR] GUARDED_BY(
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000307 _criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000308
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000309 // Sent XR receiver reference time report.
310 // <mid ntp (mid 32 bits of the 64 bits NTP timestamp), send time in ms>.
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000311 std::map<uint32_t, int64_t> last_xr_rr_
312 GUARDED_BY(_criticalSectionRTCPSender);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000313
niklase@google.com470e71d2011-07-07 08:21:25 +0000314 // send CSRCs
pbos@webrtc.org9334ac22014-11-24 08:25:50 +0000315 std::vector<uint32_t> csrcs_ GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000316
317 // Full intra request
asapersson@webrtc.org9ffd8fe2015-01-21 08:22:50 +0000318 uint8_t _sequenceNumberFIR GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000319
stefan@webrtc.org4ef438e2014-07-11 09:55:30 +0000320 // REMB
asapersson@webrtc.org9ffd8fe2015-01-21 08:22:50 +0000321 uint32_t _rembBitrate GUARDED_BY(_criticalSectionRTCPSender);
322 std::vector<uint32_t> remb_ssrcs_ GUARDED_BY(_criticalSectionRTCPSender);
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000323
asapersson@webrtc.org9ffd8fe2015-01-21 08:22:50 +0000324 TMMBRHelp _tmmbrHelp GUARDED_BY(_criticalSectionRTCPSender);
325 uint32_t _tmmbr_Send GUARDED_BY(_criticalSectionRTCPSender);
326 uint32_t _packetOH_Send GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000327
328 // APP
asapersson@webrtc.org9ffd8fe2015-01-21 08:22:50 +0000329 bool _appSend GUARDED_BY(_criticalSectionRTCPSender);
330 uint8_t _appSubType GUARDED_BY(_criticalSectionRTCPSender);
331 uint32_t _appName GUARDED_BY(_criticalSectionRTCPSender);
332 uint8_t* _appData GUARDED_BY(_criticalSectionRTCPSender);
333 uint16_t _appLength GUARDED_BY(_criticalSectionRTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000334
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000335 // True if sending of XR Receiver reference time report is enabled.
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000336 bool xrSendReceiverReferenceTimeEnabled_
337 GUARDED_BY(_criticalSectionRTCPSender);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000338
niklase@google.com470e71d2011-07-07 08:21:25 +0000339 // XR VoIP metric
pbos@webrtc.org180e5162014-07-11 15:36:26 +0000340 bool _xrSendVoIPMetric GUARDED_BY(_criticalSectionRTCPSender);
341 RTCPVoIPMetric _xrVoIPMetric GUARDED_BY(_criticalSectionRTCPSender);
edjee@google.com79b02892013-04-04 19:43:34 +0000342
pbos@webrtc.org1d0fa5d2015-02-19 12:47:00 +0000343 RtcpPacketTypeCounterObserver* const packet_type_counter_observer_;
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_