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 |
11 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_RECEIVER_H_ | 11 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_RECEIVER_H_ |
12 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_RECEIVER_H_ | 12 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_RECEIVER_H_ |
13 | 13 |
14 #include <list> | |
14 #include <map> | 15 #include <map> |
15 #include <set> | 16 #include <set> |
16 #include <vector> | 17 #include <vector> |
17 | 18 |
18 #include "webrtc/base/criticalsection.h" | 19 #include "webrtc/base/criticalsection.h" |
19 #include "webrtc/base/thread_annotations.h" | 20 #include "webrtc/base/thread_annotations.h" |
20 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" | 21 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
21 #include "webrtc/modules/rtp_rtcp/source/rtcp_receiver_help.h" | 22 #include "webrtc/modules/rtp_rtcp/source/rtcp_receiver_help.h" |
22 #include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h" | 23 #include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h" |
23 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" | |
24 #include "webrtc/typedefs.h" | 24 #include "webrtc/typedefs.h" |
25 | 25 |
26 namespace webrtc { | 26 namespace webrtc { |
27 class ModuleRtpRtcpImpl; | 27 namespace rtcp { |
28 class TmmbItem; | |
29 } // namespace rtcp | |
28 | 30 |
29 class RTCPReceiver { | 31 class RTCPReceiver { |
30 public: | 32 public: |
33 class SenderCallbacks { | |
philipel
2016/08/24 13:50:26
I think this name is a bit ambiguous. Maybe call i
danilchap
2016/08/26 11:47:51
Can agree name is ambigous, SenderCallbacks sounds
| |
34 public: | |
35 virtual void SetTmmbn(std::vector<rtcp::TmmbItem> bounding_set) = 0; | |
36 virtual void OnRequestSendReport() = 0; | |
37 virtual void OnReceivedNACK( | |
philipel
2016/08/24 13:50:26
OnReceiverNack
danilchap
2016/08/26 11:47:51
done in separate CL since it is unrelated to this
| |
38 const std::list<uint16_t>& nack_sequence_numbers) = 0; | |
philipel
2016/08/24 13:50:26
If it only requires a small change, use vector ins
danilchap
2016/08/26 11:47:51
Not that small, done in separate CL since it is un
| |
39 virtual void OnReceivedRtcpReportBlocks( | |
40 const ReportBlockList& report_blocks) = 0; | |
41 | |
42 protected: | |
43 virtual ~SenderCallbacks() = default; | |
44 }; | |
45 | |
31 RTCPReceiver(Clock* clock, | 46 RTCPReceiver(Clock* clock, |
32 bool receiver_only, | 47 bool receiver_only, |
33 RtcpPacketTypeCounterObserver* packet_type_counter_observer, | 48 RtcpPacketTypeCounterObserver* packet_type_counter_observer, |
34 RtcpBandwidthObserver* rtcp_bandwidth_observer, | 49 RtcpBandwidthObserver* rtcp_bandwidth_observer, |
35 RtcpIntraFrameObserver* rtcp_intra_frame_observer, | 50 RtcpIntraFrameObserver* rtcp_intra_frame_observer, |
36 TransportFeedbackObserver* transport_feedback_observer, | 51 TransportFeedbackObserver* transport_feedback_observer, |
37 ModuleRtpRtcpImpl* owner); | 52 SenderCallbacks* sender_callbacks); |
38 virtual ~RTCPReceiver(); | 53 virtual ~RTCPReceiver(); |
39 | 54 |
55 bool IncomingPacket(const uint8_t* packet, size_t packet_size); | |
56 | |
40 int64_t LastReceived(); | 57 int64_t LastReceived(); |
41 int64_t LastReceivedReceiverReport() const; | 58 int64_t LastReceivedReceiverReport() const; |
42 | 59 |
43 void SetSsrcs(uint32_t main_ssrc, const std::set<uint32_t>& registered_ssrcs); | 60 void SetSsrcs(uint32_t main_ssrc, const std::set<uint32_t>& registered_ssrcs); |
44 void SetRemoteSSRC(uint32_t ssrc); | 61 void SetRemoteSSRC(uint32_t ssrc); |
45 uint32_t RemoteSSRC() const; | 62 uint32_t RemoteSSRC() const; |
46 | 63 |
47 int32_t IncomingRTCPPacket( | 64 int32_t IncomingRTCPPacket( |
48 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation, | 65 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation, |
49 RTCPUtility::RTCPParserV2* rtcpParser); | 66 RTCPUtility::RTCPParserV2* rtcpParser); |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
250 uint32_t source_ssrc) | 267 uint32_t source_ssrc) |
251 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); | 268 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
252 RTCPHelp::RTCPReportBlockInformation* GetReportBlockInformation( | 269 RTCPHelp::RTCPReportBlockInformation* GetReportBlockInformation( |
253 uint32_t remote_ssrc, | 270 uint32_t remote_ssrc, |
254 uint32_t source_ssrc) const | 271 uint32_t source_ssrc) const |
255 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); | 272 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); |
256 | 273 |
257 Clock* const _clock; | 274 Clock* const _clock; |
258 const bool receiver_only_; | 275 const bool receiver_only_; |
259 int64_t _lastReceived; | 276 int64_t _lastReceived; |
260 ModuleRtpRtcpImpl& _rtpRtcp; | 277 SenderCallbacks& _rtpRtcp; |
261 | 278 |
262 rtc::CriticalSection _criticalSectionFeedbacks; | 279 rtc::CriticalSection _criticalSectionFeedbacks; |
263 RtcpBandwidthObserver* const _cbRtcpBandwidthObserver; | 280 RtcpBandwidthObserver* const _cbRtcpBandwidthObserver; |
264 RtcpIntraFrameObserver* const _cbRtcpIntraFrameObserver; | 281 RtcpIntraFrameObserver* const _cbRtcpIntraFrameObserver; |
265 TransportFeedbackObserver* const _cbTransportFeedbackObserver; | 282 TransportFeedbackObserver* const _cbTransportFeedbackObserver; |
266 | 283 |
267 rtc::CriticalSection _criticalSectionRTCPReceiver; | 284 rtc::CriticalSection _criticalSectionRTCPReceiver; |
268 uint32_t main_ssrc_ GUARDED_BY(_criticalSectionRTCPReceiver); | 285 uint32_t main_ssrc_ GUARDED_BY(_criticalSectionRTCPReceiver); |
269 uint32_t _remoteSSRC GUARDED_BY(_criticalSectionRTCPReceiver); | 286 uint32_t _remoteSSRC GUARDED_BY(_criticalSectionRTCPReceiver); |
270 std::set<uint32_t> registered_ssrcs_ GUARDED_BY(_criticalSectionRTCPReceiver); | 287 std::set<uint32_t> registered_ssrcs_ GUARDED_BY(_criticalSectionRTCPReceiver); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
302 RtcpPacketTypeCounterObserver* const packet_type_counter_observer_; | 319 RtcpPacketTypeCounterObserver* const packet_type_counter_observer_; |
303 RtcpPacketTypeCounter packet_type_counter_; | 320 RtcpPacketTypeCounter packet_type_counter_; |
304 | 321 |
305 RTCPUtility::NackStats nack_stats_; | 322 RTCPUtility::NackStats nack_stats_; |
306 | 323 |
307 size_t num_skipped_packets_; | 324 size_t num_skipped_packets_; |
308 int64_t last_skipped_packets_warning_; | 325 int64_t last_skipped_packets_warning_; |
309 }; | 326 }; |
310 } // namespace webrtc | 327 } // namespace webrtc |
311 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_RECEIVER_H_ | 328 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_RECEIVER_H_ |
OLD | NEW |