diff options
author | andrew@webrtc.org <andrew@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2013-03-05 01:12:49 +0000 |
---|---|---|
committer | andrew@webrtc.org <andrew@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2013-03-05 01:12:49 +0000 |
commit | b79627b0f3cf072721f3ae4a584a4f90edba2d1b (patch) | |
tree | 869e205cae65ff502da4f9456113aae89e44b18f /voice_engine/voe_codec_unittest.cc | |
parent | d432df47411ffb2152cbdffec242af7c34cfe7e0 (diff) | |
download | webrtc-b79627b0f3cf072721f3ae4a584a4f90edba2d1b.tar.gz |
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/webrtc@3605 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'voice_engine/voe_codec_unittest.cc')
-rw-r--r-- | voice_engine/voe_codec_unittest.cc | 319 |
1 files changed, 1 insertions, 318 deletions
diff --git a/voice_engine/voe_codec_unittest.cc b/voice_engine/voe_codec_unittest.cc index e473ddf1..2e8fe619 100644 --- a/voice_engine/voe_codec_unittest.cc +++ b/voice_engine/voe_codec_unittest.cc @@ -11,8 +11,7 @@ #include "webrtc/voice_engine/include/voe_codec.h" #include "gtest/gtest.h" -#include "webrtc/modules/audio_device/include/audio_device.h" -#include "webrtc/modules/audio_device/include/audio_device_defines.h" +#include "webrtc/modules/audio_device/include/fake_audio_device.h" #include "webrtc/system_wrappers/interface/scoped_ptr.h" #include "webrtc/voice_engine/include/voe_base.h" #include "webrtc/voice_engine/include/voe_hardware.h" @@ -22,322 +21,6 @@ namespace webrtc { namespace voe { namespace { - -class FakeAudioDeviceModule : public AudioDeviceModule { - public: - FakeAudioDeviceModule() {} - ~FakeAudioDeviceModule() {} - virtual int32_t AddRef() { return 0; } - virtual int32_t Release() { return 0; } - virtual int32_t RegisterEventObserver(AudioDeviceObserver* eventCallback) { - return 0; - } - virtual int32_t RegisterAudioCallback(AudioTransport* audioCallback) { - return 0; - } - virtual int32_t Init() { return 0; } - virtual int32_t SpeakerIsAvailable(bool* available) { - *available = true; - return 0; - } - virtual int32_t InitSpeaker() { return 0; } - virtual int32_t SetPlayoutDevice(uint16_t index) { return 0; } - virtual int32_t SetPlayoutDevice(WindowsDeviceType device) { return 0; } - virtual int32_t SetStereoPlayout(bool enable) { return 0; } - virtual int32_t StopPlayout() { return 0; } - virtual int32_t MicrophoneIsAvailable(bool* available) { - *available = true; - return 0; - } - virtual int32_t InitMicrophone() { return 0; } - virtual int32_t SetRecordingDevice(uint16_t index) { return 0; } - virtual int32_t SetRecordingDevice(WindowsDeviceType device) { return 0; } - virtual int32_t SetStereoRecording(bool enable) { return 0; } - virtual int32_t SetAGC(bool enable) { return 0; } - virtual int32_t StopRecording() { return 0; } - virtual int32_t TimeUntilNextProcess() { return 0; } - virtual int32_t Process() { return 0; } - virtual int32_t Terminate() { return 0; } - - virtual int32_t ActiveAudioLayer(AudioLayer* audioLayer) const { - assert(false); - return 0; - } - virtual ErrorCode LastError() const { - assert(false); - return kAdmErrNone; - } - virtual bool Initialized() const { - assert(false); - return true; - } - virtual int16_t PlayoutDevices() { - assert(false); - return 0; - } - virtual int16_t RecordingDevices() { - assert(false); - return 0; - } - virtual int32_t PlayoutDeviceName(uint16_t index, - char name[kAdmMaxDeviceNameSize], - char guid[kAdmMaxGuidSize]) { - assert(false); - return 0; - } - virtual int32_t RecordingDeviceName(uint16_t index, - char name[kAdmMaxDeviceNameSize], - char guid[kAdmMaxGuidSize]) { - assert(false); - return 0; - } - virtual int32_t PlayoutIsAvailable(bool* available) { - assert(false); - return 0; - } - virtual int32_t InitPlayout() { - assert(false); - return 0; - } - virtual bool PlayoutIsInitialized() const { - assert(false); - return true; - } - virtual int32_t RecordingIsAvailable(bool* available) { - assert(false); - return 0; - } - virtual int32_t InitRecording() { - assert(false); - return 0; - } - virtual bool RecordingIsInitialized() const { - assert(false); - return true; - } - virtual int32_t StartPlayout() { - assert(false); - return 0; - } - virtual bool Playing() const { - assert(false); - return false; - } - virtual int32_t StartRecording() { - assert(false); - return 0; - } - virtual bool Recording() const { - assert(false); - return false; - } - virtual bool AGC() const { - assert(false); - return true; - } - virtual int32_t SetWaveOutVolume(uint16_t volumeLeft, - uint16_t volumeRight) { - assert(false); - return 0; - } - virtual int32_t WaveOutVolume(uint16_t* volumeLeft, - uint16_t* volumeRight) const { - assert(false); - return 0; - } - virtual bool SpeakerIsInitialized() const { - assert(false); - return true; - } - virtual bool MicrophoneIsInitialized() const { - assert(false); - return true; - } - virtual int32_t SpeakerVolumeIsAvailable(bool* available) { - assert(false); - return 0; - } - virtual int32_t SetSpeakerVolume(uint32_t volume) { - assert(false); - return 0; - } - virtual int32_t SpeakerVolume(uint32_t* volume) const { - assert(false); - return 0; - } - virtual int32_t MaxSpeakerVolume(uint32_t* maxVolume) const { - assert(false); - return 0; - } - virtual int32_t MinSpeakerVolume(uint32_t* minVolume) const { - assert(false); - return 0; - } - virtual int32_t SpeakerVolumeStepSize(uint16_t* stepSize) const { - assert(false); - return 0; - } - virtual int32_t MicrophoneVolumeIsAvailable(bool* available) { - assert(false); - return 0; - } - virtual int32_t SetMicrophoneVolume(uint32_t volume) { - assert(false); - return 0; - } - virtual int32_t MicrophoneVolume(uint32_t* volume) const { - assert(false); - return 0; - } - virtual int32_t MaxMicrophoneVolume(uint32_t* maxVolume) const { - assert(false); - return 0; - } - virtual int32_t MinMicrophoneVolume(uint32_t* minVolume) const { - assert(false); - return 0; - } - virtual int32_t MicrophoneVolumeStepSize(uint16_t* stepSize) const { - assert(false); - return 0; - } - virtual int32_t SpeakerMuteIsAvailable(bool* available) { - assert(false); - return 0; - } - virtual int32_t SetSpeakerMute(bool enable) { - assert(false); - return 0; - } - virtual int32_t SpeakerMute(bool* enabled) const { - assert(false); - return 0; - } - virtual int32_t MicrophoneMuteIsAvailable(bool* available) { - assert(false); - return 0; - } - virtual int32_t SetMicrophoneMute(bool enable) { - assert(false); - return 0; - } - virtual int32_t MicrophoneMute(bool* enabled) const { - assert(false); - return 0; - } - virtual int32_t MicrophoneBoostIsAvailable(bool* available) { - assert(false); - return 0; - } - virtual int32_t SetMicrophoneBoost(bool enable) { - assert(false); - return 0; - } - virtual int32_t MicrophoneBoost(bool* enabled) const { - assert(false); - return 0; - } - virtual int32_t StereoPlayoutIsAvailable(bool* available) const { - *available = false; - return 0; - } - virtual int32_t StereoPlayout(bool* enabled) const { - assert(false); - return 0; - } - virtual int32_t StereoRecordingIsAvailable(bool* available) const { - *available = false; - return 0; - } - virtual int32_t StereoRecording(bool* enabled) const { - assert(false); - return 0; - } - virtual int32_t SetRecordingChannel(const ChannelType channel) { - assert(false); - return 0; - } - virtual int32_t RecordingChannel(ChannelType* channel) const { - assert(false); - return 0; - } - virtual int32_t SetPlayoutBuffer(const BufferType type, - uint16_t sizeMS = 0) { - assert(false); - return 0; - } - virtual int32_t PlayoutBuffer(BufferType* type, uint16_t* sizeMS) const { - assert(false); - return 0; - } - virtual int32_t PlayoutDelay(uint16_t* delayMS) const { - assert(false); - return 0; - } - virtual int32_t RecordingDelay(uint16_t* delayMS) const { - assert(false); - return 0; - } - virtual int32_t CPULoad(uint16_t* load) const { - assert(false); - return 0; - } - virtual int32_t StartRawOutputFileRecording( - const char pcmFileNameUTF8[kAdmMaxFileNameSize]) { - assert(false); - return 0; - } - virtual int32_t StopRawOutputFileRecording() { - assert(false); - return 0; - } - virtual int32_t StartRawInputFileRecording( - const char pcmFileNameUTF8[kAdmMaxFileNameSize]) { - assert(false); - return 0; - } - virtual int32_t StopRawInputFileRecording() { - assert(false); - return 0; - } - virtual int32_t SetRecordingSampleRate(const uint32_t samplesPerSec) { - assert(false); - return 0; - } - virtual int32_t RecordingSampleRate(uint32_t* samplesPerSec) const { - assert(false); - return 0; - } - virtual int32_t SetPlayoutSampleRate(const uint32_t samplesPerSec) { - assert(false); - return 0; - } - virtual int32_t PlayoutSampleRate(uint32_t* samplesPerSec) const { - assert(false); - return 0; - } - virtual int32_t ResetAudioDevice() { - assert(false); - return 0; - } - virtual int32_t SetLoudspeakerStatus(bool enable) { - assert(false); - return 0; - } - virtual int32_t GetLoudspeakerStatus(bool* enabled) const { - assert(false); - return 0; - } - virtual int32_t EnableBuiltInAEC(bool enable) { - assert(false); - return -1; - } - virtual bool BuiltInAECIsEnabled() const { - assert(false); - return false; - } -}; - class VoECodecTest : public ::testing::Test { protected: VoECodecTest() |