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

Unified Diff: webrtc/video/rtp_video_stream_receiver.cc

Issue 3008773002: Use RtxReceiveStream. (Closed)
Patch Set: Improve TODO comments. Created 3 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
Index: webrtc/video/rtp_video_stream_receiver.cc
diff --git a/webrtc/video/rtp_video_stream_receiver.cc b/webrtc/video/rtp_video_stream_receiver.cc
index 4678b8f0afff36cea95279d27b21812cb3f8a5eb..a14b06504bb6d7d37b8964e646b251b5e033289d 100644
--- a/webrtc/video/rtp_video_stream_receiver.cc
+++ b/webrtc/video/rtp_video_stream_receiver.cc
@@ -105,7 +105,6 @@ RtpVideoStreamReceiver::RtpVideoStreamReceiver(
rtp_receive_statistics_(ReceiveStatistics::Create(clock_)),
ulpfec_receiver_(UlpfecReceiver::Create(config->rtp.remote_ssrc, this)),
receiving_(false),
- restored_packet_in_use_(false),
last_packet_log_ms_(-1),
rtp_rtcp_(CreateRtpRtcpModule(rtp_receive_statistics_.get(),
transport,
@@ -146,12 +145,8 @@ RtpVideoStreamReceiver::RtpVideoStreamReceiver(
rtp_receive_statistics_->SetMaxReorderingThreshold(max_reordering_threshold);
if (config_.rtp.rtx_ssrc) {
+ // Needed for rtp_payload_registry_.RtxEnabled().
rtp_payload_registry_.SetRtxSsrc(config_.rtp.rtx_ssrc);
-
- for (const auto& kv : config_.rtp.rtx_associated_payload_types) {
- RTC_DCHECK_NE(kv.first, 0);
- rtp_payload_registry_.SetRtxPayloadType(kv.first, kv.second);
- }
}
if (IsUlpfecEnabled()) {
@@ -168,11 +163,6 @@ RtpVideoStreamReceiver::RtpVideoStreamReceiver(
strncpy(red_codec.plName, "red", sizeof(red_codec.plName));
red_codec.plType = config_.rtp.ulpfec.red_payload_type;
RTC_CHECK(AddReceiveCodec(red_codec));
- if (config_.rtp.ulpfec.red_rtx_payload_type != -1) {
- rtp_payload_registry_.SetRtxPayloadType(
- config_.rtp.ulpfec.red_rtx_payload_type,
- config_.rtp.ulpfec.red_payload_type);
- }
}
if (config_.rtp.rtcp_xr.receiver_reference_time_report)
@@ -495,31 +485,7 @@ void RtpVideoStreamReceiver::ParseAndHandleEncapsulatingHeader(
}
ulpfec_receiver_->ProcessReceivedFec();
} else if (rtp_payload_registry_.IsRtx(header)) {
- if (header.headerLength + header.paddingLength == packet_length) {
- // This is an empty packet and should be silently dropped before trying to
- // parse the RTX header.
- return;
- }
- // Remove the RTX header and parse the original RTP header.
- if (packet_length < header.headerLength)
- return;
- if (packet_length > sizeof(restored_packet_))
- return;
- if (restored_packet_in_use_) {
- LOG(LS_WARNING) << "Multiple RTX headers detected, dropping packet.";
- return;
- }
- if (!rtp_payload_registry_.RestoreOriginalPacket(
- restored_packet_, packet, &packet_length, config_.rtp.remote_ssrc,
- header)) {
- LOG(LS_WARNING) << "Incoming RTX packet: Invalid RTP header ssrc: "
- << header.ssrc << " payload type: "
- << static_cast<int>(header.payloadType);
- return;
- }
- restored_packet_in_use_ = true;
- OnRecoveredPacket(restored_packet_, packet_length);
- restored_packet_in_use_ = false;
+ LOG(LS_WARNING) << "Unexpected RTX packet on media ssrc";
}
}

Powered by Google App Engine
This is Rietveld 408576698