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>();
}
diff --git a/modules/audio_coding/codecs/ilbc/audio_decoder_ilbc.cc b/modules/audio_coding/codecs/ilbc/audio_decoder_ilbc.cc
index 153b742..08d21f4 100644
--- a/modules/audio_coding/codecs/ilbc/audio_decoder_ilbc.cc
+++ b/modules/audio_coding/codecs/ilbc/audio_decoder_ilbc.cc
@@ -60,7 +60,8 @@
size_t bytes_per_frame;
int timestamps_per_frame;
if (payload.size() >= 950) {
- LOG(LS_WARNING) << "AudioDecoderIlbcImpl::ParsePayload: Payload too large";
+ RTC_LOG(LS_WARNING)
+ << "AudioDecoderIlbcImpl::ParsePayload: Payload too large";
return results;
}
if (payload.size() % 38 == 0) {
@@ -72,7 +73,8 @@
bytes_per_frame = 50;
timestamps_per_frame = 240;
} else {
- LOG(LS_WARNING) << "AudioDecoderIlbcImpl::ParsePayload: Invalid payload";
+ RTC_LOG(LS_WARNING)
+ << "AudioDecoderIlbcImpl::ParsePayload: Invalid payload";
return results;
}
diff --git a/modules/audio_coding/codecs/opus/audio_encoder_opus.cc b/modules/audio_coding/codecs/opus/audio_encoder_opus.cc
index 0a412b1..d5358bb 100644
--- a/modules/audio_coding/codecs/opus/audio_encoder_opus.cc
+++ b/modules/audio_coding/codecs/opus/audio_encoder_opus.cc
@@ -149,13 +149,13 @@
std::max(AudioEncoderOpusConfig::kMinBitrateBps,
std::min(*bitrate, AudioEncoderOpusConfig::kMaxBitrateBps));
if (bitrate != chosen_bitrate) {
- LOG(LS_WARNING) << "Invalid maxaveragebitrate " << *bitrate
- << " clamped to " << chosen_bitrate;
+ RTC_LOG(LS_WARNING) << "Invalid maxaveragebitrate " << *bitrate
+ << " clamped to " << chosen_bitrate;
}
return chosen_bitrate;
}
- LOG(LS_WARNING) << "Invalid maxaveragebitrate \"" << *bitrate_param
- << "\" replaced by default bitrate " << default_bitrate;
+ RTC_LOG(LS_WARNING) << "Invalid maxaveragebitrate \"" << *bitrate_param
+ << "\" replaced by default bitrate " << default_bitrate;
}
return default_bitrate;
@@ -523,7 +523,7 @@
ApplyAudioNetworkAdaptor();
} else if (send_side_bwe_with_overhead_) {
if (!overhead_bytes_per_packet_) {
- LOG(LS_INFO)
+ RTC_LOG(LS_INFO)
<< "AudioEncoderOpusImpl: Overhead unknown, target audio bitrate "
<< target_audio_bitrate_bps << " bps is ignored.";
return;
diff --git a/modules/audio_coding/neteq/comfort_noise.cc b/modules/audio_coding/neteq/comfort_noise.cc
index d2635f3..5e0a875 100644
--- a/modules/audio_coding/neteq/comfort_noise.cc
+++ b/modules/audio_coding/neteq/comfort_noise.cc
@@ -42,7 +42,7 @@
fs_hz_ == 48000);
// Not adapted for multi-channel yet.
if (output->Channels() != 1) {
- LOG(LS_ERROR) << "No multi-channel support";
+ RTC_LOG(LS_ERROR) << "No multi-channel support";
return kMultiChannelNotSupported;
}
@@ -57,7 +57,7 @@
// Get the decoder from the database.
ComfortNoiseDecoder* cng_decoder = decoder_database_->GetActiveCngDecoder();
if (!cng_decoder) {
- LOG(LS_ERROR) << "Unknwown payload type";
+ RTC_LOG(LS_ERROR) << "Unknwown payload type";
return kUnknownPayloadType;
}
@@ -67,8 +67,8 @@
new_period)) {
// Error returned.
output->Zeros(requested_length);
- LOG(LS_ERROR) <<
- "ComfortNoiseDecoder::Genererate failed to generate comfort noise";
+ RTC_LOG(LS_ERROR)
+ << "ComfortNoiseDecoder::Genererate failed to generate comfort noise";
return kInternalError;
}
(*output)[0].OverwriteAt(temp.get(), number_of_samples, 0);
diff --git a/modules/audio_coding/neteq/decoder_database.cc b/modules/audio_coding/neteq/decoder_database.cc
index bd0053b..743ca87 100644
--- a/modules/audio_coding/neteq/decoder_database.cc
+++ b/modules/audio_coding/neteq/decoder_database.cc
@@ -356,8 +356,8 @@
for (it = packet_list.begin(); it != packet_list.end(); ++it) {
if (!GetDecoderInfo(it->payload_type)) {
// Payload type is not found.
- LOG(LS_WARNING) << "CheckPayloadTypes: unknown RTP payload type "
- << static_cast<int>(it->payload_type);
+ RTC_LOG(LS_WARNING) << "CheckPayloadTypes: unknown RTP payload type "
+ << static_cast<int>(it->payload_type);
return kDecoderNotFound;
}
}
diff --git a/modules/audio_coding/neteq/delay_manager.cc b/modules/audio_coding/neteq/delay_manager.cc
index 44acf81..8c84cf0 100644
--- a/modules/audio_coding/neteq/delay_manager.cc
+++ b/modules/audio_coding/neteq/delay_manager.cc
@@ -299,7 +299,7 @@
int DelayManager::SetPacketAudioLength(int length_ms) {
if (length_ms <= 0) {
- LOG_F(LS_ERROR) << "length_ms = " << length_ms;
+ RTC_LOG_F(LS_ERROR) << "length_ms = " << length_ms;
return -1;
}
if (frame_length_change_experiment_ && packet_len_ms_ != length_ms) {
@@ -353,7 +353,7 @@
// class. They are computed from |target_level_| and used for decision making.
void DelayManager::BufferLimits(int* lower_limit, int* higher_limit) const {
if (!lower_limit || !higher_limit) {
- LOG_F(LS_ERROR) << "NULL pointers supplied as input";
+ RTC_LOG_F(LS_ERROR) << "NULL pointers supplied as input";
assert(false);
return;
}
diff --git a/modules/audio_coding/neteq/dtmf_buffer.cc b/modules/audio_coding/neteq/dtmf_buffer.cc
index b06de5e..370de42 100644
--- a/modules/audio_coding/neteq/dtmf_buffer.cc
+++ b/modules/audio_coding/neteq/dtmf_buffer.cc
@@ -73,7 +73,7 @@
RTC_CHECK(payload);
RTC_CHECK(event);
if (payload_length_bytes < 4) {
- LOG(LS_WARNING) << "ParseEvent payload too short";
+ RTC_LOG(LS_WARNING) << "ParseEvent payload too short";
return kPayloadTooShort;
}
@@ -101,7 +101,7 @@
if (event.event_no < 0 || event.event_no > 15 ||
event.volume < 0 || event.volume > 63 ||
event.duration <= 0 || event.duration > 65535) {
- LOG(LS_WARNING) << "InsertEvent invalid parameters";
+ RTC_LOG(LS_WARNING) << "InsertEvent invalid parameters";
return kInvalidEventParameters;
}
DtmfList::iterator it = buffer_.begin();
diff --git a/modules/audio_coding/neteq/neteq_impl.cc b/modules/audio_coding/neteq/neteq_impl.cc
index b7bc0da..089f6ca 100644
--- a/modules/audio_coding/neteq/neteq_impl.cc
+++ b/modules/audio_coding/neteq/neteq_impl.cc
@@ -106,11 +106,11 @@
enable_muted_state_(config.enable_muted_state),
use_dtx_delay_fix_(
field_trial::IsEnabled("WebRTC-NetEqOpusDtxDelayFix")) {
- LOG(LS_INFO) << "NetEq config: " << config.ToString();
+ RTC_LOG(LS_INFO) << "NetEq config: " << config.ToString();
int fs = config.sample_rate_hz;
if (fs != 8000 && fs != 16000 && fs != 32000 && fs != 48000) {
- LOG(LS_ERROR) << "Sample rate " << fs << " Hz not supported. " <<
- "Changing to 8000 Hz.";
+ RTC_LOG(LS_ERROR) << "Sample rate " << fs << " Hz not supported. "
+ << "Changing to 8000 Hz.";
fs = 8000;
}
delay_manager_->SetMaximumDelay(config.max_delay_ms);
@@ -229,9 +229,9 @@
const std::string& name,
uint8_t rtp_payload_type) {
rtc::CritScope lock(&crit_sect_);
- LOG(LS_VERBOSE) << "RegisterPayloadType "
- << static_cast<int>(rtp_payload_type) << " "
- << static_cast<int>(codec);
+ RTC_LOG(LS_VERBOSE) << "RegisterPayloadType "
+ << static_cast<int>(rtp_payload_type) << " "
+ << static_cast<int>(codec);
if (decoder_database_->RegisterPayload(rtp_payload_type, codec, name) !=
DecoderDatabase::kOK) {
return kFail;
@@ -244,11 +244,11 @@
const std::string& codec_name,
uint8_t rtp_payload_type) {
rtc::CritScope lock(&crit_sect_);
- LOG(LS_VERBOSE) << "RegisterExternalDecoder "
- << static_cast<int>(rtp_payload_type) << " "
- << static_cast<int>(codec);
+ RTC_LOG(LS_VERBOSE) << "RegisterExternalDecoder "
+ << static_cast<int>(rtp_payload_type) << " "
+ << static_cast<int>(codec);
if (!decoder) {
- LOG(LS_ERROR) << "Cannot register external decoder with NULL pointer";
+ RTC_LOG(LS_ERROR) << "Cannot register external decoder with NULL pointer";
assert(false);
return kFail;
}
@@ -261,8 +261,8 @@
bool NetEqImpl::RegisterPayloadType(int rtp_payload_type,
const SdpAudioFormat& audio_format) {
- LOG(LS_VERBOSE) << "NetEqImpl::RegisterPayloadType: payload type "
- << rtp_payload_type << ", codec " << audio_format;
+ RTC_LOG(LS_VERBOSE) << "NetEqImpl::RegisterPayloadType: payload type "
+ << rtp_payload_type << ", codec " << audio_format;
rtc::CritScope lock(&crit_sect_);
return decoder_database_->RegisterPayload(rtp_payload_type, audio_format) ==
DecoderDatabase::kOK;
@@ -476,7 +476,7 @@
void NetEqImpl::FlushBuffers() {
rtc::CritScope lock(&crit_sect_);
- LOG(LS_VERBOSE) << "FlushBuffers";
+ RTC_LOG(LS_VERBOSE) << "FlushBuffers";
packet_buffer_->Flush();
assert(sync_buffer_.get());
assert(expand_.get());
@@ -546,7 +546,7 @@
rtc::ArrayView<const uint8_t> payload,
uint32_t receive_timestamp) {
if (payload.empty()) {
- LOG_F(LS_ERROR) << "payload is empty";
+ RTC_LOG_F(LS_ERROR) << "payload is empty";
return kInvalidPointer;
}
@@ -686,7 +686,7 @@
const DecoderDatabase::DecoderInfo* info =
decoder_database_->GetDecoderInfo(packet.payload_type);
if (!info) {
- LOG(LS_WARNING) << "SplitAudio unknown payload type";
+ RTC_LOG(LS_WARNING) << "SplitAudio unknown payload type";
return kUnknownRtpPayloadType;
}
@@ -959,7 +959,7 @@
break;
}
case kUndefined: {
- LOG(LS_ERROR) << "Invalid operation kUndefined.";
+ RTC_LOG(LS_ERROR) << "Invalid operation kUndefined.";
assert(false); // This should not happen.
last_mode_ = kModeError;
return kInvalidOperation;
@@ -981,10 +981,10 @@
size_t num_output_samples_per_channel = output_size_samples_;
size_t num_output_samples = output_size_samples_ * sync_buffer_->Channels();
if (num_output_samples > AudioFrame::kMaxDataSizeSamples) {
- LOG(LS_WARNING) << "Output array is too short. "
- << AudioFrame::kMaxDataSizeSamples << " < "
- << output_size_samples_ << " * "
- << sync_buffer_->Channels();
+ RTC_LOG(LS_WARNING) << "Output array is too short. "
+ << AudioFrame::kMaxDataSizeSamples << " < "
+ << output_size_samples_ << " * "
+ << sync_buffer_->Channels();
num_output_samples = AudioFrame::kMaxDataSizeSamples;
num_output_samples_per_channel =
AudioFrame::kMaxDataSizeSamples / sync_buffer_->Channels();
@@ -1003,10 +1003,10 @@
missing_lookahead_samples);
}
if (audio_frame->samples_per_channel_ != output_size_samples_) {
- LOG(LS_ERROR) << "audio_frame->samples_per_channel_ ("
- << audio_frame->samples_per_channel_
- << ") != output_size_samples_ (" << output_size_samples_
- << ")";
+ RTC_LOG(LS_ERROR) << "audio_frame->samples_per_channel_ ("
+ << audio_frame->samples_per_channel_
+ << ") != output_size_samples_ (" << output_size_samples_
+ << ")";
// TODO(minyue): treatment of under-run, filling zeros
audio_frame->Mute();
return kSampleUnderrun;
@@ -1168,7 +1168,7 @@
timestamp_ = dtmf_event->timestamp;
} else {
if (!packet) {
- LOG(LS_ERROR) << "Packet missing where it shouldn't.";
+ RTC_LOG(LS_ERROR) << "Packet missing where it shouldn't.";
return -1;
}
timestamp_ = packet->timestamp;
@@ -1346,8 +1346,8 @@
decoder = decoder_database_->GetDecoder(payload_type);
assert(decoder);
if (!decoder) {
- LOG(LS_WARNING) << "Unknown payload type "
- << static_cast<int>(payload_type);
+ RTC_LOG(LS_WARNING)
+ << "Unknown payload type " << static_cast<int>(payload_type);
packet_list->clear();
return kDecoderNotFound;
}
@@ -1359,8 +1359,8 @@
->GetDecoderInfo(payload_type);
assert(decoder_info);
if (!decoder_info) {
- LOG(LS_WARNING) << "Unknown payload type "
- << static_cast<int>(payload_type);
+ RTC_LOG(LS_WARNING)
+ << "Unknown payload type " << static_cast<int>(payload_type);
packet_list->clear();
return kDecoderNotFound;
}
@@ -1417,11 +1417,11 @@
if (error_code != 0) {
// Got some error code from the decoder.
return_value = kDecoderErrorCode;
- LOG(LS_WARNING) << "Decoder returned error code: " << error_code;
+ RTC_LOG(LS_WARNING) << "Decoder returned error code: " << error_code;
} else {
// Decoder does not implement error codes. Return generic error.
return_value = kOtherDecoderError;
- LOG(LS_WARNING) << "Decoder error (no error code)";
+ RTC_LOG(LS_WARNING) << "Decoder error (no error code)";
}
*operation = kExpand; // Do expansion to get data instead.
}
@@ -1454,13 +1454,13 @@
*decoded_length += length;
} else {
// Error.
- LOG(LS_WARNING) << "Failed to decode CNG";
+ RTC_LOG(LS_WARNING) << "Failed to decode CNG";
*decoded_length = -1;
break;
}
if (*decoded_length > static_cast<int>(decoded_buffer_length_)) {
// Guard against overflow.
- LOG(LS_WARNING) << "Decoded too much CNG.";
+ RTC_LOG(LS_WARNING) << "Decoded too much CNG.";
return kDecodedTooMuch;
}
}
@@ -1502,14 +1502,14 @@
} else {
// Error.
// TODO(ossu): What to put here?
- LOG(LS_WARNING) << "Decode error";
+ RTC_LOG(LS_WARNING) << "Decode error";
*decoded_length = -1;
packet_list->clear();
break;
}
if (*decoded_length > rtc::dchecked_cast<int>(decoded_buffer_length_)) {
// Guard against overflow.
- LOG(LS_WARNING) << "Decoded too much.";
+ RTC_LOG(LS_WARNING) << "Decoded too much.";
packet_list->clear();
return kDecodedTooMuch;
}
@@ -1765,7 +1765,7 @@
assert(packet_list->size() == 1);
const Packet& packet = packet_list->front();
if (!decoder_database_->IsComfortNoise(packet.payload_type)) {
- LOG(LS_ERROR) << "Trying to decode non-CNG payload as CNG.";
+ RTC_LOG(LS_ERROR) << "Trying to decode non-CNG payload as CNG.";
return kOtherError;
}
if (comfort_noise_->UpdateParameters(packet) ==
@@ -1782,8 +1782,8 @@
dtmf_tone_generator_->Reset();
}
if (cn_return == ComfortNoise::kInternalError) {
- LOG(LS_WARNING) << "Comfort noise generator returned error code: "
- << comfort_noise_->internal_error_code();
+ RTC_LOG(LS_WARNING) << "Comfort noise generator returned error code: "
+ << comfort_noise_->internal_error_code();
return kComfortNoiseErrorCode;
} else if (cn_return == ComfortNoise::kUnknownPayloadType) {
return kUnknownRtpPayloadType;
@@ -1864,7 +1864,7 @@
// // Not adapted for multi-channel yet.
// assert(algorithm_buffer_->Channels() == 1);
// if (algorithm_buffer_->Channels() != 1) {
- // LOG(LS_WARNING) << "DTMF not supported for more than one channel";
+ // RTC_LOG(LS_WARNING) << "DTMF not supported for more than one channel";
// return kStereoNotSupported;
// }
// // Shuffle the remaining data to the beginning of algorithm buffer.
@@ -1943,7 +1943,7 @@
const Packet* next_packet = packet_buffer_->PeekNextPacket();
RTC_DCHECK(next_packet);
if (!next_packet) {
- LOG(LS_ERROR) << "Packet buffer unexpectedly empty.";
+ RTC_LOG(LS_ERROR) << "Packet buffer unexpectedly empty.";
return -1;
}
uint32_t first_timestamp = next_packet->timestamp;
@@ -1956,7 +1956,7 @@
// |next_packet| may be invalid after the |packet_buffer_| operation.
next_packet = nullptr;
if (!packet) {
- LOG(LS_ERROR) << "Should always be able to extract a packet here";
+ RTC_LOG(LS_ERROR) << "Should always be able to extract a packet here";
assert(false); // Should always be able to extract a packet here.
return -1;
}
@@ -1989,8 +1989,8 @@
rtc::dchecked_cast<int>(packet_duration));
}
} else if (!has_cng_packet) {
- LOG(LS_WARNING) << "Unknown payload type "
- << static_cast<int>(packet->payload_type);
+ RTC_LOG(LS_WARNING) << "Unknown payload type "
+ << static_cast<int>(packet->payload_type);
RTC_NOTREACHED();
}
@@ -2043,7 +2043,8 @@
}
void NetEqImpl::SetSampleRateAndChannels(int fs_hz, size_t channels) {
- LOG(LS_VERBOSE) << "SetSampleRateAndChannels " << fs_hz << " " << channels;
+ RTC_LOG(LS_VERBOSE) << "SetSampleRateAndChannels " << fs_hz << " "
+ << channels;
// TODO(hlundin): Change to an enumerator and skip assert.
assert(fs_hz == 8000 || fs_hz == 16000 || fs_hz == 32000 || fs_hz == 48000);
assert(channels > 0);
diff --git a/modules/audio_coding/neteq/packet_buffer.cc b/modules/audio_coding/neteq/packet_buffer.cc
index b670c69..3005d43 100644
--- a/modules/audio_coding/neteq/packet_buffer.cc
+++ b/modules/audio_coding/neteq/packet_buffer.cc
@@ -80,7 +80,7 @@
int PacketBuffer::InsertPacket(Packet&& packet, StatisticsCalculator* stats) {
if (packet.empty()) {
- LOG(LS_WARNING) << "InsertPacket invalid packet";
+ RTC_LOG(LS_WARNING) << "InsertPacket invalid packet";
return kInvalidPacket;
}
@@ -94,7 +94,7 @@
if (buffer_.size() >= max_number_of_packets_) {
// Buffer is full. Flush it.
Flush();
- LOG(LS_WARNING) << "Packet buffer flushed";
+ RTC_LOG(LS_WARNING) << "Packet buffer flushed";
return_val = kFlushed;
}
diff --git a/modules/audio_coding/neteq/red_payload_splitter.cc b/modules/audio_coding/neteq/red_payload_splitter.cc
index 74822dd..dd10212 100644
--- a/modules/audio_coding/neteq/red_payload_splitter.cc
+++ b/modules/audio_coding/neteq/red_payload_splitter.cc
@@ -100,7 +100,7 @@
// The block lengths in the RED headers do not match the overall
// packet length. Something is corrupt. Discard this and the remaining
// payloads from this packet.
- LOG(LS_WARNING) << "SplitRed length mismatch";
+ RTC_LOG(LS_WARNING) << "SplitRed length mismatch";
ret = false;
break;
}
@@ -119,7 +119,7 @@
// iterator |it|.
packet_list->splice(it, std::move(new_packets));
} else {
- LOG(LS_WARNING) << "SplitRed too many blocks: " << new_headers.size();
+ RTC_LOG(LS_WARNING) << "SplitRed too many blocks: " << new_headers.size();
ret = false;
}
// Remove |it| from the packet list. This operation effectively moves the
diff --git a/modules/audio_coding/test/TestAllCodecs.cc b/modules/audio_coding/test/TestAllCodecs.cc
index f7f220f..3a968c9 100644
--- a/modules/audio_coding/test/TestAllCodecs.cc
+++ b/modules/audio_coding/test/TestAllCodecs.cc
@@ -127,7 +127,7 @@
infile_a_.Open(file_name, 32000, "rb");
if (test_mode_ == 0) {
- LOG(LS_INFO) << "---------- TestAllCodecs ----------";
+ RTC_LOG(LS_INFO) << "---------- TestAllCodecs ----------";
}
acm_a_->InitializeReceiver();