Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtcp_receiver.h

Issue 1401463003: Avoid data race in RtcpReceiver. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Formatting Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 117
118 RTCPHelp::RTCPReceiveInformation* CreateReceiveInformation( 118 RTCPHelp::RTCPReceiveInformation* CreateReceiveInformation(
119 uint32_t remoteSSRC); 119 uint32_t remoteSSRC);
120 RTCPHelp::RTCPReceiveInformation* GetReceiveInformation(uint32_t remoteSSRC); 120 RTCPHelp::RTCPReceiveInformation* GetReceiveInformation(uint32_t remoteSSRC);
121 121
122 void UpdateReceiveInformation( 122 void UpdateReceiveInformation(
123 RTCPHelp::RTCPReceiveInformation& receiveInformation); 123 RTCPHelp::RTCPReceiveInformation& receiveInformation);
124 124
125 void HandleSenderReceiverReport( 125 void HandleSenderReceiverReport(
126 RTCPUtility::RTCPParserV2& rtcpParser, 126 RTCPUtility::RTCPParserV2& rtcpParser,
127 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation); 127 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
128 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
128 129
129 void HandleReportBlock( 130 void HandleReportBlock(
130 const RTCPUtility::RTCPPacket& rtcpPacket, 131 const RTCPUtility::RTCPPacket& rtcpPacket,
131 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation, 132 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation,
132 uint32_t remoteSSRC); 133 uint32_t remoteSSRC)
134 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
133 135
134 void HandleSDES(RTCPUtility::RTCPParserV2& rtcpParser, 136 void HandleSDES(RTCPUtility::RTCPParserV2& rtcpParser,
135 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation); 137 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
138 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
136 139
137 void HandleSDESChunk(RTCPUtility::RTCPParserV2& rtcpParser); 140 void HandleSDESChunk(RTCPUtility::RTCPParserV2& rtcpParser)
141 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
138 142
139 void HandleXrHeader(RTCPUtility::RTCPParserV2& parser, 143 void HandleXrHeader(RTCPUtility::RTCPParserV2& parser,
140 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation); 144 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
145 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
141 146
142 void HandleXrReceiveReferenceTime( 147 void HandleXrReceiveReferenceTime(
143 RTCPUtility::RTCPParserV2& parser, 148 RTCPUtility::RTCPParserV2& parser,
144 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation); 149 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
150 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
145 151
146 void HandleXrDlrrReportBlock( 152 void HandleXrDlrrReportBlock(
147 RTCPUtility::RTCPParserV2& parser, 153 RTCPUtility::RTCPParserV2& parser,
148 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation); 154 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
155 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
149 156
150 void HandleXrDlrrReportBlockItem( 157 void HandleXrDlrrReportBlockItem(
151 const RTCPUtility::RTCPPacket& packet, 158 const RTCPUtility::RTCPPacket& packet,
152 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation); 159 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
160 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
153 161
154 void HandleXRVOIPMetric( 162 void HandleXRVOIPMetric(
155 RTCPUtility::RTCPParserV2& rtcpParser, 163 RTCPUtility::RTCPParserV2& rtcpParser,
156 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation); 164 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
165 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
157 166
158 void HandleNACK(RTCPUtility::RTCPParserV2& rtcpParser, 167 void HandleNACK(RTCPUtility::RTCPParserV2& rtcpParser,
159 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation); 168 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
169 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
160 170
161 void HandleNACKItem(const RTCPUtility::RTCPPacket& rtcpPacket, 171 void HandleNACKItem(const RTCPUtility::RTCPPacket& rtcpPacket,
162 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation); 172 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
173 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
163 174
164 void HandleBYE(RTCPUtility::RTCPParserV2& rtcpParser); 175 void HandleBYE(RTCPUtility::RTCPParserV2& rtcpParser)
176 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
165 177
166 void HandlePLI(RTCPUtility::RTCPParserV2& rtcpParser, 178 void HandlePLI(RTCPUtility::RTCPParserV2& rtcpParser,
167 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation); 179 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
180 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
168 181
169 void HandleSLI(RTCPUtility::RTCPParserV2& rtcpParser, 182 void HandleSLI(RTCPUtility::RTCPParserV2& rtcpParser,
170 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation); 183 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
184 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
171 185
172 void HandleSLIItem(const RTCPUtility::RTCPPacket& rtcpPacket, 186 void HandleSLIItem(const RTCPUtility::RTCPPacket& rtcpPacket,
173 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation); 187 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
188 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
174 189
175 void HandleRPSI(RTCPUtility::RTCPParserV2& rtcpParser, 190 void HandleRPSI(RTCPUtility::RTCPParserV2& rtcpParser,
176 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation); 191 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
192 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
177 193
178 void HandlePsfbApp(RTCPUtility::RTCPParserV2& rtcpParser, 194 void HandlePsfbApp(RTCPUtility::RTCPParserV2& rtcpParser,
179 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation); 195 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
196 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
180 197
181 void HandleREMBItem(RTCPUtility::RTCPParserV2& rtcpParser, 198 void HandleREMBItem(RTCPUtility::RTCPParserV2& rtcpParser,
182 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation); 199 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
200 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
183 201
184 void HandleIJ(RTCPUtility::RTCPParserV2& rtcpParser, 202 void HandleIJ(RTCPUtility::RTCPParserV2& rtcpParser,
185 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation); 203 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
204 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
186 205
187 void HandleIJItem(const RTCPUtility::RTCPPacket& rtcpPacket, 206 void HandleIJItem(const RTCPUtility::RTCPPacket& rtcpPacket,
188 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation); 207 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
208 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
189 209
190 void HandleTMMBR(RTCPUtility::RTCPParserV2& rtcpParser, 210 void HandleTMMBR(RTCPUtility::RTCPParserV2& rtcpParser,
191 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation); 211 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
212 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
192 213
193 void HandleTMMBRItem(RTCPHelp::RTCPReceiveInformation& receiveInfo, 214 void HandleTMMBRItem(RTCPHelp::RTCPReceiveInformation& receiveInfo,
194 const RTCPUtility::RTCPPacket& rtcpPacket, 215 const RTCPUtility::RTCPPacket& rtcpPacket,
195 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation, 216 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation,
196 uint32_t senderSSRC); 217 uint32_t senderSSRC)
218 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
197 219
198 void HandleTMMBN(RTCPUtility::RTCPParserV2& rtcpParser, 220 void HandleTMMBN(RTCPUtility::RTCPParserV2& rtcpParser,
199 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation); 221 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
222 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
200 223
201 void HandleSR_REQ(RTCPUtility::RTCPParserV2& rtcpParser, 224 void HandleSR_REQ(RTCPUtility::RTCPParserV2& rtcpParser,
202 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation); 225 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
226 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
203 227
204 void HandleTMMBNItem(RTCPHelp::RTCPReceiveInformation& receiveInfo, 228 void HandleTMMBNItem(RTCPHelp::RTCPReceiveInformation& receiveInfo,
205 const RTCPUtility::RTCPPacket& rtcpPacket); 229 const RTCPUtility::RTCPPacket& rtcpPacket)
230 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
206 231
207 void HandleFIR(RTCPUtility::RTCPParserV2& rtcpParser, 232 void HandleFIR(RTCPUtility::RTCPParserV2& rtcpParser,
208 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation); 233 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
234 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
209 235
210 void HandleFIRItem(RTCPHelp::RTCPReceiveInformation* receiveInfo, 236 void HandleFIRItem(RTCPHelp::RTCPReceiveInformation* receiveInfo,
211 const RTCPUtility::RTCPPacket& rtcpPacket, 237 const RTCPUtility::RTCPPacket& rtcpPacket,
212 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation); 238 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
239 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
213 240
214 void HandleAPP(RTCPUtility::RTCPParserV2& rtcpParser, 241 void HandleAPP(RTCPUtility::RTCPParserV2& rtcpParser,
215 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation); 242 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
243 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
216 244
217 void HandleAPPItem(RTCPUtility::RTCPParserV2& rtcpParser, 245 void HandleAPPItem(RTCPUtility::RTCPParserV2& rtcpParser,
218 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation); 246 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation)
247 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
219 248
220 void HandleTransportFeedback( 249 void HandleTransportFeedback(
221 RTCPUtility::RTCPParserV2* rtcp_parser, 250 RTCPUtility::RTCPParserV2* rtcp_parser,
222 RTCPHelp::RTCPPacketInformation* rtcp_packet_information); 251 RTCPHelp::RTCPPacketInformation* rtcp_packet_information)
252 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
223 253
224 private: 254 private:
225 typedef std::map<uint32_t, RTCPHelp::RTCPReceiveInformation*> 255 typedef std::map<uint32_t, RTCPHelp::RTCPReceiveInformation*>
226 ReceivedInfoMap; 256 ReceivedInfoMap;
227 // RTCP report block information mapped by remote SSRC. 257 // RTCP report block information mapped by remote SSRC.
228 typedef std::map<uint32_t, RTCPHelp::RTCPReportBlockInformation*> 258 typedef std::map<uint32_t, RTCPHelp::RTCPReportBlockInformation*>
229 ReportBlockInfoMap; 259 ReportBlockInfoMap;
230 // RTCP report block information map mapped by source SSRC. 260 // RTCP report block information map mapped by source SSRC.
231 typedef std::map<uint32_t, ReportBlockInfoMap> ReportBlockMap; 261 typedef std::map<uint32_t, ReportBlockInfoMap> ReportBlockMap;
232 262
233 RTCPHelp::RTCPReportBlockInformation* CreateOrGetReportBlockInformation( 263 RTCPHelp::RTCPReportBlockInformation* CreateOrGetReportBlockInformation(
234 uint32_t remote_ssrc, uint32_t source_ssrc) 264 uint32_t remote_ssrc, uint32_t source_ssrc)
235 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); 265 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
236 RTCPHelp::RTCPReportBlockInformation* GetReportBlockInformation( 266 RTCPHelp::RTCPReportBlockInformation* GetReportBlockInformation(
237 uint32_t remote_ssrc, uint32_t source_ssrc) const 267 uint32_t remote_ssrc, uint32_t source_ssrc) const
238 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); 268 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
239 269
240 Clock* const _clock; 270 Clock* const _clock;
241 const bool receiver_only_; 271 const bool receiver_only_;
242 RtcpMode _method; 272 RtcpMode _method;
243 int64_t _lastReceived; 273 int64_t _lastReceived;
244 ModuleRtpRtcpImpl& _rtpRtcp; 274 ModuleRtpRtcpImpl& _rtpRtcp;
245 275
246 CriticalSectionWrapper* _criticalSectionFeedbacks; 276 CriticalSectionWrapper* _criticalSectionFeedbacks;
247 RtcpBandwidthObserver* const _cbRtcpBandwidthObserver; 277 RtcpBandwidthObserver* const _cbRtcpBandwidthObserver;
248 RtcpIntraFrameObserver* const _cbRtcpIntraFrameObserver; 278 RtcpIntraFrameObserver* const _cbRtcpIntraFrameObserver;
249 TransportFeedbackObserver* const _cbTransportFeedbackObserver; 279 TransportFeedbackObserver* const _cbTransportFeedbackObserver;
250 280
251 CriticalSectionWrapper* _criticalSectionRTCPReceiver; 281 CriticalSectionWrapper* _criticalSectionRTCPReceiver;
252 uint32_t main_ssrc_; 282 uint32_t main_ssrc_ GUARDED_BY(_criticalSectionRTCPReceiver);
253 uint32_t _remoteSSRC; 283 uint32_t _remoteSSRC GUARDED_BY(_criticalSectionRTCPReceiver);
254 std::set<uint32_t> registered_ssrcs_; 284 std::set<uint32_t> registered_ssrcs_ GUARDED_BY(_criticalSectionRTCPReceiver);
255 285
256 // Received send report 286 // Received send report
257 RTCPSenderInfo _remoteSenderInfo; 287 RTCPSenderInfo _remoteSenderInfo;
258 // when did we receive the last send report 288 // when did we receive the last send report
259 uint32_t _lastReceivedSRNTPsecs; 289 uint32_t _lastReceivedSRNTPsecs;
260 uint32_t _lastReceivedSRNTPfrac; 290 uint32_t _lastReceivedSRNTPfrac;
261 291
262 // Received XR receive time report. 292 // Received XR receive time report.
263 RtcpReceiveTimeInfo _remoteXRReceiveTimeInfo; 293 RtcpReceiveTimeInfo _remoteXRReceiveTimeInfo;
264 // Time when the report was received. 294 // Time when the report was received.
(...skipping 22 matching lines...) Expand all
287 RtcpPacketTypeCounterObserver* const packet_type_counter_observer_; 317 RtcpPacketTypeCounterObserver* const packet_type_counter_observer_;
288 RtcpPacketTypeCounter packet_type_counter_; 318 RtcpPacketTypeCounter packet_type_counter_;
289 319
290 RTCPUtility::NackStats nack_stats_; 320 RTCPUtility::NackStats nack_stats_;
291 321
292 size_t num_skipped_packets_; 322 size_t num_skipped_packets_;
293 int64_t last_skipped_packets_warning_; 323 int64_t last_skipped_packets_warning_;
294 }; 324 };
295 } // namespace webrtc 325 } // namespace webrtc
296 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_RECEIVER_H_ 326 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_RECEIVER_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698