Use the configured remote ssrc instead of relying on the first received packet RtpStreamReceiver.

This solves an issue where if the first packet happens to be an RTX packet, it is recovered with an incorrect SSRC.

BUG=webrtc:5654

Review-Url: https://codereview.webrtc.org/2928123002
Cr-Commit-Position: refs/heads/master@{#18512}
This commit is contained in:
stefan 2017-06-09 06:12:11 -07:00 committed by Commit Bot
parent fee994c367
commit b4ab381ce3
2 changed files with 5 additions and 8 deletions

View File

@ -127,6 +127,7 @@ RtpVideoStreamReceiver::RtpVideoStreamReceiver(
rtp_rtcp_->SetRTCPStatus(config_.rtp.rtcp_mode);
rtp_rtcp_->SetSSRC(config_.rtp.local_ssrc);
rtp_rtcp_->SetRemoteSSRC(config_.rtp.remote_ssrc);
rtp_rtcp_->SetKeyFrameRequestMethod(kKeyFrameReqPliRtcp);
for (size_t i = 0; i < config_.rtp.extensions.size(); ++i) {
@ -217,7 +218,7 @@ bool RtpVideoStreamReceiver::AddReceiveCodec(const VideoCodec& video_codec) {
}
uint32_t RtpVideoStreamReceiver::GetRemoteSsrc() const {
return rtp_receiver_->SSRC();
return config_.rtp.remote_ssrc;
}
int RtpVideoStreamReceiver::GetCsrcs(uint32_t* csrcs) const {
@ -302,10 +303,6 @@ int32_t RtpVideoStreamReceiver::OnInitializeDecoder(
return 0;
}
void RtpVideoStreamReceiver::OnIncomingSSRCChanged(const uint32_t ssrc) {
rtp_rtcp_->SetRemoteSSRC(ssrc);
}
// This method handles both regular RTP packets and packets recovered
// via FlexFEC.
void RtpVideoStreamReceiver::OnRtpPacket(const RtpPacketReceived& packet) {
@ -481,7 +478,7 @@ void RtpVideoStreamReceiver::ParseAndHandleEncapsulatingHeader(
return;
}
if (!rtp_payload_registry_.RestoreOriginalPacket(
restored_packet_, packet, &packet_length, rtp_receiver_->SSRC(),
restored_packet_, packet, &packet_length, config_.rtp.remote_ssrc,
header)) {
LOG(LS_WARNING) << "Incoming RTX packet: Invalid RTP header ssrc: "
<< header.ssrc << " payload type: "
@ -623,7 +620,7 @@ bool RtpVideoStreamReceiver::IsPacketRetransmitted(const RTPHeader& header,
return false;
// Check if this is a retransmission.
int64_t min_rtt = 0;
rtp_rtcp_->RTT(rtp_receiver_->SSRC(), nullptr, nullptr, &min_rtt, nullptr);
rtp_rtcp_->RTT(config_.rtp.remote_ssrc, nullptr, nullptr, &min_rtt, nullptr);
return !in_order &&
statistician->IsRetransmitOfOldPacket(header, min_rtt);
}

View File

@ -112,7 +112,7 @@ class RtpVideoStreamReceiver : public RtpData,
int frequency,
size_t channels,
uint32_t rate) override;
void OnIncomingSSRCChanged(uint32_t ssrc) override;
void OnIncomingSSRCChanged(uint32_t ssrc) override {}
void OnIncomingCSRCChanged(uint32_t CSRC, bool added) override {}
// Implements VCMFrameTypeCallback.