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

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

Issue 2274573002: Adjust RtcpReceiver to be testable with callbacks: (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: RtpRtcpSender -> ModuleRtpRtcp Created 4 years, 3 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
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 <map> 14 #include <map>
15 #include <set> 15 #include <set>
16 #include <vector> 16 #include <vector>
17 17
18 #include "webrtc/base/criticalsection.h" 18 #include "webrtc/base/criticalsection.h"
19 #include "webrtc/base/thread_annotations.h" 19 #include "webrtc/base/thread_annotations.h"
20 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" 20 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
21 #include "webrtc/modules/rtp_rtcp/source/rtcp_receiver_help.h" 21 #include "webrtc/modules/rtp_rtcp/source/rtcp_receiver_help.h"
22 #include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h" 22 #include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h"
23 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h"
24 #include "webrtc/typedefs.h" 23 #include "webrtc/typedefs.h"
25 24
26 namespace webrtc { 25 namespace webrtc {
27 class ModuleRtpRtcpImpl; 26 namespace rtcp {
27 class TmmbItem;
28 } // namespace rtcp
28 29
29 class RTCPReceiver { 30 class RTCPReceiver {
30 public: 31 public:
32 class ModuleRtpRtcp {
33 public:
34 virtual void SetTmmbn(std::vector<rtcp::TmmbItem> bounding_set) = 0;
35 virtual void OnRequestSendReport() = 0;
36 virtual void OnReceivedNack(
37 const std::vector<uint16_t>& nack_sequence_numbers) = 0;
38 virtual void OnReceivedRtcpReportBlocks(
39 const ReportBlockList& report_blocks) = 0;
40
41 protected:
42 virtual ~ModuleRtpRtcp() = default;
43 };
44
31 RTCPReceiver(Clock* clock, 45 RTCPReceiver(Clock* clock,
32 bool receiver_only, 46 bool receiver_only,
33 RtcpPacketTypeCounterObserver* packet_type_counter_observer, 47 RtcpPacketTypeCounterObserver* packet_type_counter_observer,
34 RtcpBandwidthObserver* rtcp_bandwidth_observer, 48 RtcpBandwidthObserver* rtcp_bandwidth_observer,
35 RtcpIntraFrameObserver* rtcp_intra_frame_observer, 49 RtcpIntraFrameObserver* rtcp_intra_frame_observer,
36 TransportFeedbackObserver* transport_feedback_observer, 50 TransportFeedbackObserver* transport_feedback_observer,
37 ModuleRtpRtcpImpl* owner); 51 ModuleRtpRtcp* owner);
38 virtual ~RTCPReceiver(); 52 virtual ~RTCPReceiver();
39 53
54 bool IncomingPacket(const uint8_t* packet, size_t packet_size);
55
40 int64_t LastReceived(); 56 int64_t LastReceived();
41 int64_t LastReceivedReceiverReport() const; 57 int64_t LastReceivedReceiverReport() const;
42 58
43 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);
44 void SetRemoteSSRC(uint32_t ssrc); 60 void SetRemoteSSRC(uint32_t ssrc);
45 uint32_t RemoteSSRC() const; 61 uint32_t RemoteSSRC() const;
46 62
47 int32_t IncomingRTCPPacket( 63 int32_t IncomingRTCPPacket(
48 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation, 64 RTCPHelp::RTCPPacketInformation& rtcpPacketInformation,
49 RTCPUtility::RTCPParserV2* rtcpParser); 65 RTCPUtility::RTCPParserV2* rtcpParser);
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 uint32_t source_ssrc) 266 uint32_t source_ssrc)
251 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); 267 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
252 RTCPHelp::RTCPReportBlockInformation* GetReportBlockInformation( 268 RTCPHelp::RTCPReportBlockInformation* GetReportBlockInformation(
253 uint32_t remote_ssrc, 269 uint32_t remote_ssrc,
254 uint32_t source_ssrc) const 270 uint32_t source_ssrc) const
255 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver); 271 EXCLUSIVE_LOCKS_REQUIRED(_criticalSectionRTCPReceiver);
256 272
257 Clock* const _clock; 273 Clock* const _clock;
258 const bool receiver_only_; 274 const bool receiver_only_;
259 int64_t _lastReceived; 275 int64_t _lastReceived;
260 ModuleRtpRtcpImpl& _rtpRtcp; 276 ModuleRtpRtcp& _rtpRtcp;
261 277
262 rtc::CriticalSection _criticalSectionFeedbacks; 278 rtc::CriticalSection _criticalSectionFeedbacks;
263 RtcpBandwidthObserver* const _cbRtcpBandwidthObserver; 279 RtcpBandwidthObserver* const _cbRtcpBandwidthObserver;
264 RtcpIntraFrameObserver* const _cbRtcpIntraFrameObserver; 280 RtcpIntraFrameObserver* const _cbRtcpIntraFrameObserver;
265 TransportFeedbackObserver* const _cbTransportFeedbackObserver; 281 TransportFeedbackObserver* const _cbTransportFeedbackObserver;
266 282
267 rtc::CriticalSection _criticalSectionRTCPReceiver; 283 rtc::CriticalSection _criticalSectionRTCPReceiver;
268 uint32_t main_ssrc_ GUARDED_BY(_criticalSectionRTCPReceiver); 284 uint32_t main_ssrc_ GUARDED_BY(_criticalSectionRTCPReceiver);
269 uint32_t _remoteSSRC GUARDED_BY(_criticalSectionRTCPReceiver); 285 uint32_t _remoteSSRC GUARDED_BY(_criticalSectionRTCPReceiver);
270 std::set<uint32_t> registered_ssrcs_ GUARDED_BY(_criticalSectionRTCPReceiver); 286 std::set<uint32_t> registered_ssrcs_ GUARDED_BY(_criticalSectionRTCPReceiver);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 RtcpPacketTypeCounterObserver* const packet_type_counter_observer_; 318 RtcpPacketTypeCounterObserver* const packet_type_counter_observer_;
303 RtcpPacketTypeCounter packet_type_counter_; 319 RtcpPacketTypeCounter packet_type_counter_;
304 320
305 RTCPUtility::NackStats nack_stats_; 321 RTCPUtility::NackStats nack_stats_;
306 322
307 size_t num_skipped_packets_; 323 size_t num_skipped_packets_;
308 int64_t last_skipped_packets_warning_; 324 int64_t last_skipped_packets_warning_;
309 }; 325 };
310 } // namespace webrtc 326 } // namespace webrtc
311 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_RECEIVER_H_ 327 #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