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

@ -24,28 +24,28 @@ namespace {
// 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 @@ bool CodecManager::RegisterEncoder(const CodecInst& send_codec) {
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 @@ bool CodecManager::RegisterEncoder(const CodecInst& send_codec) {
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 @@ CodecInst CodecManager::ForgeCodecInst(
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 @@ bool CodecManager::SetVAD(bool enable, ACMVADMode mode) {
? (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::SetVAD(bool enable, ACMVADMode mode) {
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;
}