Remove some usage of RtpRtcp::SetSSRC()
Bug: webrtc:10774 Change-Id: Ib8fa84f5d70ceb7e715405eae2901bcd7bdfebfe Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146984 Commit-Queue: Erik Språng <sprang@webrtc.org> Reviewed-by: Sebastian Jansson <srte@webrtc.org> Cr-Commit-Position: refs/heads/master@{#28895}
This commit is contained in:
@ -122,15 +122,16 @@ std::unique_ptr<FlexfecReceiver> MaybeCreateFlexfecReceiver(
|
|||||||
std::unique_ptr<RtpRtcp> CreateRtpRtcpModule(
|
std::unique_ptr<RtpRtcp> CreateRtpRtcpModule(
|
||||||
Clock* clock,
|
Clock* clock,
|
||||||
ReceiveStatistics* receive_statistics,
|
ReceiveStatistics* receive_statistics,
|
||||||
Transport* rtcp_send_transport,
|
const FlexfecReceiveStreamImpl::Config& config,
|
||||||
RtcpRttStats* rtt_stats) {
|
RtcpRttStats* rtt_stats) {
|
||||||
RtpRtcp::Configuration configuration;
|
RtpRtcp::Configuration configuration;
|
||||||
configuration.audio = false;
|
configuration.audio = false;
|
||||||
configuration.receiver_only = true;
|
configuration.receiver_only = true;
|
||||||
configuration.clock = clock;
|
configuration.clock = clock;
|
||||||
configuration.receive_statistics = receive_statistics;
|
configuration.receive_statistics = receive_statistics;
|
||||||
configuration.outgoing_transport = rtcp_send_transport;
|
configuration.outgoing_transport = config.rtcp_send_transport;
|
||||||
configuration.rtt_stats = rtt_stats;
|
configuration.rtt_stats = rtt_stats;
|
||||||
|
configuration.media_send_ssrc = config.local_ssrc;
|
||||||
return RtpRtcp::Create(configuration);
|
return RtpRtcp::Create(configuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -150,14 +151,13 @@ FlexfecReceiveStreamImpl::FlexfecReceiveStreamImpl(
|
|||||||
rtp_receive_statistics_(ReceiveStatistics::Create(clock)),
|
rtp_receive_statistics_(ReceiveStatistics::Create(clock)),
|
||||||
rtp_rtcp_(CreateRtpRtcpModule(clock,
|
rtp_rtcp_(CreateRtpRtcpModule(clock,
|
||||||
rtp_receive_statistics_.get(),
|
rtp_receive_statistics_.get(),
|
||||||
config_.rtcp_send_transport,
|
config_,
|
||||||
rtt_stats)),
|
rtt_stats)),
|
||||||
process_thread_(process_thread) {
|
process_thread_(process_thread) {
|
||||||
RTC_LOG(LS_INFO) << "FlexfecReceiveStreamImpl: " << config_.ToString();
|
RTC_LOG(LS_INFO) << "FlexfecReceiveStreamImpl: " << config_.ToString();
|
||||||
|
|
||||||
// RTCP reporting.
|
// RTCP reporting.
|
||||||
rtp_rtcp_->SetRTCPStatus(config_.rtcp_mode);
|
rtp_rtcp_->SetRTCPStatus(config_.rtcp_mode);
|
||||||
rtp_rtcp_->SetSSRC(config_.local_ssrc);
|
|
||||||
process_thread_->RegisterModule(rtp_rtcp_.get(), RTC_FROM_HERE);
|
process_thread_->RegisterModule(rtp_rtcp_.get(), RTC_FROM_HERE);
|
||||||
|
|
||||||
// Register with transport.
|
// Register with transport.
|
||||||
|
@ -110,15 +110,23 @@ std::vector<RtpStreamSender> CreateRtpStreamSenders(
|
|||||||
std::vector<RtpStreamSender> rtp_streams;
|
std::vector<RtpStreamSender> rtp_streams;
|
||||||
const std::vector<uint32_t>& flexfec_protected_ssrcs =
|
const std::vector<uint32_t>& flexfec_protected_ssrcs =
|
||||||
rtp_config.flexfec.protected_media_ssrcs;
|
rtp_config.flexfec.protected_media_ssrcs;
|
||||||
for (uint32_t ssrc : rtp_config.ssrcs) {
|
RTC_DCHECK(rtp_config.rtx.ssrcs.empty() ||
|
||||||
|
rtp_config.rtx.ssrcs.size() == rtp_config.rtx.ssrcs.size());
|
||||||
|
for (size_t i = 0; i < rtp_config.ssrcs.size(); ++i) {
|
||||||
|
configuration.media_send_ssrc = rtp_config.ssrcs[i];
|
||||||
bool enable_flexfec = flexfec_sender != nullptr &&
|
bool enable_flexfec = flexfec_sender != nullptr &&
|
||||||
std::find(flexfec_protected_ssrcs.begin(),
|
std::find(flexfec_protected_ssrcs.begin(),
|
||||||
flexfec_protected_ssrcs.end(),
|
flexfec_protected_ssrcs.end(),
|
||||||
ssrc) != flexfec_protected_ssrcs.end();
|
*configuration.media_send_ssrc) !=
|
||||||
|
flexfec_protected_ssrcs.end();
|
||||||
configuration.flexfec_sender = enable_flexfec ? flexfec_sender : nullptr;
|
configuration.flexfec_sender = enable_flexfec ? flexfec_sender : nullptr;
|
||||||
auto playout_delay_oracle = absl::make_unique<PlayoutDelayOracle>();
|
auto playout_delay_oracle = absl::make_unique<PlayoutDelayOracle>();
|
||||||
|
|
||||||
configuration.ack_observer = playout_delay_oracle.get();
|
configuration.ack_observer = playout_delay_oracle.get();
|
||||||
|
if (rtp_config.rtx.ssrcs.size() > i) {
|
||||||
|
configuration.rtx_send_ssrc = rtp_config.rtx.ssrcs[i];
|
||||||
|
}
|
||||||
|
|
||||||
auto rtp_rtcp = RtpRtcp::Create(configuration);
|
auto rtp_rtcp = RtpRtcp::Create(configuration);
|
||||||
rtp_rtcp->SetSendingStatus(false);
|
rtp_rtcp->SetSendingStatus(false);
|
||||||
rtp_rtcp->SetSendingMediaStatus(false);
|
rtp_rtcp->SetSendingMediaStatus(false);
|
||||||
@ -571,7 +579,6 @@ void RtpVideoSender::ConfigureSsrcs() {
|
|||||||
for (size_t i = 0; i < rtp_config_.ssrcs.size(); ++i) {
|
for (size_t i = 0; i < rtp_config_.ssrcs.size(); ++i) {
|
||||||
uint32_t ssrc = rtp_config_.ssrcs[i];
|
uint32_t ssrc = rtp_config_.ssrcs[i];
|
||||||
RtpRtcp* const rtp_rtcp = rtp_streams_[i].rtp_rtcp.get();
|
RtpRtcp* const rtp_rtcp = rtp_streams_[i].rtp_rtcp.get();
|
||||||
rtp_rtcp->SetSSRC(ssrc);
|
|
||||||
|
|
||||||
// Restore RTP state if previous existed.
|
// Restore RTP state if previous existed.
|
||||||
auto it = suspended_ssrcs_.find(ssrc);
|
auto it = suspended_ssrcs_.find(ssrc);
|
||||||
@ -587,12 +594,10 @@ void RtpVideoSender::ConfigureSsrcs() {
|
|||||||
if (rtp_config_.rtx.ssrcs.empty())
|
if (rtp_config_.rtx.ssrcs.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Configure RTX SSRCs.
|
|
||||||
RTC_DCHECK_EQ(rtp_config_.rtx.ssrcs.size(), rtp_config_.ssrcs.size());
|
RTC_DCHECK_EQ(rtp_config_.rtx.ssrcs.size(), rtp_config_.ssrcs.size());
|
||||||
for (size_t i = 0; i < rtp_config_.rtx.ssrcs.size(); ++i) {
|
for (size_t i = 0; i < rtp_config_.rtx.ssrcs.size(); ++i) {
|
||||||
uint32_t ssrc = rtp_config_.rtx.ssrcs[i];
|
uint32_t ssrc = rtp_config_.rtx.ssrcs[i];
|
||||||
RtpRtcp* const rtp_rtcp = rtp_streams_[i].rtp_rtcp.get();
|
RtpRtcp* const rtp_rtcp = rtp_streams_[i].rtp_rtcp.get();
|
||||||
rtp_rtcp->SetRtxSsrc(ssrc);
|
|
||||||
auto it = suspended_ssrcs_.find(ssrc);
|
auto it = suspended_ssrcs_.find(ssrc);
|
||||||
if (it != suspended_ssrcs_.end())
|
if (it != suspended_ssrcs_.end())
|
||||||
rtp_rtcp->SetRtxState(it->second);
|
rtp_rtcp->SetRtxState(it->second);
|
||||||
|
@ -135,11 +135,11 @@ class RtpRtcpRtxNackTest : public ::testing::Test {
|
|||||||
configuration.receive_statistics = receive_statistics_.get();
|
configuration.receive_statistics = receive_statistics_.get();
|
||||||
configuration.outgoing_transport = &transport_;
|
configuration.outgoing_transport = &transport_;
|
||||||
configuration.retransmission_rate_limiter = &retransmission_rate_limiter_;
|
configuration.retransmission_rate_limiter = &retransmission_rate_limiter_;
|
||||||
|
configuration.media_send_ssrc = kTestSsrc;
|
||||||
rtp_rtcp_module_ = RtpRtcp::Create(configuration);
|
rtp_rtcp_module_ = RtpRtcp::Create(configuration);
|
||||||
rtp_sender_video_ = absl::make_unique<RTPSenderVideo>(
|
rtp_sender_video_ = absl::make_unique<RTPSenderVideo>(
|
||||||
&fake_clock, rtp_rtcp_module_->RtpSender(), nullptr,
|
&fake_clock, rtp_rtcp_module_->RtpSender(), nullptr,
|
||||||
&playout_delay_oracle_, nullptr, false, false, FieldTrialBasedConfig());
|
&playout_delay_oracle_, nullptr, false, false, FieldTrialBasedConfig());
|
||||||
rtp_rtcp_module_->SetSSRC(kTestSsrc);
|
|
||||||
rtp_rtcp_module_->SetRTCPStatus(RtcpMode::kCompound);
|
rtp_rtcp_module_->SetRTCPStatus(RtcpMode::kCompound);
|
||||||
rtp_rtcp_module_->SetStorePacketsStatus(true, 600);
|
rtp_rtcp_module_->SetStorePacketsStatus(true, 600);
|
||||||
EXPECT_EQ(0, rtp_rtcp_module_->SetSendingStatus(true));
|
EXPECT_EQ(0, rtp_rtcp_module_->SetSendingStatus(true));
|
||||||
|
@ -180,7 +180,6 @@ class RtpRtcpImplTest : public ::testing::Test {
|
|||||||
|
|
||||||
void SetUp() override {
|
void SetUp() override {
|
||||||
// Send module.
|
// Send module.
|
||||||
sender_.impl_->SetSSRC(kSenderSsrc);
|
|
||||||
EXPECT_EQ(0, sender_.impl_->SetSendingStatus(true));
|
EXPECT_EQ(0, sender_.impl_->SetSendingStatus(true));
|
||||||
sender_.impl_->SetSendingMediaStatus(true);
|
sender_.impl_->SetSendingMediaStatus(true);
|
||||||
sender_.SetRemoteSsrc(kReceiverSsrc);
|
sender_.SetRemoteSsrc(kReceiverSsrc);
|
||||||
|
Reference in New Issue
Block a user