Bug 1392583 - Remove calls to FATAL() from audio_device_template.h for unimplemented functions. r=padenot, a=lizzard
authorDan Minor <dminor@mozilla.com>
Tue, 22 Aug 2017 09:58:03 -0400
changeset 423739 9ea3c346233617a6f769a6bd2e07130d7db9d89f
parent 423738 ccd625c4e5f1001a96dc74bc4ee1e8956ad02ea7
child 423740 d51bedb9d492abba795601298b90a7670b19e228
push id1517
push userjlorenzo@mozilla.com
push dateThu, 14 Sep 2017 16:50:54 +0000
treeherdermozilla-release@3b41fd564418 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot, lizzard
bugs1392583
milestone56.0
Bug 1392583 - Remove calls to FATAL() from audio_device_template.h for unimplemented functions. r=padenot, a=lizzard This removes calls to FATAL() and replaces them with LOG() statements. The unimplemented functions already returned error codes. MozReview-Commit-ID: KgXVCIKWoLp
media/webrtc/trunk/webrtc/modules/audio_device/android/audio_device_template.h
--- a/media/webrtc/trunk/webrtc/modules/audio_device/android/audio_device_template.h
+++ b/media/webrtc/trunk/webrtc/modules/audio_device/android/audio_device_template.h
@@ -99,17 +99,17 @@ class AudioDeviceTemplate : public Audio
     LOG(INFO) << __FUNCTION__;
     return 1;
   }
 
   int32_t PlayoutDeviceName(
       uint16_t index,
       char name[kAdmMaxDeviceNameSize],
       char guid[kAdmMaxGuidSize]) override {
-    FATAL() << "Should never be called";
+    LOG(INFO) << __FUNCTION__;
     return -1;
   }
 
   int32_t RecordingDeviceName(
       uint16_t index,
       char name[kAdmMaxDeviceNameSize],
       char guid[kAdmMaxGuidSize]) override {
     LOG(INFO) << __FUNCTION__;
@@ -120,30 +120,30 @@ class AudioDeviceTemplate : public Audio
     // OK to use but it has no effect currently since device selection is
     // done using Andoid APIs instead.
     LOG(INFO) << __FUNCTION__;
     return 0;
   }
 
   int32_t SetPlayoutDevice(
       AudioDeviceModule::WindowsDeviceType device) override {
-    FATAL() << "Should never be called";
+    LOG(INFO) << __FUNCTION__;
     return -1;
   }
 
   int32_t SetRecordingDevice(uint16_t index) override {
     // OK to use but it has no effect currently since device selection is
     // done using Andoid APIs instead.
     LOG(INFO) << __FUNCTION__;
     return 0;
   }
 
   int32_t SetRecordingDevice(
       AudioDeviceModule::WindowsDeviceType device) override {
-    FATAL() << "Should never be called";
+    LOG(INFO) << __FUNCTION__;
     return -1;
   }
 
   int32_t PlayoutIsAvailable(bool& available) override {
     LOG(INFO) << __FUNCTION__;
     available = true;
     return 0;
   }
@@ -215,36 +215,34 @@ class AudioDeviceTemplate : public Audio
     return err;
   }
 
   bool Recording() const override {
     return input_.Recording() ;
   }
 
   int32_t SetAGC(bool enable) override {
-    if (enable) {
-      FATAL() << "Should never be called";
-    }
+    LOG(INFO) << __FUNCTION__;
     return -1;
   }
 
   bool AGC() const override {
     LOG(INFO) << __FUNCTION__;
     return false;
   }
 
   int32_t SetWaveOutVolume(
       uint16_t volumeLeft, uint16_t volumeRight) override {
-     FATAL() << "Should never be called";
+    LOG(INFO) << __FUNCTION__;
     return -1;
   }
 
   int32_t WaveOutVolume(
       uint16_t& volumeLeft, uint16_t& volumeRight) const override {
-    FATAL() << "Should never be called";
+    LOG(INFO) << __FUNCTION__;
     return -1;
   }
 
   int32_t InitSpeaker() override {
     LOG(INFO) << __FUNCTION__;
     return 0;
   }
 
@@ -284,92 +282,98 @@ class AudioDeviceTemplate : public Audio
   }
 
   int32_t MinSpeakerVolume(uint32_t& minVolume) const override {
     LOG(INFO) << __FUNCTION__;
     return output_.MinSpeakerVolume(minVolume);
   }
 
   int32_t SpeakerVolumeStepSize(uint16_t& stepSize) const override {
-    FATAL() << "Should never be called";
+    LOG(INFO) << __FUNCTION__;
     return -1;
   }
 
   int32_t MicrophoneVolumeIsAvailable(bool& available) override{
     available = false;
     return -1;
   }
 
   int32_t SetMicrophoneVolume(uint32_t volume) override {
-    FATAL() << "Should never be called";
+    LOG(INFO) << __FUNCTION__;
     return -1;
   }
 
   int32_t MicrophoneVolume(uint32_t& volume) const override {
-    FATAL() << "Should never be called";
+    LOG(INFO) << __FUNCTION__;
     return -1;
   }
 
   int32_t MaxMicrophoneVolume(uint32_t& maxVolume) const override {
-    FATAL() << "Should never be called";
+    LOG(INFO) << __FUNCTION__;
     return -1;
   }
 
   int32_t MinMicrophoneVolume(uint32_t& minVolume) const override {
-    FATAL() << "Should never be called";
+    LOG(INFO) << __FUNCTION__;
     return -1;
   }
 
   int32_t MicrophoneVolumeStepSize(uint16_t& stepSize) const override {
-    FATAL() << "Should never be called";
+    LOG(INFO) << __FUNCTION__;
     return -1;
   }
 
   int32_t SpeakerMuteIsAvailable(bool& available) override {
-    FATAL() << "Should never be called";
+    LOG(INFO) << __FUNCTION__;
+    available = false;
     return -1;
   }
 
   int32_t SetSpeakerMute(bool enable) override {
-    FATAL() << "Should never be called";
+    LOG(INFO) << __FUNCTION__;
     return -1;
   }
 
   int32_t SpeakerMute(bool& enabled) const override {
-    FATAL() << "Should never be called";
+    LOG(INFO) << __FUNCTION__;
+    enabled = false;
     return -1;
   }
 
   int32_t MicrophoneMuteIsAvailable(bool& available) override {
-    FATAL() << "Not implemented";
+    LOG(INFO) << __FUNCTION__;
+    available = false;
     return -1;
   }
 
   int32_t SetMicrophoneMute(bool enable) override {
-    FATAL() << "Not implemented";
+    LOG(INFO) << __FUNCTION__;
     return -1;
   }
 
   int32_t MicrophoneMute(bool& enabled) const override {
-    FATAL() << "Not implemented";
+    LOG(INFO) << __FUNCTION__;
+    enabled = false;
     return -1;
   }
 
   int32_t MicrophoneBoostIsAvailable(bool& available) override {
-    FATAL() << "Should never be called";
+    LOG(INFO) << __FUNCTION__;
+    available = false;
     return -1;
   }
 
   int32_t SetMicrophoneBoost(bool enable) override {
-    FATAL() << "Should never be called";
+    LOG(INFO) << __FUNCTION__;
     return -1;
   }
 
   int32_t MicrophoneBoost(bool& enabled) const override {
-    FATAL() << "Should never be called";
+    LOG(INFO) << __FUNCTION__;
+    enabled = false;
     return -1;
   }
 
   int32_t StereoPlayoutIsAvailable(bool& available) override {
     LOG(INFO) << __FUNCTION__;
     available = false;
     return 0;
   }
@@ -378,17 +382,17 @@ class AudioDeviceTemplate : public Audio
   int32_t SetStereoPlayout(bool enable) override {
     LOG(INFO) << __FUNCTION__;
     return -1;
   }
 
   // TODO(henrika): add support.
   int32_t StereoPlayout(bool& enabled) const override {
     enabled = false;
-    FATAL() << "Should never be called";
+    LOG(INFO) << __FUNCTION__;
     return -1;
   }
 
   int32_t StereoRecordingIsAvailable(bool& available) override {
     LOG(INFO) << __FUNCTION__;
     available = false;
     return 0;
   }
@@ -401,23 +405,23 @@ class AudioDeviceTemplate : public Audio
   int32_t StereoRecording(bool& enabled) const override {
     LOG(INFO) << __FUNCTION__;
     enabled = false;
     return 0;
   }
 
   int32_t SetPlayoutBuffer(
       const AudioDeviceModule::BufferType type, uint16_t sizeMS) override {
-    FATAL() << "Should never be called";
+    LOG(INFO) << __FUNCTION__;
     return -1;
   }
 
   int32_t PlayoutBuffer(
       AudioDeviceModule::BufferType& type, uint16_t& sizeMS) const override {
-    FATAL() << "Should never be called";
+    LOG(INFO) << __FUNCTION__;
     return -1;
   }
 
   int32_t PlayoutDelay(uint16_t& delay_ms) const override {
     // Best guess we can do is to use half of the estimated total delay.
     delay_ms = audio_manager_->GetDelayEstimateInMilliseconds() / 2;
     RTC_DCHECK_GT(delay_ms, 0);
     return 0;
@@ -427,17 +431,17 @@ class AudioDeviceTemplate : public Audio
     // Best guess we can do is to use half of the estimated total delay.
     LOG(INFO) << __FUNCTION__;
     delay_ms = audio_manager_->GetDelayEstimateInMilliseconds() / 2;
     RTC_DCHECK_GT(delay_ms, 0);
     return 0;
   }
 
   int32_t CPULoad(uint16_t& load) const override {
-    FATAL() << "Should never be called";
+    LOG(INFO) << __FUNCTION__;
     return -1;
   }
 
   bool PlayoutWarning() const override {
     return false;
   }
 
   bool PlayoutError() const override {
@@ -463,27 +467,27 @@ class AudioDeviceTemplate : public Audio
   void AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) override {
     LOG(INFO) << __FUNCTION__;
     output_.AttachAudioBuffer(audioBuffer);
     input_.AttachAudioBuffer(audioBuffer);
   }
 
   // TODO(henrika): remove
   int32_t SetPlayoutSampleRate(const uint32_t samplesPerSec) override {
-    FATAL() << "Should never be called";
+    LOG(INFO) << __FUNCTION__;
     return -1;
   }
 
   int32_t SetLoudspeakerStatus(bool enable) override {
-    FATAL() << "Should never be called";
+    LOG(INFO) << __FUNCTION__;
     return -1;
   }
 
   int32_t GetLoudspeakerStatus(bool& enable) const override {
-    FATAL() << "Should never be called";
+    LOG(INFO) << __FUNCTION__;
     return -1;
   }
 
   // Returns true if the device both supports built in AEC and the device
   // is not blacklisted.
   // Currently, if OpenSL ES is used in both directions, this method will still
   // report the correct value and it has the correct effect. As an example:
   // a device supports built in AEC and this method returns true. Libjingle