diff --git a/audio/audio_send_stream.cc b/audio/audio_send_stream.cc index 00c66a28ba..c88a52ef2e 100644 --- a/audio/audio_send_stream.cc +++ b/audio/audio_send_stream.cc @@ -199,7 +199,6 @@ AudioSendStream::AudioSendStream( RTC_DCHECK(rtp_transport || config.media_transport); RTC_DCHECK(overall_call_lifetime_); - channel_proxy_->SetRTCPStatus(true); rtp_rtcp_module_ = channel_proxy_->GetRtpRtcp(); RTC_DCHECK(rtp_rtcp_module_); diff --git a/audio/audio_send_stream_unittest.cc b/audio/audio_send_stream_unittest.cc index ed94283ac3..e226221715 100644 --- a/audio/audio_send_stream_unittest.cc +++ b/audio/audio_send_stream_unittest.cc @@ -193,7 +193,6 @@ struct ConfigHelper { EXPECT_CALL(*channel_proxy_, GetRtpRtcp()).WillRepeatedly(Invoke([this]() { return &this->rtp_rtcp_; })); - EXPECT_CALL(*channel_proxy_, SetRTCPStatus(true)).Times(1); EXPECT_CALL(*channel_proxy_, SetLocalSSRC(kSsrc)).Times(1); EXPECT_CALL(*channel_proxy_, SetRTCP_CNAME(StrEq(kCName))).Times(1); EXPECT_CALL(*channel_proxy_, SetNACKStatus(true, 10)).Times(1); diff --git a/audio/channel_send.cc b/audio/channel_send.cc index 09482a4fb5..abdb9807d9 100644 --- a/audio/channel_send.cc +++ b/audio/channel_send.cc @@ -442,12 +442,6 @@ bool ChannelSend::SendRtcp(const uint8_t* data, size_t len) { return true; } -int ChannelSend::PreferredSampleRate() const { - // Return the bigger of playout and receive frequency in the ACM. - return std::max(audio_coding_->ReceiveFrequency(), - audio_coding_->PlayoutFrequency()); -} - ChannelSend::ChannelSend(rtc::TaskQueue* encoder_queue, ProcessThread* module_process_thread, MediaTransportInterface* media_transport, @@ -505,26 +499,14 @@ ChannelSend::ChannelSend(rtc::TaskQueue* encoder_queue, _rtpRtcpModule.reset(RtpRtcp::CreateRtpRtcp(configuration)); _rtpRtcpModule->SetSendingMediaStatus(false); - Init(); -} -ChannelSend::~ChannelSend() { - Terminate(); - RTC_DCHECK(!channel_state_.Get().sending); -} - -void ChannelSend::Init() { channel_state_.Reset(); - // --- Add modules to process thread (for periodic schedulation) _moduleProcessThreadPtr->RegisterModule(_rtpRtcpModule.get(), RTC_FROM_HERE); - // --- ACM initialization int error = audio_coding_->InitializeReceiver(); RTC_DCHECK_EQ(0, error); - // --- RTP/RTCP module initialization - // Ensure that RTCP is enabled by default for the created channel. // Note that, the module will keep generating RTCP until it is explicitly // disabled by the user. @@ -533,29 +515,22 @@ void ChannelSend::Init() { // RTCP is enabled by default. _rtpRtcpModule->SetRTCPStatus(RtcpMode::kCompound); - // --- Register all permanent callbacks error = audio_coding_->RegisterTransportCallback(this); RTC_DCHECK_EQ(0, error); } -void ChannelSend::Terminate() { +ChannelSend::~ChannelSend() { RTC_DCHECK(construction_thread_.CalledOnValidThread()); - // Must be called on the same thread as Init(). StopSend(); - // The order to safely shutdown modules in a channel is: - // 1. De-register callbacks in modules - // 2. De-register modules in process thread - // 3. Destroy modules int error = audio_coding_->RegisterTransportCallback(NULL); RTC_DCHECK_EQ(0, error); - // De-register modules in process thread if (_moduleProcessThreadPtr) _moduleProcessThreadPtr->DeRegisterModule(_rtpRtcpModule.get()); - // End of modules shutdown + RTC_DCHECK(!channel_state_.Get().sending); } void ChannelSend::StartSend() { @@ -853,10 +828,6 @@ void ChannelSend::ResetSenderCongestionControlObjects() { rtp_packet_sender_proxy_->SetPacketSender(nullptr); } -void ChannelSend::SetRTCPStatus(bool enable) { - _rtpRtcpModule->SetRTCPStatus(enable ? RtcpMode::kCompound : RtcpMode::kOff); -} - void ChannelSend::SetRTCP_CNAME(absl::string_view c_name) { // Note: SetCNAME() accepts a c string of length at most 255. const std::string c_name_limited(c_name.substr(0, 255)); diff --git a/audio/channel_send.h b/audio/channel_send.h index 29b472a12a..6fefd281d0 100644 --- a/audio/channel_send.h +++ b/audio/channel_send.h @@ -175,7 +175,6 @@ class ChannelSend RtpTransportControllerSendInterface* transport, RtcpBandwidthObserver* bandwidth_observer); void ResetSenderCongestionControlObjects(); - void SetRTCPStatus(bool enable); void SetRTCP_CNAME(absl::string_view c_name); std::vector GetRemoteRTCPReportBlocks() const; CallSendStatistics GetRTCPStatistics() const; @@ -212,9 +211,6 @@ class ChannelSend private: class ProcessAndEncodeAudioTask; - void Init(); - void Terminate(); - // From AudioPacketizationCallback in the ACM int32_t SendData(FrameType frameType, uint8_t payloadType, @@ -229,8 +225,6 @@ class ChannelSend const PacketOptions& packet_options) override; bool SendRtcp(const uint8_t* data, size_t len) override; - int PreferredSampleRate() const; - bool Sending() const { return channel_state_.Get().sending; } // From OverheadObserver in the RTP/RTCP module diff --git a/audio/channel_send_proxy.cc b/audio/channel_send_proxy.cc index 1fe87a00e8..961528a8e5 100644 --- a/audio/channel_send_proxy.cc +++ b/audio/channel_send_proxy.cc @@ -66,11 +66,6 @@ void ChannelSendProxy::ModifyEncoder( channel_->ModifyEncoder(modifier); } -void ChannelSendProxy::SetRTCPStatus(bool enable) { - RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); - channel_->SetRTCPStatus(enable); -} - void ChannelSendProxy::SetMid(const std::string& mid, int extension_id) { RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); channel_->SetMid(mid, extension_id); diff --git a/audio/channel_send_proxy.h b/audio/channel_send_proxy.h index e26ef54e9d..a606ea1db0 100644 --- a/audio/channel_send_proxy.h +++ b/audio/channel_send_proxy.h @@ -55,7 +55,6 @@ class ChannelSendProxy { virtual void ModifyEncoder( rtc::FunctionView*)> modifier); - virtual void SetRTCPStatus(bool enable); virtual void SetMid(const std::string& mid, int extension_id); virtual void SetRTCP_CNAME(absl::string_view c_name); virtual void SetExtmapAllowMixed(bool extmap_allow_mixed); diff --git a/audio/mock_voe_channel_proxy.h b/audio/mock_voe_channel_proxy.h index 2ded3a3f75..84e96af06c 100644 --- a/audio/mock_voe_channel_proxy.h +++ b/audio/mock_voe_channel_proxy.h @@ -72,7 +72,6 @@ class MockChannelSendProxy : public voe::ChannelSendProxy { MOCK_METHOD1( ModifyEncoder, void(rtc::FunctionView*)> modifier)); - MOCK_METHOD1(SetRTCPStatus, void(bool enable)); MOCK_METHOD1(SetLocalSSRC, void(uint32_t ssrc)); MOCK_METHOD1(SetRTCP_CNAME, void(absl::string_view c_name)); MOCK_METHOD2(SetNACKStatus, void(bool enable, int max_packets));