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

@ -50,7 +50,7 @@ std::unique_ptr<IvfFileWriter> IvfFileWriter::Wrap(rtc::File file,
bool IvfFileWriter::WriteHeader() {
if (!file_.Seek(0)) {
LOG(LS_WARNING) << "Unable to rewind ivf output file.";
RTC_LOG(LS_WARNING) << "Unable to rewind ivf output file.";
return false;
}
@ -82,7 +82,7 @@ bool IvfFileWriter::WriteHeader() {
ivf_header[11] = '4';
break;
default:
LOG(LS_ERROR) << "Unknown CODEC type: " << codec_type_;
RTC_LOG(LS_ERROR) << "Unknown CODEC type: " << codec_type_;
return false;
}
@ -98,7 +98,7 @@ bool IvfFileWriter::WriteHeader() {
ByteWriter<uint32_t>::WriteLittleEndian(&ivf_header[28], 0); // Reserved.
if (file_.Write(ivf_header, kIvfHeaderSize) < kIvfHeaderSize) {
LOG(LS_ERROR) << "Unable to write IVF header for ivf output file.";
RTC_LOG(LS_ERROR) << "Unable to write IVF header for ivf output file.";
return false;
}
@ -124,10 +124,11 @@ bool IvfFileWriter::InitFromFirstFrame(const EncodedImage& encoded_image,
const char* codec_name =
CodecTypeToPayloadString(codec_type_);
LOG(LS_WARNING) << "Created IVF file for codec data of type " << codec_name
<< " at resolution " << width_ << " x " << height_
<< ", using " << (using_capture_timestamps_ ? "1" : "90")
<< "kHz clock resolution.";
RTC_LOG(LS_WARNING) << "Created IVF file for codec data of type "
<< codec_name << " at resolution " << width_ << " x "
<< height_ << ", using "
<< (using_capture_timestamps_ ? "1" : "90")
<< "kHz clock resolution.";
return true;
}
@ -143,7 +144,7 @@ bool IvfFileWriter::WriteFrame(const EncodedImage& encoded_image,
if ((encoded_image._encodedWidth > 0 || encoded_image._encodedHeight > 0) &&
(encoded_image._encodedHeight != height_ ||
encoded_image._encodedWidth != width_)) {
LOG(LS_WARNING)
RTC_LOG(LS_WARNING)
<< "Incomig frame has diffferent resolution then previous: (" << width_
<< "x" << height_ << ") -> (" << encoded_image._encodedWidth << "x"
<< encoded_image._encodedHeight << ")";
@ -153,16 +154,16 @@ bool IvfFileWriter::WriteFrame(const EncodedImage& encoded_image,
? encoded_image.capture_time_ms_
: wrap_handler_.Unwrap(encoded_image._timeStamp);
if (last_timestamp_ != -1 && timestamp <= last_timestamp_) {
LOG(LS_WARNING) << "Timestamp no increasing: " << last_timestamp_ << " -> "
<< timestamp;
RTC_LOG(LS_WARNING) << "Timestamp no increasing: " << last_timestamp_
<< " -> " << timestamp;
}
last_timestamp_ = timestamp;
const size_t kFrameHeaderSize = 12;
if (byte_limit_ != 0 &&
bytes_written_ + kFrameHeaderSize + encoded_image._length > byte_limit_) {
LOG(LS_WARNING) << "Closing IVF file due to reaching size limit: "
<< byte_limit_ << " bytes.";
RTC_LOG(LS_WARNING) << "Closing IVF file due to reaching size limit: "
<< byte_limit_ << " bytes.";
Close();
return false;
}
@ -173,7 +174,7 @@ bool IvfFileWriter::WriteFrame(const EncodedImage& encoded_image,
if (file_.Write(frame_header, kFrameHeaderSize) < kFrameHeaderSize ||
file_.Write(encoded_image._buffer, encoded_image._length) <
encoded_image._length) {
LOG(LS_ERROR) << "Unable to write frame to file.";
RTC_LOG(LS_ERROR) << "Unable to write frame to file.";
return false;
}

View File

@ -73,13 +73,13 @@ static VideoEncoder::QpThresholds CodecTypeToDefaultThresholds(
class QualityScaler::CheckQPTask : public rtc::QueuedTask {
public:
explicit CheckQPTask(QualityScaler* scaler) : scaler_(scaler) {
LOG(LS_INFO) << "Created CheckQPTask. Scheduling on queue...";
RTC_LOG(LS_INFO) << "Created CheckQPTask. Scheduling on queue...";
rtc::TaskQueue::Current()->PostDelayedTask(
std::unique_ptr<rtc::QueuedTask>(this), scaler_->GetSamplingPeriodMs());
}
void Stop() {
RTC_DCHECK_CALLED_SEQUENTIALLY(&task_checker_);
LOG(LS_INFO) << "Stopping QP Check task.";
RTC_LOG(LS_INFO) << "Stopping QP Check task.";
stop_ = true;
}
@ -122,8 +122,8 @@ QualityScaler::QualityScaler(AdaptationObserverInterface* observer,
RTC_DCHECK_CALLED_SEQUENTIALLY(&task_checker_);
RTC_DCHECK(observer_ != nullptr);
check_qp_task_ = new CheckQPTask(this);
LOG(LS_INFO) << "QP thresholds: low: " << thresholds_.low
<< ", high: " << thresholds_.high;
RTC_LOG(LS_INFO) << "QP thresholds: low: " << thresholds_.low
<< ", high: " << thresholds_.high;
}
QualityScaler::~QualityScaler() {
@ -168,7 +168,7 @@ void QualityScaler::CheckQP() {
// Check if we should scale up or down based on QP.
const rtc::Optional<int> avg_qp = average_qp_.GetAverage();
if (avg_qp) {
LOG(LS_INFO) << "Checking average QP " << *avg_qp;
RTC_LOG(LS_INFO) << "Checking average QP " << *avg_qp;
if (*avg_qp > thresholds_.high) {
ReportQPHigh();
return;

View File

@ -162,7 +162,7 @@ static void ParseFilterHeader(VP8BitReader* br) {
bool GetQp(const uint8_t* buf, size_t length, int* qp) {
if (length < kCommonPayloadHeaderLength) {
LOG(LS_WARNING) << "Failed to get QP, invalid length.";
RTC_LOG(LS_WARNING) << "Failed to get QP, invalid length.";
return false;
}
VP8BitReader br;
@ -175,7 +175,7 @@ bool GetQp(const uint8_t* buf, size_t length, int* qp) {
header_length = kKeyPayloadHeaderLength;
}
if (header_length + partition_length > length) {
LOG(LS_WARNING) << "Failed to get QP, invalid length: " << length;
RTC_LOG(LS_WARNING) << "Failed to get QP, invalid length: " << length;
return false;
}
buf += header_length;
@ -193,7 +193,7 @@ bool GetQp(const uint8_t* buf, size_t length, int* qp) {
// Base QP.
const int base_q0 = VP8GetValue(&br, 7);
if (br.eof_ == 1) {
LOG(LS_WARNING) << "Failed to get QP, end of file reached.";
RTC_LOG(LS_WARNING) << "Failed to get QP, end of file reached.";
return false;
}
*qp = base_q0;

View File

@ -35,7 +35,7 @@ bool Vp9ReadProfile(rtc::BitBuffer* br, uint8_t* profile) {
uint32_t reserved_bit;
RETURN_FALSE_IF_ERROR(br->ReadBits(&reserved_bit, 1));
if (reserved_bit) {
LOG(LS_WARNING) << "Failed to get QP. Unsupported bitstream profile.";
RTC_LOG(LS_WARNING) << "Failed to get QP. Unsupported bitstream profile.";
return false;
}
}
@ -46,7 +46,7 @@ bool Vp9ReadSyncCode(rtc::BitBuffer* br) {
uint32_t sync_code;
RETURN_FALSE_IF_ERROR(br->ReadBits(&sync_code, 24));
if (sync_code != 0x498342) {
LOG(LS_WARNING) << "Failed to get QP. Invalid sync code.";
RTC_LOG(LS_WARNING) << "Failed to get QP. Invalid sync code.";
return false;
}
return true;
@ -71,7 +71,7 @@ bool Vp9ReadColorConfig(rtc::BitBuffer* br, uint8_t profile) {
uint32_t reserved_bit;
RETURN_FALSE_IF_ERROR(br->ReadBits(&reserved_bit, 1));
if (reserved_bit) {
LOG(LS_WARNING) << "Failed to get QP. Reserved bit set.";
RTC_LOG(LS_WARNING) << "Failed to get QP. Reserved bit set.";
return false;
}
}
@ -80,12 +80,12 @@ bool Vp9ReadColorConfig(rtc::BitBuffer* br, uint8_t profile) {
uint32_t reserved_bit;
RETURN_FALSE_IF_ERROR(br->ReadBits(&reserved_bit, 1));
if (reserved_bit) {
LOG(LS_WARNING) << "Failed to get QP. Reserved bit set.";
RTC_LOG(LS_WARNING) << "Failed to get QP. Reserved bit set.";
return false;
}
} else {
LOG(LS_WARNING) << "Failed to get QP. 4:4:4 color not supported in "
"profile 0 or 2.";
RTC_LOG(LS_WARNING) << "Failed to get QP. 4:4:4 color not supported in "
"profile 0 or 2.";
return false;
}
}
@ -173,7 +173,7 @@ bool GetQp(const uint8_t* buf, size_t length, int* qp) {
uint32_t frame_marker;
RETURN_FALSE_IF_ERROR(br.ReadBits(&frame_marker, 2));
if (frame_marker != 0x2) {
LOG(LS_WARNING) << "Failed to get QP. Frame marker should be 2.";
RTC_LOG(LS_WARNING) << "Failed to get QP. Frame marker should be 2.";
return false;
}