blob: ba6fb7005581fb24d217b4dee738e8d7bd6a9014 [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>
danilchap56036ff2016-03-22 11:14:09 -070015#include <memory>
Erik Språng242e22b2015-05-11 10:17:43 +020016#include <set>
edjee@google.com79b02892013-04-04 19:43:34 +000017#include <sstream>
18#include <string>
danilchapb8b6fbb2015-12-10 05:05:27 -080019#include <vector>
pwestin@webrtc.org26f8d9c2012-01-19 15:53:09 +000020
danilchap56036ff2016-03-22 11:14:09 -070021#include "webrtc/base/criticalsection.h"
danilchap47a740b2015-12-15 00:30:07 -080022#include "webrtc/base/random.h"
pbos@webrtc.org38344ed2014-09-24 06:05:00 +000023#include "webrtc/base/thread_annotations.h"
pbos@webrtc.orga048d7c2013-05-29 14:27:38 +000024#include "webrtc/modules/remote_bitrate_estimator/include/bwe_defines.h"
25#include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h"
Henrik Kjellanderff761fb2015-11-04 08:31:52 +010026#include "webrtc/modules/rtp_rtcp/include/receive_statistics.h"
27#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
Erik Språngbdc0b0d2015-06-22 15:21:24 +020028#include "webrtc/modules/rtp_rtcp/source/rtcp_packet.h"
danilchap34ed2b92016-01-18 02:43:32 -080029#include "webrtc/modules/rtp_rtcp/source/rtcp_packet/report_block.h"
pbos@webrtc.orga048d7c2013-05-29 14:27:38 +000030#include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h"
pbos@webrtc.orga048d7c2013-05-29 14:27:38 +000031#include "webrtc/modules/rtp_rtcp/source/tmmbr_help.h"
pbos2d566682015-09-28 09:59:31 -070032#include "webrtc/transport.h"
pbos@webrtc.orga048d7c2013-05-29 14:27:38 +000033#include "webrtc/typedefs.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000034
35namespace webrtc {
pwestin@webrtc.org741da942011-09-20 13:52:04 +000036
wu@webrtc.org822fbd82013-08-15 23:38:54 +000037class ModuleRtpRtcpImpl;
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +000038class RTCPReceiver;
terelius429c3452016-01-21 05:42:04 -080039class RtcEventLog;
pwestin@webrtc.org741da942011-09-20 13:52:04 +000040
asapersson@webrtc.org9ffd8fe2015-01-21 08:22:50 +000041class NACKStringBuilder {
42 public:
43 NACKStringBuilder();
44 ~NACKStringBuilder();
pbos@webrtc.orgf3e4cee2013-07-31 15:17:19 +000045
asapersson@webrtc.org9ffd8fe2015-01-21 08:22:50 +000046 void PushNACK(uint16_t nack);
47 std::string GetResult();
edjee@google.com79b02892013-04-04 19:43:34 +000048
asapersson@webrtc.org9ffd8fe2015-01-21 08:22:50 +000049 private:
Erik Språng242e22b2015-05-11 10:17:43 +020050 std::ostringstream stream_;
51 int count_;
52 uint16_t prevNack_;
53 bool consecutive_;
edjee@google.com79b02892013-04-04 19:43:34 +000054};
55
asapersson@webrtc.org9ffd8fe2015-01-21 08:22:50 +000056class RTCPSender {
danilchap162abd32015-12-10 02:39:40 -080057 public:
58 struct FeedbackState {
59 FeedbackState();
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +000060
danilchap162abd32015-12-10 02:39:40 -080061 uint8_t send_payload_type;
62 uint32_t frequency_hz;
63 uint32_t packets_sent;
64 size_t media_bytes_sent;
65 uint32_t send_bitrate;
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +000066
danilchap162abd32015-12-10 02:39:40 -080067 uint32_t last_rr_ntp_secs;
68 uint32_t last_rr_ntp_frac;
69 uint32_t remote_sr;
pbos@webrtc.org59f20bb2013-09-09 16:02:19 +000070
danilchap162abd32015-12-10 02:39:40 -080071 bool has_last_xr_rr;
72 RtcpReceiveTimeInfo last_xr_rr;
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +000073
danilchap162abd32015-12-10 02:39:40 -080074 // Used when generating TMMBR.
75 ModuleRtpRtcpImpl* module;
76 };
Erik Språng61be2a42015-04-27 13:32:52 +020077
danilchap162abd32015-12-10 02:39:40 -080078 RTCPSender(bool audio,
79 Clock* clock,
80 ReceiveStatistics* receive_statistics,
81 RtcpPacketTypeCounterObserver* packet_type_counter_observer,
terelius429c3452016-01-21 05:42:04 -080082 RtcEventLog* event_log,
danilchap162abd32015-12-10 02:39:40 -080083 Transport* outgoing_transport);
84 virtual ~RTCPSender();
niklase@google.com470e71d2011-07-07 08:21:25 +000085
danilchap162abd32015-12-10 02:39:40 -080086 RtcpMode Status() const;
87 void SetRTCPStatus(RtcpMode method);
niklase@google.com470e71d2011-07-07 08:21:25 +000088
danilchap162abd32015-12-10 02:39:40 -080089 bool Sending() const;
90 int32_t SetSendingStatus(const FeedbackState& feedback_state,
91 bool enabled); // combine the functions
niklase@google.com470e71d2011-07-07 08:21:25 +000092
danilchap162abd32015-12-10 02:39:40 -080093 int32_t SetNackStatus(bool enable);
niklase@google.com470e71d2011-07-07 08:21:25 +000094
danilchap162abd32015-12-10 02:39:40 -080095 void SetStartTimestamp(uint32_t start_timestamp);
stefan@webrtc.org7c3523c2012-09-11 07:00:42 +000096
danilchap162abd32015-12-10 02:39:40 -080097 void SetLastRtpTime(uint32_t rtp_timestamp, int64_t capture_time_ms);
stefan@webrtc.org7c3523c2012-09-11 07:00:42 +000098
danilchap162abd32015-12-10 02:39:40 -080099 void SetSSRC(uint32_t ssrc);
niklase@google.com470e71d2011-07-07 08:21:25 +0000100
danilchap162abd32015-12-10 02:39:40 -0800101 void SetRemoteSSRC(uint32_t ssrc);
niklase@google.com470e71d2011-07-07 08:21:25 +0000102
danilchap162abd32015-12-10 02:39:40 -0800103 int32_t SetCNAME(const char* cName);
niklase@google.com470e71d2011-07-07 08:21:25 +0000104
danilchap162abd32015-12-10 02:39:40 -0800105 int32_t AddMixedCNAME(uint32_t SSRC, const char* c_name);
niklase@google.com470e71d2011-07-07 08:21:25 +0000106
danilchap162abd32015-12-10 02:39:40 -0800107 int32_t RemoveMixedCNAME(uint32_t SSRC);
niklase@google.com470e71d2011-07-07 08:21:25 +0000108
danilchap162abd32015-12-10 02:39:40 -0800109 bool TimeToSendRTCPReport(bool sendKeyframeBeforeRTP = false) const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000110
danilchap162abd32015-12-10 02:39:40 -0800111 int32_t SendRTCP(const FeedbackState& feedback_state,
112 RTCPPacketType packetType,
113 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
danilchap162abd32015-12-10 02:39:40 -0800118 int32_t SendCompoundRTCP(const FeedbackState& feedback_state,
119 const std::set<RTCPPacketType>& packetTypes,
120 int32_t nackSize = 0,
121 const uint16_t* nackList = 0,
122 bool repeat = false,
123 uint64_t pictureID = 0);
Erik Språng242e22b2015-05-11 10:17:43 +0200124
danilchap162abd32015-12-10 02:39:40 -0800125 bool REMB() const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000126
danilchap162abd32015-12-10 02:39:40 -0800127 void SetREMBStatus(bool enable);
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000128
danilchap162abd32015-12-10 02:39:40 -0800129 void SetREMBData(uint32_t bitrate, const std::vector<uint32_t>& ssrcs);
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000130
danilchap162abd32015-12-10 02:39:40 -0800131 bool TMMBR() const;
mflodman@webrtc.org84dc3d12011-12-22 10:26:13 +0000132
danilchap162abd32015-12-10 02:39:40 -0800133 void SetTMMBRStatus(bool enable);
niklase@google.com470e71d2011-07-07 08:21:25 +0000134
danilchap41befce2016-03-30 11:11:51 -0700135 void SetMaxPayloadLength(size_t max_payload_length);
136
Peter Boström9d0c4322016-02-16 17:59:27 +0100137 int32_t SetTMMBN(const TMMBRSet* boundingSet);
niklase@google.com470e71d2011-07-07 08:21:25 +0000138
danilchap162abd32015-12-10 02:39:40 -0800139 int32_t SetApplicationSpecificData(uint8_t subType,
140 uint32_t name,
141 const uint8_t* data,
142 uint16_t length);
143 int32_t SetRTCPVoIPMetrics(const RTCPVoIPMetric* VoIPMetric);
asapersson@webrtc.org5249cc82011-12-16 14:31:37 +0000144
danilchap162abd32015-12-10 02:39:40 -0800145 void SendRtcpXrReceiverReferenceTime(bool enable);
niklase@google.com470e71d2011-07-07 08:21:25 +0000146
danilchap162abd32015-12-10 02:39:40 -0800147 bool RtcpXrReceiverReferenceTime() const;
niklase@google.com470e71d2011-07-07 08:21:25 +0000148
danilchap162abd32015-12-10 02:39:40 -0800149 void SetCsrcs(const std::vector<uint32_t>& csrcs);
niklase@google.com470e71d2011-07-07 08:21:25 +0000150
danilchap162abd32015-12-10 02:39:40 -0800151 void SetTargetBitrate(unsigned int target_bitrate);
152 bool SendFeedbackPacket(const rtcp::TransportFeedback& packet);
mflodman@webrtc.org117c1192012-01-13 08:52:58 +0000153
danilchap162abd32015-12-10 02:39:40 -0800154 private:
155 class RtcpContext;
Erik Språng242e22b2015-05-11 10:17:43 +0200156
danilchap162abd32015-12-10 02:39:40 -0800157 // Determine which RTCP messages should be sent and setup flags.
158 void PrepareReport(const std::set<RTCPPacketType>& packetTypes,
159 const FeedbackState& feedback_state)
160 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000161
danilchapa72e7342015-12-22 08:07:45 -0800162 bool AddReportBlock(const FeedbackState& feedback_state,
163 uint32_t ssrc,
164 StreamStatistician* statistician)
danilchap162abd32015-12-10 02:39:40 -0800165 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000166
danilchap56036ff2016-03-22 11:14:09 -0700167 std::unique_ptr<rtcp::RtcpPacket> BuildSR(const RtcpContext& context)
danilchap162abd32015-12-10 02:39:40 -0800168 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
danilchap56036ff2016-03-22 11:14:09 -0700169 std::unique_ptr<rtcp::RtcpPacket> BuildRR(const RtcpContext& context)
danilchap162abd32015-12-10 02:39:40 -0800170 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
danilchap56036ff2016-03-22 11:14:09 -0700171 std::unique_ptr<rtcp::RtcpPacket> BuildSDES(const RtcpContext& context)
danilchap162abd32015-12-10 02:39:40 -0800172 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
danilchap56036ff2016-03-22 11:14:09 -0700173 std::unique_ptr<rtcp::RtcpPacket> BuildPLI(const RtcpContext& context)
danilchap162abd32015-12-10 02:39:40 -0800174 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
danilchap56036ff2016-03-22 11:14:09 -0700175 std::unique_ptr<rtcp::RtcpPacket> BuildREMB(const RtcpContext& context)
danilchap162abd32015-12-10 02:39:40 -0800176 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
danilchap56036ff2016-03-22 11:14:09 -0700177 std::unique_ptr<rtcp::RtcpPacket> BuildTMMBR(const RtcpContext& context)
danilchap162abd32015-12-10 02:39:40 -0800178 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
danilchap56036ff2016-03-22 11:14:09 -0700179 std::unique_ptr<rtcp::RtcpPacket> BuildTMMBN(const RtcpContext& context)
danilchap162abd32015-12-10 02:39:40 -0800180 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
danilchap56036ff2016-03-22 11:14:09 -0700181 std::unique_ptr<rtcp::RtcpPacket> BuildAPP(const RtcpContext& context)
danilchap162abd32015-12-10 02:39:40 -0800182 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
danilchap56036ff2016-03-22 11:14:09 -0700183 std::unique_ptr<rtcp::RtcpPacket> BuildVoIPMetric(const RtcpContext& context)
danilchap162abd32015-12-10 02:39:40 -0800184 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
danilchap56036ff2016-03-22 11:14:09 -0700185 std::unique_ptr<rtcp::RtcpPacket> BuildBYE(const RtcpContext& context)
danilchap162abd32015-12-10 02:39:40 -0800186 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
danilchap56036ff2016-03-22 11:14:09 -0700187 std::unique_ptr<rtcp::RtcpPacket> BuildFIR(const RtcpContext& context)
danilchap162abd32015-12-10 02:39:40 -0800188 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
danilchap56036ff2016-03-22 11:14:09 -0700189 std::unique_ptr<rtcp::RtcpPacket> BuildSLI(const RtcpContext& context)
danilchap162abd32015-12-10 02:39:40 -0800190 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
danilchap56036ff2016-03-22 11:14:09 -0700191 std::unique_ptr<rtcp::RtcpPacket> BuildRPSI(const RtcpContext& context)
danilchap162abd32015-12-10 02:39:40 -0800192 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
danilchap56036ff2016-03-22 11:14:09 -0700193 std::unique_ptr<rtcp::RtcpPacket> BuildNACK(const RtcpContext& context)
danilchap162abd32015-12-10 02:39:40 -0800194 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
danilchap56036ff2016-03-22 11:14:09 -0700195 std::unique_ptr<rtcp::RtcpPacket> BuildReceiverReferenceTime(
danilchap162abd32015-12-10 02:39:40 -0800196 const RtcpContext& context)
197 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
danilchap56036ff2016-03-22 11:14:09 -0700198 std::unique_ptr<rtcp::RtcpPacket> BuildDlrr(const RtcpContext& context)
danilchap162abd32015-12-10 02:39:40 -0800199 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000200
danilchap162abd32015-12-10 02:39:40 -0800201 private:
202 const bool audio_;
203 Clock* const clock_;
danilchap47a740b2015-12-15 00:30:07 -0800204 Random random_ GUARDED_BY(critical_section_rtcp_sender_);
danilchap162abd32015-12-10 02:39:40 -0800205 RtcpMode method_ GUARDED_BY(critical_section_rtcp_sender_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000206
terelius429c3452016-01-21 05:42:04 -0800207 RtcEventLog* const event_log_;
danilchap162abd32015-12-10 02:39:40 -0800208 Transport* const transport_;
niklase@google.com470e71d2011-07-07 08:21:25 +0000209
danilchap56036ff2016-03-22 11:14:09 -0700210 rtc::CriticalSection critical_section_rtcp_sender_;
danilchap162abd32015-12-10 02:39:40 -0800211 bool using_nack_ GUARDED_BY(critical_section_rtcp_sender_);
212 bool sending_ GUARDED_BY(critical_section_rtcp_sender_);
213 bool remb_enabled_ GUARDED_BY(critical_section_rtcp_sender_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000214
danilchap162abd32015-12-10 02:39:40 -0800215 int64_t next_time_to_send_rtcp_ GUARDED_BY(critical_section_rtcp_sender_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000216
danilchap162abd32015-12-10 02:39:40 -0800217 uint32_t start_timestamp_ GUARDED_BY(critical_section_rtcp_sender_);
218 uint32_t last_rtp_timestamp_ GUARDED_BY(critical_section_rtcp_sender_);
219 int64_t last_frame_capture_time_ms_ GUARDED_BY(critical_section_rtcp_sender_);
220 uint32_t ssrc_ GUARDED_BY(critical_section_rtcp_sender_);
221 // SSRC that we receive on our RTP channel
222 uint32_t remote_ssrc_ GUARDED_BY(critical_section_rtcp_sender_);
223 std::string cname_ GUARDED_BY(critical_section_rtcp_sender_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000224
danilchap162abd32015-12-10 02:39:40 -0800225 ReceiveStatistics* receive_statistics_
226 GUARDED_BY(critical_section_rtcp_sender_);
227 std::map<uint32_t, rtcp::ReportBlock> report_blocks_
228 GUARDED_BY(critical_section_rtcp_sender_);
229 std::map<uint32_t, std::string> csrc_cnames_
230 GUARDED_BY(critical_section_rtcp_sender_);
stefan@webrtc.org286fe0b2013-08-21 20:58:21 +0000231
danilchap162abd32015-12-10 02:39:40 -0800232 // send CSRCs
233 std::vector<uint32_t> csrcs_ GUARDED_BY(critical_section_rtcp_sender_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000234
danilchap162abd32015-12-10 02:39:40 -0800235 // Full intra request
236 uint8_t sequence_number_fir_ GUARDED_BY(critical_section_rtcp_sender_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000237
danilchap162abd32015-12-10 02:39:40 -0800238 // REMB
239 uint32_t remb_bitrate_ GUARDED_BY(critical_section_rtcp_sender_);
240 std::vector<uint32_t> remb_ssrcs_ GUARDED_BY(critical_section_rtcp_sender_);
pwestin@webrtc.org741da942011-09-20 13:52:04 +0000241
danilchap162abd32015-12-10 02:39:40 -0800242 TMMBRHelp tmmbr_help_ GUARDED_BY(critical_section_rtcp_sender_);
243 uint32_t tmmbr_send_ GUARDED_BY(critical_section_rtcp_sender_);
244 uint32_t packet_oh_send_ GUARDED_BY(critical_section_rtcp_sender_);
danilchap41befce2016-03-30 11:11:51 -0700245 size_t max_payload_length_;
niklase@google.com470e71d2011-07-07 08:21:25 +0000246
danilchap162abd32015-12-10 02:39:40 -0800247 // APP
248 uint8_t app_sub_type_ GUARDED_BY(critical_section_rtcp_sender_);
249 uint32_t app_name_ GUARDED_BY(critical_section_rtcp_sender_);
danilchap56036ff2016-03-22 11:14:09 -0700250 std::unique_ptr<uint8_t[]> app_data_
danilchap162abd32015-12-10 02:39:40 -0800251 GUARDED_BY(critical_section_rtcp_sender_);
252 uint16_t app_length_ GUARDED_BY(critical_section_rtcp_sender_);
niklase@google.com470e71d2011-07-07 08:21:25 +0000253
danilchap162abd32015-12-10 02:39:40 -0800254 // True if sending of XR Receiver reference time report is enabled.
255 bool xr_send_receiver_reference_time_enabled_
256 GUARDED_BY(critical_section_rtcp_sender_);
asapersson@webrtc.org8469f7b2013-10-02 13:15:34 +0000257
danilchap162abd32015-12-10 02:39:40 -0800258 // XR VoIP metric
259 RTCPVoIPMetric xr_voip_metric_ GUARDED_BY(critical_section_rtcp_sender_);
edjee@google.com79b02892013-04-04 19:43:34 +0000260
danilchap162abd32015-12-10 02:39:40 -0800261 RtcpPacketTypeCounterObserver* const packet_type_counter_observer_;
262 RtcpPacketTypeCounter packet_type_counter_
263 GUARDED_BY(critical_section_rtcp_sender_);
asapersson@webrtc.org2dd31342014-10-29 12:42:30 +0000264
danilchap162abd32015-12-10 02:39:40 -0800265 RTCPUtility::NackStats nack_stats_ GUARDED_BY(critical_section_rtcp_sender_);
Erik Språng242e22b2015-05-11 10:17:43 +0200266
danilchap162abd32015-12-10 02:39:40 -0800267 void SetFlag(RTCPPacketType type, bool is_volatile)
268 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
269 void SetFlags(const std::set<RTCPPacketType>& types, bool is_volatile)
270 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
271 bool IsFlagPresent(RTCPPacketType type) const
272 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
273 bool ConsumeFlag(RTCPPacketType type, bool forced = false)
274 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
275 bool AllVolatileFlagsConsumed() const
276 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_);
277 struct ReportFlag {
278 ReportFlag(RTCPPacketType type, bool is_volatile)
279 : type(type), is_volatile(is_volatile) {}
280 bool operator<(const ReportFlag& flag) const { return type < flag.type; }
281 bool operator==(const ReportFlag& flag) const { return type == flag.type; }
282 const RTCPPacketType type;
283 const bool is_volatile;
284 };
Erik Språng242e22b2015-05-11 10:17:43 +0200285
danilchap162abd32015-12-10 02:39:40 -0800286 std::set<ReportFlag> report_flags_ GUARDED_BY(critical_section_rtcp_sender_);
Erik Språng242e22b2015-05-11 10:17:43 +0200287
danilchap56036ff2016-03-22 11:14:09 -0700288 typedef std::unique_ptr<rtcp::RtcpPacket> (RTCPSender::*BuilderFunc)(
danilchap162abd32015-12-10 02:39:40 -0800289 const RtcpContext&);
290 std::map<RTCPPacketType, BuilderFunc> builders_;
terelius429c3452016-01-21 05:42:04 -0800291
292 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RTCPSender);
niklase@google.com470e71d2011-07-07 08:21:25 +0000293};
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +0000294} // namespace webrtc
niklase@google.com470e71d2011-07-07 08:21:25 +0000295
danilchap162abd32015-12-10 02:39:40 -0800296#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_SENDER_H_