Home | History | Annotate | Download | only in ios
      1 /*
      2  *  Copyright (c) 2015 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/ios/audio_device_ios.h"
     12 
     13 #include "webrtc/base/checks.h"
     14 #include "webrtc/base/logging.h"
     15 
     16 namespace webrtc {
     17 
     18 int32_t AudioDeviceIOS::PlayoutBuffer(AudioDeviceModule::BufferType& type,
     19                                       uint16_t& sizeMS) const {
     20   RTC_NOTREACHED() << "Not implemented";
     21   return -1;
     22 }
     23 
     24 int32_t AudioDeviceIOS::ActiveAudioLayer(
     25     AudioDeviceModule::AudioLayer& audioLayer) const {
     26   audioLayer = AudioDeviceModule::kPlatformDefaultAudio;
     27   return 0;
     28 }
     29 
     30 int32_t AudioDeviceIOS::ResetAudioDevice() {
     31   RTC_NOTREACHED() << "Not implemented";
     32   return -1;
     33 }
     34 
     35 int16_t AudioDeviceIOS::PlayoutDevices() {
     36   // TODO(henrika): improve.
     37   LOG_F(LS_WARNING) << "Not implemented";
     38   return (int16_t)1;
     39 }
     40 
     41 int16_t AudioDeviceIOS::RecordingDevices() {
     42   // TODO(henrika): improve.
     43   LOG_F(LS_WARNING) << "Not implemented";
     44   return (int16_t)1;
     45 }
     46 
     47 int32_t AudioDeviceIOS::InitSpeaker() {
     48   return 0;
     49 }
     50 
     51 bool AudioDeviceIOS::SpeakerIsInitialized() const {
     52   return true;
     53 }
     54 
     55 int32_t AudioDeviceIOS::SpeakerVolumeIsAvailable(bool& available) {
     56   available = false;
     57   return 0;
     58 }
     59 
     60 int32_t AudioDeviceIOS::SetSpeakerVolume(uint32_t volume) {
     61   RTC_NOTREACHED() << "Not implemented";
     62   return -1;
     63 }
     64 
     65 int32_t AudioDeviceIOS::SpeakerVolume(uint32_t& volume) const {
     66   RTC_NOTREACHED() << "Not implemented";
     67   return -1;
     68 }
     69 
     70 int32_t AudioDeviceIOS::SetWaveOutVolume(uint16_t, uint16_t) {
     71   RTC_NOTREACHED() << "Not implemented";
     72   return -1;
     73 }
     74 
     75 int32_t AudioDeviceIOS::WaveOutVolume(uint16_t&, uint16_t&) const {
     76   RTC_NOTREACHED() << "Not implemented";
     77   return -1;
     78 }
     79 
     80 int32_t AudioDeviceIOS::MaxSpeakerVolume(uint32_t& maxVolume) const {
     81   RTC_NOTREACHED() << "Not implemented";
     82   return -1;
     83 }
     84 
     85 int32_t AudioDeviceIOS::MinSpeakerVolume(uint32_t& minVolume) const {
     86   RTC_NOTREACHED() << "Not implemented";
     87   return -1;
     88 }
     89 
     90 int32_t AudioDeviceIOS::SpeakerVolumeStepSize(uint16_t& stepSize) const {
     91   RTC_NOTREACHED() << "Not implemented";
     92   return -1;
     93 }
     94 
     95 int32_t AudioDeviceIOS::SpeakerMuteIsAvailable(bool& available) {
     96   available = false;
     97   return 0;
     98 }
     99 
    100 int32_t AudioDeviceIOS::SetSpeakerMute(bool enable) {
    101   RTC_NOTREACHED() << "Not implemented";
    102   return -1;
    103 }
    104 
    105 int32_t AudioDeviceIOS::SpeakerMute(bool& enabled) const {
    106   RTC_NOTREACHED() << "Not implemented";
    107   return -1;
    108 }
    109 
    110 int32_t AudioDeviceIOS::SetPlayoutDevice(uint16_t index) {
    111   LOG_F(LS_WARNING) << "Not implemented";
    112   return 0;
    113 }
    114 
    115 int32_t AudioDeviceIOS::SetPlayoutDevice(AudioDeviceModule::WindowsDeviceType) {
    116   RTC_NOTREACHED() << "Not implemented";
    117   return -1;
    118 }
    119 
    120 bool AudioDeviceIOS::PlayoutWarning() const {
    121   return false;
    122 }
    123 
    124 bool AudioDeviceIOS::PlayoutError() const {
    125   return false;
    126 }
    127 
    128 bool AudioDeviceIOS::RecordingWarning() const {
    129   return false;
    130 }
    131 
    132 bool AudioDeviceIOS::RecordingError() const {
    133   return false;
    134 }
    135 
    136 int32_t AudioDeviceIOS::InitMicrophone() {
    137   return 0;
    138 }
    139 
    140 bool AudioDeviceIOS::MicrophoneIsInitialized() const {
    141   return true;
    142 }
    143 
    144 int32_t AudioDeviceIOS::MicrophoneMuteIsAvailable(bool& available) {
    145   available = false;
    146   return 0;
    147 }
    148 
    149 int32_t AudioDeviceIOS::SetMicrophoneMute(bool enable) {
    150   RTC_NOTREACHED() << "Not implemented";
    151   return -1;
    152 }
    153 
    154 int32_t AudioDeviceIOS::MicrophoneMute(bool& enabled) const {
    155   RTC_NOTREACHED() << "Not implemented";
    156   return -1;
    157 }
    158 
    159 int32_t AudioDeviceIOS::MicrophoneBoostIsAvailable(bool& available) {
    160   available = false;
    161   return 0;
    162 }
    163 
    164 int32_t AudioDeviceIOS::SetMicrophoneBoost(bool enable) {
    165   RTC_NOTREACHED() << "Not implemented";
    166   return -1;
    167 }
    168 
    169 int32_t AudioDeviceIOS::MicrophoneBoost(bool& enabled) const {
    170   enabled = false;
    171   return 0;
    172 }
    173 
    174 int32_t AudioDeviceIOS::StereoRecordingIsAvailable(bool& available) {
    175   available = false;
    176   return 0;
    177 }
    178 
    179 int32_t AudioDeviceIOS::SetStereoRecording(bool enable) {
    180   LOG_F(LS_WARNING) << "Not implemented";
    181   return -1;
    182 }
    183 
    184 int32_t AudioDeviceIOS::StereoRecording(bool& enabled) const {
    185   enabled = false;
    186   return 0;
    187 }
    188 
    189 int32_t AudioDeviceIOS::StereoPlayoutIsAvailable(bool& available) {
    190   available = false;
    191   return 0;
    192 }
    193 
    194 int32_t AudioDeviceIOS::SetStereoPlayout(bool enable) {
    195   LOG_F(LS_WARNING) << "Not implemented";
    196   return -1;
    197 }
    198 
    199 int32_t AudioDeviceIOS::StereoPlayout(bool& enabled) const {
    200   enabled = false;
    201   return 0;
    202 }
    203 
    204 int32_t AudioDeviceIOS::SetAGC(bool enable) {
    205   if (enable) {
    206     RTC_NOTREACHED() << "Should never be called";
    207   }
    208   return -1;
    209 }
    210 
    211 bool AudioDeviceIOS::AGC() const {
    212   return false;
    213 }
    214 
    215 int32_t AudioDeviceIOS::MicrophoneVolumeIsAvailable(bool& available) {
    216   available = false;
    217   return 0;
    218 }
    219 
    220 int32_t AudioDeviceIOS::SetMicrophoneVolume(uint32_t volume) {
    221   RTC_NOTREACHED() << "Not implemented";
    222   return -1;
    223 }
    224 
    225 int32_t AudioDeviceIOS::MicrophoneVolume(uint32_t& volume) const {
    226   RTC_NOTREACHED() << "Not implemented";
    227   return -1;
    228 }
    229 
    230 int32_t AudioDeviceIOS::MaxMicrophoneVolume(uint32_t& maxVolume) const {
    231   RTC_NOTREACHED() << "Not implemented";
    232   return -1;
    233 }
    234 
    235 int32_t AudioDeviceIOS::MinMicrophoneVolume(uint32_t& minVolume) const {
    236   RTC_NOTREACHED() << "Not implemented";
    237   return -1;
    238 }
    239 
    240 int32_t AudioDeviceIOS::MicrophoneVolumeStepSize(uint16_t& stepSize) const {
    241   RTC_NOTREACHED() << "Not implemented";
    242   return -1;
    243 }
    244 
    245 int32_t AudioDeviceIOS::PlayoutDeviceName(uint16_t index,
    246                                           char name[kAdmMaxDeviceNameSize],
    247                                           char guid[kAdmMaxGuidSize]) {
    248   RTC_NOTREACHED() << "Not implemented";
    249   return -1;
    250 }
    251 
    252 int32_t AudioDeviceIOS::RecordingDeviceName(uint16_t index,
    253                                             char name[kAdmMaxDeviceNameSize],
    254                                             char guid[kAdmMaxGuidSize]) {
    255   RTC_NOTREACHED() << "Not implemented";
    256   return -1;
    257 }
    258 
    259 int32_t AudioDeviceIOS::SetRecordingDevice(uint16_t index) {
    260   LOG_F(LS_WARNING) << "Not implemented";
    261   return 0;
    262 }
    263 
    264 int32_t AudioDeviceIOS::SetRecordingDevice(
    265     AudioDeviceModule::WindowsDeviceType) {
    266   RTC_NOTREACHED() << "Not implemented";
    267   return -1;
    268 }
    269 
    270 int32_t AudioDeviceIOS::PlayoutIsAvailable(bool& available) {
    271   available = true;
    272   return 0;
    273 }
    274 
    275 int32_t AudioDeviceIOS::RecordingIsAvailable(bool& available) {
    276   available = true;
    277   return 0;
    278 }
    279 
    280 int32_t AudioDeviceIOS::SetPlayoutBuffer(
    281     const AudioDeviceModule::BufferType type,
    282     uint16_t sizeMS) {
    283   RTC_NOTREACHED() << "Not implemented";
    284   return -1;
    285 }
    286 
    287 int32_t AudioDeviceIOS::CPULoad(uint16_t&) const {
    288   RTC_NOTREACHED() << "Not implemented";
    289   return -1;
    290 }
    291 
    292 }  // namespace webrtc
    293