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

Unified Diff: webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc

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, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_receiver.h ('k') | webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc b/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc
index 9c0d66d1af91d3810cb3624014de18f7f0a1d3cb..4d30bb0784742926b929b6ab936f778b14ab950f 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc
@@ -20,7 +20,6 @@
#include "webrtc/base/trace_event.h"
#include "webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h"
#include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h"
-#include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h"
#include "webrtc/modules/rtp_rtcp/source/time_util.h"
#include "webrtc/modules/rtp_rtcp/source/tmmbr_help.h"
#include "webrtc/system_wrappers/include/ntp_time.h"
@@ -46,7 +45,7 @@ RTCPReceiver::RTCPReceiver(
RtcpBandwidthObserver* rtcp_bandwidth_observer,
RtcpIntraFrameObserver* rtcp_intra_frame_observer,
TransportFeedbackObserver* transport_feedback_observer,
- ModuleRtpRtcpImpl* owner)
+ ModuleRtpRtcp* owner)
: _clock(clock),
receiver_only_(receiver_only),
_lastReceived(0),
@@ -97,6 +96,20 @@ RTCPReceiver::~RTCPReceiver() {
}
}
+bool RTCPReceiver::IncomingPacket(const uint8_t* packet, size_t packet_size) {
+ // Allow receive of non-compound RTCP packets.
+ RTCPUtility::RTCPParserV2 rtcp_parser(packet, packet_size, true);
+
+ if (!rtcp_parser.IsValid()) {
+ LOG(LS_WARNING) << "Incoming invalid RTCP packet";
+ return false;
+ }
+ RTCPHelp::RTCPPacketInformation rtcp_packet_information;
+ IncomingRTCPPacket(rtcp_packet_information, &rtcp_parser);
+ TriggerCallbacksFromRTCPPacket(rtcp_packet_information);
+ return true;
+}
+
int64_t RTCPReceiver::LastReceived() {
rtc::CritScope lock(&_criticalSectionRTCPReceiver);
return _lastReceived;
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_receiver.h ('k') | webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698