Introduce RTC_CHECK_NOTREACHED(), an always-checking RTC_NOTREACHED()

And use it in a few places that were using RTC_CHECK(false) or FATAL()
to do the exact same job. There should be no change in behavior.

Bug: none
Change-Id: I36d5e6bcf35fd41534e08a8c879fa0811b4f1967
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/191963
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32567}
This commit is contained in:
Karl Wiberg
2020-11-08 00:49:37 +01:00
committed by Commit Bot
parent 9dfe2fce9a
commit c95b939667
42 changed files with 168 additions and 177 deletions

View File

@ -151,15 +151,13 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
int32_t PlayoutDeviceName(uint16_t index,
char name[kAdmMaxDeviceNameSize],
char guid[kAdmMaxGuidSize]) override {
FATAL() << "Should never be called";
return -1;
RTC_CHECK_NOTREACHED();
}
int32_t RecordingDeviceName(uint16_t index,
char name[kAdmMaxDeviceNameSize],
char guid[kAdmMaxGuidSize]) override {
FATAL() << "Should never be called";
return -1;
RTC_CHECK_NOTREACHED();
}
int32_t SetPlayoutDevice(uint16_t index) override {
@ -171,8 +169,7 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
int32_t SetPlayoutDevice(
AudioDeviceModule::WindowsDeviceType device) override {
FATAL() << "Should never be called";
return -1;
RTC_CHECK_NOTREACHED();
}
int32_t SetRecordingDevice(uint16_t index) override {
@ -184,8 +181,7 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
int32_t SetRecordingDevice(
AudioDeviceModule::WindowsDeviceType device) override {
FATAL() << "Should never be called";
return -1;
RTC_CHECK_NOTREACHED();
}
int32_t PlayoutIsAvailable(bool* available) override {
@ -396,62 +392,52 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
int32_t SetMicrophoneVolume(uint32_t volume) override {
RTC_LOG(INFO) << __FUNCTION__ << "(" << volume << ")";
FATAL() << "Should never be called";
return -1;
RTC_CHECK_NOTREACHED();
}
int32_t MicrophoneVolume(uint32_t* volume) const override {
RTC_LOG(INFO) << __FUNCTION__;
FATAL() << "Should never be called";
return -1;
RTC_CHECK_NOTREACHED();
}
int32_t MaxMicrophoneVolume(uint32_t* maxVolume) const override {
RTC_LOG(INFO) << __FUNCTION__;
FATAL() << "Should never be called";
return -1;
RTC_CHECK_NOTREACHED();
}
int32_t MinMicrophoneVolume(uint32_t* minVolume) const override {
RTC_LOG(INFO) << __FUNCTION__;
FATAL() << "Should never be called";
return -1;
RTC_CHECK_NOTREACHED();
}
int32_t SpeakerMuteIsAvailable(bool* available) override {
RTC_LOG(INFO) << __FUNCTION__;
FATAL() << "Should never be called";
return -1;
RTC_CHECK_NOTREACHED();
}
int32_t SetSpeakerMute(bool enable) override {
RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
FATAL() << "Should never be called";
return -1;
RTC_CHECK_NOTREACHED();
}
int32_t SpeakerMute(bool* enabled) const override {
RTC_LOG(INFO) << __FUNCTION__;
FATAL() << "Should never be called";
return -1;
RTC_CHECK_NOTREACHED();
}
int32_t MicrophoneMuteIsAvailable(bool* available) override {
RTC_LOG(INFO) << __FUNCTION__;
FATAL() << "Not implemented";
return -1;
RTC_CHECK_NOTREACHED();
}
int32_t SetMicrophoneMute(bool enable) override {
RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
FATAL() << "Not implemented";
return -1;
RTC_CHECK_NOTREACHED();
}
int32_t MicrophoneMute(bool* enabled) const override {
RTC_LOG(INFO) << __FUNCTION__;
FATAL() << "Not implemented";
return -1;
RTC_CHECK_NOTREACHED();
}
int32_t StereoPlayoutIsAvailable(bool* available) const override {
@ -569,8 +555,7 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
int32_t EnableBuiltInAGC(bool enable) override {
RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
FATAL() << "HW AGC is not available";
return -1;
RTC_CHECK_NOTREACHED();
}
// TODO(henrika): add implementation for OpenSL ES based audio as well.