Revert of WebRtcVoiceMediaChannel::AddRecvStream: Don't call SetRecPayloadType (patchset #13 id:260001 of https://codereview.webrtc.org/2686043006/ )

Reason for revert:
Makes perf and Chromium FYI bots unhappy.

Original issue's description:
> WebRtcVoiceMediaChannel::AddRecvStream: Don't call SetRecPayloadType
>
> This removes one more place where we were unable to handle codecs not
> in the built-in set.
>
> BUG=webrtc:5805
>
> Review-Url: https://codereview.webrtc.org/2686043006
> Cr-Commit-Position: refs/heads/master@{#17370}
> Committed: 1724cfbdba

TBR=ossu@webrtc.org,solenberg@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:5805

Review-Url: https://codereview.webrtc.org/2772043002
Cr-Commit-Position: refs/heads/master@{#17374}
This commit is contained in:
kwiberg
2017-03-24 05:56:21 -07:00
committed by Commit bot
parent 6d7900de66
commit 670a7f3611
28 changed files with 150 additions and 221 deletions

View File

@ -987,10 +987,9 @@ int32_t Channel::Init() {
return -1;
}
return 0;
}
// --- Register all supported codecs to the receiving side of the
// RTP/RTCP module
void Channel::RegisterLegacyCodecs() {
CodecInst codec;
const uint8_t nSupportedCodecs = AudioCodingModule::NumberOfCodecs();
@ -1042,6 +1041,8 @@ void Channel::RegisterLegacyCodecs() {
}
}
}
return 0;
}
void Channel::Terminate() {
@ -1359,11 +1360,6 @@ int32_t Channel::GetVADStatus(bool& enabledVAD,
return 0;
}
void Channel::SetReceiveCodecs(const std::map<int, SdpAudioFormat>& codecs) {
rtp_payload_registry_->SetAudioReceivePayloads(codecs);
audio_coding_->SetReceiveCodecs(codecs);
}
int32_t Channel::SetRecPayloadType(const CodecInst& codec) {
return SetRecPayloadType(codec.pltype, CodecInstToSdp(codec));
}

View File

@ -151,7 +151,6 @@ class Channel
uint32_t instanceId,
const VoEBase::ChannelConfig& config);
int32_t Init();
void RegisterLegacyCodecs();
void Terminate();
int32_t SetEngineInformation(Statistics& engineStatistics,
OutputMixer& outputMixer,
@ -169,8 +168,6 @@ class Channel
// go.
const rtc::scoped_refptr<AudioDecoderFactory>& GetAudioDecoderFactory() const;
void SetReceiveCodecs(const std::map<int, SdpAudioFormat>& codecs);
// API methods
// VoEBase

View File

@ -173,12 +173,6 @@ void ChannelProxy::SetRecPayloadType(int payload_type,
RTC_DCHECK_EQ(0, result);
}
void ChannelProxy::SetReceiveCodecs(
const std::map<int, SdpAudioFormat>& codecs) {
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
channel()->SetReceiveCodecs(codecs);
}
void ChannelProxy::SetSink(std::unique_ptr<AudioSinkInterface> sink) {
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
channel()->SetSink(std::move(sink));
@ -385,11 +379,6 @@ void ChannelProxy::OnRecoverableUplinkPacketLossRate(
channel()->OnRecoverableUplinkPacketLossRate(recoverable_packet_loss_rate);
}
void ChannelProxy::RegisterLegacyCodecs() {
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
channel()->RegisterLegacyCodecs();
}
Channel* ChannelProxy::channel() const {
RTC_DCHECK(channel_owner_.channel());
return channel_owner_.channel();

View File

@ -82,7 +82,6 @@ class ChannelProxy {
virtual void SetBitrate(int bitrate_bps, int64_t probing_interval_ms);
virtual void SetRecPayloadType(int payload_type,
const SdpAudioFormat& format);
virtual void SetReceiveCodecs(const std::map<int, SdpAudioFormat>& codecs);
virtual void SetSink(std::unique_ptr<AudioSinkInterface> sink);
virtual void SetInputMute(bool muted);
virtual void RegisterExternalTransport(Transport* transport);
@ -120,7 +119,6 @@ class ChannelProxy {
virtual void OnTwccBasedUplinkPacketLossRate(float packet_loss_rate);
virtual void OnRecoverableUplinkPacketLossRate(
float recoverable_packet_loss_rate);
virtual void RegisterLegacyCodecs();
private:
Channel* channel() const;

View File

@ -15,8 +15,6 @@
#include "webrtc/base/byteorder.h"
#include "webrtc/base/timeutils.h"
#include "webrtc/system_wrappers/include/sleep.h"
#include "webrtc/voice_engine/channel_proxy.h"
#include "webrtc/voice_engine/voice_engine_impl.h"
namespace {
static const unsigned int kReflectorSsrc = 0x0000;
@ -64,9 +62,6 @@ ConferenceTransport::ConferenceTransport()
EXPECT_EQ(0, local_base_->Init());
local_sender_ = local_base_->CreateChannel();
static_cast<webrtc::VoiceEngineImpl*>(local_voe_)
->GetChannelProxy(local_sender_)
->RegisterLegacyCodecs();
EXPECT_EQ(0, local_network_->RegisterExternalTransport(local_sender_, *this));
EXPECT_EQ(0, local_rtp_rtcp_->SetLocalSSRC(local_sender_, kLocalSsrc));
EXPECT_EQ(0, local_rtp_rtcp_->
@ -77,9 +72,6 @@ ConferenceTransport::ConferenceTransport()
EXPECT_EQ(0, remote_base_->Init());
reflector_ = remote_base_->CreateChannel();
static_cast<webrtc::VoiceEngineImpl*>(remote_voe_)
->GetChannelProxy(reflector_)
->RegisterLegacyCodecs();
EXPECT_EQ(0, remote_network_->RegisterExternalTransport(reflector_, *this));
EXPECT_EQ(0, remote_rtp_rtcp_->SetLocalSSRC(reflector_, kReflectorSsrc));
@ -230,9 +222,6 @@ void ConferenceTransport::SetRtt(unsigned int rtt_ms) {
unsigned int ConferenceTransport::AddStream(std::string file_name,
webrtc::FileFormats format) {
const int new_sender = remote_base_->CreateChannel();
static_cast<webrtc::VoiceEngineImpl*>(remote_voe_)
->GetChannelProxy(new_sender)
->RegisterLegacyCodecs();
EXPECT_EQ(0, remote_network_->RegisterExternalTransport(new_sender, *this));
const unsigned int remote_ssrc = kFirstRemoteSsrc + stream_count_++;
@ -246,9 +235,6 @@ unsigned int ConferenceTransport::AddStream(std::string file_name,
new_sender, file_name.c_str(), true, false, format, 1.0));
const int new_receiver = local_base_->CreateChannel();
static_cast<webrtc::VoiceEngineImpl*>(local_voe_)
->GetChannelProxy(new_receiver)
->RegisterLegacyCodecs();
EXPECT_EQ(0, local_base_->AssociateSendChannel(new_receiver, local_sender_));
EXPECT_EQ(0, local_network_->RegisterExternalTransport(new_receiver, *this));

View File

@ -16,6 +16,5 @@ AfterStreamingFixture::AfterStreamingFixture()
webrtc::VoiceEngineImpl* voe_impl =
static_cast<webrtc::VoiceEngineImpl*>(voice_engine_);
channel_proxy_ = voe_impl->GetChannelProxy(channel_);
channel_proxy_->RegisterLegacyCodecs();
ResumePlaying();
}

View File

@ -8,9 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "webrtc/voice_engine/channel_proxy.h"
#include "webrtc/voice_engine/test/auto_test/fixtures/after_initialization_fixture.h"
#include "webrtc/voice_engine/voice_engine_impl.h"
class CodecBeforeStreamingTest : public AfterInitializationFixture {
protected:
@ -21,9 +19,6 @@ class CodecBeforeStreamingTest : public AfterInitializationFixture {
codec_instance_.pacsize = 480;
channel_ = voe_base_->CreateChannel();
static_cast<webrtc::VoiceEngineImpl*>(voice_engine_)
->GetChannelProxy(channel_)
->RegisterLegacyCodecs();
}
void TearDown() {