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

Unified Diff: webrtc/video/rtp_video_stream_receiver.cc

Issue 3006063002: Reland of Use RtxReceiveStream. (Closed)
Patch Set: Address comments. Created 3 years, 3 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
« no previous file with comments | « webrtc/video/rtp_video_stream_receiver.h ('k') | webrtc/video/rtp_video_stream_receiver_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a47055abf08465a2ed0e03886c2770e636a62af0..1dbd86988d30df5d655be795b23e6bcefba4f54f 100644
--- a/webrtc/video/rtp_video_stream_receiver.cc
+++ b/webrtc/video/rtp_video_stream_receiver.cc
@@ -86,6 +86,7 @@ RtpVideoStreamReceiver::RtpVideoStreamReceiver(
RtcpRttStats* rtt_stats,
PacketRouter* packet_router,
const VideoReceiveStream::Config* config,
+ ReceiveStatistics* rtp_receive_statistics,
ReceiveStatisticsProxy* receive_stats_proxy,
ProcessThread* process_thread,
NackSender* nack_sender,
@@ -102,12 +103,11 @@ RtpVideoStreamReceiver::RtpVideoStreamReceiver(
this,
this,
&rtp_payload_registry_)),
- rtp_receive_statistics_(ReceiveStatistics::Create(clock_)),
+ rtp_receive_statistics_(rtp_receive_statistics),
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(),
+ rtp_rtcp_(CreateRtpRtcpModule(rtp_receive_statistics_,
transport,
rtt_stats,
receive_stats_proxy,
@@ -146,12 +146,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 +164,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 +486,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";
}
}
« no previous file with comments | « webrtc/video/rtp_video_stream_receiver.h ('k') | webrtc/video/rtp_video_stream_receiver_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698