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:
@ -56,25 +56,16 @@ std::unique_ptr<RtpRtcp> CreateRtpRtcpModule(
|
|||||||
ReceiveStatistics* receive_statistics,
|
ReceiveStatistics* receive_statistics,
|
||||||
Transport* outgoing_transport,
|
Transport* outgoing_transport,
|
||||||
RtcpRttStats* rtt_stats,
|
RtcpRttStats* rtt_stats,
|
||||||
RtcpPacketTypeCounterObserver* rtcp_packet_type_counter_observer,
|
RtcpPacketTypeCounterObserver* rtcp_packet_type_counter_observer) {
|
||||||
TransportSequenceNumberAllocator* transport_sequence_number_allocator) {
|
|
||||||
RtpRtcp::Configuration configuration;
|
RtpRtcp::Configuration configuration;
|
||||||
configuration.clock = clock;
|
configuration.clock = clock;
|
||||||
configuration.audio = false;
|
configuration.audio = false;
|
||||||
configuration.receiver_only = true;
|
configuration.receiver_only = true;
|
||||||
configuration.receive_statistics = receive_statistics;
|
configuration.receive_statistics = receive_statistics;
|
||||||
configuration.outgoing_transport = outgoing_transport;
|
configuration.outgoing_transport = outgoing_transport;
|
||||||
configuration.intra_frame_callback = nullptr;
|
|
||||||
configuration.rtt_stats = rtt_stats;
|
configuration.rtt_stats = rtt_stats;
|
||||||
configuration.rtcp_packet_type_counter_observer =
|
configuration.rtcp_packet_type_counter_observer =
|
||||||
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);
|
std::unique_ptr<RtpRtcp> rtp_rtcp = RtpRtcp::Create(configuration);
|
||||||
rtp_rtcp->SetRTCPStatus(RtcpMode::kCompound);
|
rtp_rtcp->SetRTCPStatus(RtcpMode::kCompound);
|
||||||
@ -111,14 +102,14 @@ RtpVideoStreamReceiver::RtpVideoStreamReceiver(
|
|||||||
rtp_receive_statistics_,
|
rtp_receive_statistics_,
|
||||||
transport,
|
transport,
|
||||||
rtt_stats,
|
rtt_stats,
|
||||||
receive_stats_proxy,
|
receive_stats_proxy)),
|
||||||
packet_router)),
|
|
||||||
complete_frame_callback_(complete_frame_callback),
|
complete_frame_callback_(complete_frame_callback),
|
||||||
keyframe_request_sender_(keyframe_request_sender),
|
keyframe_request_sender_(keyframe_request_sender),
|
||||||
has_received_frame_(false),
|
has_received_frame_(false),
|
||||||
frames_decryptable_(false) {
|
frames_decryptable_(false) {
|
||||||
constexpr bool remb_candidate = true;
|
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)
|
RTC_DCHECK(config_.rtp.rtcp_mode != RtcpMode::kOff)
|
||||||
<< "A stream should not be configured with RTCP disabled. This value is "
|
<< "A stream should not be configured with RTCP disabled. This value is "
|
||||||
@ -195,7 +186,8 @@ RtpVideoStreamReceiver::~RtpVideoStreamReceiver() {
|
|||||||
|
|
||||||
process_thread_->DeRegisterModule(rtp_rtcp_.get());
|
process_thread_->DeRegisterModule(rtp_rtcp_.get());
|
||||||
|
|
||||||
packet_router_->RemoveReceiveRtpModule(rtp_rtcp_.get());
|
if (packet_router_)
|
||||||
|
packet_router_->RemoveReceiveRtpModule(rtp_rtcp_.get());
|
||||||
UpdateHistograms();
|
UpdateHistograms();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,6 +67,9 @@ class RtpVideoStreamReceiver : public LossNotificationSender,
|
|||||||
Clock* clock,
|
Clock* clock,
|
||||||
Transport* transport,
|
Transport* transport,
|
||||||
RtcpRttStats* rtt_stats,
|
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,
|
PacketRouter* packet_router,
|
||||||
const VideoReceiveStream::Config* config,
|
const VideoReceiveStream::Config* config,
|
||||||
ReceiveStatistics* rtp_receive_statistics,
|
ReceiveStatistics* rtp_receive_statistics,
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
#include "api/video/video_frame_type.h"
|
#include "api/video/video_frame_type.h"
|
||||||
#include "common_video/h264/h264_common.h"
|
#include "common_video/h264/h264_common.h"
|
||||||
#include "media/base/media_constants.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_format.h"
|
||||||
#include "modules/rtp_rtcp/source/rtp_generic_frame_descriptor.h"
|
#include "modules/rtp_rtcp/source/rtp_generic_frame_descriptor.h"
|
||||||
#include "modules/rtp_rtcp/source/rtp_generic_frame_descriptor_extension.h"
|
#include "modules/rtp_rtcp/source/rtp_generic_frame_descriptor_extension.h"
|
||||||
@ -138,8 +137,8 @@ class RtpVideoStreamReceiverTest : public ::testing::Test {
|
|||||||
rtp_receive_statistics_ =
|
rtp_receive_statistics_ =
|
||||||
absl::WrapUnique(ReceiveStatistics::Create(Clock::GetRealTimeClock()));
|
absl::WrapUnique(ReceiveStatistics::Create(Clock::GetRealTimeClock()));
|
||||||
rtp_video_stream_receiver_ = absl::make_unique<RtpVideoStreamReceiver>(
|
rtp_video_stream_receiver_ = absl::make_unique<RtpVideoStreamReceiver>(
|
||||||
Clock::GetRealTimeClock(), &mock_transport_, nullptr, &packet_router_,
|
Clock::GetRealTimeClock(), &mock_transport_, nullptr, nullptr, &config_,
|
||||||
&config_, rtp_receive_statistics_.get(), nullptr, process_thread_.get(),
|
rtp_receive_statistics_.get(), nullptr, process_thread_.get(),
|
||||||
&mock_nack_sender_, &mock_key_frame_request_sender_,
|
&mock_nack_sender_, &mock_key_frame_request_sender_,
|
||||||
&mock_on_complete_frame_callback_, nullptr);
|
&mock_on_complete_frame_callback_, nullptr);
|
||||||
}
|
}
|
||||||
@ -203,7 +202,6 @@ class RtpVideoStreamReceiverTest : public ::testing::Test {
|
|||||||
MockKeyFrameRequestSender mock_key_frame_request_sender_;
|
MockKeyFrameRequestSender mock_key_frame_request_sender_;
|
||||||
MockTransport mock_transport_;
|
MockTransport mock_transport_;
|
||||||
MockOnCompleteFrameCallback mock_on_complete_frame_callback_;
|
MockOnCompleteFrameCallback mock_on_complete_frame_callback_;
|
||||||
PacketRouter packet_router_;
|
|
||||||
std::unique_ptr<ProcessThread> process_thread_;
|
std::unique_ptr<ProcessThread> process_thread_;
|
||||||
std::unique_ptr<ReceiveStatistics> rtp_receive_statistics_;
|
std::unique_ptr<ReceiveStatistics> rtp_receive_statistics_;
|
||||||
std::unique_ptr<RtpVideoStreamReceiver> rtp_video_stream_receiver_;
|
std::unique_ptr<RtpVideoStreamReceiver> rtp_video_stream_receiver_;
|
||||||
|
Reference in New Issue
Block a user