• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  Copyright (c) 2018 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 #ifndef MODULES_AUDIO_DEVICE_INCLUDE_AUDIO_DEVICE_DEFAULT_H_
12 #define MODULES_AUDIO_DEVICE_INCLUDE_AUDIO_DEVICE_DEFAULT_H_
13 
14 #include "modules/audio_device/include/audio_device.h"
15 
16 namespace webrtc {
17 namespace webrtc_impl {
18 
19 // AudioDeviceModuleDefault template adds default implementation for all
20 // AudioDeviceModule methods to the class, which inherits from
21 // AudioDeviceModuleDefault<T>.
22 template <typename T>
23 class AudioDeviceModuleDefault : public T {
24  public:
AudioDeviceModuleDefault()25   AudioDeviceModuleDefault() {}
~AudioDeviceModuleDefault()26   virtual ~AudioDeviceModuleDefault() {}
27 
RegisterAudioCallback(AudioTransport * audioCallback)28   int32_t RegisterAudioCallback(AudioTransport* audioCallback) override {
29     return 0;
30   }
Init()31   int32_t Init() override { return 0; }
InitSpeaker()32   int32_t InitSpeaker() override { return 0; }
SetPlayoutDevice(uint16_t index)33   int32_t SetPlayoutDevice(uint16_t index) override { return 0; }
SetPlayoutDevice(AudioDeviceModule::WindowsDeviceType device)34   int32_t SetPlayoutDevice(
35       AudioDeviceModule::WindowsDeviceType device) override {
36     return 0;
37   }
SetStereoPlayout(bool enable)38   int32_t SetStereoPlayout(bool enable) override { return 0; }
StopPlayout()39   int32_t StopPlayout() override { return 0; }
InitMicrophone()40   int32_t InitMicrophone() override { return 0; }
SetRecordingDevice(uint16_t index)41   int32_t SetRecordingDevice(uint16_t index) override { return 0; }
SetRecordingDevice(AudioDeviceModule::WindowsDeviceType device)42   int32_t SetRecordingDevice(
43       AudioDeviceModule::WindowsDeviceType device) override {
44     return 0;
45   }
SetStereoRecording(bool enable)46   int32_t SetStereoRecording(bool enable) override { return 0; }
StopRecording()47   int32_t StopRecording() override { return 0; }
48 
Terminate()49   int32_t Terminate() override { return 0; }
50 
ActiveAudioLayer(AudioDeviceModule::AudioLayer * audioLayer)51   int32_t ActiveAudioLayer(
52       AudioDeviceModule::AudioLayer* audioLayer) const override {
53     return 0;
54   }
Initialized()55   bool Initialized() const override { return true; }
PlayoutDevices()56   int16_t PlayoutDevices() override { return 0; }
RecordingDevices()57   int16_t RecordingDevices() override { return 0; }
PlayoutDeviceName(uint16_t index,char name[kAdmMaxDeviceNameSize],char guid[kAdmMaxGuidSize])58   int32_t PlayoutDeviceName(uint16_t index,
59                             char name[kAdmMaxDeviceNameSize],
60                             char guid[kAdmMaxGuidSize]) override {
61     return 0;
62   }
RecordingDeviceName(uint16_t index,char name[kAdmMaxDeviceNameSize],char guid[kAdmMaxGuidSize])63   int32_t RecordingDeviceName(uint16_t index,
64                               char name[kAdmMaxDeviceNameSize],
65                               char guid[kAdmMaxGuidSize]) override {
66     return 0;
67   }
PlayoutIsAvailable(bool * available)68   int32_t PlayoutIsAvailable(bool* available) override { return 0; }
InitPlayout()69   int32_t InitPlayout() override { return 0; }
PlayoutIsInitialized()70   bool PlayoutIsInitialized() const override { return true; }
RecordingIsAvailable(bool * available)71   int32_t RecordingIsAvailable(bool* available) override { return 0; }
InitRecording()72   int32_t InitRecording() override { return 0; }
RecordingIsInitialized()73   bool RecordingIsInitialized() const override { return true; }
StartPlayout()74   int32_t StartPlayout() override { return 0; }
Playing()75   bool Playing() const override { return false; }
StartRecording()76   int32_t StartRecording() override { return 0; }
Recording()77   bool Recording() const override { return false; }
SpeakerIsInitialized()78   bool SpeakerIsInitialized() const override { return true; }
MicrophoneIsInitialized()79   bool MicrophoneIsInitialized() const override { return true; }
SpeakerVolumeIsAvailable(bool * available)80   int32_t SpeakerVolumeIsAvailable(bool* available) override { return 0; }
SetSpeakerVolume(uint32_t volume)81   int32_t SetSpeakerVolume(uint32_t volume) override { return 0; }
SpeakerVolume(uint32_t * volume)82   int32_t SpeakerVolume(uint32_t* volume) const override { return 0; }
MaxSpeakerVolume(uint32_t * maxVolume)83   int32_t MaxSpeakerVolume(uint32_t* maxVolume) const override { return 0; }
MinSpeakerVolume(uint32_t * minVolume)84   int32_t MinSpeakerVolume(uint32_t* minVolume) const override { return 0; }
MicrophoneVolumeIsAvailable(bool * available)85   int32_t MicrophoneVolumeIsAvailable(bool* available) override { return 0; }
SetMicrophoneVolume(uint32_t volume)86   int32_t SetMicrophoneVolume(uint32_t volume) override { return 0; }
MicrophoneVolume(uint32_t * volume)87   int32_t MicrophoneVolume(uint32_t* volume) const override { return 0; }
MaxMicrophoneVolume(uint32_t * maxVolume)88   int32_t MaxMicrophoneVolume(uint32_t* maxVolume) const override { return 0; }
MinMicrophoneVolume(uint32_t * minVolume)89   int32_t MinMicrophoneVolume(uint32_t* minVolume) const override { return 0; }
SpeakerMuteIsAvailable(bool * available)90   int32_t SpeakerMuteIsAvailable(bool* available) override { return 0; }
SetSpeakerMute(bool enable)91   int32_t SetSpeakerMute(bool enable) override { return 0; }
SpeakerMute(bool * enabled)92   int32_t SpeakerMute(bool* enabled) const override { return 0; }
MicrophoneMuteIsAvailable(bool * available)93   int32_t MicrophoneMuteIsAvailable(bool* available) override { return 0; }
SetMicrophoneMute(bool enable)94   int32_t SetMicrophoneMute(bool enable) override { return 0; }
MicrophoneMute(bool * enabled)95   int32_t MicrophoneMute(bool* enabled) const override { return 0; }
StereoPlayoutIsAvailable(bool * available)96   int32_t StereoPlayoutIsAvailable(bool* available) const override {
97     *available = false;
98     return 0;
99   }
StereoPlayout(bool * enabled)100   int32_t StereoPlayout(bool* enabled) const override { return 0; }
StereoRecordingIsAvailable(bool * available)101   int32_t StereoRecordingIsAvailable(bool* available) const override {
102     *available = false;
103     return 0;
104   }
StereoRecording(bool * enabled)105   int32_t StereoRecording(bool* enabled) const override { return 0; }
PlayoutDelay(uint16_t * delayMS)106   int32_t PlayoutDelay(uint16_t* delayMS) const override {
107     *delayMS = 0;
108     return 0;
109   }
BuiltInAECIsAvailable()110   bool BuiltInAECIsAvailable() const override { return false; }
EnableBuiltInAEC(bool enable)111   int32_t EnableBuiltInAEC(bool enable) override { return -1; }
BuiltInAGCIsAvailable()112   bool BuiltInAGCIsAvailable() const override { return false; }
EnableBuiltInAGC(bool enable)113   int32_t EnableBuiltInAGC(bool enable) override { return -1; }
BuiltInNSIsAvailable()114   bool BuiltInNSIsAvailable() const override { return false; }
EnableBuiltInNS(bool enable)115   int32_t EnableBuiltInNS(bool enable) override { return -1; }
116 
GetPlayoutUnderrunCount()117   int32_t GetPlayoutUnderrunCount() const override { return -1; }
118 
119 #if defined(WEBRTC_IOS)
GetPlayoutAudioParameters(AudioParameters * params)120   int GetPlayoutAudioParameters(AudioParameters* params) const override {
121     return -1;
122   }
GetRecordAudioParameters(AudioParameters * params)123   int GetRecordAudioParameters(AudioParameters* params) const override {
124     return -1;
125   }
126 #endif  // WEBRTC_IOS
127 };
128 
129 }  // namespace webrtc_impl
130 }  // namespace webrtc
131 
132 #endif  // MODULES_AUDIO_DEVICE_INCLUDE_AUDIO_DEVICE_DEFAULT_H_
133