Add support for external encoders in ACM

Also introduce tests using external (mock) encoders, both for
CodecOwner and for AudioCodingModule.

Support for external decoders is still missing.

COAUTHOR=henrik.lundin@webrtc.org
BUG=4474
R=jmarusic@webrtc.org, minyue@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/49939004

Cr-Commit-Position: refs/heads/master@{#9206}
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_send_test_oldapi.h b/webrtc/modules/audio_coding/main/acm2/acm_send_test_oldapi.h
index 52cb415..8cdc298 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_send_test_oldapi.h
+++ b/webrtc/modules/audio_coding/main/acm2/acm_send_test_oldapi.h
@@ -20,6 +20,7 @@
 #include "webrtc/system_wrappers/interface/clock.h"
 
 namespace webrtc {
+class AudioEncoderMutable;
 
 namespace test {
 class InputAudioFile;
@@ -40,6 +41,9 @@
                      int payload_type,
                      int frame_size_samples);
 
+  // Registers an external send codec. Returns true on success, false otherwise.
+  bool RegisterExternalCodec(AudioEncoderMutable* external_speech_encoder);
+
   // Returns the next encoded packet. Returns NULL if the test duration was
   // exceeded. Ownership of the packet is handed over to the caller.
   // Inherited from PacketSource.
@@ -69,7 +73,6 @@
   int source_rate_hz_;
   const int input_block_size_samples_;
   AudioFrame input_frame_;
-  CodecInst codec_;
   bool codec_registered_;
   int test_duration_ms_;
   // The following member variables are set whenever SendData() is called.