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:
@ -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(
|
||||
|
||||
Reference in New Issue
Block a user