diff --git a/video/rtp_video_stream_receiver.cc b/video/rtp_video_stream_receiver.cc index 4146836881..305b8bd898 100644 --- a/video/rtp_video_stream_receiver.cc +++ b/video/rtp_video_stream_receiver.cc @@ -56,25 +56,16 @@ std::unique_ptr CreateRtpRtcpModule( ReceiveStatistics* receive_statistics, Transport* outgoing_transport, RtcpRttStats* rtt_stats, - RtcpPacketTypeCounterObserver* rtcp_packet_type_counter_observer, - TransportSequenceNumberAllocator* transport_sequence_number_allocator) { + RtcpPacketTypeCounterObserver* rtcp_packet_type_counter_observer) { RtpRtcp::Configuration configuration; configuration.clock = clock; configuration.audio = false; configuration.receiver_only = true; configuration.receive_statistics = receive_statistics; configuration.outgoing_transport = outgoing_transport; - configuration.intra_frame_callback = nullptr; configuration.rtt_stats = rtt_stats; configuration.rtcp_packet_type_counter_observer = rtcp_packet_type_counter_observer; - configuration.transport_sequence_number_allocator = - transport_sequence_number_allocator; - configuration.send_bitrate_observer = nullptr; - configuration.send_side_delay_observer = nullptr; - configuration.send_packet_observer = nullptr; - configuration.bandwidth_callback = nullptr; - configuration.transport_feedback_callback = nullptr; std::unique_ptr rtp_rtcp = RtpRtcp::Create(configuration); rtp_rtcp->SetRTCPStatus(RtcpMode::kCompound); @@ -111,14 +102,14 @@ RtpVideoStreamReceiver::RtpVideoStreamReceiver( rtp_receive_statistics_, transport, rtt_stats, - receive_stats_proxy, - packet_router)), + receive_stats_proxy)), complete_frame_callback_(complete_frame_callback), keyframe_request_sender_(keyframe_request_sender), has_received_frame_(false), frames_decryptable_(false) { constexpr bool remb_candidate = true; - packet_router_->AddReceiveRtpModule(rtp_rtcp_.get(), remb_candidate); + if (packet_router_) + packet_router_->AddReceiveRtpModule(rtp_rtcp_.get(), remb_candidate); RTC_DCHECK(config_.rtp.rtcp_mode != RtcpMode::kOff) << "A stream should not be configured with RTCP disabled. This value is " @@ -195,7 +186,8 @@ RtpVideoStreamReceiver::~RtpVideoStreamReceiver() { process_thread_->DeRegisterModule(rtp_rtcp_.get()); - packet_router_->RemoveReceiveRtpModule(rtp_rtcp_.get()); + if (packet_router_) + packet_router_->RemoveReceiveRtpModule(rtp_rtcp_.get()); UpdateHistograms(); } diff --git a/video/rtp_video_stream_receiver.h b/video/rtp_video_stream_receiver.h index e12b8e0a8d..fdacca9fe8 100644 --- a/video/rtp_video_stream_receiver.h +++ b/video/rtp_video_stream_receiver.h @@ -67,6 +67,9 @@ class RtpVideoStreamReceiver : public LossNotificationSender, Clock* clock, Transport* transport, RtcpRttStats* rtt_stats, + // The packet router is optional; if provided, the RtpRtcp module for this + // stream is registered as a candidate for sending REMB and transport + // feedback. PacketRouter* packet_router, const VideoReceiveStream::Config* config, ReceiveStatistics* rtp_receive_statistics, diff --git a/video/rtp_video_stream_receiver_unittest.cc b/video/rtp_video_stream_receiver_unittest.cc index eb6fbc5c08..11335603f9 100644 --- a/video/rtp_video_stream_receiver_unittest.cc +++ b/video/rtp_video_stream_receiver_unittest.cc @@ -16,7 +16,6 @@ #include "api/video/video_frame_type.h" #include "common_video/h264/h264_common.h" #include "media/base/media_constants.h" -#include "modules/pacing/packet_router.h" #include "modules/rtp_rtcp/source/rtp_format.h" #include "modules/rtp_rtcp/source/rtp_generic_frame_descriptor.h" #include "modules/rtp_rtcp/source/rtp_generic_frame_descriptor_extension.h" @@ -138,8 +137,8 @@ class RtpVideoStreamReceiverTest : public ::testing::Test { rtp_receive_statistics_ = absl::WrapUnique(ReceiveStatistics::Create(Clock::GetRealTimeClock())); rtp_video_stream_receiver_ = absl::make_unique( - Clock::GetRealTimeClock(), &mock_transport_, nullptr, &packet_router_, - &config_, rtp_receive_statistics_.get(), nullptr, process_thread_.get(), + Clock::GetRealTimeClock(), &mock_transport_, nullptr, nullptr, &config_, + rtp_receive_statistics_.get(), nullptr, process_thread_.get(), &mock_nack_sender_, &mock_key_frame_request_sender_, &mock_on_complete_frame_callback_, nullptr); } @@ -203,7 +202,6 @@ class RtpVideoStreamReceiverTest : public ::testing::Test { MockKeyFrameRequestSender mock_key_frame_request_sender_; MockTransport mock_transport_; MockOnCompleteFrameCallback mock_on_complete_frame_callback_; - PacketRouter packet_router_; std::unique_ptr process_thread_; std::unique_ptr rtp_receive_statistics_; std::unique_ptr rtp_video_stream_receiver_;