Adjust RtcpReceiver to be testable with callbacks:

Instead of full RtpRtcpImpl takes interface of all functions it needs from it.
Added single function for parsing packets and sending feedback, moving that
logic from RtpRtcpImpl to RtcpReceiver.

BUG=webrtc:5260

Review-Url: https://codereview.webrtc.org/2274573002
Cr-Commit-Position: refs/heads/master@{#13960}
This commit is contained in:
danilchap
2016-08-29 11:08:47 -07:00
committed by Commit bot
parent 65fc8b9138
commit 59cb2bd20e
4 changed files with 43 additions and 27 deletions

View File

@ -223,21 +223,7 @@ void ModuleRtpRtcpImpl::SetRtxSendPayloadType(int payload_type,
int32_t ModuleRtpRtcpImpl::IncomingRtcpPacket(
const uint8_t* rtcp_packet,
const size_t length) {
// Allow receive of non-compound RTCP packets.
RTCPUtility::RTCPParserV2 rtcp_parser(rtcp_packet, length, true);
const bool valid_rtcpheader = rtcp_parser.IsValid();
if (!valid_rtcpheader) {
LOG(LS_WARNING) << "Incoming invalid RTCP packet";
return -1;
}
RTCPHelp::RTCPPacketInformation rtcp_packet_information;
int32_t ret_val =
rtcp_receiver_.IncomingRTCPPacket(rtcp_packet_information, &rtcp_parser);
if (ret_val == 0) {
rtcp_receiver_.TriggerCallbacksFromRTCPPacket(rtcp_packet_information);
}
return ret_val;
return rtcp_receiver_.IncomingPacket(rtcp_packet, length) ? 0 : -1;
}
int32_t ModuleRtpRtcpImpl::RegisterSendPayload(