Stop using LOG macros in favor of RTC_ prefixed macros.
This CL has been generated with the following script:
for m in PLOG \
LOG_TAG \
LOG_GLEM \
LOG_GLE_EX \
LOG_GLE \
LAST_SYSTEM_ERROR \
LOG_ERRNO_EX \
LOG_ERRNO \
LOG_ERR_EX \
LOG_ERR \
LOG_V \
LOG_F \
LOG_T_F \
LOG_E \
LOG_T \
LOG_CHECK_LEVEL_V \
LOG_CHECK_LEVEL \
LOG
do
git grep -l $m | xargs sed -i "s,\b$m\b,RTC_$m,g"
done
git checkout rtc_base/logging.h
git cl format
Bug: webrtc:8452
Change-Id: I1a53ef3e0a5ef6e244e62b2e012b864914784600
Reviewed-on: https://webrtc-review.googlesource.com/21325
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20617}
diff --git a/modules/audio_coding/acm2/acm_receiver.cc b/modules/audio_coding/acm2/acm_receiver.cc
index 085e77a..360a583 100644
--- a/modules/audio_coding/acm2/acm_receiver.cc
+++ b/modules/audio_coding/acm2/acm_receiver.cc
@@ -46,14 +46,14 @@
int AcmReceiver::SetMinimumDelay(int delay_ms) {
if (neteq_->SetMinimumDelay(delay_ms))
return 0;
- LOG(LERROR) << "AcmReceiver::SetExtraDelay " << delay_ms;
+ RTC_LOG(LERROR) << "AcmReceiver::SetExtraDelay " << delay_ms;
return -1;
}
int AcmReceiver::SetMaximumDelay(int delay_ms) {
if (neteq_->SetMaximumDelay(delay_ms))
return 0;
- LOG(LERROR) << "AcmReceiver::SetExtraDelay " << delay_ms;
+ RTC_LOG(LERROR) << "AcmReceiver::SetExtraDelay " << delay_ms;
return -1;
}
@@ -86,9 +86,9 @@
const rtc::Optional<CodecInst> ci =
RtpHeaderToDecoder(*header, incoming_payload[0]);
if (!ci) {
- LOG_F(LS_ERROR) << "Payload-type "
- << static_cast<int>(header->payloadType)
- << " is not registered.";
+ RTC_LOG_F(LS_ERROR) << "Payload-type "
+ << static_cast<int>(header->payloadType)
+ << " is not registered.";
return -1;
}
receive_timestamp = NowInTimestamp(ci->plfreq);
@@ -109,9 +109,9 @@
if (neteq_->InsertPacket(rtp_header.header, incoming_payload,
receive_timestamp) < 0) {
- LOG(LERROR) << "AcmReceiver::InsertPacket "
- << static_cast<int>(header->payloadType)
- << " Failed to insert packet";
+ RTC_LOG(LERROR) << "AcmReceiver::InsertPacket "
+ << static_cast<int>(header->payloadType)
+ << " Failed to insert packet";
return -1;
}
return 0;
@@ -125,7 +125,7 @@
rtc::CritScope lock(&crit_sect_);
if (neteq_->GetAudio(audio_frame, muted) != NetEq::kOK) {
- LOG(LERROR) << "AcmReceiver::GetAudio - NetEq Failed.";
+ RTC_LOG(LERROR) << "AcmReceiver::GetAudio - NetEq Failed.";
return -1;
}
@@ -143,8 +143,8 @@
audio_frame->num_channels_, AudioFrame::kMaxDataSizeSamples,
temp_output);
if (samples_per_channel_int < 0) {
- LOG(LERROR) << "AcmReceiver::GetAudio - "
- "Resampling last_audio_buffer_ failed.";
+ RTC_LOG(LERROR) << "AcmReceiver::GetAudio - "
+ "Resampling last_audio_buffer_ failed.";
return -1;
}
}
@@ -158,7 +158,8 @@
audio_frame->num_channels_, AudioFrame::kMaxDataSizeSamples,
audio_frame->mutable_data());
if (samples_per_channel_int < 0) {
- LOG(LERROR) << "AcmReceiver::GetAudio - Resampling audio_buffer_ failed.";
+ RTC_LOG(LERROR)
+ << "AcmReceiver::GetAudio - Resampling audio_buffer_ failed.";
return -1;
}
audio_frame->samples_per_channel_ =
@@ -218,7 +219,8 @@
}
if (neteq_->RemovePayloadType(payload_type) != NetEq::kOK) {
- LOG(LERROR) << "Cannot remove payload " << static_cast<int>(payload_type);
+ RTC_LOG(LERROR) << "Cannot remove payload "
+ << static_cast<int>(payload_type);
return -1;
}
@@ -230,9 +232,9 @@
audio_decoder, neteq_decoder, name, payload_type);
}
if (ret_val != NetEq::kOK) {
- LOG(LERROR) << "AcmReceiver::AddCodec " << acm_codec_id
- << static_cast<int>(payload_type)
- << " channels: " << channels;
+ RTC_LOG(LERROR) << "AcmReceiver::AddCodec " << acm_codec_id
+ << static_cast<int>(payload_type)
+ << " channels: " << channels;
return -1;
}
return 0;
@@ -247,17 +249,18 @@
}
if (neteq_->RemovePayloadType(rtp_payload_type) != NetEq::kOK) {
- LOG(LERROR) << "AcmReceiver::AddCodec: Could not remove existing decoder"
- " for payload type "
- << rtp_payload_type;
+ RTC_LOG(LERROR)
+ << "AcmReceiver::AddCodec: Could not remove existing decoder"
+ " for payload type "
+ << rtp_payload_type;
return false;
}
const bool success =
neteq_->RegisterPayloadType(rtp_payload_type, audio_format);
if (!success) {
- LOG(LERROR) << "AcmReceiver::AddCodec failed for payload type "
- << rtp_payload_type << ", decoder format " << audio_format;
+ RTC_LOG(LERROR) << "AcmReceiver::AddCodec failed for payload type "
+ << rtp_payload_type << ", decoder format " << audio_format;
}
return success;
}
@@ -277,8 +280,8 @@
int AcmReceiver::RemoveCodec(uint8_t payload_type) {
rtc::CritScope lock(&crit_sect_);
if (neteq_->RemovePayloadType(payload_type) != NetEq::kOK) {
- LOG(LERROR) << "AcmReceiver::RemoveCodec "
- << static_cast<int>(payload_type);
+ RTC_LOG(LERROR) << "AcmReceiver::RemoveCodec "
+ << static_cast<int>(payload_type);
return -1;
}
if (last_audio_decoder_ && payload_type == last_audio_decoder_->pltype) {
@@ -348,8 +351,8 @@
*codec = *ci;
return 0;
} else {
- LOG(LERROR) << "AcmReceiver::DecoderByPayloadType "
- << static_cast<int>(payload_type);
+ RTC_LOG(LERROR) << "AcmReceiver::DecoderByPayloadType "
+ << static_cast<int>(payload_type);
return -1;
}
}
diff --git a/modules/audio_coding/acm2/acm_resampler.cc b/modules/audio_coding/acm2/acm_resampler.cc
index 3cd7caa..b97ced2 100644
--- a/modules/audio_coding/acm2/acm_resampler.cc
+++ b/modules/audio_coding/acm2/acm_resampler.cc
@@ -43,16 +43,18 @@
if (resampler_.InitializeIfNeeded(in_freq_hz, out_freq_hz,
num_audio_channels) != 0) {
- LOG(LS_ERROR) << "InitializeIfNeeded(" << in_freq_hz << ", " << out_freq_hz
- << ", " << num_audio_channels << ") failed.";
+ RTC_LOG(LS_ERROR) << "InitializeIfNeeded(" << in_freq_hz << ", "
+ << out_freq_hz << ", " << num_audio_channels
+ << ") failed.";
return -1;
}
int out_length =
resampler_.Resample(in_audio, in_length, out_audio, out_capacity_samples);
if (out_length == -1) {
- LOG(LS_ERROR) << "Resample(" << in_audio << ", " << in_length << ", "
- << out_audio << ", " << out_capacity_samples << ") failed.";
+ RTC_LOG(LS_ERROR) << "Resample(" << in_audio << ", " << in_length << ", "
+ << out_audio << ", " << out_capacity_samples
+ << ") failed.";
return -1;
}
diff --git a/modules/audio_coding/acm2/audio_coding_module.cc b/modules/audio_coding/acm2/audio_coding_module.cc
index 3320d1b..361278f 100644
--- a/modules/audio_coding/acm2/audio_coding_module.cc
+++ b/modules/audio_coding/acm2/audio_coding_module.cc
@@ -455,9 +455,9 @@
codec_histogram_bins_log_(),
number_of_consecutive_empty_packets_(0) {
if (InitializeReceiverSafe() < 0) {
- LOG(LS_ERROR) << "Cannot initialize receiver";
+ RTC_LOG(LS_ERROR) << "Cannot initialize receiver";
}
- LOG(LS_INFO) << "Created";
+ RTC_LOG(LS_INFO) << "Created";
}
AudioCodingModuleImpl::~AudioCodingModuleImpl() = default;
@@ -629,7 +629,7 @@
rtc::CritScope lock(&acm_crit_sect_);
if (!encoder_stack_) {
- LOG(LS_ERROR) << "SendFrequency Failed, no codec is registered";
+ RTC_LOG(LS_ERROR) << "SendFrequency Failed, no codec is registered";
return -1;
}
@@ -665,26 +665,26 @@
InputData* input_data) {
if (audio_frame.samples_per_channel_ == 0) {
assert(false);
- LOG(LS_ERROR) << "Cannot Add 10 ms audio, payload length is zero";
+ RTC_LOG(LS_ERROR) << "Cannot Add 10 ms audio, payload length is zero";
return -1;
}
if (audio_frame.sample_rate_hz_ > 48000) {
assert(false);
- LOG(LS_ERROR) << "Cannot Add 10 ms audio, input frequency not valid";
+ RTC_LOG(LS_ERROR) << "Cannot Add 10 ms audio, input frequency not valid";
return -1;
}
// If the length and frequency matches. We currently just support raw PCM.
if (static_cast<size_t>(audio_frame.sample_rate_hz_ / 100) !=
audio_frame.samples_per_channel_) {
- LOG(LS_ERROR)
+ RTC_LOG(LS_ERROR)
<< "Cannot Add 10 ms audio, input frequency and length doesn't match";
return -1;
}
if (audio_frame.num_channels_ != 1 && audio_frame.num_channels_ != 2) {
- LOG(LS_ERROR) << "Cannot Add 10 ms audio, invalid number of channels.";
+ RTC_LOG(LS_ERROR) << "Cannot Add 10 ms audio, invalid number of channels.";
return -1;
}
@@ -757,8 +757,8 @@
expected_codec_ts_ = in_frame.timestamp_;
first_10ms_data_ = true;
} else if (in_frame.timestamp_ != expected_in_ts_) {
- LOG(LS_WARNING) << "Unexpected input timestamp: " << in_frame.timestamp_
- << ", expected: " << expected_in_ts_;
+ RTC_LOG(LS_WARNING) << "Unexpected input timestamp: " << in_frame.timestamp_
+ << ", expected: " << expected_in_ts_;
expected_codec_ts_ +=
(in_frame.timestamp_ - expected_in_ts_) *
static_cast<uint32_t>(
@@ -816,7 +816,7 @@
dest_ptr_audio);
if (samples_per_channel < 0) {
- LOG(LS_ERROR) << "Cannot add 10 ms audio, resampling failed";
+ RTC_LOG(LS_ERROR) << "Cannot add 10 ms audio, resampling failed";
return -1;
}
preprocess_frame_.samples_per_channel_ =
@@ -853,7 +853,7 @@
encoder_stack_ = encoder_factory_->rent_a_codec.RentEncoderStack(sp);
return 0;
#else
- LOG(LS_WARNING) << " WEBRTC_CODEC_RED is undefined";
+ RTC_LOG(LS_WARNING) << " WEBRTC_CODEC_RED is undefined";
return -1;
#endif
}
@@ -971,8 +971,8 @@
RTC_DCHECK(receiver_initialized_);
if (!acm2::RentACodec::IsPayloadTypeValid(rtp_payload_type)) {
- LOG_F(LS_ERROR) << "Invalid payload-type " << rtp_payload_type
- << " for decoder.";
+ RTC_LOG_F(LS_ERROR) << "Invalid payload-type " << rtp_payload_type
+ << " for decoder.";
return false;
}
@@ -998,14 +998,15 @@
rtc::FunctionView<std::unique_ptr<AudioDecoder>()> isac_factory) {
RTC_DCHECK(receiver_initialized_);
if (codec.channels > 2) {
- LOG_F(LS_ERROR) << "Unsupported number of channels: " << codec.channels;
+ RTC_LOG_F(LS_ERROR) << "Unsupported number of channels: " << codec.channels;
return -1;
}
auto codec_id = acm2::RentACodec::CodecIdByParams(codec.plname, codec.plfreq,
codec.channels);
if (!codec_id) {
- LOG_F(LS_ERROR) << "Wrong codec params to be registered as receive codec";
+ RTC_LOG_F(LS_ERROR)
+ << "Wrong codec params to be registered as receive codec";
return -1;
}
auto codec_index = acm2::RentACodec::CodecIndexFromId(*codec_id);
@@ -1013,8 +1014,8 @@
// Check if the payload-type is valid.
if (!acm2::RentACodec::IsPayloadTypeValid(codec.pltype)) {
- LOG_F(LS_ERROR) << "Invalid payload type " << codec.pltype << " for "
- << codec.plname;
+ RTC_LOG_F(LS_ERROR) << "Invalid payload type " << codec.pltype << " for "
+ << codec.plname;
return -1;
}
@@ -1040,14 +1041,14 @@
rtc::CritScope lock(&acm_crit_sect_);
RTC_DCHECK(receiver_initialized_);
if (num_channels > 2 || num_channels < 0) {
- LOG_F(LS_ERROR) << "Unsupported number of channels: " << num_channels;
+ RTC_LOG_F(LS_ERROR) << "Unsupported number of channels: " << num_channels;
return -1;
}
// Check if the payload-type is valid.
if (!acm2::RentACodec::IsPayloadTypeValid(rtp_payload_type)) {
- LOG_F(LS_ERROR) << "Invalid payload-type " << rtp_payload_type
- << " for external decoder.";
+ RTC_LOG_F(LS_ERROR) << "Invalid payload-type " << rtp_payload_type
+ << " for external decoder.";
return -1;
}
@@ -1079,7 +1080,7 @@
// Minimum playout delay (Used for lip-sync).
int AudioCodingModuleImpl::SetMinimumPlayoutDelay(int time_ms) {
if ((time_ms < 0) || (time_ms > 10000)) {
- LOG(LS_ERROR) << "Delay must be in the range of 0-10000 milliseconds.";
+ RTC_LOG(LS_ERROR) << "Delay must be in the range of 0-10000 milliseconds.";
return -1;
}
return receiver_.SetMinimumDelay(time_ms);
@@ -1087,7 +1088,7 @@
int AudioCodingModuleImpl::SetMaximumPlayoutDelay(int time_ms) {
if ((time_ms < 0) || (time_ms > 10000)) {
- LOG(LS_ERROR) << "Delay must be in the range of 0-10000 milliseconds.";
+ RTC_LOG(LS_ERROR) << "Delay must be in the range of 0-10000 milliseconds.";
return -1;
}
return receiver_.SetMaximumDelay(time_ms);
@@ -1100,7 +1101,7 @@
bool* muted) {
// GetAudio always returns 10 ms, at the requested sample rate.
if (receiver_.GetAudio(desired_freq_hz, audio_frame, muted) != 0) {
- LOG(LS_ERROR) << "PlayoutData failed, RecOut Failed";
+ RTC_LOG(LS_ERROR) << "PlayoutData failed, RecOut Failed";
return -1;
}
return 0;
@@ -1126,7 +1127,7 @@
}
int AudioCodingModuleImpl::RegisterVADCallback(ACMVADCallback* vad_callback) {
- LOG(LS_VERBOSE) << "RegisterVADCallback()";
+ RTC_LOG(LS_VERBOSE) << "RegisterVADCallback()";
rtc::CritScope lock(&callback_crit_sect_);
vad_callback_ = vad_callback;
return 0;
@@ -1196,7 +1197,7 @@
bool AudioCodingModuleImpl::HaveValidEncoder(const char* caller_name) const {
if (!encoder_stack_) {
- LOG(LS_ERROR) << caller_name << " failed: No send codec is registered.";
+ RTC_LOG(LS_ERROR) << caller_name << " failed: No send codec is registered.";
return false;
}
return true;
@@ -1331,7 +1332,7 @@
bool AudioCodingModule::IsCodecValid(const CodecInst& codec) {
bool valid = acm2::RentACodec::IsCodecValid(codec);
if (!valid)
- LOG(LS_ERROR) << "Invalid codec setting";
+ RTC_LOG(LS_ERROR) << "Invalid codec setting";
return valid;
}
diff --git a/modules/audio_coding/acm2/codec_manager.cc b/modules/audio_coding/acm2/codec_manager.cc
index 2b3303b..50ef9ef 100644
--- a/modules/audio_coding/acm2/codec_manager.cc
+++ b/modules/audio_coding/acm2/codec_manager.cc
@@ -24,28 +24,28 @@
// Check if the given codec is a valid to be registered as send codec.
int IsValidSendCodec(const CodecInst& send_codec) {
if ((send_codec.channels != 1) && (send_codec.channels != 2)) {
- LOG(LS_ERROR) << "Wrong number of channels (" << send_codec.channels
- << "), only mono and stereo are supported)";
+ RTC_LOG(LS_ERROR) << "Wrong number of channels (" << send_codec.channels
+ << "), only mono and stereo are supported)";
return -1;
}
auto maybe_codec_id = RentACodec::CodecIdByInst(send_codec);
if (!maybe_codec_id) {
- LOG(LS_ERROR) << "Invalid codec setting for the send codec.";
+ RTC_LOG(LS_ERROR) << "Invalid codec setting for the send codec.";
return -1;
}
// Telephone-event cannot be a send codec.
if (!STR_CASE_CMP(send_codec.plname, "telephone-event")) {
- LOG(LS_ERROR) << "telephone-event cannot be a send codec";
+ RTC_LOG(LS_ERROR) << "telephone-event cannot be a send codec";
return -1;
}
if (!RentACodec::IsSupportedNumChannels(*maybe_codec_id, send_codec.channels)
.value_or(false)) {
- LOG(LS_ERROR) << send_codec.channels
- << " number of channels not supported for "
- << send_codec.plname << ".";
+ RTC_LOG(LS_ERROR) << send_codec.channels
+ << " number of channels not supported for "
+ << send_codec.plname << ".";
return -1;
}
return RentACodec::CodecIndexFromId(*maybe_codec_id).value_or(-1);
@@ -81,8 +81,9 @@
case RentACodec::RegistrationResult::kOk:
return true;
case RentACodec::RegistrationResult::kBadFreq:
- LOG(LS_ERROR) << "RegisterSendCodec() failed, invalid frequency for RED"
- " registration";
+ RTC_LOG(LS_ERROR)
+ << "RegisterSendCodec() failed, invalid frequency for RED"
+ " registration";
return false;
case RentACodec::RegistrationResult::kSkip:
break;
@@ -92,8 +93,9 @@
case RentACodec::RegistrationResult::kOk:
return true;
case RentACodec::RegistrationResult::kBadFreq:
- LOG(LS_ERROR) << "RegisterSendCodec() failed, invalid frequency for CNG"
- " registration";
+ RTC_LOG(LS_ERROR)
+ << "RegisterSendCodec() failed, invalid frequency for CNG"
+ " registration";
return false;
case RentACodec::RegistrationResult::kSkip:
break;
@@ -127,14 +129,14 @@
bool CodecManager::SetCopyRed(bool enable) {
if (enable && codec_stack_params_.use_codec_fec) {
- LOG(LS_WARNING) << "Codec internal FEC and RED cannot be co-enabled.";
+ RTC_LOG(LS_WARNING) << "Codec internal FEC and RED cannot be co-enabled.";
return false;
}
if (enable && send_codec_inst_ &&
codec_stack_params_.red_payload_types.count(send_codec_inst_->plfreq) <
1) {
- LOG(LS_WARNING) << "Cannot enable RED at " << send_codec_inst_->plfreq
- << " Hz.";
+ RTC_LOG(LS_WARNING) << "Cannot enable RED at " << send_codec_inst_->plfreq
+ << " Hz.";
return false;
}
codec_stack_params_.use_red = enable;
@@ -153,7 +155,7 @@
? (codec_stack_params_.speech_encoder->NumChannels() != 1)
: false;
if (enable && stereo_send) {
- LOG(LS_ERROR) << "VAD/DTX not supported for stereo sending";
+ RTC_LOG(LS_ERROR) << "VAD/DTX not supported for stereo sending";
return false;
}
@@ -171,7 +173,7 @@
bool CodecManager::SetCodecFEC(bool enable_codec_fec) {
if (enable_codec_fec && codec_stack_params_.use_red) {
- LOG(LS_WARNING) << "Codec internal FEC and RED cannot be co-enabled.";
+ RTC_LOG(LS_WARNING) << "Codec internal FEC and RED cannot be co-enabled.";
return false;
}
diff --git a/modules/audio_coding/acm2/rent_a_codec.cc b/modules/audio_coding/acm2/rent_a_codec.cc
index 120d54c..39efd96 100644
--- a/modules/audio_coding/acm2/rent_a_codec.cc
+++ b/modules/audio_coding/acm2/rent_a_codec.cc
@@ -175,7 +175,8 @@
#endif
if (STR_CASE_CMP(speech_inst.plname, "g722") == 0)
return std::unique_ptr<AudioEncoder>(new AudioEncoderG722Impl(speech_inst));
- LOG_F(LS_ERROR) << "Could not create encoder of type " << speech_inst.plname;
+ RTC_LOG_F(LS_ERROR) << "Could not create encoder of type "
+ << speech_inst.plname;
return std::unique_ptr<AudioEncoder>();
}