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:
Erik Språng 2019-08-19 12:42:58 +02:00 committed by Commit Bot
parent cd277b84da
commit 93f518917f
4 changed files with 15 additions and 11 deletions

View file

@ -122,15 +122,16 @@ std::unique_ptr<FlexfecReceiver> MaybeCreateFlexfecReceiver(
std::unique_ptr<RtpRtcp> CreateRtpRtcpModule(
Clock* clock,
ReceiveStatistics* receive_statistics,
Transport* rtcp_send_transport,
const FlexfecReceiveStreamImpl::Config& config,
RtcpRttStats* rtt_stats) {
RtpRtcp::Configuration configuration;
configuration.audio = false;
configuration.receiver_only = true;
configuration.clock = clock;
configuration.receive_statistics = receive_statistics;
configuration.outgoing_transport = rtcp_send_transport;
configuration.outgoing_transport = config.rtcp_send_transport;
configuration.rtt_stats = rtt_stats;
configuration.media_send_ssrc = config.local_ssrc;
return RtpRtcp::Create(configuration);
}
@ -150,14 +151,13 @@ FlexfecReceiveStreamImpl::FlexfecReceiveStreamImpl(
rtp_receive_statistics_(ReceiveStatistics::Create(clock)),
rtp_rtcp_(CreateRtpRtcpModule(clock,
rtp_receive_statistics_.get(),
config_.rtcp_send_transport,
config_,
rtt_stats)),
process_thread_(process_thread) {
RTC_LOG(LS_INFO) << "FlexfecReceiveStreamImpl: " << config_.ToString();
// RTCP reporting.
rtp_rtcp_->SetRTCPStatus(config_.rtcp_mode);
rtp_rtcp_->SetSSRC(config_.local_ssrc);
process_thread_->RegisterModule(rtp_rtcp_.get(), RTC_FROM_HERE);
// Register with transport.

View file

@ -110,15 +110,23 @@ std::vector<RtpStreamSender> CreateRtpStreamSenders(
std::vector<RtpStreamSender> rtp_streams;
const std::vector<uint32_t>& flexfec_protected_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 &&
std::find(flexfec_protected_ssrcs.begin(),
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;
auto playout_delay_oracle = absl::make_unique<PlayoutDelayOracle>();
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);
rtp_rtcp->SetSendingStatus(false);
rtp_rtcp->SetSendingMediaStatus(false);
@ -571,7 +579,6 @@ void RtpVideoSender::ConfigureSsrcs() {
for (size_t i = 0; i < rtp_config_.ssrcs.size(); ++i) {
uint32_t ssrc = rtp_config_.ssrcs[i];
RtpRtcp* const rtp_rtcp = rtp_streams_[i].rtp_rtcp.get();
rtp_rtcp->SetSSRC(ssrc);
// Restore RTP state if previous existed.
auto it = suspended_ssrcs_.find(ssrc);
@ -587,12 +594,10 @@ void RtpVideoSender::ConfigureSsrcs() {
if (rtp_config_.rtx.ssrcs.empty())
return;
// Configure RTX SSRCs.
RTC_DCHECK_EQ(rtp_config_.rtx.ssrcs.size(), rtp_config_.ssrcs.size());
for (size_t i = 0; i < rtp_config_.rtx.ssrcs.size(); ++i) {
uint32_t ssrc = rtp_config_.rtx.ssrcs[i];
RtpRtcp* const rtp_rtcp = rtp_streams_[i].rtp_rtcp.get();
rtp_rtcp->SetRtxSsrc(ssrc);
auto it = suspended_ssrcs_.find(ssrc);
if (it != suspended_ssrcs_.end())
rtp_rtcp->SetRtxState(it->second);

View file

@ -135,11 +135,11 @@ class RtpRtcpRtxNackTest : public ::testing::Test {
configuration.receive_statistics = receive_statistics_.get();
configuration.outgoing_transport = &transport_;
configuration.retransmission_rate_limiter = &retransmission_rate_limiter_;
configuration.media_send_ssrc = kTestSsrc;
rtp_rtcp_module_ = RtpRtcp::Create(configuration);
rtp_sender_video_ = absl::make_unique<RTPSenderVideo>(
&fake_clock, rtp_rtcp_module_->RtpSender(), nullptr,
&playout_delay_oracle_, nullptr, false, false, FieldTrialBasedConfig());
rtp_rtcp_module_->SetSSRC(kTestSsrc);
rtp_rtcp_module_->SetRTCPStatus(RtcpMode::kCompound);
rtp_rtcp_module_->SetStorePacketsStatus(true, 600);
EXPECT_EQ(0, rtp_rtcp_module_->SetSendingStatus(true));

View file

@ -180,7 +180,6 @@ class RtpRtcpImplTest : public ::testing::Test {
void SetUp() override {
// Send module.
sender_.impl_->SetSSRC(kSenderSsrc);
EXPECT_EQ(0, sender_.impl_->SetSendingStatus(true));
sender_.impl_->SetSendingMediaStatus(true);
sender_.SetRemoteSsrc(kReceiverSsrc);