• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3  *
4  *  Use of this source code is governed by a BSD-style license
5  *  that can be found in the LICENSE file in the root of the source
6  *  tree. An additional intellectual property rights grant can be found
7  *  in the file PATENTS.  All contributing project authors may
8  *  be found in the AUTHORS file in the root of the source tree.
9  */
10 
11 #include "webrtc/modules/audio_device/include/audio_device.h"
12 
13 namespace webrtc {
14 
15 class FakeAudioDeviceModule : public AudioDeviceModule {
16  public:
FakeAudioDeviceModule()17   FakeAudioDeviceModule() {}
~FakeAudioDeviceModule()18   virtual ~FakeAudioDeviceModule() {}
AddRef()19   virtual int32_t AddRef() const { return 0; }
Release()20   virtual int32_t Release() const { return 0; }
RegisterEventObserver(AudioDeviceObserver * eventCallback)21   virtual int32_t RegisterEventObserver(AudioDeviceObserver* eventCallback) {
22     return 0;
23   }
RegisterAudioCallback(AudioTransport * audioCallback)24   virtual int32_t RegisterAudioCallback(AudioTransport* audioCallback) {
25     return 0;
26   }
Init()27   virtual int32_t Init() { return 0; }
InitSpeaker()28   virtual int32_t InitSpeaker() { return 0; }
SetPlayoutDevice(uint16_t index)29   virtual int32_t SetPlayoutDevice(uint16_t index) { return 0; }
SetPlayoutDevice(WindowsDeviceType device)30   virtual int32_t SetPlayoutDevice(WindowsDeviceType device) { return 0; }
SetStereoPlayout(bool enable)31   virtual int32_t SetStereoPlayout(bool enable) { return 0; }
StopPlayout()32   virtual int32_t StopPlayout() { return 0; }
InitMicrophone()33   virtual int32_t InitMicrophone() { return 0; }
SetRecordingDevice(uint16_t index)34   virtual int32_t SetRecordingDevice(uint16_t index) { return 0; }
SetRecordingDevice(WindowsDeviceType device)35   virtual int32_t SetRecordingDevice(WindowsDeviceType device) { return 0; }
SetStereoRecording(bool enable)36   virtual int32_t SetStereoRecording(bool enable) { return 0; }
SetAGC(bool enable)37   virtual int32_t SetAGC(bool enable) { return 0; }
StopRecording()38   virtual int32_t StopRecording() { return 0; }
TimeUntilNextProcess()39   virtual int64_t TimeUntilNextProcess() { return 0; }
Process()40   virtual int32_t Process() { return 0; }
Terminate()41   virtual int32_t Terminate() { return 0; }
42 
ActiveAudioLayer(AudioLayer * audioLayer)43   virtual int32_t ActiveAudioLayer(AudioLayer* audioLayer) const { return 0; }
LastError()44   virtual ErrorCode LastError() const { return kAdmErrNone; }
Initialized()45   virtual bool Initialized() const { return true; }
PlayoutDevices()46   virtual int16_t PlayoutDevices() { return 0; }
RecordingDevices()47   virtual int16_t RecordingDevices() { return 0; }
PlayoutDeviceName(uint16_t index,char name[kAdmMaxDeviceNameSize],char guid[kAdmMaxGuidSize])48   virtual int32_t PlayoutDeviceName(uint16_t index,
49                             char name[kAdmMaxDeviceNameSize],
50                             char guid[kAdmMaxGuidSize]) {
51     return 0;
52   }
RecordingDeviceName(uint16_t index,char name[kAdmMaxDeviceNameSize],char guid[kAdmMaxGuidSize])53   virtual int32_t RecordingDeviceName(uint16_t index,
54                               char name[kAdmMaxDeviceNameSize],
55                               char guid[kAdmMaxGuidSize]) {
56     return 0;
57   }
PlayoutIsAvailable(bool * available)58   virtual int32_t PlayoutIsAvailable(bool* available) { return 0; }
InitPlayout()59   virtual int32_t InitPlayout() { return 0; }
PlayoutIsInitialized()60   virtual bool PlayoutIsInitialized() const { return true; }
RecordingIsAvailable(bool * available)61   virtual int32_t RecordingIsAvailable(bool* available) { return 0; }
InitRecording()62   virtual int32_t InitRecording() { return 0; }
RecordingIsInitialized()63   virtual bool RecordingIsInitialized() const { return true; }
StartPlayout()64   virtual int32_t StartPlayout() { return 0; }
Playing()65   virtual bool Playing() const { return false; }
StartRecording()66   virtual int32_t StartRecording() { return 0; }
Recording()67   virtual bool Recording() const { return false; }
AGC()68   virtual bool AGC() const { return true; }
SetWaveOutVolume(uint16_t volumeLeft,uint16_t volumeRight)69   virtual int32_t SetWaveOutVolume(uint16_t volumeLeft,
70                            uint16_t volumeRight) {
71     return 0;
72   }
WaveOutVolume(uint16_t * volumeLeft,uint16_t * volumeRight)73   virtual int32_t WaveOutVolume(uint16_t* volumeLeft,
74                         uint16_t* volumeRight) const {
75     return 0;
76   }
SpeakerIsInitialized()77   virtual bool SpeakerIsInitialized() const { return true; }
MicrophoneIsInitialized()78   virtual bool MicrophoneIsInitialized() const { return true; }
SpeakerVolumeIsAvailable(bool * available)79   virtual int32_t SpeakerVolumeIsAvailable(bool* available) { return 0; }
SetSpeakerVolume(uint32_t volume)80   virtual int32_t SetSpeakerVolume(uint32_t volume) { return 0; }
SpeakerVolume(uint32_t * volume)81   virtual int32_t SpeakerVolume(uint32_t* volume) const { return 0; }
MaxSpeakerVolume(uint32_t * maxVolume)82   virtual int32_t MaxSpeakerVolume(uint32_t* maxVolume) const { return 0; }
MinSpeakerVolume(uint32_t * minVolume)83   virtual int32_t MinSpeakerVolume(uint32_t* minVolume) const { return 0; }
SpeakerVolumeStepSize(uint16_t * stepSize)84   virtual int32_t SpeakerVolumeStepSize(uint16_t* stepSize) const { return 0; }
MicrophoneVolumeIsAvailable(bool * available)85   virtual int32_t MicrophoneVolumeIsAvailable(bool* available) { return 0; }
SetMicrophoneVolume(uint32_t volume)86   virtual int32_t SetMicrophoneVolume(uint32_t volume) { return 0; }
MicrophoneVolume(uint32_t * volume)87   virtual int32_t MicrophoneVolume(uint32_t* volume) const { return 0; }
MaxMicrophoneVolume(uint32_t * maxVolume)88   virtual int32_t MaxMicrophoneVolume(uint32_t* maxVolume) const { return 0; }
MinMicrophoneVolume(uint32_t * minVolume)89   virtual int32_t MinMicrophoneVolume(uint32_t* minVolume) const { return 0; }
MicrophoneVolumeStepSize(uint16_t * stepSize)90   virtual int32_t MicrophoneVolumeStepSize(uint16_t* stepSize) const {
91     return 0;
92   }
SpeakerMuteIsAvailable(bool * available)93   virtual int32_t SpeakerMuteIsAvailable(bool* available) { return 0; }
SetSpeakerMute(bool enable)94   virtual int32_t SetSpeakerMute(bool enable) { return 0; }
SpeakerMute(bool * enabled)95   virtual int32_t SpeakerMute(bool* enabled) const { return 0; }
MicrophoneMuteIsAvailable(bool * available)96   virtual int32_t MicrophoneMuteIsAvailable(bool* available) { return 0; }
SetMicrophoneMute(bool enable)97   virtual int32_t SetMicrophoneMute(bool enable) { return 0; }
MicrophoneMute(bool * enabled)98   virtual int32_t MicrophoneMute(bool* enabled) const { return 0; }
MicrophoneBoostIsAvailable(bool * available)99   virtual int32_t MicrophoneBoostIsAvailable(bool* available) { return 0; }
SetMicrophoneBoost(bool enable)100   virtual int32_t SetMicrophoneBoost(bool enable) { return 0; }
MicrophoneBoost(bool * enabled)101   virtual int32_t MicrophoneBoost(bool* enabled) const { return 0; }
StereoPlayoutIsAvailable(bool * available)102   virtual int32_t StereoPlayoutIsAvailable(bool* available) const {
103     *available = false;
104     return 0;
105   }
StereoPlayout(bool * enabled)106   virtual int32_t StereoPlayout(bool* enabled) const { return 0; }
StereoRecordingIsAvailable(bool * available)107   virtual int32_t StereoRecordingIsAvailable(bool* available) const {
108     *available = false;
109     return 0;
110   }
StereoRecording(bool * enabled)111   virtual int32_t StereoRecording(bool* enabled) const { return 0; }
SetRecordingChannel(const ChannelType channel)112   virtual int32_t SetRecordingChannel(const ChannelType channel) { return 0; }
RecordingChannel(ChannelType * channel)113   virtual int32_t RecordingChannel(ChannelType* channel) const { return 0; }
114   virtual int32_t SetPlayoutBuffer(const BufferType type,
115                            uint16_t sizeMS = 0) {
116     return 0;
117   }
PlayoutBuffer(BufferType * type,uint16_t * sizeMS)118   virtual int32_t PlayoutBuffer(BufferType* type, uint16_t* sizeMS) const {
119     return 0;
120   }
PlayoutDelay(uint16_t * delayMS)121   virtual int32_t PlayoutDelay(uint16_t* delayMS) const { return 0; }
RecordingDelay(uint16_t * delayMS)122   virtual int32_t RecordingDelay(uint16_t* delayMS) const { return 0; }
CPULoad(uint16_t * load)123   virtual int32_t CPULoad(uint16_t* load) const { return 0; }
StartRawOutputFileRecording(const char pcmFileNameUTF8[kAdmMaxFileNameSize])124   virtual int32_t StartRawOutputFileRecording(
125       const char pcmFileNameUTF8[kAdmMaxFileNameSize]) {
126     return 0;
127   }
StopRawOutputFileRecording()128   virtual int32_t StopRawOutputFileRecording() { return 0; }
StartRawInputFileRecording(const char pcmFileNameUTF8[kAdmMaxFileNameSize])129   virtual int32_t StartRawInputFileRecording(
130       const char pcmFileNameUTF8[kAdmMaxFileNameSize]) {
131     return 0;
132   }
StopRawInputFileRecording()133   virtual int32_t StopRawInputFileRecording() { return 0; }
SetRecordingSampleRate(const uint32_t samplesPerSec)134   virtual int32_t SetRecordingSampleRate(const uint32_t samplesPerSec) {
135     return 0;
136   }
RecordingSampleRate(uint32_t * samplesPerSec)137   virtual int32_t RecordingSampleRate(uint32_t* samplesPerSec) const {
138     return 0;
139   }
SetPlayoutSampleRate(const uint32_t samplesPerSec)140   virtual int32_t SetPlayoutSampleRate(const uint32_t samplesPerSec) {
141     return 0;
142   }
PlayoutSampleRate(uint32_t * samplesPerSec)143   virtual int32_t PlayoutSampleRate(uint32_t* samplesPerSec) const { return 0; }
ResetAudioDevice()144   virtual int32_t ResetAudioDevice() { return 0; }
SetLoudspeakerStatus(bool enable)145   virtual int32_t SetLoudspeakerStatus(bool enable) { return 0; }
GetLoudspeakerStatus(bool * enabled)146   virtual int32_t GetLoudspeakerStatus(bool* enabled) const { return 0; }
BuiltInAECIsAvailable()147   virtual bool BuiltInAECIsAvailable() const { return false; }
EnableBuiltInAEC(bool enable)148   virtual int32_t EnableBuiltInAEC(bool enable) { return -1; }
BuiltInAECIsEnabled()149   virtual bool BuiltInAECIsEnabled() const { return false; }
BuiltInAGCIsAvailable()150   virtual bool BuiltInAGCIsAvailable() const { return false; }
EnableBuiltInAGC(bool enable)151   virtual int32_t EnableBuiltInAGC(bool enable) { return -1; }
BuiltInNSIsAvailable()152   virtual bool BuiltInNSIsAvailable() const { return false; }
EnableBuiltInNS(bool enable)153   virtual int32_t EnableBuiltInNS(bool enable) { return -1; }
154 };
155 
156 }  // namespace webrtc
157