Remove usage of VoEVolumeControl from WVoE and Audio[Send|Receive]Stream.

BUG=webrtc:4690

Review-Url: https://codereview.webrtc.org/2721003002
Cr-Commit-Position: refs/heads/master@{#16956}
diff --git a/webrtc/audio/audio_receive_stream.cc b/webrtc/audio/audio_receive_stream.cc
index 8dc14e8..8c073d9 100644
--- a/webrtc/audio/audio_receive_stream.cc
+++ b/webrtc/audio/audio_receive_stream.cc
@@ -207,6 +207,11 @@
   return stats;
 }
 
+int AudioReceiveStream::GetOutputLevel() const {
+  RTC_DCHECK_RUN_ON(&worker_thread_checker_);
+  return channel_proxy_->GetSpeechOutputLevel();
+}
+
 void AudioReceiveStream::SetSink(std::unique_ptr<AudioSinkInterface> sink) {
   RTC_DCHECK_RUN_ON(&worker_thread_checker_);
   channel_proxy_->SetSink(std::move(sink));
diff --git a/webrtc/audio/audio_receive_stream.h b/webrtc/audio/audio_receive_stream.h
index e344e22..adac883 100644
--- a/webrtc/audio/audio_receive_stream.h
+++ b/webrtc/audio/audio_receive_stream.h
@@ -46,6 +46,7 @@
   void Start() override;
   void Stop() override;
   webrtc::AudioReceiveStream::Stats GetStats() const override;
+  int GetOutputLevel() const override;
   void SetSink(std::unique_ptr<AudioSinkInterface> sink) override;
   void SetGain(float gain) override;
 
diff --git a/webrtc/audio/audio_send_stream.cc b/webrtc/audio/audio_send_stream.cc
index ec18125..2d0c99b 100644
--- a/webrtc/audio/audio_send_stream.cc
+++ b/webrtc/audio/audio_send_stream.cc
@@ -25,7 +25,7 @@
 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
 #include "webrtc/voice_engine/channel_proxy.h"
 #include "webrtc/voice_engine/include/voe_base.h"
-#include "webrtc/voice_engine/include/voe_volume_control.h"
+#include "webrtc/voice_engine/transmit_mixer.h"
 #include "webrtc/voice_engine/voice_engine_impl.h"
 
 namespace webrtc {
@@ -193,16 +193,11 @@
     }
   }
 
-  // Local speech level.
-  {
-    ScopedVoEInterface<VoEVolumeControl> volume(voice_engine());
-    unsigned int level = 0;
-    int error = volume->GetSpeechInputLevelFullRange(level);
-    RTC_DCHECK_EQ(0, error);
-    stats.audio_level = static_cast<int32_t>(level);
-  }
-
   ScopedVoEInterface<VoEBase> base(voice_engine());
+  RTC_DCHECK(base->transmit_mixer());
+  stats.audio_level = base->transmit_mixer()->AudioLevelFullRange();
+  RTC_DCHECK_LE(0, stats.audio_level);
+
   RTC_DCHECK(base->audio_processing());
   auto audio_processing_stats = base->audio_processing()->GetStatistics();
   stats.echo_delay_median_ms = audio_processing_stats.delay_median;
diff --git a/webrtc/audio/audio_send_stream_unittest.cc b/webrtc/audio/audio_send_stream_unittest.cc
index 8e8b0e9..b1a2401 100644
--- a/webrtc/audio/audio_send_stream_unittest.cc
+++ b/webrtc/audio/audio_send_stream_unittest.cc
@@ -26,6 +26,7 @@
 #include "webrtc/test/gtest.h"
 #include "webrtc/test/mock_voe_channel_proxy.h"
 #include "webrtc/test/mock_voice_engine.h"
+#include "webrtc/voice_engine/transmit_mixer.h"
 
 namespace webrtc {
 namespace test {
@@ -46,7 +47,7 @@
 const int kEchoReturnLoss = -65;
 const int kEchoReturnLossEnhancement = 101;
 const float kResidualEchoLikelihood = -1.0f;
-const unsigned int kSpeechInputLevel = 96;
+const int32_t kSpeechInputLevel = 96;
 const CallStatistics kCallStats = {
     1345,  1678,  1901, 1234,  112, 13456, 17890, 1567, -1890, -1123};
 const ReportBlock kReportBlock = {456, 780, 123, 567, 890, 132, 143, 13354};
@@ -63,6 +64,11 @@
                     uint32_t max_padding_bitrate_bps));
 };
 
+class MockTransmitMixer : public voe::TransmitMixer {
+ public:
+  MOCK_CONST_METHOD0(AudioLevelFullRange, int16_t());
+};
+
 struct ConfigHelper {
   explicit ConfigHelper(bool audio_bwe_enabled)
       : simulated_clock_(123456),
@@ -213,11 +219,14 @@
         .WillRepeatedly(Return(report_blocks));
     EXPECT_CALL(*channel_proxy_, GetSendCodec(_))
         .WillRepeatedly(DoAll(SetArgPointee<0>(kIsacCodec), Return(true)));
-    EXPECT_CALL(voice_engine_, GetSpeechInputLevelFullRange(_))
-        .WillRepeatedly(DoAll(SetArgReferee<0>(kSpeechInputLevel), Return(0)));
+    EXPECT_CALL(voice_engine_, transmit_mixer())
+        .WillRepeatedly(Return(&transmit_mixer_));
     EXPECT_CALL(voice_engine_, audio_processing())
         .WillRepeatedly(Return(&audio_processing_));
 
+    EXPECT_CALL(transmit_mixer_, AudioLevelFullRange())
+        .WillRepeatedly(Return(kSpeechInputLevel));
+
     // We have to set the instantaneous value, the average, min and max. We only
     // care about the instantaneous value, so we set all to the same value.
     audio_processing_stats_.echo_return_loss.Set(
@@ -241,6 +250,7 @@
   testing::NiceMock<MockCongestionObserver> bitrate_observer_;
   testing::NiceMock<MockRemoteBitrateObserver> remote_bitrate_observer_;
   MockAudioProcessing audio_processing_;
+  MockTransmitMixer transmit_mixer_;
   AudioProcessing::AudioProcessingStatistics audio_processing_stats_;
   PacketRouter packet_router_;
   CongestionController congestion_controller_;
diff --git a/webrtc/call/audio_receive_stream.h b/webrtc/call/audio_receive_stream.h
index f441c31..3959da1 100644
--- a/webrtc/call/audio_receive_stream.h
+++ b/webrtc/call/audio_receive_stream.h
@@ -116,6 +116,8 @@
   virtual void Stop() = 0;
 
   virtual Stats GetStats() const = 0;
+  // TODO(solenberg): Remove, once AudioMonitor is gone.
+  virtual int GetOutputLevel() const = 0;
 
   // Sets an audio sink that receives unmixed audio from the receive stream.
   // Ownership of the sink is passed to the stream and can be used by the
diff --git a/webrtc/media/engine/fakewebrtccall.h b/webrtc/media/engine/fakewebrtccall.h
index 8a1547b..1c9212d 100644
--- a/webrtc/media/engine/fakewebrtccall.h
+++ b/webrtc/media/engine/fakewebrtccall.h
@@ -94,6 +94,7 @@
   void Stop() override { started_ = false; }
 
   webrtc::AudioReceiveStream::Stats GetStats() const override;
+  int GetOutputLevel() const override { return 0; }
   void SetSink(std::unique_ptr<webrtc::AudioSinkInterface> sink) override;
   void SetGain(float gain) override;
 
diff --git a/webrtc/media/engine/fakewebrtcvoiceengine.h b/webrtc/media/engine/fakewebrtcvoiceengine.h
index 18c7766..e44e44d 100644
--- a/webrtc/media/engine/fakewebrtcvoiceengine.h
+++ b/webrtc/media/engine/fakewebrtcvoiceengine.h
@@ -60,8 +60,7 @@
 
 class FakeWebRtcVoiceEngine
     : public webrtc::VoEBase, public webrtc::VoECodec,
-      public webrtc::VoEHardware,
-      public webrtc::VoEVolumeControl {
+      public webrtc::VoEHardware {
  public:
   struct Channel {
     std::vector<webrtc::CodecInst> recv_codecs;
@@ -224,22 +223,6 @@
   WEBRTC_STUB(EnableBuiltInNS, (bool enable));
   bool BuiltInNSIsAvailable() const override { return false; }
 
-  // webrtc::VoEVolumeControl
-  WEBRTC_STUB(SetSpeakerVolume, (unsigned int));
-  WEBRTC_STUB(GetSpeakerVolume, (unsigned int&));
-  WEBRTC_STUB(SetMicVolume, (unsigned int));
-  WEBRTC_STUB(GetMicVolume, (unsigned int&));
-  WEBRTC_STUB(SetInputMute, (int, bool));
-  WEBRTC_STUB(GetInputMute, (int, bool&));
-  WEBRTC_STUB(GetSpeechInputLevel, (unsigned int&));
-  WEBRTC_STUB(GetSpeechOutputLevel, (int, unsigned int&));
-  WEBRTC_STUB(GetSpeechInputLevelFullRange, (unsigned int&));
-  WEBRTC_STUB(GetSpeechOutputLevelFullRange, (int, unsigned int&));
-  WEBRTC_STUB(SetChannelOutputVolumeScaling, (int channel, float scale));
-  WEBRTC_STUB(GetChannelOutputVolumeScaling, (int channel, float& scale));
-  WEBRTC_STUB(SetOutputVolumePan, (int channel, float left, float right));
-  WEBRTC_STUB(GetOutputVolumePan, (int channel, float& left, float& right));
-
   size_t GetNetEqCapacity() const {
     auto ch = channels_.find(last_channel_);
     RTC_DCHECK(ch != channels_.end());
diff --git a/webrtc/media/engine/webrtcvoe.h b/webrtc/media/engine/webrtcvoe.h
index eabde365..6d99b5c 100644
--- a/webrtc/media/engine/webrtcvoe.h
+++ b/webrtc/media/engine/webrtcvoe.h
@@ -21,7 +21,6 @@
 #include "webrtc/voice_engine/include/voe_codec.h"
 #include "webrtc/voice_engine/include/voe_errors.h"
 #include "webrtc/voice_engine/include/voe_hardware.h"
-#include "webrtc/voice_engine/include/voe_volume_control.h"
 
 namespace cricket {
 // automatically handles lifetime of WebRtc VoiceEngine
@@ -78,25 +77,21 @@
  public:
   VoEWrapper()
       : engine_(webrtc::VoiceEngine::Create()),
-        base_(engine_), codec_(engine_), hw_(engine_),
-        volume_(engine_) {
+        base_(engine_), codec_(engine_), hw_(engine_) {
   }
   VoEWrapper(webrtc::VoEBase* base,
              webrtc::VoECodec* codec,
-             webrtc::VoEHardware* hw,
-             webrtc::VoEVolumeControl* volume)
+             webrtc::VoEHardware* hw)
       : engine_(NULL),
         base_(base),
         codec_(codec),
-        hw_(hw),
-        volume_(volume) {
+        hw_(hw) {
   }
   ~VoEWrapper() {}
   webrtc::VoiceEngine* engine() const { return engine_.get(); }
   webrtc::VoEBase* base() const { return base_.get(); }
   webrtc::VoECodec* codec() const { return codec_.get(); }
   webrtc::VoEHardware* hw() const { return hw_.get(); }
-  webrtc::VoEVolumeControl* volume() const { return volume_.get(); }
   int error() { return base_->LastError(); }
 
  private:
@@ -104,7 +99,6 @@
   scoped_voe_ptr<webrtc::VoEBase> base_;
   scoped_voe_ptr<webrtc::VoECodec> codec_;
   scoped_voe_ptr<webrtc::VoEHardware> hw_;
-  scoped_voe_ptr<webrtc::VoEVolumeControl> volume_;
 };
 }  // namespace cricket
 
diff --git a/webrtc/media/engine/webrtcvoiceengine.cc b/webrtc/media/engine/webrtcvoiceengine.cc
index 996bc5a..ae48678 100644
--- a/webrtc/media/engine/webrtcvoiceengine.cc
+++ b/webrtc/media/engine/webrtcvoiceengine.cc
@@ -962,11 +962,12 @@
 #endif  // !WEBRTC_IOS
 }
 
+// TODO(solenberg): Remove, once AudioMonitor is gone.
 int WebRtcVoiceEngine::GetInputLevel() {
   RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
-  unsigned int ulevel;
-  return (voe_wrapper_->volume()->GetSpeechInputLevel(ulevel) != -1) ?
-      static_cast<int>(ulevel) : -1;
+  int8_t level = transmit_mixer()->AudioLevel();
+  RTC_DCHECK_LE(0, level);
+  return level;
 }
 
 const std::vector<AudioCodec>& WebRtcVoiceEngine::send_codecs() const {
@@ -1577,6 +1578,12 @@
     return stream_->GetStats();
   }
 
+  int GetOutputLevel() const {
+    RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
+    RTC_DCHECK(stream_);
+    return stream_->GetOutputLevel();
+  }
+
   int channel() const {
     RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
     return config_.voe_channel_id;
@@ -2341,12 +2348,13 @@
   return true;
 }
 
+// TODO(solenberg): Remove, once AudioMonitor is gone.
 bool WebRtcVoiceMediaChannel::GetActiveStreams(
     AudioInfo::StreamList* actives) {
   RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
   actives->clear();
   for (const auto& ch : recv_streams_) {
-    int level = GetOutputLevel(ch.second->channel());
+    int level = ch.second->GetOutputLevel();
     if (level > 0) {
       actives->push_back(std::make_pair(ch.first, level));
     }
@@ -2354,11 +2362,12 @@
   return true;
 }
 
+// TODO(solenberg): Remove, once AudioMonitor is gone.
 int WebRtcVoiceMediaChannel::GetOutputLevel() {
   RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
   int highest = 0;
   for (const auto& ch : recv_streams_) {
-    highest = std::max(GetOutputLevel(ch.second->channel()), highest);
+    highest = std::max(ch.second->GetOutputLevel(), highest);
   }
   return highest;
 }
@@ -2657,12 +2666,6 @@
   it->second->SetRawAudioSink(std::move(sink));
 }
 
-int WebRtcVoiceMediaChannel::GetOutputLevel(int channel) {
-  unsigned int ulevel = 0;
-  int ret = engine()->voe()->volume()->GetSpeechOutputLevel(channel, ulevel);
-  return (ret == 0) ? static_cast<int>(ulevel) : -1;
-}
-
 int WebRtcVoiceMediaChannel::GetReceiveChannelId(uint32_t ssrc) const {
   RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
   const auto it = recv_streams_.find(ssrc);
diff --git a/webrtc/media/engine/webrtcvoiceengine.h b/webrtc/media/engine/webrtcvoiceengine.h
index ac3c989..33e53f1 100644
--- a/webrtc/media/engine/webrtcvoiceengine.h
+++ b/webrtc/media/engine/webrtcvoiceengine.h
@@ -237,7 +237,6 @@
 
   WebRtcVoiceEngine* engine() { return engine_; }
   int GetLastEngineError() { return engine()->GetLastEngineError(); }
-  int GetOutputLevel(int channel);
   void ChangePlayout(bool playout);
   int CreateVoEChannel();
   bool DeleteVoEChannel(int channel);
diff --git a/webrtc/media/engine/webrtcvoiceengine_unittest.cc b/webrtc/media/engine/webrtcvoiceengine_unittest.cc
index 751d41b..e72a9a0 100644
--- a/webrtc/media/engine/webrtcvoiceengine_unittest.cc
+++ b/webrtc/media/engine/webrtcvoiceengine_unittest.cc
@@ -63,8 +63,7 @@
   explicit FakeVoEWrapper(cricket::FakeWebRtcVoiceEngine* engine)
       : cricket::VoEWrapper(engine,  // base
                             engine,  // codec
-                            engine,  // hw
-                            engine) {  // volume
+                            engine) {  // hw
   }
 };
 
diff --git a/webrtc/test/mock_voe_channel_proxy.h b/webrtc/test/mock_voe_channel_proxy.h
index a2053f0..58fddb0 100644
--- a/webrtc/test/mock_voe_channel_proxy.h
+++ b/webrtc/test/mock_voe_channel_proxy.h
@@ -42,6 +42,7 @@
   MOCK_CONST_METHOD0(GetRemoteRTCPReportBlocks, std::vector<ReportBlock>());
   MOCK_CONST_METHOD0(GetNetworkStatistics, NetworkStatistics());
   MOCK_CONST_METHOD0(GetDecodingCallStatistics, AudioDecodingCallStats());
+  MOCK_CONST_METHOD0(GetSpeechOutputLevel, int32_t());
   MOCK_CONST_METHOD0(GetSpeechOutputLevelFullRange, int32_t());
   MOCK_CONST_METHOD0(GetDelayEstimate, uint32_t());
   MOCK_METHOD2(SetSendTelephoneEventPayloadType, bool(int payload_type,
diff --git a/webrtc/test/mock_voice_engine.h b/webrtc/test/mock_voice_engine.h
index 6177304..406b58f 100644
--- a/webrtc/test/mock_voice_engine.h
+++ b/webrtc/test/mock_voice_engine.h
@@ -21,6 +21,10 @@
 #include "webrtc/voice_engine/voice_engine_impl.h"
 
 namespace webrtc {
+namespace voe {
+class TransmitMixer;
+}  // namespace voe
+
 namespace test {
 
 // NOTE: This class inherits from VoiceEngineImpl so that its clients will be
@@ -122,6 +126,7 @@
           const rtc::scoped_refptr<AudioDecoderFactory>& decoder_factory));
   MOCK_METHOD0(audio_processing, AudioProcessing*());
   MOCK_METHOD0(audio_device_module, AudioDeviceModule*());
+  MOCK_METHOD0(transmit_mixer, voe::TransmitMixer*());
   MOCK_METHOD0(Terminate, int());
   MOCK_METHOD0(CreateChannel, int());
   MOCK_METHOD1(CreateChannel, int(const ChannelConfig& config));
@@ -289,23 +294,6 @@
                int(int channel, bool& enable, int& redPayloadtype));
   MOCK_METHOD3(SetNACKStatus, int(int channel, bool enable, int maxNoPackets));
 
-  // VoEVolumeControl
-  MOCK_METHOD1(SetSpeakerVolume, int(unsigned int volume));
-  MOCK_METHOD1(GetSpeakerVolume, int(unsigned int& volume));
-  MOCK_METHOD1(SetMicVolume, int(unsigned int volume));
-  MOCK_METHOD1(GetMicVolume, int(unsigned int& volume));
-  MOCK_METHOD2(SetInputMute, int(int channel, bool enable));
-  MOCK_METHOD2(GetInputMute, int(int channel, bool& enabled));
-  MOCK_METHOD1(GetSpeechInputLevel, int(unsigned int& level));
-  MOCK_METHOD2(GetSpeechOutputLevel, int(int channel, unsigned int& level));
-  MOCK_METHOD1(GetSpeechInputLevelFullRange, int(unsigned int& level));
-  MOCK_METHOD2(GetSpeechOutputLevelFullRange,
-               int(int channel, unsigned& level));
-  MOCK_METHOD2(SetChannelOutputVolumeScaling, int(int channel, float scaling));
-  MOCK_METHOD2(GetChannelOutputVolumeScaling, int(int channel, float& scaling));
-  MOCK_METHOD3(SetOutputVolumePan, int(int channel, float left, float right));
-  MOCK_METHOD3(GetOutputVolumePan, int(int channel, float& left, float& right));
-
  private:
   // TODO(ossu): I'm not particularly happy about keeping the decoder factory
   // here, but due to how gmock is implemented, I cannot just keep it in the
diff --git a/webrtc/voice_engine/channel.cc b/webrtc/voice_engine/channel.cc
index 60e213d..0573245 100644
--- a/webrtc/voice_engine/channel.cc
+++ b/webrtc/voice_engine/channel.cc
@@ -39,7 +39,6 @@
 #include "webrtc/voice_engine/include/voe_rtp_rtcp.h"
 #include "webrtc/voice_engine/output_mixer.h"
 #include "webrtc/voice_engine/statistics.h"
-#include "webrtc/voice_engine/transmit_mixer.h"
 #include "webrtc/voice_engine/utility.h"
 
 namespace webrtc {
@@ -908,7 +907,6 @@
       capture_start_ntp_time_ms_(-1),
       _engineStatisticsPtr(NULL),
       _outputMixerPtr(NULL),
-      _transmitMixerPtr(NULL),
       _moduleProcessThreadPtr(NULL),
       _audioDeviceModulePtr(NULL),
       _voiceEngineObserverPtr(NULL),
@@ -1119,7 +1117,6 @@
 
 int32_t Channel::SetEngineInformation(Statistics& engineStatistics,
                                       OutputMixer& outputMixer,
-                                      voe::TransmitMixer& transmitMixer,
                                       ProcessThread& moduleProcessThread,
                                       AudioDeviceModule& audioDeviceModule,
                                       VoiceEngineObserver* voiceEngineObserver,
@@ -1128,7 +1125,6 @@
                "Channel::SetEngineInformation()");
   _engineStatisticsPtr = &engineStatistics;
   _outputMixerPtr = &outputMixer;
-  _transmitMixerPtr = &transmitMixer,
   _moduleProcessThreadPtr = &moduleProcessThread;
   _audioDeviceModulePtr = &audioDeviceModule;
   _voiceEngineObserverPtr = voiceEngineObserver;
diff --git a/webrtc/voice_engine/channel.h b/webrtc/voice_engine/channel.h
index e4e819c..0426adf 100644
--- a/webrtc/voice_engine/channel.h
+++ b/webrtc/voice_engine/channel.h
@@ -71,7 +71,6 @@
 class RtpPacketSenderProxy;
 class Statistics;
 class TransportFeedbackProxy;
-class TransmitMixer;
 class TransportSequenceNumberProxy;
 class VoERtcpObserver;
 
@@ -155,7 +154,6 @@
   int32_t Init();
   int32_t SetEngineInformation(Statistics& engineStatistics,
                                OutputMixer& outputMixer,
-                               TransmitMixer& transmitMixer,
                                ProcessThread& moduleProcessThread,
                                AudioDeviceModule& audioDeviceModule,
                                VoiceEngineObserver* voiceEngineObserver,
@@ -478,7 +476,6 @@
   // uses
   Statistics* _engineStatisticsPtr;
   OutputMixer* _outputMixerPtr;
-  TransmitMixer* _transmitMixerPtr;
   ProcessThread* _moduleProcessThreadPtr;
   AudioDeviceModule* _audioDeviceModulePtr;
   VoiceEngineObserver* _voiceEngineObserverPtr;  // owned by base
diff --git a/webrtc/voice_engine/channel_proxy.cc b/webrtc/voice_engine/channel_proxy.cc
index 5538d9e..ca1d359 100644
--- a/webrtc/voice_engine/channel_proxy.cc
+++ b/webrtc/voice_engine/channel_proxy.cc
@@ -128,6 +128,14 @@
   return stats;
 }
 
+int32_t ChannelProxy::GetSpeechOutputLevel() const {
+  RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
+  uint32_t level = 0;
+  int error = channel()->GetSpeechOutputLevel(level);
+  RTC_DCHECK_EQ(0, error);
+  return static_cast<int32_t>(level);
+}
+
 int32_t ChannelProxy::GetSpeechOutputLevelFullRange() const {
   RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
   uint32_t level = 0;
diff --git a/webrtc/voice_engine/channel_proxy.h b/webrtc/voice_engine/channel_proxy.h
index aa7cef1..d8cc00b 100644
--- a/webrtc/voice_engine/channel_proxy.h
+++ b/webrtc/voice_engine/channel_proxy.h
@@ -73,6 +73,7 @@
   virtual std::vector<ReportBlock> GetRemoteRTCPReportBlocks() const;
   virtual NetworkStatistics GetNetworkStatistics() const;
   virtual AudioDecodingCallStats GetDecodingCallStatistics() const;
+  virtual int32_t GetSpeechOutputLevel() const;
   virtual int32_t GetSpeechOutputLevelFullRange() const;
   virtual uint32_t GetDelayEstimate() const;
   virtual bool SetSendTelephoneEventPayloadType(int payload_type,
diff --git a/webrtc/voice_engine/transmit_mixer.h b/webrtc/voice_engine/transmit_mixer.h
index 5353f97..3ccf251 100644
--- a/webrtc/voice_engine/transmit_mixer.h
+++ b/webrtc/voice_engine/transmit_mixer.h
@@ -87,7 +87,8 @@
 
     int8_t AudioLevel() const;
 
-    int16_t AudioLevelFullRange() const;
+    // 'virtual' to allow mocking.
+    virtual int16_t AudioLevelFullRange() const;
 
     bool IsRecordingCall();
 
diff --git a/webrtc/voice_engine/voe_base_impl.cc b/webrtc/voice_engine/voe_base_impl.cc
index 5a037bf..ecf5b94 100644
--- a/webrtc/voice_engine/voe_base_impl.cc
+++ b/webrtc/voice_engine/voe_base_impl.cc
@@ -374,9 +374,8 @@
 int VoEBaseImpl::InitializeChannel(voe::ChannelOwner* channel_owner) {
   if (channel_owner->channel()->SetEngineInformation(
           shared_->statistics(), *shared_->output_mixer(),
-          *shared_->transmit_mixer(), *shared_->process_thread(),
-          *shared_->audio_device(), voiceEngineObserverPtr_,
-          &callbackCritSect_) != 0) {
+          *shared_->process_thread(), *shared_->audio_device(),
+          voiceEngineObserverPtr_, &callbackCritSect_) != 0) {
     shared_->SetLastError(
         VE_CHANNEL_NOT_CREATED, kTraceError,
         "CreateChannel() failed to associate engine and channel."