Rename FATAL() into RTC_FATAL().
No-Try: True Bug: webrtc:8454 Change-Id: I9130487a92463a2128cf1493e6c5117b2fab313a Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/193703 Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#32620}
This commit is contained in:

committed by
Commit Bot

parent
11ab77d14f
commit
9653d26f8e
@ -56,9 +56,10 @@ void RemixAndResample(const int16_t* src_data,
|
|||||||
|
|
||||||
if (resampler->InitializeIfNeeded(sample_rate_hz, dst_frame->sample_rate_hz_,
|
if (resampler->InitializeIfNeeded(sample_rate_hz, dst_frame->sample_rate_hz_,
|
||||||
audio_ptr_num_channels) == -1) {
|
audio_ptr_num_channels) == -1) {
|
||||||
FATAL() << "InitializeIfNeeded failed: sample_rate_hz = " << sample_rate_hz
|
RTC_FATAL() << "InitializeIfNeeded failed: sample_rate_hz = "
|
||||||
<< ", dst_frame->sample_rate_hz_ = " << dst_frame->sample_rate_hz_
|
<< sample_rate_hz << ", dst_frame->sample_rate_hz_ = "
|
||||||
<< ", audio_ptr_num_channels = " << audio_ptr_num_channels;
|
<< dst_frame->sample_rate_hz_
|
||||||
|
<< ", audio_ptr_num_channels = " << audio_ptr_num_channels;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(yujo): for muted input frames, don't resample. Either 1) allow
|
// TODO(yujo): for muted input frames, don't resample. Either 1) allow
|
||||||
@ -70,9 +71,10 @@ void RemixAndResample(const int16_t* src_data,
|
|||||||
resampler->Resample(audio_ptr, src_length, dst_frame->mutable_data(),
|
resampler->Resample(audio_ptr, src_length, dst_frame->mutable_data(),
|
||||||
AudioFrame::kMaxDataSizeSamples);
|
AudioFrame::kMaxDataSizeSamples);
|
||||||
if (out_length == -1) {
|
if (out_length == -1) {
|
||||||
FATAL() << "Resample failed: audio_ptr = " << audio_ptr
|
RTC_FATAL() << "Resample failed: audio_ptr = " << audio_ptr
|
||||||
<< ", src_length = " << src_length
|
<< ", src_length = " << src_length
|
||||||
<< ", dst_frame->mutable_data() = " << dst_frame->mutable_data();
|
<< ", dst_frame->mutable_data() = "
|
||||||
|
<< dst_frame->mutable_data();
|
||||||
}
|
}
|
||||||
dst_frame->samples_per_channel_ = out_length / audio_ptr_num_channels;
|
dst_frame->samples_per_channel_ = out_length / audio_ptr_num_channels;
|
||||||
|
|
||||||
|
@ -266,8 +266,7 @@ rtc::scoped_refptr<PlanarYuvBuffer> WrapYuvBuffer(
|
|||||||
return WrapI444Buffer(width, height, y_plane, y_stride, u_plane, u_stride,
|
return WrapI444Buffer(width, height, y_plane, y_stride, u_plane, u_stride,
|
||||||
v_plane, v_stride, no_longer_used);
|
v_plane, v_stride, no_longer_used);
|
||||||
default:
|
default:
|
||||||
FATAL() << "Unexpected frame buffer type.";
|
RTC_CHECK_NOTREACHED();
|
||||||
return nullptr;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,9 +171,8 @@ AudioEncoder::EncodedInfo AudioEncoderCng::EncodeImpl(
|
|||||||
last_frame_active_ = true;
|
last_frame_active_ = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Vad::kError: {
|
default: {
|
||||||
FATAL(); // Fails only if fed invalid data.
|
RTC_CHECK_NOTREACHED();
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,12 +51,12 @@ void DefaultNetEqTestErrorCallback::OnInsertPacketError(
|
|||||||
const NetEqInput::PacketData& packet) {
|
const NetEqInput::PacketData& packet) {
|
||||||
std::cerr << "InsertPacket returned an error." << std::endl;
|
std::cerr << "InsertPacket returned an error." << std::endl;
|
||||||
std::cerr << "Packet data: " << packet.ToString() << std::endl;
|
std::cerr << "Packet data: " << packet.ToString() << std::endl;
|
||||||
FATAL();
|
RTC_FATAL();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DefaultNetEqTestErrorCallback::OnGetAudioError() {
|
void DefaultNetEqTestErrorCallback::OnGetAudioError() {
|
||||||
std::cerr << "GetAudio returned an error." << std::endl;
|
std::cerr << "GetAudio returned an error." << std::endl;
|
||||||
FATAL();
|
RTC_FATAL();
|
||||||
}
|
}
|
||||||
|
|
||||||
NetEqTest::NetEqTest(const NetEq::Config& config,
|
NetEqTest::NetEqTest(const NetEq::Config& config,
|
||||||
|
@ -91,8 +91,9 @@ bool RtpFileSource::OpenFile(const std::string& file_name) {
|
|||||||
return true;
|
return true;
|
||||||
rtp_reader_.reset(RtpFileReader::Create(RtpFileReader::kPcap, file_name));
|
rtp_reader_.reset(RtpFileReader::Create(RtpFileReader::kPcap, file_name));
|
||||||
if (!rtp_reader_) {
|
if (!rtp_reader_) {
|
||||||
FATAL() << "Couldn't open input file as either a rtpdump or .pcap. Note "
|
RTC_FATAL()
|
||||||
"that .pcapng is not supported.";
|
<< "Couldn't open input file as either a rtpdump or .pcap. Note "
|
||||||
|
<< "that .pcapng is not supported.";
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ int main(int argc, char* argv[]) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FATAL() << kErrorMessage;
|
RTC_FATAL() << kErrorMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace test
|
} // namespace test
|
||||||
|
@ -43,8 +43,9 @@ WavBasedSimulator::GetCustomEventChain(const std::string& filename) {
|
|||||||
case '\n':
|
case '\n':
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
FATAL() << "Incorrect custom call order file, reverting to using the "
|
RTC_FATAL()
|
||||||
"default call order";
|
<< "Incorrect custom call order file, reverting to using the "
|
||||||
|
<< "default call order";
|
||||||
return WavBasedSimulator::GetDefaultEventChain();
|
return WavBasedSimulator::GetDefaultEventChain();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ RTC_NORETURN void rtc_FatalMessage(const char* file, int line, const char* msg);
|
|||||||
// messages if the condition doesn't hold. Prefer them to raw RTC_CHECK and
|
// messages if the condition doesn't hold. Prefer them to raw RTC_CHECK and
|
||||||
// RTC_DCHECK.
|
// RTC_DCHECK.
|
||||||
//
|
//
|
||||||
// - FATAL() aborts unconditionally.
|
// - RTC_FATAL() aborts unconditionally.
|
||||||
|
|
||||||
namespace rtc {
|
namespace rtc {
|
||||||
namespace webrtc_checks_impl {
|
namespace webrtc_checks_impl {
|
||||||
@ -454,8 +454,7 @@ RTC_NORETURN RTC_EXPORT void UnreachableCodeReached();
|
|||||||
RTC_UNREACHABLE_FILE_AND_LINE_CALL_ARGS); \
|
RTC_UNREACHABLE_FILE_AND_LINE_CALL_ARGS); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
// TODO(bugs.webrtc.org/8454): Add an RTC_ prefix or rename differently.
|
#define RTC_FATAL() \
|
||||||
#define FATAL() \
|
|
||||||
::rtc::webrtc_checks_impl::FatalLogCall<false>(__FILE__, __LINE__, \
|
::rtc::webrtc_checks_impl::FatalLogCall<false>(__FILE__, __LINE__, \
|
||||||
"FATAL()") & \
|
"FATAL()") & \
|
||||||
::rtc::webrtc_checks_impl::LogStreamer<>()
|
::rtc::webrtc_checks_impl::LogStreamer<>()
|
||||||
|
@ -21,7 +21,7 @@ TEST(ChecksTest, ExpressionNotEvaluatedWhenCheckPassing) {
|
|||||||
#if GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID)
|
#if GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID)
|
||||||
TEST(ChecksDeathTest, Checks) {
|
TEST(ChecksDeathTest, Checks) {
|
||||||
#if RTC_CHECK_MSG_ENABLED
|
#if RTC_CHECK_MSG_ENABLED
|
||||||
EXPECT_DEATH(FATAL() << "message",
|
EXPECT_DEATH(RTC_FATAL() << "message",
|
||||||
"\n\n#\n"
|
"\n\n#\n"
|
||||||
"# Fatal error in: \\S+, line \\w+\n"
|
"# Fatal error in: \\S+, line \\w+\n"
|
||||||
"# last system error: \\w+\n"
|
"# last system error: \\w+\n"
|
||||||
@ -45,7 +45,7 @@ TEST(ChecksDeathTest, Checks) {
|
|||||||
"# Check failed: false\n"
|
"# Check failed: false\n"
|
||||||
"# Hi there!");
|
"# Hi there!");
|
||||||
#else
|
#else
|
||||||
EXPECT_DEATH(FATAL() << "message",
|
EXPECT_DEATH(RTC_FATAL() << "message",
|
||||||
"\n\n#\n"
|
"\n\n#\n"
|
||||||
"# Fatal error in: \\S+, line \\w+\n"
|
"# Fatal error in: \\S+, line \\w+\n"
|
||||||
"# last system error: \\w+\n"
|
"# last system error: \\w+\n"
|
||||||
|
@ -87,10 +87,10 @@ class InterleavedRtpFileReader : public RtpFileReaderImpl {
|
|||||||
uint32_t len = 0;
|
uint32_t len = 0;
|
||||||
TRY(ReadUint32(&len, file_));
|
TRY(ReadUint32(&len, file_));
|
||||||
if (packet->length < len) {
|
if (packet->length < len) {
|
||||||
FATAL() << "Packet is too large to fit: " << len << " bytes vs "
|
RTC_FATAL() << "Packet is too large to fit: " << len << " bytes vs "
|
||||||
<< packet->length
|
<< packet->length
|
||||||
<< " bytes allocated. Consider increasing the buffer "
|
<< " bytes allocated. Consider increasing the buffer "
|
||||||
"size";
|
<< "size";
|
||||||
}
|
}
|
||||||
if (fread(packet->data, 1, len, file_) != len)
|
if (fread(packet->data, 1, len, file_) != len)
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user