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}
This commit is contained in:
Mirko Bonadei
2017-11-09 11:09:25 +01:00
committed by Commit Bot
parent 34fa309129
commit 675513b96a
407 changed files with 5753 additions and 5371 deletions

View File

@ -106,11 +106,11 @@ NetEqImpl::NetEqImpl(const NetEq::Config& config,
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 @@ int NetEqImpl::RegisterPayloadType(NetEqDecoder codec,
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 @@ int NetEqImpl::RegisterExternalDecoder(AudioDecoder* decoder,
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 @@ int NetEqImpl::RegisterExternalDecoder(AudioDecoder* decoder,
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 @@ int NetEqImpl::SetTargetSampleRate() {
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 @@ int NetEqImpl::InsertPacketInternal(const RTPHeader& rtp_header,
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 @@ int NetEqImpl::InsertPacketInternal(const RTPHeader& rtp_header,
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 @@ int NetEqImpl::GetAudioInternal(AudioFrame* audio_frame, bool* muted) {
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 @@ int NetEqImpl::GetAudioInternal(AudioFrame* audio_frame, bool* muted) {
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 @@ int NetEqImpl::GetAudioInternal(AudioFrame* audio_frame, bool* muted) {
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 @@ int NetEqImpl::GetDecision(Operations* operation,
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 @@ int NetEqImpl::Decode(PacketList* packet_list, Operations* operation,
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 @@ int NetEqImpl::Decode(PacketList* packet_list, Operations* operation,
->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 @@ int NetEqImpl::Decode(PacketList* packet_list, Operations* operation,
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 @@ int NetEqImpl::DecodeCng(AudioDecoder* decoder, int* decoded_length,
*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 @@ int NetEqImpl::DecodeLoop(PacketList* packet_list, const Operations& operation,
} 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 @@ int NetEqImpl::DoRfc3389Cng(PacketList* packet_list, bool play_dtmf) {
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 @@ int NetEqImpl::DoRfc3389Cng(PacketList* packet_list, bool play_dtmf) {
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 @@ int NetEqImpl::DoDtmf(const DtmfEvent& dtmf_event, bool* play_dtmf) {
// // 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 @@ int NetEqImpl::ExtractPackets(size_t required_samples,
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 @@ int NetEqImpl::ExtractPackets(size_t required_samples,
// |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 @@ int NetEqImpl::ExtractPackets(size_t required_samples,
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::UpdatePlcComponents(int fs_hz, size_t channels) {
}
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);