Remove use of VoECodec in video/call tests.

BUG=webrtc:4690

Review-Url: https://codereview.webrtc.org/2447723002
Cr-Commit-Position: refs/heads/master@{#14797}
diff --git a/webrtc/call/call_perf_tests.cc b/webrtc/call/call_perf_tests.cc
index 43d7aa5..5a60ace 100644
--- a/webrtc/call/call_perf_tests.cc
+++ b/webrtc/call/call_perf_tests.cc
@@ -40,9 +40,6 @@
 #include "webrtc/test/testsupport/fileutils.h"
 #include "webrtc/test/testsupport/perf_test.h"
 #include "webrtc/voice_engine/include/voe_base.h"
-#include "webrtc/voice_engine/include/voe_codec.h"
-#include "webrtc/voice_engine/include/voe_rtp_rtcp.h"
-#include "webrtc/voice_engine/include/voe_video_sync.h"
 
 using webrtc::test::DriftingClock;
 using webrtc::test::FakeAudioDevice;
@@ -152,7 +149,6 @@
   metrics::Reset();
   VoiceEngine* voice_engine = VoiceEngine::Create();
   VoEBase* voe_base = VoEBase::GetInterface(voice_engine);
-  VoECodec* voe_codec = VoECodec::GetInterface(voice_engine);
   const std::string audio_filename =
       test::ResourcePath("voice_engine/audio_long16", "pcm");
   ASSERT_STRNE("", audio_filename.c_str());
@@ -226,12 +222,11 @@
   AudioSendStream::Config audio_send_config(&audio_send_transport);
   audio_send_config.voe_channel_id = send_channel_id;
   audio_send_config.rtp.ssrc = kAudioSendSsrc;
+  audio_send_config.send_codec_spec.codec_inst =
+      CodecInst{103, "ISAC", 16000, 480, 1, 32000};
   AudioSendStream* audio_send_stream =
       sender_call_->CreateAudioSendStream(audio_send_config);
 
-  CodecInst isac = {103, "ISAC", 16000, 480, 1, 32000};
-  EXPECT_EQ(0, voe_codec->SetSendCodec(send_channel_id, isac));
-
   video_send_config_.rtp.nack.rtp_history_ms = kNackRtpHistoryMs;
   if (fec == FecMode::kOn) {
     video_send_config_.rtp.ulpfec.red_payload_type = kRedPayloadType;
@@ -297,7 +292,6 @@
   voe_base->DeleteChannel(send_channel_id);
   voe_base->DeleteChannel(recv_channel_id);
   voe_base->Release();
-  voe_codec->Release();
 
   DestroyCalls();
 
diff --git a/webrtc/test/call_test.cc b/webrtc/test/call_test.cc
index 57aca89..23a82bf 100644
--- a/webrtc/test/call_test.cc
+++ b/webrtc/test/call_test.cc
@@ -13,7 +13,6 @@
 #include "webrtc/test/call_test.h"
 #include "webrtc/test/testsupport/fileutils.h"
 #include "webrtc/voice_engine/include/voe_base.h"
-#include "webrtc/voice_engine/include/voe_codec.h"
 
 namespace webrtc {
 namespace test {
@@ -201,6 +200,8 @@
     audio_send_config_ = AudioSendStream::Config(send_transport);
     audio_send_config_.voe_channel_id = voe_send_.channel_id;
     audio_send_config_.rtp.ssrc = kAudioSendSsrc;
+    audio_send_config_.send_codec_spec.codec_inst =
+        CodecInst{kAudioSendPayloadType, "ISAC", 16000, 480, 1, 32000};
   }
 }
 
@@ -227,9 +228,9 @@
     }
   }
 
-  RTC_DCHECK(num_audio_streams_ <= 1);
+  RTC_DCHECK_GE(1u, num_audio_streams_);
   if (num_audio_streams_ == 1) {
-    RTC_DCHECK(voe_send_.channel_id >= 0);
+    RTC_DCHECK_LE(0, voe_send_.channel_id);
     AudioReceiveStream::Config audio_config;
     audio_config.rtp.local_ssrc = kReceiverLocalAudioSsrc;
     audio_config.rtcp_send_transport = rtcp_send_transport;
@@ -291,8 +292,6 @@
     audio_receive_streams_.push_back(
         receiver_call_->CreateAudioReceiveStream(audio_receive_configs_[i]));
   }
-  CodecInst isac = {kAudioSendPayloadType, "ISAC", 16000, 480, 1, 32000};
-  EXPECT_EQ(0, voe_send_.codec->SetSendCodec(voe_send_.channel_id, isac));
 }
 
 void CallTest::DestroyStreams() {
@@ -316,7 +315,6 @@
   CreateFakeAudioDevices();
   voe_send_.voice_engine = VoiceEngine::Create();
   voe_send_.base = VoEBase::GetInterface(voe_send_.voice_engine);
-  voe_send_.codec = VoECodec::GetInterface(voe_send_.voice_engine);
   EXPECT_EQ(0, voe_send_.base->Init(fake_send_audio_device_.get(), nullptr,
                                     decoder_factory_));
   VoEBase::ChannelConfig config;
@@ -326,7 +324,6 @@
 
   voe_recv_.voice_engine = VoiceEngine::Create();
   voe_recv_.base = VoEBase::GetInterface(voe_recv_.voice_engine);
-  voe_recv_.codec = VoECodec::GetInterface(voe_recv_.voice_engine);
   EXPECT_EQ(0, voe_recv_.base->Init(fake_recv_audio_device_.get(), nullptr,
                                     decoder_factory_));
   voe_recv_.channel_id = voe_recv_.base->CreateChannel();
@@ -338,15 +335,11 @@
   voe_recv_.channel_id = -1;
   voe_recv_.base->Release();
   voe_recv_.base = nullptr;
-  voe_recv_.codec->Release();
-  voe_recv_.codec = nullptr;
 
   voe_send_.base->DeleteChannel(voe_send_.channel_id);
   voe_send_.channel_id = -1;
   voe_send_.base->Release();
   voe_send_.base = nullptr;
-  voe_send_.codec->Release();
-  voe_send_.codec = nullptr;
 
   VoiceEngine::Delete(voe_send_.voice_engine);
   voe_send_.voice_engine = nullptr;
diff --git a/webrtc/test/call_test.h b/webrtc/test/call_test.h
index ff84782..74a5451 100644
--- a/webrtc/test/call_test.h
+++ b/webrtc/test/call_test.h
@@ -26,7 +26,6 @@
 namespace webrtc {
 
 class VoEBase;
-class VoECodec;
 
 namespace test {
 
@@ -123,12 +122,10 @@
     VoiceEngineState()
         : voice_engine(nullptr),
           base(nullptr),
-          codec(nullptr),
           channel_id(-1) {}
 
     VoiceEngine* voice_engine;
     VoEBase* base;
-    VoECodec* codec;
     int channel_id;
   };
 
diff --git a/webrtc/video/video_quality_test.cc b/webrtc/video/video_quality_test.cc
index b45cfde..c5db053 100644
--- a/webrtc/video/video_quality_test.cc
+++ b/webrtc/video/video_quality_test.cc
@@ -37,7 +37,6 @@
 #include "webrtc/test/vcm_capturer.h"
 #include "webrtc/test/video_renderer.h"
 #include "webrtc/voice_engine/include/voe_base.h"
-#include "webrtc/voice_engine/include/voe_codec.h"
 
 namespace {
 
@@ -54,13 +53,11 @@
   VoiceEngineState()
       : voice_engine(nullptr),
         base(nullptr),
-        codec(nullptr),
         send_channel_id(-1),
         receive_channel_id(-1) {}
 
   webrtc::VoiceEngine* voice_engine;
   webrtc::VoEBase* base;
-  webrtc::VoECodec* codec;
   int send_channel_id;
   int receive_channel_id;
 };
@@ -70,7 +67,6 @@
                            decoder_factory) {
   voe->voice_engine = webrtc::VoiceEngine::Create();
   voe->base = webrtc::VoEBase::GetInterface(voe->voice_engine);
-  voe->codec = webrtc::VoECodec::GetInterface(voe->voice_engine);
   EXPECT_EQ(0, voe->base->Init(nullptr, nullptr, decoder_factory));
   webrtc::VoEBase::ChannelConfig config;
   config.enable_voice_pacing = true;
@@ -87,8 +83,6 @@
   voe->receive_channel_id = -1;
   voe->base->Release();
   voe->base = nullptr;
-  voe->codec->Release();
-  voe->codec = nullptr;
 
   webrtc::VoiceEngine::Delete(voe->voice_engine);
   voe->voice_engine = nullptr;
@@ -1341,6 +1335,8 @@
       audio_send_config_.min_bitrate_kbps = kOpusMinBitrate / 1000;
       audio_send_config_.max_bitrate_kbps = kOpusBitrateFb / 1000;
     }
+    audio_send_config_.send_codec_spec.codec_inst =
+        CodecInst{120, "OPUS", 48000, 960, 2, 64000};
 
     audio_send_stream_ = call->CreateAudioSendStream(audio_send_config_);
 
@@ -1356,9 +1352,6 @@
       audio_config.sync_group = kSyncGroup;
 
     audio_receive_stream = call->CreateAudioReceiveStream(audio_config);
-
-    const CodecInst kOpusInst = {120, "OPUS", 48000, 960, 2, 64000};
-    EXPECT_EQ(0, voe.codec->SetSendCodec(voe.send_channel_id, kOpusInst));
   }
 
   StartEncodedFrameLogs(video_receive_stream);