Remove unused/unnecessary things from ChannelSend.

Bug: none
Change-Id: I48e105d39597c3a84402599af7289f2ea9adc0c6
Reviewed-on: https://webrtc-review.googlesource.com/c/111183
Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25671}
This commit is contained in:
Fredrik Solenberg
2018-11-16 12:51:15 +01:00
committed by Commit Bot
parent a32d7e2a2f
commit 645a3afcea
7 changed files with 2 additions and 46 deletions

View File

@ -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_);

View File

@ -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);

View File

@ -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));

View File

@ -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<ReportBlock> 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

View File

@ -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);

View File

@ -55,7 +55,6 @@ class ChannelSendProxy {
virtual void ModifyEncoder(
rtc::FunctionView<void(std::unique_ptr<AudioEncoder>*)> 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);

View File

@ -72,7 +72,6 @@ class MockChannelSendProxy : public voe::ChannelSendProxy {
MOCK_METHOD1(
ModifyEncoder,
void(rtc::FunctionView<void(std::unique_ptr<AudioEncoder>*)> 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));