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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 bool IncomingPacket(const uint8_t* packet, size_t packet_size); | 54 bool IncomingPacket(const uint8_t* packet, size_t packet_size); |
55 | 55 |
56 int64_t LastReceived(); | 56 int64_t LastReceived(); |
57 int64_t LastReceivedReceiverReport() const; | 57 int64_t LastReceivedReceiverReport() const; |
58 | 58 |
59 void SetSsrcs(uint32_t main_ssrc, const std::set<uint32_t>& registered_ssrcs); | 59 void SetSsrcs(uint32_t main_ssrc, const std::set<uint32_t>& registered_ssrcs); |
60 void SetRemoteSSRC(uint32_t ssrc); | 60 void SetRemoteSSRC(uint32_t ssrc); |
61 uint32_t RemoteSSRC() const; | 61 uint32_t RemoteSSRC() const; |
62 | 62 |
63 int32_t IncomingRTCPPacket( | |
64 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation, | |
65 RTCPUtility::RTCPParserV2* rtcpParser); | |
66 | |
67 void TriggerCallbacksFromRTCPPacket( | |
68 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation); | |
69 | |
70 // get received cname | 63 // get received cname |
71 int32_t CNAME(uint32_t remoteSSRC, char cName[RTCP_CNAME_SIZE]) const; | 64 int32_t CNAME(uint32_t remoteSSRC, char cName[RTCP_CNAME_SIZE]) const; |
72 | 65 |
73 // get received NTP | 66 // get received NTP |
74 bool NTP(uint32_t* ReceivedNTPsecs, | 67 bool NTP(uint32_t* ReceivedNTPsecs, |
75 uint32_t* ReceivedNTPfrac, | 68 uint32_t* ReceivedNTPfrac, |
76 uint32_t* RTCPArrivalTimeSecs, | 69 uint32_t* RTCPArrivalTimeSecs, |
77 uint32_t* RTCPArrivalTimeFrac, | 70 uint32_t* RTCPArrivalTimeFrac, |
78 uint32_t* rtcp_timestamp) const; | 71 uint32_t* rtcp_timestamp) const; |
79 | 72 |
(...skipping 28 matching lines...) Expand all Loading... |
108 | 101 |
109 bool UpdateRTCPReceiveInformationTimers(); | 102 bool UpdateRTCPReceiveInformationTimers(); |
110 | 103 |
111 std::vector<rtcp::TmmbItem> BoundingSet(bool* tmmbr_owner); | 104 std::vector<rtcp::TmmbItem> BoundingSet(bool* tmmbr_owner); |
112 | 105 |
113 void UpdateTmmbr(); | 106 void UpdateTmmbr(); |
114 | 107 |
115 void RegisterRtcpStatisticsCallback(RtcpStatisticsCallback* callback); | 108 void RegisterRtcpStatisticsCallback(RtcpStatisticsCallback* callback); |
116 RtcpStatisticsCallback* GetRtcpStatisticsCallback(); | 109 RtcpStatisticsCallback* GetRtcpStatisticsCallback(); |
117 | 110 |
118 protected: | 111 private: |
| 112 using ReceivedInfoMap = std::map<uint32_t, RTCPHelp::RTCPReceiveInformation*>; |
| 113 // RTCP report block information mapped by remote SSRC. |
| 114 using ReportBlockInfoMap = |
| 115 std::map<uint32_t, RTCPHelp::RTCPReportBlockInformation*>; |
| 116 // RTCP report block information map mapped by source SSRC. |
| 117 using ReportBlockMap = std::map<uint32_t, ReportBlockInfoMap>; |
| 118 |
| 119 int32_t IncomingRTCPPacket( |
| 120 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation, |
| 121 RTCPUtility::RTCPParserV2* rtcpParser); |
| 122 |
| 123 void TriggerCallbacksFromRTCPPacket( |
| 124 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation); |
| 125 |
119 RTCPUtility::RTCPCnameInformation* CreateCnameInformation( | 126 RTCPUtility::RTCPCnameInformation* CreateCnameInformation( |
120 uint32_t remoteSSRC); | 127 uint32_t remoteSSRC); |
121 RTCPUtility::RTCPCnameInformation* GetCnameInformation( | 128 RTCPUtility::RTCPCnameInformation* GetCnameInformation( |
122 uint32_t remoteSSRC) const; | 129 uint32_t remoteSSRC) const; |
123 | 130 |
124 RTCPHelp::RTCPReceiveInformation* CreateReceiveInformation( | 131 RTCPHelp::RTCPReceiveInformation* CreateReceiveInformation( |
125 uint32_t remoteSSRC); | 132 uint32_t remoteSSRC); |
126 RTCPHelp::RTCPReceiveInformation* GetReceiveInformation(uint32_t remoteSSRC); | 133 RTCPHelp::RTCPReceiveInformation* GetReceiveInformation(uint32_t remoteSSRC); |
127 | 134 |
128 void HandleSenderReceiverReport( | 135 void HandleSenderReceiverReport( |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 | 253 |
247 void HandleAPPItem(RTCPUtility::RTCPParserV2& rtcpParser, | 254 void HandleAPPItem(RTCPUtility::RTCPParserV2& rtcpParser, |
248 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation) | 255 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation) |
249 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); | 256 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
250 | 257 |
251 void HandleTransportFeedback( | 258 void HandleTransportFeedback( |
252 RTCPUtility::RTCPParserV2* rtcp_parser, | 259 RTCPUtility::RTCPParserV2* rtcp_parser, |
253 RTCPHelp::RTCPPacketInformation* rtcp_packet_information) | 260 RTCPHelp::RTCPPacketInformation* rtcp_packet_information) |
254 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); | 261 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
255 | 262 |
256 private: | |
257 typedef std::map<uint32_t, RTCPHelp::RTCPReceiveInformation*> ReceivedInfoMap; | |
258 // RTCP report block information mapped by remote SSRC. | |
259 typedef std::map<uint32_t, RTCPHelp::RTCPReportBlockInformation*> | |
260 ReportBlockInfoMap; | |
261 // RTCP report block information map mapped by source SSRC. | |
262 typedef std::map<uint32_t, ReportBlockInfoMap> ReportBlockMap; | |
263 | |
264 RTCPHelp::RTCPReportBlockInformation* CreateOrGetReportBlockInformation( | 263 RTCPHelp::RTCPReportBlockInformation* CreateOrGetReportBlockInformation( |
265 uint32_t remote_ssrc, | 264 uint32_t remote_ssrc, |
266 uint32_t source_ssrc) | 265 uint32_t source_ssrc) |
267 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); | 266 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
268 RTCPHelp::RTCPReportBlockInformation* GetReportBlockInformation( | 267 RTCPHelp::RTCPReportBlockInformation* GetReportBlockInformation( |
269 uint32_t remote_ssrc, | 268 uint32_t remote_ssrc, |
270 uint32_t source_ssrc) const | 269 uint32_t source_ssrc) const |
271 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); | 270 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
272 | 271 |
273 Clock* const _clock; | 272 Clock* const _clock; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 RtcpPacketTypeCounterObserver* const packet_type_counter_observer_; | 317 RtcpPacketTypeCounterObserver* const packet_type_counter_observer_; |
319 RtcpPacketTypeCounter packet_type_counter_; | 318 RtcpPacketTypeCounter packet_type_counter_; |
320 | 319 |
321 RTCPUtility::NackStats nack_stats_; | 320 RTCPUtility::NackStats nack_stats_; |
322 | 321 |
323 size_t num_skipped_packets_; | 322 size_t num_skipped_packets_; |
324 int64_t last_skipped_packets_warning_; | 323 int64_t last_skipped_packets_warning_; |
325 }; | 324 }; |
326 } // namespace webrtc | 325 } // namespace webrtc |
327 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_RECEIVER_H_ | 326 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_RECEIVER_H_ |
OLD | NEW |