| File: | root/firefox-clang/third_party/libwebrtc/modules/rtp_rtcp/source/rtcp_sender.h |
| Warning: | line 50, column 7 Excessive padding in 'class webrtc::RTCPSender' (45 padding bytes, where 13 is optimal). Optimal fields order: recv_ssrc_callback_, schedule_next_rtcp_send_evaluation_, random_, transport_, report_interval_, receive_statistics_, remb_bitrate_, max_packet_size_, packet_type_counter_observer_, next_time_to_send_rtcp_, last_frame_capture_time_, csrcs_, loss_notification_, remb_ssrcs_, tmmbn_to_send_, cname_, env_, rtp_clock_rates_khz_, report_flags_, builders_, mutex_rtcp_sender_, send_ssrc_, method_, timestamp_offset_, last_rtp_timestamp_, remote_ssrc_, tmmbr_send_bps_, packet_oh_send_, nack_stats_, packet_type_counter_, video_bitrate_allocation_, is_rtp_sender_, audio_, sending_, sequence_number_fir_, xr_send_receiver_reference_time_enabled_, send_video_bitrate_allocation_, last_payload_type_, consider reordering the fields or adding explicit padding members |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
| 1 | /* |
| 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 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 MODULES_RTP_RTCP_SOURCE_RTCP_SENDER_H_ |
| 12 | #define MODULES_RTP_RTCP_SOURCE_RTCP_SENDER_H_ |
| 13 | |
| 14 | #include <cstddef> |
| 15 | #include <cstdint> |
| 16 | #include <map> |
| 17 | #include <memory> |
| 18 | #include <optional> |
| 19 | #include <set> |
| 20 | #include <span> |
| 21 | #include <string> |
| 22 | #include <vector> |
| 23 | |
| 24 | #include "absl/functional/any_invocable.h" |
| 25 | #include "absl/strings/string_view.h" |
| 26 | #include "api/call/transport.h" |
| 27 | #include "api/environment/environment.h" |
| 28 | #include "api/rtp_headers.h" |
| 29 | #include "api/units/data_rate.h" |
| 30 | #include "api/units/time_delta.h" |
| 31 | #include "api/units/timestamp.h" |
| 32 | #include "api/video/video_bitrate_allocation.h" |
| 33 | #include "modules/rtp_rtcp/include/receive_statistics.h" |
| 34 | #include "modules/rtp_rtcp/include/rtcp_statistics.h" |
| 35 | #include "modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
| 36 | #include "modules/rtp_rtcp/source/rtcp_nack_stats.h" |
| 37 | #include "modules/rtp_rtcp/source/rtcp_packet.h" |
| 38 | #include "modules/rtp_rtcp/source/rtcp_packet/dlrr.h" |
| 39 | #include "modules/rtp_rtcp/source/rtcp_packet/loss_notification.h" |
| 40 | #include "modules/rtp_rtcp/source/rtcp_packet/report_block.h" |
| 41 | #include "modules/rtp_rtcp/source/rtcp_packet/tmmb_item.h" |
| 42 | #include "modules/rtp_rtcp/source/rtcp_receiver.h" |
| 43 | #include "rtc_base/random.h" |
| 44 | #include "rtc_base/synchronization/mutex.h" |
| 45 | #include "rtc_base/thread_annotations.h" |
| 46 | #include "system_wrappers/include/ntp_time.h" |
| 47 | |
| 48 | namespace webrtc { |
| 49 | |
| 50 | class RTCPSender final { |
Excessive padding in 'class webrtc::RTCPSender' (45 padding bytes, where 13 is optimal). Optimal fields order: recv_ssrc_callback_, schedule_next_rtcp_send_evaluation_, random_, transport_, report_interval_, receive_statistics_, remb_bitrate_, max_packet_size_, packet_type_counter_observer_, next_time_to_send_rtcp_, last_frame_capture_time_, csrcs_, loss_notification_, remb_ssrcs_, tmmbn_to_send_, cname_, env_, rtp_clock_rates_khz_, report_flags_, builders_, mutex_rtcp_sender_, send_ssrc_, method_, timestamp_offset_, last_rtp_timestamp_, remote_ssrc_, tmmbr_send_bps_, packet_oh_send_, nack_stats_, packet_type_counter_, video_bitrate_allocation_, is_rtp_sender_, audio_, sending_, sequence_number_fir_, xr_send_receiver_reference_time_enabled_, send_video_bitrate_allocation_, last_payload_type_, consider reordering the fields or adding explicit padding members | |
| 51 | public: |
| 52 | struct Configuration { |
| 53 | // True for a audio version of the RTP/RTCP module object false will create |
| 54 | // a video version. |
| 55 | bool audio = false; |
| 56 | // SSRC for sending media. |
| 57 | uint32_t local_media_ssrc = 0; |
| 58 | // Function for fetching SSRC for sending RTCP reports when this object |
| 59 | // belongs to a ModuleRtpRtcp2 that is not used for sending RTP. |
| 60 | absl::AnyInvocable<uint32_t() const> recv_ssrc_callback; |
| 61 | // FlexFec SSRC is fetched from `flexfec_sender`. |
| 62 | |
| 63 | // Transport object that will be called when packets are ready to be sent |
| 64 | // out on the network. |
| 65 | Transport* outgoing_transport = nullptr; |
| 66 | // Estimate RTT as non-sender as described in |
| 67 | // https://tools.ietf.org/html/rfc3611#section-4.4 and #section-4.5 |
| 68 | bool non_sender_rtt_measurement = false; |
| 69 | |
| 70 | // Mandatory callback which is used by RTCPSender to schedule the next time |
| 71 | // to evaluate if RTCP should be sent by means of |
| 72 | // TimeToSendRTCPReport/SendRTCP. The RTCPSender client still needs to call |
| 73 | // TimeToSendRTCPReport/SendRTCP to actually get RTCP sent. |
| 74 | absl::AnyInvocable<void(TimeDelta)> schedule_next_rtcp_send_evaluation; |
| 75 | |
| 76 | TimeDelta rtcp_report_interval; |
| 77 | |
| 78 | // Initial RTCP status. Defaults to kOff to preserve backward compatibility |
| 79 | // with raw low-level RTCPSender tests and usages that assume the sender |
| 80 | // starts with RTCP disabled until explicitly configured. |
| 81 | RtcpMode rtcp_mode = RtcpMode::kOff; |
| 82 | ReceiveStatisticsProvider* receive_statistics = nullptr; |
| 83 | RtcpPacketTypeCounterObserver* rtcp_packet_type_counter_observer = nullptr; |
| 84 | }; |
| 85 | struct FeedbackState { |
| 86 | FeedbackState(); |
| 87 | FeedbackState(const FeedbackState&); |
| 88 | FeedbackState(FeedbackState&&); |
| 89 | |
| 90 | ~FeedbackState(); |
| 91 | |
| 92 | uint32_t packets_sent; |
| 93 | size_t media_bytes_sent; |
| 94 | DataRate send_bitrate; |
| 95 | |
| 96 | uint32_t remote_sr; |
| 97 | NtpTime last_rr; |
| 98 | |
| 99 | std::vector<rtcp::ReceiveTimeInfo> last_xr_rtis; |
| 100 | |
| 101 | // Used when generating TMMBR. |
| 102 | RTCPReceiver* receiver; |
| 103 | }; |
| 104 | |
| 105 | RTCPSender(const Environment& env, Configuration config); |
| 106 | |
| 107 | RTCPSender() = delete; |
| 108 | RTCPSender(const RTCPSender&) = delete; |
| 109 | RTCPSender& operator=(const RTCPSender&) = delete; |
| 110 | |
| 111 | ~RTCPSender(); |
| 112 | |
| 113 | RtcpMode Status() const RTC_LOCKS_EXCLUDED(mutex_rtcp_sender_)__attribute__((locks_excluded(mutex_rtcp_sender_))); |
| 114 | void SetRTCPStatus(RtcpMode method) RTC_LOCKS_EXCLUDED(mutex_rtcp_sender_)__attribute__((locks_excluded(mutex_rtcp_sender_))); |
| 115 | |
| 116 | bool Sending() const RTC_LOCKS_EXCLUDED(mutex_rtcp_sender_)__attribute__((locks_excluded(mutex_rtcp_sender_))); |
| 117 | void SetSendingStatus(const FeedbackState& feedback_state, |
| 118 | bool enabled) |
| 119 | RTC_LOCKS_EXCLUDED(mutex_rtcp_sender_)__attribute__((locks_excluded(mutex_rtcp_sender_))); // combine the functions |
| 120 | |
| 121 | void SetNonSenderRttMeasurement(bool enabled) |
| 122 | RTC_LOCKS_EXCLUDED(mutex_rtcp_sender_)__attribute__((locks_excluded(mutex_rtcp_sender_))); |
| 123 | |
| 124 | void SetTimestampOffset(uint32_t timestamp_offset) |
| 125 | RTC_LOCKS_EXCLUDED(mutex_rtcp_sender_)__attribute__((locks_excluded(mutex_rtcp_sender_))); |
| 126 | |
| 127 | void SetLastRtpTime(uint32_t rtp_timestamp, |
| 128 | std::optional<Timestamp> capture_time, |
| 129 | std::optional<int8_t> payload_type) |
| 130 | RTC_LOCKS_EXCLUDED(mutex_rtcp_sender_)__attribute__((locks_excluded(mutex_rtcp_sender_))); |
| 131 | |
| 132 | void SetRtpClockRate(int8_t payload_type, int rtp_clock_rate_hz) |
| 133 | RTC_LOCKS_EXCLUDED(mutex_rtcp_sender_)__attribute__((locks_excluded(mutex_rtcp_sender_))); |
| 134 | |
| 135 | uint32_t SSRC() const; |
| 136 | |
| 137 | void SetRemoteSSRC(uint32_t ssrc) RTC_LOCKS_EXCLUDED(mutex_rtcp_sender_)__attribute__((locks_excluded(mutex_rtcp_sender_))); |
| 138 | |
| 139 | int32_t SetCNAME(absl::string_view cName) |
| 140 | RTC_LOCKS_EXCLUDED(mutex_rtcp_sender_)__attribute__((locks_excluded(mutex_rtcp_sender_))); |
| 141 | |
| 142 | bool TimeToSendRTCPReport(bool send_keyframe_before_rtp = false) const |
| 143 | RTC_LOCKS_EXCLUDED(mutex_rtcp_sender_)__attribute__((locks_excluded(mutex_rtcp_sender_))); |
| 144 | |
| 145 | int32_t SendRTCP(const FeedbackState& feedback_state, |
| 146 | RTCPPacketType packetType, |
| 147 | std::span<const uint16_t> nacks = {}) |
| 148 | RTC_LOCKS_EXCLUDED(mutex_rtcp_sender_)__attribute__((locks_excluded(mutex_rtcp_sender_))); |
| 149 | |
| 150 | int32_t SendLossNotification(const FeedbackState& feedback_state, |
| 151 | uint16_t last_decoded_seq_num, |
| 152 | uint16_t last_received_seq_num, |
| 153 | bool decodability_flag, |
| 154 | bool buffering_allowed) |
| 155 | RTC_LOCKS_EXCLUDED(mutex_rtcp_sender_)__attribute__((locks_excluded(mutex_rtcp_sender_))); |
| 156 | |
| 157 | void SetRemb(int64_t bitrate_bps, std::vector<uint32_t> ssrcs) |
| 158 | RTC_LOCKS_EXCLUDED(mutex_rtcp_sender_)__attribute__((locks_excluded(mutex_rtcp_sender_))); |
| 159 | |
| 160 | void UnsetRemb() RTC_LOCKS_EXCLUDED(mutex_rtcp_sender_)__attribute__((locks_excluded(mutex_rtcp_sender_))); |
| 161 | |
| 162 | bool TMMBR() const RTC_LOCKS_EXCLUDED(mutex_rtcp_sender_)__attribute__((locks_excluded(mutex_rtcp_sender_))); |
| 163 | |
| 164 | void SetMaxRtpPacketSize(size_t max_packet_size) |
| 165 | RTC_LOCKS_EXCLUDED(mutex_rtcp_sender_)__attribute__((locks_excluded(mutex_rtcp_sender_))); |
| 166 | |
| 167 | void SetTmmbn(std::vector<rtcp::TmmbItem> bounding_set) |
| 168 | RTC_LOCKS_EXCLUDED(mutex_rtcp_sender_)__attribute__((locks_excluded(mutex_rtcp_sender_))); |
| 169 | |
| 170 | void SetCsrcs(const std::vector<uint32_t>& csrcs) |
| 171 | RTC_LOCKS_EXCLUDED(mutex_rtcp_sender_)__attribute__((locks_excluded(mutex_rtcp_sender_))); |
| 172 | |
| 173 | void SetTargetBitrate(unsigned int target_bitrate) |
| 174 | RTC_LOCKS_EXCLUDED(mutex_rtcp_sender_)__attribute__((locks_excluded(mutex_rtcp_sender_))); |
| 175 | void SetVideoBitrateAllocation(const VideoBitrateAllocation& bitrate) |
| 176 | RTC_LOCKS_EXCLUDED(mutex_rtcp_sender_)__attribute__((locks_excluded(mutex_rtcp_sender_))); |
| 177 | void SendCombinedRtcpPacket( |
| 178 | std::vector<std::unique_ptr<rtcp::RtcpPacket>> rtcp_packets) |
| 179 | RTC_LOCKS_EXCLUDED(mutex_rtcp_sender_)__attribute__((locks_excluded(mutex_rtcp_sender_))); |
| 180 | |
| 181 | private: |
| 182 | class RtcpContext; |
| 183 | class PacketSender; |
| 184 | |
| 185 | uint32_t ComputeSsrc() const RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_rtcp_sender_)__attribute__((exclusive_locks_required(mutex_rtcp_sender_))); |
| 186 | |
| 187 | std::optional<int32_t> ComputeCompoundRTCPPacket( |
| 188 | const FeedbackState& feedback_state, |
| 189 | RTCPPacketType packet_type, |
| 190 | std::span<const uint16_t> nacks, |
| 191 | PacketSender& sender) RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_rtcp_sender_)__attribute__((exclusive_locks_required(mutex_rtcp_sender_))); |
| 192 | |
| 193 | TimeDelta ComputeTimeUntilNextReport(DataRate send_bitrate) |
| 194 | RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_rtcp_sender_)__attribute__((exclusive_locks_required(mutex_rtcp_sender_))); |
| 195 | |
| 196 | // Determine which RTCP messages should be sent and setup flags. |
| 197 | void PrepareReport(const FeedbackState& feedback_state) |
| 198 | RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_rtcp_sender_)__attribute__((exclusive_locks_required(mutex_rtcp_sender_))); |
| 199 | |
| 200 | std::vector<rtcp::ReportBlock> CreateReportBlocks( |
| 201 | const FeedbackState& feedback_state) |
| 202 | RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_rtcp_sender_)__attribute__((exclusive_locks_required(mutex_rtcp_sender_))); |
| 203 | |
| 204 | void BuildSR(const RtcpContext& context, PacketSender& sender) |
| 205 | RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_rtcp_sender_)__attribute__((exclusive_locks_required(mutex_rtcp_sender_))); |
| 206 | void BuildRR(const RtcpContext& context, PacketSender& sender) |
| 207 | RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_rtcp_sender_)__attribute__((exclusive_locks_required(mutex_rtcp_sender_))); |
| 208 | void BuildSDES(const RtcpContext& context, PacketSender& sender) |
| 209 | RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_rtcp_sender_)__attribute__((exclusive_locks_required(mutex_rtcp_sender_))); |
| 210 | void BuildPLI(const RtcpContext& context, PacketSender& sender) |
| 211 | RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_rtcp_sender_)__attribute__((exclusive_locks_required(mutex_rtcp_sender_))); |
| 212 | void BuildREMB(const RtcpContext& context, PacketSender& sender) |
| 213 | RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_rtcp_sender_)__attribute__((exclusive_locks_required(mutex_rtcp_sender_))); |
| 214 | void BuildTMMBR(const RtcpContext& context, PacketSender& sender) |
| 215 | RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_rtcp_sender_)__attribute__((exclusive_locks_required(mutex_rtcp_sender_))); |
| 216 | void BuildTMMBN(const RtcpContext& context, PacketSender& sender) |
| 217 | RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_rtcp_sender_)__attribute__((exclusive_locks_required(mutex_rtcp_sender_))); |
| 218 | void BuildAPP(const RtcpContext& context, PacketSender& sender) |
| 219 | RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_rtcp_sender_)__attribute__((exclusive_locks_required(mutex_rtcp_sender_))); |
| 220 | void BuildLossNotification(const RtcpContext& context, PacketSender& sender) |
| 221 | RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_rtcp_sender_)__attribute__((exclusive_locks_required(mutex_rtcp_sender_))); |
| 222 | void BuildExtendedReports(const RtcpContext& context, PacketSender& sender) |
| 223 | RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_rtcp_sender_)__attribute__((exclusive_locks_required(mutex_rtcp_sender_))); |
| 224 | void BuildBYE(const RtcpContext& context, PacketSender& sender) |
| 225 | RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_rtcp_sender_)__attribute__((exclusive_locks_required(mutex_rtcp_sender_))); |
| 226 | void BuildFIR(const RtcpContext& context, PacketSender& sender) |
| 227 | RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_rtcp_sender_)__attribute__((exclusive_locks_required(mutex_rtcp_sender_))); |
| 228 | void BuildNACK(const RtcpContext& context, PacketSender& sender) |
| 229 | RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_rtcp_sender_)__attribute__((exclusive_locks_required(mutex_rtcp_sender_))); |
| 230 | |
| 231 | // `duration` being TimeDelta::Zero() means schedule immediately. |
| 232 | void SetNextRtcpSendEvaluationDuration(TimeDelta duration) |
| 233 | RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_rtcp_sender_)__attribute__((exclusive_locks_required(mutex_rtcp_sender_))); |
| 234 | |
| 235 | const Environment env_; |
| 236 | const bool is_rtp_sender_; |
| 237 | const bool audio_; |
| 238 | // The SSRC used for sending when is_rtp_sender_ is true |
| 239 | // and sending_ is true. |
| 240 | const uint32_t send_ssrc_; |
| 241 | // The function used for getting the right SSRC to send from |
| 242 | // when the RTCPSender is used with a ModuleRtpRtcp that is not |
| 243 | // configured for sending RTP (is_rtp_sender_ is false). |
| 244 | absl::AnyInvocable<uint32_t() const> recv_ssrc_callback_; |
| 245 | Random random_ RTC_GUARDED_BY(mutex_rtcp_sender_)__attribute__((guarded_by(mutex_rtcp_sender_))); |
| 246 | RtcpMode method_ RTC_GUARDED_BY(mutex_rtcp_sender_)__attribute__((guarded_by(mutex_rtcp_sender_))); |
| 247 | |
| 248 | Transport* const transport_; |
| 249 | |
| 250 | const TimeDelta report_interval_; |
| 251 | absl::AnyInvocable<void(TimeDelta)> schedule_next_rtcp_send_evaluation_; |
| 252 | |
| 253 | mutable Mutex mutex_rtcp_sender_; |
| 254 | bool sending_ RTC_GUARDED_BY(mutex_rtcp_sender_)__attribute__((guarded_by(mutex_rtcp_sender_))); |
| 255 | |
| 256 | std::optional<Timestamp> next_time_to_send_rtcp_ |
| 257 | RTC_GUARDED_BY(mutex_rtcp_sender_)__attribute__((guarded_by(mutex_rtcp_sender_))); |
| 258 | |
| 259 | uint32_t timestamp_offset_ RTC_GUARDED_BY(mutex_rtcp_sender_)__attribute__((guarded_by(mutex_rtcp_sender_))); |
| 260 | uint32_t last_rtp_timestamp_ RTC_GUARDED_BY(mutex_rtcp_sender_)__attribute__((guarded_by(mutex_rtcp_sender_))); |
| 261 | std::optional<Timestamp> last_frame_capture_time_ |
| 262 | RTC_GUARDED_BY(mutex_rtcp_sender_)__attribute__((guarded_by(mutex_rtcp_sender_))); |
| 263 | // SSRC that we receive on our RTP channel |
| 264 | uint32_t remote_ssrc_ RTC_GUARDED_BY(mutex_rtcp_sender_)__attribute__((guarded_by(mutex_rtcp_sender_))); |
| 265 | std::string cname_ RTC_GUARDED_BY(mutex_rtcp_sender_)__attribute__((guarded_by(mutex_rtcp_sender_))); |
| 266 | |
| 267 | ReceiveStatisticsProvider* receive_statistics_ |
| 268 | RTC_GUARDED_BY(mutex_rtcp_sender_)__attribute__((guarded_by(mutex_rtcp_sender_))); |
| 269 | |
| 270 | // send CSRCs |
| 271 | std::vector<uint32_t> csrcs_ RTC_GUARDED_BY(mutex_rtcp_sender_)__attribute__((guarded_by(mutex_rtcp_sender_))); |
| 272 | |
| 273 | // Full intra request |
| 274 | uint8_t sequence_number_fir_ RTC_GUARDED_BY(mutex_rtcp_sender_)__attribute__((guarded_by(mutex_rtcp_sender_))); |
| 275 | |
| 276 | rtcp::LossNotification loss_notification_ RTC_GUARDED_BY(mutex_rtcp_sender_)__attribute__((guarded_by(mutex_rtcp_sender_))); |
| 277 | |
| 278 | // REMB |
| 279 | int64_t remb_bitrate_ RTC_GUARDED_BY(mutex_rtcp_sender_)__attribute__((guarded_by(mutex_rtcp_sender_))); |
| 280 | std::vector<uint32_t> remb_ssrcs_ RTC_GUARDED_BY(mutex_rtcp_sender_)__attribute__((guarded_by(mutex_rtcp_sender_))); |
| 281 | |
| 282 | std::vector<rtcp::TmmbItem> tmmbn_to_send_ RTC_GUARDED_BY(mutex_rtcp_sender_)__attribute__((guarded_by(mutex_rtcp_sender_))); |
| 283 | uint32_t tmmbr_send_bps_ RTC_GUARDED_BY(mutex_rtcp_sender_)__attribute__((guarded_by(mutex_rtcp_sender_))); |
| 284 | uint32_t packet_oh_send_ RTC_GUARDED_BY(mutex_rtcp_sender_)__attribute__((guarded_by(mutex_rtcp_sender_))); |
| 285 | size_t max_packet_size_ RTC_GUARDED_BY(mutex_rtcp_sender_)__attribute__((guarded_by(mutex_rtcp_sender_))); |
| 286 | |
| 287 | // True if sending of XR Receiver reference time report is enabled. |
| 288 | bool xr_send_receiver_reference_time_enabled_ |
| 289 | RTC_GUARDED_BY(mutex_rtcp_sender_)__attribute__((guarded_by(mutex_rtcp_sender_))); |
| 290 | |
| 291 | RtcpPacketTypeCounterObserver* const packet_type_counter_observer_; |
| 292 | RtcpPacketTypeCounter packet_type_counter_ RTC_GUARDED_BY(mutex_rtcp_sender_)__attribute__((guarded_by(mutex_rtcp_sender_))); |
| 293 | |
| 294 | RtcpNackStats nack_stats_ RTC_GUARDED_BY(mutex_rtcp_sender_)__attribute__((guarded_by(mutex_rtcp_sender_))); |
| 295 | |
| 296 | VideoBitrateAllocation video_bitrate_allocation_ |
| 297 | RTC_GUARDED_BY(mutex_rtcp_sender_)__attribute__((guarded_by(mutex_rtcp_sender_))); |
| 298 | bool send_video_bitrate_allocation_ RTC_GUARDED_BY(mutex_rtcp_sender_)__attribute__((guarded_by(mutex_rtcp_sender_))); |
| 299 | |
| 300 | std::map<int8_t, int> rtp_clock_rates_khz_ RTC_GUARDED_BY(mutex_rtcp_sender_)__attribute__((guarded_by(mutex_rtcp_sender_))); |
| 301 | int8_t last_payload_type_ RTC_GUARDED_BY(mutex_rtcp_sender_)__attribute__((guarded_by(mutex_rtcp_sender_))); |
| 302 | |
| 303 | std::optional<VideoBitrateAllocation> CheckAndUpdateLayerStructure( |
| 304 | const VideoBitrateAllocation& bitrate) const |
| 305 | RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_rtcp_sender_)__attribute__((exclusive_locks_required(mutex_rtcp_sender_))); |
| 306 | |
| 307 | void SetFlag(uint32_t type, bool is_volatile) |
| 308 | RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_rtcp_sender_)__attribute__((exclusive_locks_required(mutex_rtcp_sender_))); |
| 309 | bool IsFlagPresent(uint32_t type) const |
| 310 | RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_rtcp_sender_)__attribute__((exclusive_locks_required(mutex_rtcp_sender_))); |
| 311 | bool ConsumeFlag(uint32_t type, bool forced = false) |
| 312 | RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_rtcp_sender_)__attribute__((exclusive_locks_required(mutex_rtcp_sender_))); |
| 313 | bool AllVolatileFlagsConsumed() const |
| 314 | RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_rtcp_sender_)__attribute__((exclusive_locks_required(mutex_rtcp_sender_))); |
| 315 | struct ReportFlag { |
| 316 | ReportFlag(uint32_t type, bool is_volatile) |
| 317 | : type(type), is_volatile(is_volatile) {} |
| 318 | bool operator<(const ReportFlag& flag) const { return type < flag.type; } |
| 319 | bool operator==(const ReportFlag& flag) const { return type == flag.type; } |
| 320 | const uint32_t type; |
| 321 | const bool is_volatile; |
| 322 | }; |
| 323 | |
| 324 | std::set<ReportFlag> report_flags_ RTC_GUARDED_BY(mutex_rtcp_sender_)__attribute__((guarded_by(mutex_rtcp_sender_))); |
| 325 | |
| 326 | typedef void (RTCPSender::*BuilderFunc)(const RtcpContext&, PacketSender&); |
| 327 | // Map from RTCPPacketType to builder. |
| 328 | std::map<uint32_t, BuilderFunc> builders_; |
| 329 | }; |
| 330 | } // namespace webrtc |
| 331 | |
| 332 | #endif // MODULES_RTP_RTCP_SOURCE_RTCP_SENDER_H_ |