Expose the capture-side AudioProcessing object and allow it to be injected.

* Clean up the configuration code, including removing most of the weird defines.
* Add a unit test.

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3605 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/voice_engine/shared_data.cc b/webrtc/voice_engine/shared_data.cc
index 7bea1e0..0426eca 100644
--- a/webrtc/voice_engine/shared_data.cc
+++ b/webrtc/voice_engine/shared_data.cc
@@ -29,7 +29,7 @@
     _channelManager(_gInstanceCounter),
     _engineStatistics(_gInstanceCounter),
     _audioDevicePtr(NULL),
-    _audioProcessingModulePtr(NULL),
+    audioproc_(NULL),
     _moduleProcessThreadPtr(ProcessThread::CreateProcessThread()),
     _externalRecording(false),
     _externalPlayout(false)
@@ -56,7 +56,6 @@
     if (_audioDevicePtr) {
         _audioDevicePtr->Release();
     }
-    AudioProcessing::Destroy(_audioProcessingModulePtr);
     delete _apiCritPtr;
     ProcessThread::DestroyProcessThread(_moduleProcessThreadPtr);
     Trace::ReturnTrace();
@@ -72,10 +71,10 @@
     _audioDevicePtr = audio_device;
 }
 
-void SharedData::set_audio_processing(AudioProcessing* audio_processing) {
-    if (_audioProcessingModulePtr)
-      AudioProcessing::Destroy(_audioProcessingModulePtr);
-    _audioProcessingModulePtr = audio_processing;
+void SharedData::set_audio_processing(AudioProcessing* audioproc) {
+  audioproc_.reset(audioproc);
+  _transmitMixerPtr->SetAudioProcessingModule(audioproc);
+  _outputMixerPtr->SetAudioProcessingModule(audioproc);
 }
 
 WebRtc_UWord16 SharedData::NumOfSendingChannels()