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: https://chromium.googlesource.com/external/webrtc/+/1724cfbdbafef4736fedda37312b0286f1eb03d0

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}
diff --git a/webrtc/voice_engine/channel.cc b/webrtc/voice_engine/channel.cc
index 3b562f9..d2b30ca 100644
--- a/webrtc/voice_engine/channel.cc
+++ b/webrtc/voice_engine/channel.cc
@@ -987,10 +987,9 @@
     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 @@
       }
     }
   }
+
+  return 0;
 }
 
 void Channel::Terminate() {
@@ -1359,11 +1360,6 @@
   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));
 }
diff --git a/webrtc/voice_engine/channel.h b/webrtc/voice_engine/channel.h
index 1365ae8..0a12f21 100644
--- a/webrtc/voice_engine/channel.h
+++ b/webrtc/voice_engine/channel.h
@@ -151,7 +151,6 @@
           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 @@
   // go.
   const rtc::scoped_refptr<AudioDecoderFactory>& GetAudioDecoderFactory() const;
 
-  void SetReceiveCodecs(const std::map<int, SdpAudioFormat>& codecs);
-
   // API methods
 
   // VoEBase
diff --git a/webrtc/voice_engine/channel_proxy.cc b/webrtc/voice_engine/channel_proxy.cc
index d67011e..45cbf10 100644
--- a/webrtc/voice_engine/channel_proxy.cc
+++ b/webrtc/voice_engine/channel_proxy.cc
@@ -173,12 +173,6 @@
   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 @@
   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();
diff --git a/webrtc/voice_engine/channel_proxy.h b/webrtc/voice_engine/channel_proxy.h
index b808096..685a168 100644
--- a/webrtc/voice_engine/channel_proxy.h
+++ b/webrtc/voice_engine/channel_proxy.h
@@ -82,7 +82,6 @@
   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 @@
   virtual void OnTwccBasedUplinkPacketLossRate(float packet_loss_rate);
   virtual void OnRecoverableUplinkPacketLossRate(
       float recoverable_packet_loss_rate);
-  virtual void RegisterLegacyCodecs();
 
  private:
   Channel* channel() const;
diff --git a/webrtc/voice_engine/test/auto_test/fakes/conference_transport.cc b/webrtc/voice_engine/test/auto_test/fakes/conference_transport.cc
index f1eee9c..b15d72f 100644
--- a/webrtc/voice_engine/test/auto_test/fakes/conference_transport.cc
+++ b/webrtc/voice_engine/test/auto_test/fakes/conference_transport.cc
@@ -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 @@
 
   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 @@
 
   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 @@
 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 @@
       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));
diff --git a/webrtc/voice_engine/test/auto_test/fixtures/after_streaming_fixture.cc b/webrtc/voice_engine/test/auto_test/fixtures/after_streaming_fixture.cc
index 5582124..0fbe635 100644
--- a/webrtc/voice_engine/test/auto_test/fixtures/after_streaming_fixture.cc
+++ b/webrtc/voice_engine/test/auto_test/fixtures/after_streaming_fixture.cc
@@ -16,6 +16,5 @@
   webrtc::VoiceEngineImpl* voe_impl =
       static_cast<webrtc::VoiceEngineImpl*>(voice_engine_);
   channel_proxy_ = voe_impl->GetChannelProxy(channel_);
-  channel_proxy_->RegisterLegacyCodecs();
   ResumePlaying();
 }
diff --git a/webrtc/voice_engine/test/auto_test/standard/codec_before_streaming_test.cc b/webrtc/voice_engine/test/auto_test/standard/codec_before_streaming_test.cc
index d9a5e2b..a733b12 100644
--- a/webrtc/voice_engine/test/auto_test/standard/codec_before_streaming_test.cc
+++ b/webrtc/voice_engine/test/auto_test/standard/codec_before_streaming_test.cc
@@ -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 @@
     codec_instance_.pacsize = 480;
 
     channel_ = voe_base_->CreateChannel();
-    static_cast<webrtc::VoiceEngineImpl*>(voice_engine_)
-        ->GetChannelProxy(channel_)
-        ->RegisterLegacyCodecs();
   }
 
   void TearDown() {