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

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

Issue 1527003002: [rtp_rtcp] RtcpReceiverTest rewritten using public available interface (observers) instead intermid… (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 4 years, 10 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
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 e8a943f23eecaacb7889137feb98ba9719a2aff2..1b6d7063a11b4feea9c938ea67fe21a20700c376 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc
@@ -284,10 +284,24 @@ int32_t RTCPReceiver::StatisticsReceived(
return 0;
}
-int32_t
-RTCPReceiver::IncomingRTCPPacket(RTCPPacketInformation& rtcpPacketInformation,
- RTCPUtility::RTCPParserV2* rtcpParser)
-{
+bool RTCPReceiver::IncomingPacket(const uint8_t* buffer, size_t length) {
+ // Allow receive of non-compound RTCP packets.
+ RTCPUtility::RTCPParserV2 rtcp_parser(buffer, length, true);
+
+ const bool valid_rtcpheader = rtcp_parser.IsValid();
+ if (!valid_rtcpheader) {
philipel 2016/02/24 11:02:01 Replace with if(!rtcp_parser.IsValid()) and remove
danilchap 2016/02/24 12:53:11 Actually yes: rtcp_parser do slightly more than va
+ 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;
+}
+
+void RTCPReceiver::IncomingRTCPPacket(
+ RTCPPacketInformation& rtcpPacketInformation,
+ RTCPUtility::RTCPParserV2* rtcpParser) {
CriticalSectionScoped lock(_criticalSectionRTCPReceiver);
_lastReceived = _clock->TimeInMilliseconds();
@@ -389,8 +403,6 @@ RTCPReceiver::IncomingRTCPPacket(RTCPPacketInformation& rtcpPacketInformation,
"unrecognized/unsupported type, during the past "
<< (kMaxWarningLogIntervalMs / 1000) << " second period.";
}
-
- return 0;
}
void

Powered by Google App Engine
This is Rietveld 408576698