audio_device_dummy.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*
  2. * Copyright (c) 2012 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. #ifndef AUDIO_DEVICE_AUDIO_DEVICE_DUMMY_H_
  11. #define AUDIO_DEVICE_AUDIO_DEVICE_DUMMY_H_
  12. #include <stdint.h>
  13. #include "modules/audio_device/audio_device_buffer.h"
  14. #include "modules/audio_device/audio_device_generic.h"
  15. #include "modules/audio_device/include/audio_device.h"
  16. #include "modules/audio_device/include/audio_device_defines.h"
  17. namespace webrtc {
  18. class AudioDeviceDummy : public AudioDeviceGeneric {
  19. public:
  20. AudioDeviceDummy() {}
  21. virtual ~AudioDeviceDummy() {}
  22. // Retrieve the currently utilized audio layer
  23. int32_t ActiveAudioLayer(
  24. AudioDeviceModule::AudioLayer& audioLayer) const override;
  25. // Main initializaton and termination
  26. InitStatus Init() override;
  27. int32_t Terminate() override;
  28. bool Initialized() const override;
  29. // Device enumeration
  30. int16_t PlayoutDevices() override;
  31. int16_t RecordingDevices() override;
  32. int32_t PlayoutDeviceName(uint16_t index,
  33. char name[kAdmMaxDeviceNameSize],
  34. char guid[kAdmMaxGuidSize]) override;
  35. int32_t RecordingDeviceName(uint16_t index,
  36. char name[kAdmMaxDeviceNameSize],
  37. char guid[kAdmMaxGuidSize]) override;
  38. // Device selection
  39. int32_t SetPlayoutDevice(uint16_t index) override;
  40. int32_t SetPlayoutDevice(
  41. AudioDeviceModule::WindowsDeviceType device) override;
  42. int32_t SetRecordingDevice(uint16_t index) override;
  43. int32_t SetRecordingDevice(
  44. AudioDeviceModule::WindowsDeviceType device) override;
  45. // Audio transport initialization
  46. int32_t PlayoutIsAvailable(bool& available) override;
  47. int32_t InitPlayout() override;
  48. bool PlayoutIsInitialized() const override;
  49. int32_t RecordingIsAvailable(bool& available) override;
  50. int32_t InitRecording() override;
  51. bool RecordingIsInitialized() const override;
  52. // Audio transport control
  53. int32_t StartPlayout() override;
  54. int32_t StopPlayout() override;
  55. bool Playing() const override;
  56. int32_t StartRecording() override;
  57. int32_t StopRecording() override;
  58. bool Recording() const override;
  59. // Audio mixer initialization
  60. int32_t InitSpeaker() override;
  61. bool SpeakerIsInitialized() const override;
  62. int32_t InitMicrophone() override;
  63. bool MicrophoneIsInitialized() const override;
  64. // Speaker volume controls
  65. int32_t SpeakerVolumeIsAvailable(bool& available) override;
  66. int32_t SetSpeakerVolume(uint32_t volume) override;
  67. int32_t SpeakerVolume(uint32_t& volume) const override;
  68. int32_t MaxSpeakerVolume(uint32_t& maxVolume) const override;
  69. int32_t MinSpeakerVolume(uint32_t& minVolume) const override;
  70. // Microphone volume controls
  71. int32_t MicrophoneVolumeIsAvailable(bool& available) override;
  72. int32_t SetMicrophoneVolume(uint32_t volume) override;
  73. int32_t MicrophoneVolume(uint32_t& volume) const override;
  74. int32_t MaxMicrophoneVolume(uint32_t& maxVolume) const override;
  75. int32_t MinMicrophoneVolume(uint32_t& minVolume) const override;
  76. // Speaker mute control
  77. int32_t SpeakerMuteIsAvailable(bool& available) override;
  78. int32_t SetSpeakerMute(bool enable) override;
  79. int32_t SpeakerMute(bool& enabled) const override;
  80. // Microphone mute control
  81. int32_t MicrophoneMuteIsAvailable(bool& available) override;
  82. int32_t SetMicrophoneMute(bool enable) override;
  83. int32_t MicrophoneMute(bool& enabled) const override;
  84. // Stereo support
  85. int32_t StereoPlayoutIsAvailable(bool& available) override;
  86. int32_t SetStereoPlayout(bool enable) override;
  87. int32_t StereoPlayout(bool& enabled) const override;
  88. int32_t StereoRecordingIsAvailable(bool& available) override;
  89. int32_t SetStereoRecording(bool enable) override;
  90. int32_t StereoRecording(bool& enabled) const override;
  91. // Delay information and control
  92. int32_t PlayoutDelay(uint16_t& delayMS) const override;
  93. void AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) override;
  94. };
  95. } // namespace webrtc
  96. #endif // AUDIO_DEVICE_AUDIO_DEVICE_DUMMY_H_