| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 std::string GetResult(); | 43 std::string GetResult(); |
| 44 | 44 |
| 45 private: | 45 private: |
| 46 std::ostringstream stream_; | 46 std::ostringstream stream_; |
| 47 int count_; | 47 int count_; |
| 48 uint16_t prevNack_; | 48 uint16_t prevNack_; |
| 49 bool consecutive_; | 49 bool consecutive_; |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 class RTCPSender { | 52 class RTCPSender { |
| 53 public: | 53 public: |
| 54 struct FeedbackState { | 54 struct FeedbackState { |
| 55 FeedbackState(); | 55 FeedbackState(); |
| 56 | 56 |
| 57 uint8_t send_payload_type; | 57 uint8_t send_payload_type; |
| 58 uint32_t frequency_hz; | 58 uint32_t frequency_hz; |
| 59 uint32_t packets_sent; | 59 uint32_t packets_sent; |
| 60 size_t media_bytes_sent; | 60 size_t media_bytes_sent; |
| 61 uint32_t send_bitrate; | 61 uint32_t send_bitrate; |
| 62 | 62 |
| 63 uint32_t last_rr_ntp_secs; | 63 uint32_t last_rr_ntp_secs; |
| 64 uint32_t last_rr_ntp_frac; | 64 uint32_t last_rr_ntp_frac; |
| 65 uint32_t remote_sr; | 65 uint32_t remote_sr; |
| 66 | 66 |
| 67 bool has_last_xr_rr; | 67 bool has_last_xr_rr; |
| 68 RtcpReceiveTimeInfo last_xr_rr; | 68 RtcpReceiveTimeInfo last_xr_rr; |
| 69 | 69 |
| 70 // Used when generating TMMBR. | 70 // Used when generating TMMBR. |
| 71 ModuleRtpRtcpImpl* module; | 71 ModuleRtpRtcpImpl* module; |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 RTCPSender(bool audio, | 74 RTCPSender(bool audio, |
| 75 Clock* clock, | 75 Clock* clock, |
| 76 ReceiveStatistics* receive_statistics, | 76 ReceiveStatistics* receive_statistics, |
| 77 RtcpPacketTypeCounterObserver* packet_type_counter_observer, | 77 RtcpPacketTypeCounterObserver* packet_type_counter_observer, |
| 78 Transport* outgoing_transport); | 78 Transport* outgoing_transport); |
| 79 virtual ~RTCPSender(); | 79 virtual ~RTCPSender(); |
| 80 | 80 |
| 81 RtcpMode Status() const; | 81 RtcpMode Status() const; |
| 82 void SetRTCPStatus(RtcpMode method); | 82 void SetRTCPStatus(RtcpMode method); |
| 83 | 83 |
| 84 bool Sending() const; | 84 bool Sending() const; |
| 85 int32_t SetSendingStatus(const FeedbackState& feedback_state, | 85 int32_t SetSendingStatus(const FeedbackState& feedback_state, |
| 86 bool enabled); // combine the functions | 86 bool enabled); // combine the functions |
| 87 | 87 |
| 88 int32_t SetNackStatus(bool enable); | 88 int32_t SetNackStatus(bool enable); |
| 89 | 89 |
| 90 void SetStartTimestamp(uint32_t start_timestamp); | 90 void SetStartTimestamp(uint32_t start_timestamp); |
| 91 | 91 |
| 92 void SetLastRtpTime(uint32_t rtp_timestamp, int64_t capture_time_ms); | 92 void SetLastRtpTime(uint32_t rtp_timestamp, int64_t capture_time_ms); |
| 93 | 93 |
| 94 void SetSSRC(uint32_t ssrc); | 94 void SetSSRC(uint32_t ssrc); |
| 95 | 95 |
| 96 void SetRemoteSSRC(uint32_t ssrc); | 96 void SetRemoteSSRC(uint32_t ssrc); |
| 97 | 97 |
| 98 int32_t SetCNAME(const char* cName); | 98 int32_t SetCNAME(const char* cName); |
| 99 | 99 |
| 100 int32_t AddMixedCNAME(uint32_t SSRC, const char* c_name); | 100 int32_t AddMixedCNAME(uint32_t SSRC, const char* c_name); |
| 101 | 101 |
| 102 int32_t RemoveMixedCNAME(uint32_t SSRC); | 102 int32_t RemoveMixedCNAME(uint32_t SSRC); |
| 103 | 103 |
| 104 int64_t SendTimeOfSendReport(uint32_t sendReport); | 104 int64_t SendTimeOfSendReport(uint32_t sendReport); |
| 105 | 105 |
| 106 bool SendTimeOfXrRrReport(uint32_t mid_ntp, int64_t* time_ms) const; | 106 bool SendTimeOfXrRrReport(uint32_t mid_ntp, int64_t* time_ms) const; |
| 107 | 107 |
| 108 bool TimeToSendRTCPReport(bool sendKeyframeBeforeRTP = false) const; | 108 bool TimeToSendRTCPReport(bool sendKeyframeBeforeRTP = false) const; |
| 109 | 109 |
| 110 int32_t SendRTCP(const FeedbackState& feedback_state, | 110 int32_t SendRTCP(const FeedbackState& feedback_state, |
| 111 RTCPPacketType packetType, | 111 RTCPPacketType packetType, |
| 112 int32_t nackSize = 0, | 112 int32_t nackSize = 0, |
| 113 const uint16_t* nackList = 0, | 113 const uint16_t* nackList = 0, |
| 114 bool repeat = false, | 114 bool repeat = false, |
| 115 uint64_t pictureID = 0); | 115 uint64_t pictureID = 0); |
| 116 | 116 |
| 117 int32_t SendCompoundRTCP(const FeedbackState& feedback_state, | 117 int32_t SendCompoundRTCP(const FeedbackState& feedback_state, |
| 118 const std::set<RTCPPacketType>& packetTypes, | 118 const std::set<RTCPPacketType>& packetTypes, |
| 119 int32_t nackSize = 0, | 119 int32_t nackSize = 0, |
| 120 const uint16_t* nackList = 0, | 120 const uint16_t* nackList = 0, |
| 121 bool repeat = false, | 121 bool repeat = false, |
| 122 uint64_t pictureID = 0); | 122 uint64_t pictureID = 0); |
| 123 | 123 |
| 124 bool REMB() const; | 124 bool REMB() const; |
| 125 | 125 |
| 126 void SetREMBStatus(bool enable); | 126 void SetREMBStatus(bool enable); |
| 127 | 127 |
| 128 void SetREMBData(uint32_t bitrate, const std::vector<uint32_t>& ssrcs); | 128 void SetREMBData(uint32_t bitrate, const std::vector<uint32_t>& ssrcs); |
| 129 | 129 |
| 130 bool TMMBR() const; | 130 bool TMMBR() const; |
| 131 | 131 |
| 132 void SetTMMBRStatus(bool enable); | 132 void SetTMMBRStatus(bool enable); |
| 133 | 133 |
| 134 int32_t SetTMMBN(const TMMBRSet* boundingSet, uint32_t maxBitrateKbit); | 134 int32_t SetTMMBN(const TMMBRSet* boundingSet, uint32_t maxBitrateKbit); |
| 135 | 135 |
| 136 int32_t SetApplicationSpecificData(uint8_t subType, | 136 int32_t SetApplicationSpecificData(uint8_t subType, |
| 137 uint32_t name, | 137 uint32_t name, |
| 138 const uint8_t* data, | 138 const uint8_t* data, |
| 139 uint16_t length); | 139 uint16_t length); |
| 140 int32_t SetRTCPVoIPMetrics(const RTCPVoIPMetric* VoIPMetric); | 140 int32_t SetRTCPVoIPMetrics(const RTCPVoIPMetric* VoIPMetric); |
| 141 | 141 |
| 142 void SendRtcpXrReceiverReferenceTime(bool enable); | 142 void SendRtcpXrReceiverReferenceTime(bool enable); |
| 143 | 143 |
| 144 bool RtcpXrReceiverReferenceTime() const; | 144 bool RtcpXrReceiverReferenceTime() const; |
| 145 | 145 |
| 146 void SetCsrcs(const std::vector<uint32_t>& csrcs); | 146 void SetCsrcs(const std::vector<uint32_t>& csrcs); |
| 147 | 147 |
| 148 void SetTargetBitrate(unsigned int target_bitrate); | 148 void SetTargetBitrate(unsigned int target_bitrate); |
| 149 bool SendFeedbackPacket(const rtcp::TransportFeedback& packet); | 149 bool SendFeedbackPacket(const rtcp::TransportFeedback& packet); |
| 150 | 150 |
| 151 private: | 151 private: |
| 152 class RtcpContext; | 152 class RtcpContext; |
| 153 | 153 |
| 154 // Determine which RTCP messages should be sent and setup flags. | 154 // Determine which RTCP messages should be sent and setup flags. |
| 155 void PrepareReport(const std::set<RTCPPacketType>& packetTypes, | 155 void PrepareReport(const std::set<RTCPPacketType>& packetTypes, |
| 156 const FeedbackState& feedback_state) | 156 const FeedbackState& feedback_state) |
| 157 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); | 157 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); |
| 158 | 158 |
| 159 int32_t AddReportBlock(const RTCPReportBlock& report_block) | 159 int32_t AddReportBlock(const RTCPReportBlock& report_block) |
| 160 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); | 160 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); |
| 161 | 161 |
| 162 bool PrepareReportBlock(const FeedbackState& feedback_state, | 162 bool PrepareReportBlock(const FeedbackState& feedback_state, |
| 163 uint32_t ssrc, | 163 uint32_t ssrc, |
| 164 StreamStatistician* statistician, | 164 StreamStatistician* statistician, |
| 165 RTCPReportBlock* report_block); | 165 RTCPReportBlock* report_block); |
| 166 | 166 |
| 167 rtc::scoped_ptr<rtcp::RtcpPacket> BuildSR(const RtcpContext& context) | 167 rtc::scoped_ptr<rtcp::RtcpPacket> BuildSR(const RtcpContext& context) |
| 168 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); | 168 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); |
| 169 rtc::scoped_ptr<rtcp::RtcpPacket> BuildRR(const RtcpContext& context) | 169 rtc::scoped_ptr<rtcp::RtcpPacket> BuildRR(const RtcpContext& context) |
| 170 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); | 170 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); |
| 171 rtc::scoped_ptr<rtcp::RtcpPacket> BuildSDES(const RtcpContext& context) | 171 rtc::scoped_ptr<rtcp::RtcpPacket> BuildSDES(const RtcpContext& context) |
| 172 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); | 172 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); |
| 173 rtc::scoped_ptr<rtcp::RtcpPacket> BuildPLI(const RtcpContext& context) | 173 rtc::scoped_ptr<rtcp::RtcpPacket> BuildPLI(const RtcpContext& context) |
| 174 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); | 174 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); |
| 175 rtc::scoped_ptr<rtcp::RtcpPacket> BuildREMB(const RtcpContext& context) | 175 rtc::scoped_ptr<rtcp::RtcpPacket> BuildREMB(const RtcpContext& context) |
| 176 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); | 176 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); |
| 177 rtc::scoped_ptr<rtcp::RtcpPacket> BuildTMMBR(const RtcpContext& context) | 177 rtc::scoped_ptr<rtcp::RtcpPacket> BuildTMMBR(const RtcpContext& context) |
| 178 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); | 178 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); |
| 179 rtc::scoped_ptr<rtcp::RtcpPacket> BuildTMMBN(const RtcpContext& context) | 179 rtc::scoped_ptr<rtcp::RtcpPacket> BuildTMMBN(const RtcpContext& context) |
| 180 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); | 180 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); |
| 181 rtc::scoped_ptr<rtcp::RtcpPacket> BuildAPP(const RtcpContext& context) | 181 rtc::scoped_ptr<rtcp::RtcpPacket> BuildAPP(const RtcpContext& context) |
| 182 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); | 182 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); |
| 183 rtc::scoped_ptr<rtcp::RtcpPacket> BuildVoIPMetric(const RtcpContext& context) | 183 rtc::scoped_ptr<rtcp::RtcpPacket> BuildVoIPMetric(const RtcpContext& context) |
| 184 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); | 184 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); |
| 185 rtc::scoped_ptr<rtcp::RtcpPacket> BuildBYE(const RtcpContext& context) | 185 rtc::scoped_ptr<rtcp::RtcpPacket> BuildBYE(const RtcpContext& context) |
| 186 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); | 186 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); |
| 187 rtc::scoped_ptr<rtcp::RtcpPacket> BuildFIR(const RtcpContext& context) | 187 rtc::scoped_ptr<rtcp::RtcpPacket> BuildFIR(const RtcpContext& context) |
| 188 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); | 188 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); |
| 189 rtc::scoped_ptr<rtcp::RtcpPacket> BuildSLI(const RtcpContext& context) | 189 rtc::scoped_ptr<rtcp::RtcpPacket> BuildSLI(const RtcpContext& context) |
| 190 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); | 190 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); |
| 191 rtc::scoped_ptr<rtcp::RtcpPacket> BuildRPSI(const RtcpContext& context) | 191 rtc::scoped_ptr<rtcp::RtcpPacket> BuildRPSI(const RtcpContext& context) |
| 192 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); | 192 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); |
| 193 rtc::scoped_ptr<rtcp::RtcpPacket> BuildNACK(const RtcpContext& context) | 193 rtc::scoped_ptr<rtcp::RtcpPacket> BuildNACK(const RtcpContext& context) |
| 194 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); | 194 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); |
| 195 rtc::scoped_ptr<rtcp::RtcpPacket> BuildReceiverReferenceTime( | 195 rtc::scoped_ptr<rtcp::RtcpPacket> BuildReceiverReferenceTime( |
| 196 const RtcpContext& context) | 196 const RtcpContext& context) |
| 197 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); | 197 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); |
| 198 rtc::scoped_ptr<rtcp::RtcpPacket> BuildDlrr(const RtcpContext& context) | 198 rtc::scoped_ptr<rtcp::RtcpPacket> BuildDlrr(const RtcpContext& context) |
| 199 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); | 199 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); |
| 200 | 200 |
| 201 private: | 201 private: |
| 202 const bool audio_; | 202 const bool audio_; |
| 203 Clock* const clock_; | 203 Clock* const clock_; |
| 204 RtcpMode method_ GUARDED_BY(critical_section_rtcp_sender_); | 204 RtcpMode method_ GUARDED_BY(critical_section_rtcp_sender_); |
| 205 | 205 |
| 206 Transport* const transport_; | 206 Transport* const transport_; |
| 207 | 207 |
| 208 rtc::scoped_ptr<CriticalSectionWrapper> critical_section_rtcp_sender_; | 208 rtc::scoped_ptr<CriticalSectionWrapper> critical_section_rtcp_sender_; |
| 209 bool using_nack_ GUARDED_BY(critical_section_rtcp_sender_); | 209 bool using_nack_ GUARDED_BY(critical_section_rtcp_sender_); |
| 210 bool sending_ GUARDED_BY(critical_section_rtcp_sender_); | 210 bool sending_ GUARDED_BY(critical_section_rtcp_sender_); |
| 211 bool remb_enabled_ GUARDED_BY(critical_section_rtcp_sender_); | 211 bool remb_enabled_ GUARDED_BY(critical_section_rtcp_sender_); |
| 212 | 212 |
| 213 int64_t next_time_to_send_rtcp_ GUARDED_BY(critical_section_rtcp_sender_); | 213 int64_t next_time_to_send_rtcp_ GUARDED_BY(critical_section_rtcp_sender_); |
| 214 | 214 |
| 215 uint32_t start_timestamp_ GUARDED_BY(critical_section_rtcp_sender_); | 215 uint32_t start_timestamp_ GUARDED_BY(critical_section_rtcp_sender_); |
| 216 uint32_t last_rtp_timestamp_ GUARDED_BY(critical_section_rtcp_sender_); | 216 uint32_t last_rtp_timestamp_ GUARDED_BY(critical_section_rtcp_sender_); |
| 217 int64_t last_frame_capture_time_ms_ GUARDED_BY(critical_section_rtcp_sender_); | 217 int64_t last_frame_capture_time_ms_ GUARDED_BY(critical_section_rtcp_sender_); |
| 218 uint32_t ssrc_ GUARDED_BY(critical_section_rtcp_sender_); | 218 uint32_t ssrc_ GUARDED_BY(critical_section_rtcp_sender_); |
| 219 // SSRC that we receive on our RTP channel | 219 // SSRC that we receive on our RTP channel |
| 220 uint32_t remote_ssrc_ GUARDED_BY(critical_section_rtcp_sender_); | 220 uint32_t remote_ssrc_ GUARDED_BY(critical_section_rtcp_sender_); |
| 221 std::string cname_ GUARDED_BY(critical_section_rtcp_sender_); | 221 std::string cname_ GUARDED_BY(critical_section_rtcp_sender_); |
| 222 | 222 |
| 223 ReceiveStatistics* receive_statistics_ | 223 ReceiveStatistics* receive_statistics_ |
| 224 GUARDED_BY(critical_section_rtcp_sender_); | 224 GUARDED_BY(critical_section_rtcp_sender_); |
| 225 std::map<uint32_t, rtcp::ReportBlock> report_blocks_ | 225 std::map<uint32_t, rtcp::ReportBlock> report_blocks_ |
| 226 GUARDED_BY(critical_section_rtcp_sender_); | 226 GUARDED_BY(critical_section_rtcp_sender_); |
| 227 std::map<uint32_t, std::string> csrc_cnames_ | 227 std::map<uint32_t, std::string> csrc_cnames_ |
| 228 GUARDED_BY(critical_section_rtcp_sender_); | 228 GUARDED_BY(critical_section_rtcp_sender_); |
| 229 | 229 |
| 230 // Sent | 230 // Sent |
| 231 uint32_t last_send_report_[RTCP_NUMBER_OF_SR] GUARDED_BY( | 231 uint32_t last_send_report_[RTCP_NUMBER_OF_SR] GUARDED_BY( |
| 232 critical_section_rtcp_sender_); // allow packet loss and RTT above 1 sec | 232 critical_section_rtcp_sender_); // allow packet loss and RTT above 1 sec |
| 233 int64_t last_rtcp_time_[RTCP_NUMBER_OF_SR] GUARDED_BY( | 233 int64_t last_rtcp_time_[RTCP_NUMBER_OF_SR] GUARDED_BY( |
| 234 critical_section_rtcp_sender_); | 234 critical_section_rtcp_sender_); |
| 235 | 235 |
| 236 // Sent XR receiver reference time report. | 236 // Sent XR receiver reference time report. |
| 237 // <mid ntp (mid 32 bits of the 64 bits NTP timestamp), send time in ms>. | 237 // <mid ntp (mid 32 bits of the 64 bits NTP timestamp), send time in ms>. |
| 238 std::map<uint32_t, int64_t> last_xr_rr_ | 238 std::map<uint32_t, int64_t> last_xr_rr_ |
| 239 GUARDED_BY(critical_section_rtcp_sender_); | 239 GUARDED_BY(critical_section_rtcp_sender_); |
| 240 | 240 |
| 241 // send CSRCs | 241 // send CSRCs |
| 242 std::vector<uint32_t> csrcs_ GUARDED_BY(critical_section_rtcp_sender_); | 242 std::vector<uint32_t> csrcs_ GUARDED_BY(critical_section_rtcp_sender_); |
| 243 | 243 |
| 244 // Full intra request | 244 // Full intra request |
| 245 uint8_t sequence_number_fir_ GUARDED_BY(critical_section_rtcp_sender_); | 245 uint8_t sequence_number_fir_ GUARDED_BY(critical_section_rtcp_sender_); |
| 246 | 246 |
| 247 // REMB | 247 // REMB |
| 248 uint32_t remb_bitrate_ GUARDED_BY(critical_section_rtcp_sender_); | 248 uint32_t remb_bitrate_ GUARDED_BY(critical_section_rtcp_sender_); |
| 249 std::vector<uint32_t> remb_ssrcs_ GUARDED_BY(critical_section_rtcp_sender_); | 249 std::vector<uint32_t> remb_ssrcs_ GUARDED_BY(critical_section_rtcp_sender_); |
| 250 | 250 |
| 251 TMMBRHelp tmmbr_help_ GUARDED_BY(critical_section_rtcp_sender_); | 251 TMMBRHelp tmmbr_help_ GUARDED_BY(critical_section_rtcp_sender_); |
| 252 uint32_t tmmbr_send_ GUARDED_BY(critical_section_rtcp_sender_); | 252 uint32_t tmmbr_send_ GUARDED_BY(critical_section_rtcp_sender_); |
| 253 uint32_t packet_oh_send_ GUARDED_BY(critical_section_rtcp_sender_); | 253 uint32_t packet_oh_send_ GUARDED_BY(critical_section_rtcp_sender_); |
| 254 | 254 |
| 255 // APP | 255 // APP |
| 256 uint8_t app_sub_type_ GUARDED_BY(critical_section_rtcp_sender_); | 256 uint8_t app_sub_type_ GUARDED_BY(critical_section_rtcp_sender_); |
| 257 uint32_t app_name_ GUARDED_BY(critical_section_rtcp_sender_); | 257 uint32_t app_name_ GUARDED_BY(critical_section_rtcp_sender_); |
| 258 rtc::scoped_ptr<uint8_t[]> app_data_ GUARDED_BY(critical_section_rtcp_sender_); | 258 rtc::scoped_ptr<uint8_t[]> app_data_ |
| 259 uint16_t app_length_ GUARDED_BY(critical_section_rtcp_sender_); | 259 GUARDED_BY(critical_section_rtcp_sender_); |
| 260 | 260 uint16_t app_length_ GUARDED_BY(critical_section_rtcp_sender_); |
| 261 // True if sending of XR Receiver reference time report is enabled. | 261 |
| 262 bool xr_send_receiver_reference_time_enabled_ | 262 // True if sending of XR Receiver reference time report is enabled. |
| 263 GUARDED_BY(critical_section_rtcp_sender_); | 263 bool xr_send_receiver_reference_time_enabled_ |
| 264 | 264 GUARDED_BY(critical_section_rtcp_sender_); |
| 265 // XR VoIP metric | 265 |
| 266 RTCPVoIPMetric xr_voip_metric_ GUARDED_BY(critical_section_rtcp_sender_); | 266 // XR VoIP metric |
| 267 | 267 RTCPVoIPMetric xr_voip_metric_ GUARDED_BY(critical_section_rtcp_sender_); |
| 268 RtcpPacketTypeCounterObserver* const packet_type_counter_observer_; | 268 |
| 269 RtcpPacketTypeCounter packet_type_counter_ | 269 RtcpPacketTypeCounterObserver* const packet_type_counter_observer_; |
| 270 GUARDED_BY(critical_section_rtcp_sender_); | 270 RtcpPacketTypeCounter packet_type_counter_ |
| 271 | 271 GUARDED_BY(critical_section_rtcp_sender_); |
| 272 RTCPUtility::NackStats nack_stats_ GUARDED_BY(critical_section_rtcp_sender_); | 272 |
| 273 | 273 RTCPUtility::NackStats nack_stats_ GUARDED_BY(critical_section_rtcp_sender_); |
| 274 void SetFlag(RTCPPacketType type, bool is_volatile) | 274 |
| 275 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); | 275 void SetFlag(RTCPPacketType type, bool is_volatile) |
| 276 void SetFlags(const std::set<RTCPPacketType>& types, bool is_volatile) | 276 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); |
| 277 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); | 277 void SetFlags(const std::set<RTCPPacketType>& types, bool is_volatile) |
| 278 bool IsFlagPresent(RTCPPacketType type) const | 278 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); |
| 279 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); | 279 bool IsFlagPresent(RTCPPacketType type) const |
| 280 bool ConsumeFlag(RTCPPacketType type, bool forced = false) | 280 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); |
| 281 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); | 281 bool ConsumeFlag(RTCPPacketType type, bool forced = false) |
| 282 bool AllVolatileFlagsConsumed() const | 282 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); |
| 283 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); | 283 bool AllVolatileFlagsConsumed() const |
| 284 struct ReportFlag { | 284 EXCLUSIVE_LOCKS_REQUIRED(critical_section_rtcp_sender_); |
| 285 ReportFlag(RTCPPacketType type, bool is_volatile) | 285 struct ReportFlag { |
| 286 : type(type), is_volatile(is_volatile) {} | 286 ReportFlag(RTCPPacketType type, bool is_volatile) |
| 287 bool operator<(const ReportFlag& flag) const { return type < flag.type; } | 287 : type(type), is_volatile(is_volatile) {} |
| 288 bool operator==(const ReportFlag& flag) const { return type == flag.type; } | 288 bool operator<(const ReportFlag& flag) const { return type < flag.type; } |
| 289 const RTCPPacketType type; | 289 bool operator==(const ReportFlag& flag) const { return type == flag.type; } |
| 290 const bool is_volatile; | 290 const RTCPPacketType type; |
| 291 }; | 291 const bool is_volatile; |
| 292 | 292 }; |
| 293 std::set<ReportFlag> report_flags_ GUARDED_BY(critical_section_rtcp_sender_); | 293 |
| 294 | 294 std::set<ReportFlag> report_flags_ GUARDED_BY(critical_section_rtcp_sender_); |
| 295 typedef rtc::scoped_ptr<rtcp::RtcpPacket> (RTCPSender::*BuilderFunc)( | 295 |
| 296 const RtcpContext&); | 296 typedef rtc::scoped_ptr<rtcp::RtcpPacket> (RTCPSender::*BuilderFunc)( |
| 297 std::map<RTCPPacketType, BuilderFunc> builders_; | 297 const RtcpContext&); |
| 298 std::map<RTCPPacketType, BuilderFunc> builders_; |
| 298 }; | 299 }; |
| 299 } // namespace webrtc | 300 } // namespace webrtc |
| 300 | 301 |
| 301 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_SENDER_H_ | 302 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_SENDER_H_ |
| OLD | NEW |