Delete configuration of unused transport_sequence_number_allocator

RtpVideoStreamReceiver used to pass the PacketRouter when creating its
RtpRtcp module, but it's not needed for a receive-only module. Make the
PacketRouter optional to the constructor; it's used only for registering
the created RtpRtcp module as a candidate for sending rtcp feedback.

Bug: None
Change-Id: I371a0bdb9d68ac48b16f52e1d7939f8c177dc528
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/137429
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27984}
This commit is contained in:
Niels Möller
2019-05-20 11:06:33 +02:00
committed by Commit Bot
parent ed4d1584cb
commit 60f4e29259
3 changed files with 11 additions and 18 deletions

View File

@ -56,25 +56,16 @@ std::unique_ptr<RtpRtcp> 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<RtpRtcp> 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();
}

View File

@ -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,

View File

@ -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<RtpVideoStreamReceiver>(
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<ProcessThread> process_thread_;
std::unique_ptr<ReceiveStatistics> rtp_receive_statistics_;
std::unique_ptr<RtpVideoStreamReceiver> rtp_video_stream_receiver_;