Use separate rtp module lists for send and receive in PacketRouter.
This makes it possible to handle send and receive streams with the same SSRC, which is currently the case in some peer connection tests.
Also moves sending transport feedback to the pacer thread.
BUG=webrtc:5263
Review URL: https://codereview.webrtc.org/1628683002
Cr-Commit-Position: refs/heads/master@{#11443}
diff --git a/webrtc/audio/audio_receive_stream.cc b/webrtc/audio/audio_receive_stream.cc
index ebe2713..b731126 100644
--- a/webrtc/audio/audio_receive_stream.cc
+++ b/webrtc/audio/audio_receive_stream.cc
@@ -117,8 +117,8 @@
}
}
// Configure bandwidth estimation.
- channel_proxy_->SetCongestionControlObjects(
- nullptr, nullptr, congestion_controller->packet_router());
+ channel_proxy_->RegisterReceiverCongestionControlObjects(
+ congestion_controller->packet_router());
if (config.combined_audio_video_bwe) {
if (UseSendSideBwe(config)) {
remote_bitrate_estimator_ =
@@ -134,7 +134,7 @@
AudioReceiveStream::~AudioReceiveStream() {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
LOG(LS_INFO) << "~AudioReceiveStream: " << config_.ToString();
- channel_proxy_->SetCongestionControlObjects(nullptr, nullptr, nullptr);
+ channel_proxy_->ResetCongestionControlObjects();
if (remote_bitrate_estimator_) {
remote_bitrate_estimator_->RemoveStream(config_.rtp.remote_ssrc);
}
diff --git a/webrtc/audio/audio_receive_stream_unittest.cc b/webrtc/audio/audio_receive_stream_unittest.cc
index b241bed..fd88fc8 100644
--- a/webrtc/audio/audio_receive_stream_unittest.cc
+++ b/webrtc/audio/audio_receive_stream_unittest.cc
@@ -94,13 +94,12 @@
EXPECT_CALL(*channel_proxy_, EnableReceiveTransportSequenceNumber(
kTransportSequenceNumberId))
.Times(1);
- EXPECT_CALL(*channel_proxy_, SetCongestionControlObjects(
- nullptr, nullptr, &packet_router_))
+ EXPECT_CALL(*channel_proxy_,
+ RegisterReceiverCongestionControlObjects(&packet_router_))
.Times(1);
EXPECT_CALL(congestion_controller_, packet_router())
.WillOnce(Return(&packet_router_));
- EXPECT_CALL(*channel_proxy_,
- SetCongestionControlObjects(nullptr, nullptr, nullptr))
+ EXPECT_CALL(*channel_proxy_, ResetCongestionControlObjects())
.Times(1);
return channel_proxy_;
}));
diff --git a/webrtc/audio/audio_send_stream.cc b/webrtc/audio/audio_send_stream.cc
index 35a6552..62121c6 100644
--- a/webrtc/audio/audio_send_stream.cc
+++ b/webrtc/audio/audio_send_stream.cc
@@ -68,7 +68,7 @@
VoiceEngineImpl* voe_impl = static_cast<VoiceEngineImpl*>(voice_engine());
channel_proxy_ = voe_impl->GetChannelProxy(config_.voe_channel_id);
- channel_proxy_->SetCongestionControlObjects(
+ channel_proxy_->RegisterSenderCongestionControlObjects(
congestion_controller->pacer(),
congestion_controller->GetTransportFeedbackObserver(),
congestion_controller->packet_router());
@@ -92,7 +92,7 @@
AudioSendStream::~AudioSendStream() {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
LOG(LS_INFO) << "~AudioSendStream: " << config_.ToString();
- channel_proxy_->SetCongestionControlObjects(nullptr, nullptr, nullptr);
+ channel_proxy_->ResetCongestionControlObjects();
}
void AudioSendStream::Start() {
diff --git a/webrtc/audio/audio_send_stream_unittest.cc b/webrtc/audio/audio_send_stream_unittest.cc
index 466c157..a01ef02 100644
--- a/webrtc/audio/audio_send_stream_unittest.cc
+++ b/webrtc/audio/audio_send_stream_unittest.cc
@@ -83,13 +83,12 @@
kTransportSequenceNumberId))
.Times(1);
EXPECT_CALL(*channel_proxy_,
- SetCongestionControlObjects(
+ RegisterSenderCongestionControlObjects(
congestion_controller_.pacer(),
congestion_controller_.GetTransportFeedbackObserver(),
congestion_controller_.packet_router()))
.Times(1);
- EXPECT_CALL(*channel_proxy_,
- SetCongestionControlObjects(nullptr, nullptr, nullptr))
+ EXPECT_CALL(*channel_proxy_, ResetCongestionControlObjects())
.Times(1);
return channel_proxy_;
}));