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();
diff --git a/modules/audio_device/android/audio_device_template.h b/modules/audio_device/android/audio_device_template.h
index 04ff1bc..bb577ad 100644
--- a/modules/audio_device/android/audio_device_template.h
+++ b/modules/audio_device/android/audio_device_template.h
@@ -39,22 +39,22 @@
output_(audio_manager_),
input_(audio_manager_),
initialized_(false) {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
RTC_CHECK(audio_manager);
audio_manager_->SetActiveAudioLayer(audio_layer);
}
- virtual ~AudioDeviceTemplate() { LOG(INFO) << __FUNCTION__; }
+ virtual ~AudioDeviceTemplate() { RTC_LOG(INFO) << __FUNCTION__; }
int32_t ActiveAudioLayer(
AudioDeviceModule::AudioLayer& audioLayer) const override {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
audioLayer = audio_layer_;
return 0;
}
InitStatus Init() override {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
RTC_DCHECK(thread_checker_.CalledOnValidThread());
RTC_DCHECK(!initialized_);
if (!audio_manager_->Init()) {
@@ -74,7 +74,7 @@
}
int32_t Terminate() override {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
RTC_DCHECK(thread_checker_.CalledOnValidThread());
int32_t err = input_.Terminate();
err |= output_.Terminate();
@@ -85,18 +85,18 @@
}
bool Initialized() const override {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
RTC_DCHECK(thread_checker_.CalledOnValidThread());
return initialized_;
}
int16_t PlayoutDevices() override {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
return 1;
}
int16_t RecordingDevices() override {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
return 1;
}
@@ -117,7 +117,7 @@
int32_t SetPlayoutDevice(uint16_t index) override {
// OK to use but it has no effect currently since device selection is
// done using Andoid APIs instead.
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
return 0;
}
@@ -130,7 +130,7 @@
int32_t SetRecordingDevice(uint16_t index) override {
// OK to use but it has no effect currently since device selection is
// done using Andoid APIs instead.
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
return 0;
}
@@ -141,41 +141,41 @@
}
int32_t PlayoutIsAvailable(bool& available) override {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
available = true;
return 0;
}
int32_t InitPlayout() override {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
return output_.InitPlayout();
}
bool PlayoutIsInitialized() const override {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
return output_.PlayoutIsInitialized();
}
int32_t RecordingIsAvailable(bool& available) override {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
available = true;
return 0;
}
int32_t InitRecording() override {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
return input_.InitRecording();
}
bool RecordingIsInitialized() const override {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
return input_.RecordingIsInitialized();
}
int32_t StartPlayout() override {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
if (!audio_manager_->IsCommunicationModeEnabled()) {
- LOG(WARNING)
+ RTC_LOG(WARNING)
<< "The application should use MODE_IN_COMMUNICATION audio mode!";
}
return output_.StartPlayout();
@@ -185,20 +185,20 @@
// Avoid using audio manger (JNI/Java cost) if playout was inactive.
if (!Playing())
return 0;
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
int32_t err = output_.StopPlayout();
return err;
}
bool Playing() const override {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
return output_.Playing();
}
int32_t StartRecording() override {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
if (!audio_manager_->IsCommunicationModeEnabled()) {
- LOG(WARNING)
+ RTC_LOG(WARNING)
<< "The application should use MODE_IN_COMMUNICATION audio mode!";
}
return input_.StartRecording();
@@ -206,7 +206,7 @@
int32_t StopRecording() override {
// Avoid using audio manger (JNI/Java cost) if recording was inactive.
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
if (!Recording())
return 0;
int32_t err = input_.StopRecording();
@@ -223,52 +223,52 @@
}
bool AGC() const override {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
return false;
}
int32_t InitSpeaker() override {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
return 0;
}
bool SpeakerIsInitialized() const override {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
return true;
}
int32_t InitMicrophone() override {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
return 0;
}
bool MicrophoneIsInitialized() const override {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
return true;
}
int32_t SpeakerVolumeIsAvailable(bool& available) override {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
return output_.SpeakerVolumeIsAvailable(available);
}
int32_t SetSpeakerVolume(uint32_t volume) override {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
return output_.SetSpeakerVolume(volume);
}
int32_t SpeakerVolume(uint32_t& volume) const override {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
return output_.SpeakerVolume(volume);
}
int32_t MaxSpeakerVolume(uint32_t& maxVolume) const override {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
return output_.MaxSpeakerVolume(maxVolume);
}
int32_t MinSpeakerVolume(uint32_t& minVolume) const override {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
return output_.MinSpeakerVolume(minVolume);
}
@@ -330,13 +330,13 @@
// Returns true if the audio manager has been configured to support stereo
// and false otherwised. Default is mono.
int32_t StereoPlayoutIsAvailable(bool& available) override {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
available = audio_manager_->IsStereoPlayoutSupported();
return 0;
}
int32_t SetStereoPlayout(bool enable) override {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
bool available = audio_manager_->IsStereoPlayoutSupported();
// Android does not support changes between mono and stero on the fly.
// Instead, the native audio layer is configured via the audio manager
@@ -351,13 +351,13 @@
}
int32_t StereoRecordingIsAvailable(bool& available) override {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
available = audio_manager_->IsStereoRecordSupported();
return 0;
}
int32_t SetStereoRecording(bool enable) override {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
bool available = audio_manager_->IsStereoRecordSupported();
// Android does not support changes between mono and stero on the fly.
// Instead, the native audio layer is configured via the audio manager
@@ -367,7 +367,7 @@
}
int32_t StereoRecording(bool& enabled) const override {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
enabled = audio_manager_->IsStereoRecordSupported();
return 0;
}
@@ -380,7 +380,7 @@
}
void AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) override {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
output_.AttachAudioBuffer(audioBuffer);
input_.AttachAudioBuffer(audioBuffer);
}
@@ -414,13 +414,13 @@
// a "Not Implemented" log will be filed. This non-perfect state will remain
// until I have added full support for audio effects based on OpenSL ES APIs.
bool BuiltInAECIsAvailable() const override {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
return audio_manager_->IsAcousticEchoCancelerSupported();
}
// TODO(henrika): add implementation for OpenSL ES based audio as well.
int32_t EnableBuiltInAEC(bool enable) override {
- LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
+ RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
RTC_CHECK(BuiltInAECIsAvailable()) << "HW AEC is not available";
return input_.EnableBuiltInAEC(enable);
}
@@ -430,13 +430,13 @@
// TODO(henrika): add implementation for OpenSL ES based audio as well.
// In addition, see comments for BuiltInAECIsAvailable().
bool BuiltInAGCIsAvailable() const override {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
return audio_manager_->IsAutomaticGainControlSupported();
}
// TODO(henrika): add implementation for OpenSL ES based audio as well.
int32_t EnableBuiltInAGC(bool enable) override {
- LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
+ RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
RTC_CHECK(BuiltInAGCIsAvailable()) << "HW AGC is not available";
return input_.EnableBuiltInAGC(enable);
}
@@ -446,13 +446,13 @@
// TODO(henrika): add implementation for OpenSL ES based audio as well.
// In addition, see comments for BuiltInAECIsAvailable().
bool BuiltInNSIsAvailable() const override {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
return audio_manager_->IsNoiseSuppressorSupported();
}
// TODO(henrika): add implementation for OpenSL ES based audio as well.
int32_t EnableBuiltInNS(bool enable) override {
- LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
+ RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
RTC_CHECK(BuiltInNSIsAvailable()) << "HW NS is not available";
return input_.EnableBuiltInNS(enable);
}
diff --git a/modules/audio_device/audio_device_buffer.cc b/modules/audio_device/audio_device_buffer.cc
index 3d7d9bc..b580c16 100644
--- a/modules/audio_device/audio_device_buffer.cc
+++ b/modules/audio_device/audio_device_buffer.cc
@@ -63,10 +63,10 @@
play_start_time_(0),
only_silence_recorded_(true),
log_stats_(false) {
- LOG(INFO) << "AudioDeviceBuffer::ctor";
+ RTC_LOG(INFO) << "AudioDeviceBuffer::ctor";
#ifdef AUDIO_DEVICE_PLAYS_SINUS_TONE
phase_ = 0.0;
- LOG(WARNING) << "AUDIO_DEVICE_PLAYS_SINUS_TONE is defined!";
+ RTC_LOG(WARNING) << "AUDIO_DEVICE_PLAYS_SINUS_TONE is defined!";
#endif
WebRtcSpl_Init();
playout_thread_checker_.DetachFromThread();
@@ -77,15 +77,15 @@
RTC_DCHECK_RUN_ON(&main_thread_checker_);
RTC_DCHECK(!playing_);
RTC_DCHECK(!recording_);
- LOG(INFO) << "AudioDeviceBuffer::~dtor";
+ RTC_LOG(INFO) << "AudioDeviceBuffer::~dtor";
}
int32_t AudioDeviceBuffer::RegisterAudioCallback(
AudioTransport* audio_callback) {
RTC_DCHECK_RUN_ON(&main_thread_checker_);
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
if (playing_ || recording_) {
- LOG(LS_ERROR) << "Failed to set audio transport since media was active";
+ RTC_LOG(LS_ERROR) << "Failed to set audio transport since media was active";
return -1;
}
audio_transport_cb_ = audio_callback;
@@ -100,7 +100,7 @@
if (playing_) {
return;
}
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
playout_thread_checker_.DetachFromThread();
// Clear members tracking playout stats and do it on the task queue.
task_queue_.PostTask([this] { ResetPlayStats(); });
@@ -120,7 +120,7 @@
if (recording_) {
return;
}
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
recording_thread_checker_.DetachFromThread();
// Clear members tracking recording stats and do it on the task queue.
task_queue_.PostTask([this] { ResetRecStats(); });
@@ -143,13 +143,13 @@
if (!playing_) {
return;
}
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
playing_ = false;
// Stop periodic logging if no more media is active.
if (!recording_) {
StopPeriodicLogging();
}
- LOG(INFO) << "total playout time: " << rtc::TimeSince(play_start_time_);
+ RTC_LOG(INFO) << "total playout time: " << rtc::TimeSince(play_start_time_);
}
void AudioDeviceBuffer::StopRecording() {
@@ -157,7 +157,7 @@
if (!recording_) {
return;
}
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
recording_ = false;
// Stop periodic logging if no more media is active.
if (!playing_) {
@@ -177,21 +177,22 @@
if (time_since_start > kMinValidCallTimeTimeInMilliseconds) {
const int only_zeros = static_cast<int>(only_silence_recorded_);
RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.RecordedOnlyZeros", only_zeros);
- LOG(INFO) << "HISTOGRAM(WebRTC.Audio.RecordedOnlyZeros): " << only_zeros;
+ RTC_LOG(INFO) << "HISTOGRAM(WebRTC.Audio.RecordedOnlyZeros): "
+ << only_zeros;
}
- LOG(INFO) << "total recording time: " << time_since_start;
+ RTC_LOG(INFO) << "total recording time: " << time_since_start;
}
int32_t AudioDeviceBuffer::SetRecordingSampleRate(uint32_t fsHz) {
RTC_DCHECK(main_thread_checker_.CalledOnValidThread());
- LOG(INFO) << "SetRecordingSampleRate(" << fsHz << ")";
+ RTC_LOG(INFO) << "SetRecordingSampleRate(" << fsHz << ")";
rec_sample_rate_ = fsHz;
return 0;
}
int32_t AudioDeviceBuffer::SetPlayoutSampleRate(uint32_t fsHz) {
RTC_DCHECK(main_thread_checker_.CalledOnValidThread());
- LOG(INFO) << "SetPlayoutSampleRate(" << fsHz << ")";
+ RTC_LOG(INFO) << "SetPlayoutSampleRate(" << fsHz << ")";
play_sample_rate_ = fsHz;
return 0;
}
@@ -208,22 +209,22 @@
int32_t AudioDeviceBuffer::SetRecordingChannels(size_t channels) {
RTC_DCHECK(main_thread_checker_.CalledOnValidThread());
- LOG(INFO) << "SetRecordingChannels(" << channels << ")";
+ RTC_LOG(INFO) << "SetRecordingChannels(" << channels << ")";
rec_channels_ = channels;
return 0;
}
int32_t AudioDeviceBuffer::SetPlayoutChannels(size_t channels) {
RTC_DCHECK(main_thread_checker_.CalledOnValidThread());
- LOG(INFO) << "SetPlayoutChannels(" << channels << ")";
+ RTC_LOG(INFO) << "SetPlayoutChannels(" << channels << ")";
play_channels_ = channels;
return 0;
}
int32_t AudioDeviceBuffer::SetRecordingChannel(
const AudioDeviceModule::ChannelType channel) {
- LOG(INFO) << "SetRecordingChannel(" << channel << ")";
- LOG(LS_WARNING) << "Not implemented";
+ RTC_LOG(INFO) << "SetRecordingChannel(" << channel << ")";
+ RTC_LOG(LS_WARNING) << "Not implemented";
// Add DCHECK to ensure that user does not try to use this API with a non-
// default parameter.
RTC_DCHECK_EQ(channel, AudioDeviceModule::kChannelBoth);
@@ -232,7 +233,7 @@
int32_t AudioDeviceBuffer::RecordingChannel(
AudioDeviceModule::ChannelType& channel) const {
- LOG(LS_WARNING) << "Not implemented";
+ RTC_LOG(LS_WARNING) << "Not implemented";
return -1;
}
@@ -291,7 +292,7 @@
// Keep track of the size of the recording buffer. Only updated when the
// size changes, which is a rare event.
if (old_size != rec_buffer_.size()) {
- LOG(LS_INFO) << "Size of recording buffer: " << rec_buffer_.size();
+ RTC_LOG(LS_INFO) << "Size of recording buffer: " << rec_buffer_.size();
}
// Derive a new level value twice per second and check if it is non-zero.
@@ -317,7 +318,7 @@
int32_t AudioDeviceBuffer::DeliverRecordedData() {
RTC_DCHECK_RUN_ON(&recording_thread_checker_);
if (!audio_transport_cb_) {
- LOG(LS_WARNING) << "Invalid audio transport";
+ RTC_LOG(LS_WARNING) << "Invalid audio transport";
return 0;
}
const size_t frames = rec_buffer_.size() / rec_channels_;
@@ -331,7 +332,7 @@
if (res != -1) {
new_mic_level_ = new_mic_level;
} else {
- LOG(LS_ERROR) << "RecordedDataIsAvailable() failed";
+ RTC_LOG(LS_ERROR) << "RecordedDataIsAvailable() failed";
}
return 0;
}
@@ -344,14 +345,14 @@
const size_t total_samples = play_channels_ * samples_per_channel;
if (play_buffer_.size() != total_samples) {
play_buffer_.SetSize(total_samples);
- LOG(LS_INFO) << "Size of playout buffer: " << play_buffer_.size();
+ RTC_LOG(LS_INFO) << "Size of playout buffer: " << play_buffer_.size();
}
size_t num_samples_out(0);
// It is currently supported to start playout without a valid audio
// transport object. Leads to warning and silence.
if (!audio_transport_cb_) {
- LOG(LS_WARNING) << "Invalid audio transport";
+ RTC_LOG(LS_WARNING) << "Invalid audio transport";
return 0;
}
@@ -363,7 +364,7 @@
samples_per_channel, bytes_per_frame, play_channels_, play_sample_rate_,
play_buffer_.data(), num_samples_out, &elapsed_time_ms, &ntp_time_ms);
if (res != 0) {
- LOG(LS_ERROR) << "NeedMorePlayData() failed";
+ RTC_LOG(LS_ERROR) << "NeedMorePlayData() failed";
}
// Derive a new level value twice per second.
@@ -449,21 +450,21 @@
if (++num_stat_reports_ > 1 && time_since_last > 0) {
uint32_t diff_samples = stats.rec_samples - last_stats_.rec_samples;
float rate = diff_samples / (static_cast<float>(time_since_last) / 1000.0);
- LOG(INFO) << "[REC : " << time_since_last << "msec, "
- << rec_sample_rate_ / 1000 << "kHz] callbacks: "
- << stats.rec_callbacks - last_stats_.rec_callbacks << ", "
- << "samples: " << diff_samples << ", "
- << "rate: " << static_cast<int>(rate + 0.5) << ", "
- << "level: " << stats.max_rec_level;
+ RTC_LOG(INFO) << "[REC : " << time_since_last << "msec, "
+ << rec_sample_rate_ / 1000 << "kHz] callbacks: "
+ << stats.rec_callbacks - last_stats_.rec_callbacks << ", "
+ << "samples: " << diff_samples << ", "
+ << "rate: " << static_cast<int>(rate + 0.5) << ", "
+ << "level: " << stats.max_rec_level;
diff_samples = stats.play_samples - last_stats_.play_samples;
rate = diff_samples / (static_cast<float>(time_since_last) / 1000.0);
- LOG(INFO) << "[PLAY: " << time_since_last << "msec, "
- << play_sample_rate_ / 1000 << "kHz] callbacks: "
- << stats.play_callbacks - last_stats_.play_callbacks << ", "
- << "samples: " << diff_samples << ", "
- << "rate: " << static_cast<int>(rate + 0.5) << ", "
- << "level: " << stats.max_play_level;
+ RTC_LOG(INFO) << "[PLAY: " << time_since_last << "msec, "
+ << play_sample_rate_ / 1000 << "kHz] callbacks: "
+ << stats.play_callbacks - last_stats_.play_callbacks << ", "
+ << "samples: " << diff_samples << ", "
+ << "rate: " << static_cast<int>(rate + 0.5) << ", "
+ << "level: " << stats.max_play_level;
last_stats_ = stats;
}
diff --git a/modules/audio_device/audio_device_generic.cc b/modules/audio_device/audio_device_generic.cc
index 142d993..e7c1f0e 100644
--- a/modules/audio_device/audio_device_generic.cc
+++ b/modules/audio_device/audio_device_generic.cc
@@ -15,65 +15,65 @@
int32_t AudioDeviceGeneric::SetRecordingSampleRate(
const uint32_t samplesPerSec) {
- LOG_F(LS_ERROR) << "Not supported on this platform";
+ RTC_LOG_F(LS_ERROR) << "Not supported on this platform";
return -1;
}
int32_t AudioDeviceGeneric::SetPlayoutSampleRate(const uint32_t samplesPerSec) {
- LOG_F(LS_ERROR) << "Not supported on this platform";
+ RTC_LOG_F(LS_ERROR) << "Not supported on this platform";
return -1;
}
int32_t AudioDeviceGeneric::SetLoudspeakerStatus(bool enable) {
- LOG_F(LS_ERROR) << "Not supported on this platform";
+ RTC_LOG_F(LS_ERROR) << "Not supported on this platform";
return -1;
}
int32_t AudioDeviceGeneric::GetLoudspeakerStatus(bool& enable) const {
- LOG_F(LS_ERROR) << "Not supported on this platform";
+ RTC_LOG_F(LS_ERROR) << "Not supported on this platform";
return -1;
}
bool AudioDeviceGeneric::BuiltInAECIsAvailable() const {
- LOG_F(LS_ERROR) << "Not supported on this platform";
+ RTC_LOG_F(LS_ERROR) << "Not supported on this platform";
return false;
}
int32_t AudioDeviceGeneric::EnableBuiltInAEC(bool enable) {
- LOG_F(LS_ERROR) << "Not supported on this platform";
+ RTC_LOG_F(LS_ERROR) << "Not supported on this platform";
return -1;
}
bool AudioDeviceGeneric::BuiltInAGCIsAvailable() const {
- LOG_F(LS_ERROR) << "Not supported on this platform";
+ RTC_LOG_F(LS_ERROR) << "Not supported on this platform";
return false;
}
int32_t AudioDeviceGeneric::EnableBuiltInAGC(bool enable) {
- LOG_F(LS_ERROR) << "Not supported on this platform";
+ RTC_LOG_F(LS_ERROR) << "Not supported on this platform";
return -1;
}
bool AudioDeviceGeneric::BuiltInNSIsAvailable() const {
- LOG_F(LS_ERROR) << "Not supported on this platform";
+ RTC_LOG_F(LS_ERROR) << "Not supported on this platform";
return false;
}
int32_t AudioDeviceGeneric::EnableBuiltInNS(bool enable) {
- LOG_F(LS_ERROR) << "Not supported on this platform";
+ RTC_LOG_F(LS_ERROR) << "Not supported on this platform";
return -1;
}
#if defined(WEBRTC_IOS)
int AudioDeviceGeneric::GetPlayoutAudioParameters(
AudioParameters* params) const {
- LOG_F(LS_ERROR) << "Not supported on this platform";
+ RTC_LOG_F(LS_ERROR) << "Not supported on this platform";
return -1;
}
int AudioDeviceGeneric::GetRecordAudioParameters(
AudioParameters* params) const {
- LOG_F(LS_ERROR) << "Not supported on this platform";
+ RTC_LOG_F(LS_ERROR) << "Not supported on this platform";
return -1;
}
#endif // WEBRTC_IOS
diff --git a/modules/audio_device/audio_device_impl.cc b/modules/audio_device/audio_device_impl.cc
index 0a669ca..f4fdd11 100644
--- a/modules/audio_device/audio_device_impl.cc
+++ b/modules/audio_device/audio_device_impl.cc
@@ -69,7 +69,7 @@
rtc::scoped_refptr<AudioDeviceModule> AudioDeviceModule::Create(
const int32_t id,
const AudioLayer audio_layer) {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
// Create the generic reference counted (platform independent) implementation.
rtc::scoped_refptr<AudioDeviceModuleImpl> audioDevice(
new rtc::RefCountedObject<AudioDeviceModuleImpl>(audio_layer));
@@ -95,32 +95,33 @@
AudioDeviceModuleImpl::AudioDeviceModuleImpl(const AudioLayer audioLayer)
: audio_layer_(audioLayer) {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
}
int32_t AudioDeviceModuleImpl::CheckPlatform() {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
// Ensure that the current platform is supported
PlatformType platform(kPlatformNotSupported);
#if defined(_WIN32)
platform = kPlatformWin32;
- LOG(INFO) << "current platform is Win32";
+ RTC_LOG(INFO) << "current platform is Win32";
#elif defined(WEBRTC_ANDROID)
platform = kPlatformAndroid;
- LOG(INFO) << "current platform is Android";
+ RTC_LOG(INFO) << "current platform is Android";
#elif defined(WEBRTC_LINUX)
platform = kPlatformLinux;
- LOG(INFO) << "current platform is Linux";
+ RTC_LOG(INFO) << "current platform is Linux";
#elif defined(WEBRTC_IOS)
platform = kPlatformIOS;
- LOG(INFO) << "current platform is IOS";
+ RTC_LOG(INFO) << "current platform is IOS";
#elif defined(WEBRTC_MAC)
platform = kPlatformMac;
- LOG(INFO) << "current platform is Mac";
+ RTC_LOG(INFO) << "current platform is Mac";
#endif
if (platform == kPlatformNotSupported) {
- LOG(LERROR) << "current platform is not supported => this module will self "
- "destruct!";
+ RTC_LOG(LERROR)
+ << "current platform is not supported => this module will self "
+ "destruct!";
return -1;
}
platform_type_ = platform;
@@ -128,19 +129,19 @@
}
int32_t AudioDeviceModuleImpl::CreatePlatformSpecificObjects() {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
// Dummy ADM implementations if build flags are set.
#if defined(WEBRTC_DUMMY_AUDIO_BUILD)
audio_device_.reset(new AudioDeviceDummy());
- LOG(INFO) << "Dummy Audio APIs will be utilized";
+ RTC_LOG(INFO) << "Dummy Audio APIs will be utilized";
#elif defined(WEBRTC_DUMMY_FILE_DEVICES)
audio_device_.reset(FileAudioDeviceFactory::CreateFileAudioDevice());
if (audio_device_) {
- LOG(INFO) << "Will use file-playing dummy device.";
+ RTC_LOG(INFO) << "Will use file-playing dummy device.";
} else {
// Create a dummy device instead.
audio_device_.reset(new AudioDeviceDummy());
- LOG(INFO) << "Dummy Audio APIs will be utilized";
+ RTC_LOG(INFO) << "Dummy Audio APIs will be utilized";
}
// Real (non-dummy) ADM implementations.
@@ -150,10 +151,10 @@
#if defined(WEBRTC_WINDOWS_CORE_AUDIO_BUILD)
if ((audio_layer == kWindowsCoreAudio) ||
(audio_layer == kPlatformDefaultAudio)) {
- LOG(INFO) << "Attempting to use the Windows Core Audio APIs...";
+ RTC_LOG(INFO) << "Attempting to use the Windows Core Audio APIs...";
if (AudioDeviceWindowsCore::CoreAudioIsSupported()) {
audio_device_.reset(new AudioDeviceWindowsCore());
- LOG(INFO) << "Windows Core Audio APIs will be utilized";
+ RTC_LOG(INFO) << "Windows Core Audio APIs will be utilized";
}
}
#endif // defined(WEBRTC_WINDOWS_CORE_AUDIO_BUILD)
@@ -205,10 +206,10 @@
if ((audio_layer == kLinuxPulseAudio) ||
(audio_layer == kPlatformDefaultAudio)) {
#if defined(LINUX_PULSE)
- LOG(INFO) << "Attempting to use Linux PulseAudio APIs...";
+ RTC_LOG(INFO) << "Attempting to use Linux PulseAudio APIs...";
// Linux PulseAudio implementation.
audio_device_.reset(new AudioDeviceLinuxPulse());
- LOG(INFO) << "Linux PulseAudio APIs will be utilized";
+ RTC_LOG(INFO) << "Linux PulseAudio APIs will be utilized";
#endif
#if defined(LINUX_PULSE)
#endif
@@ -216,7 +217,7 @@
#if defined(LINUX_ALSA)
// Linux ALSA implementation.
audio_device_.reset(new AudioDeviceLinuxALSA());
- LOG(INFO) << "Linux ALSA APIs will be utilized.";
+ RTC_LOG(INFO) << "Linux ALSA APIs will be utilized.";
#endif
}
#endif // #if defined(WEBRTC_LINUX)
@@ -225,7 +226,7 @@
#if defined(WEBRTC_IOS)
if (audio_layer == kPlatformDefaultAudio) {
audio_device_.reset(new AudioDeviceIOS());
- LOG(INFO) << "iPhone Audio APIs will be utilized.";
+ RTC_LOG(INFO) << "iPhone Audio APIs will be utilized.";
}
// END #if defined(WEBRTC_IOS)
@@ -233,19 +234,19 @@
#elif defined(WEBRTC_MAC)
if (audio_layer == kPlatformDefaultAudio) {
audio_device_.reset(new AudioDeviceMac());
- LOG(INFO) << "Mac OS X Audio APIs will be utilized.";
+ RTC_LOG(INFO) << "Mac OS X Audio APIs will be utilized.";
}
#endif // WEBRTC_MAC
// Dummy ADM implementation.
if (audio_layer == kDummyAudio) {
audio_device_.reset(new AudioDeviceDummy());
- LOG(INFO) << "Dummy Audio APIs will be utilized.";
+ RTC_LOG(INFO) << "Dummy Audio APIs will be utilized.";
}
#endif // if defined(WEBRTC_DUMMY_AUDIO_BUILD)
if (!audio_device_) {
- LOG(LS_ERROR)
+ RTC_LOG(LS_ERROR)
<< "Failed to create the platform specific ADM implementation.";
return -1;
}
@@ -253,17 +254,17 @@
}
int32_t AudioDeviceModuleImpl::AttachAudioBuffer() {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
audio_device_->AttachAudioBuffer(&audio_device_buffer_);
return 0;
}
AudioDeviceModuleImpl::~AudioDeviceModuleImpl() {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
}
int32_t AudioDeviceModuleImpl::ActiveAudioLayer(AudioLayer* audioLayer) const {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
AudioLayer activeAudio;
if (audio_device_->ActiveAudioLayer(activeAudio) == -1) {
return -1;
@@ -273,7 +274,7 @@
}
int32_t AudioDeviceModuleImpl::Init() {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
if (initialized_)
return 0;
RTC_CHECK(audio_device_);
@@ -282,7 +283,7 @@
"WebRTC.Audio.InitializationResult", static_cast<int>(status),
static_cast<int>(AudioDeviceGeneric::InitStatus::NUM_STATUSES));
if (status != AudioDeviceGeneric::InitStatus::OK) {
- LOG(LS_ERROR) << "Audio device initialization failed.";
+ RTC_LOG(LS_ERROR) << "Audio device initialization failed.";
return -1;
}
initialized_ = true;
@@ -290,7 +291,7 @@
}
int32_t AudioDeviceModuleImpl::Terminate() {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
if (!initialized_)
return 0;
if (audio_device_->Terminate() == -1) {
@@ -301,65 +302,65 @@
}
bool AudioDeviceModuleImpl::Initialized() const {
- LOG(INFO) << __FUNCTION__ << ": " << initialized_;
+ RTC_LOG(INFO) << __FUNCTION__ << ": " << initialized_;
return initialized_;
}
int32_t AudioDeviceModuleImpl::InitSpeaker() {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized_();
return audio_device_->InitSpeaker();
}
int32_t AudioDeviceModuleImpl::InitMicrophone() {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized_();
return audio_device_->InitMicrophone();
}
int32_t AudioDeviceModuleImpl::SpeakerVolumeIsAvailable(bool* available) {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized_();
bool isAvailable = false;
if (audio_device_->SpeakerVolumeIsAvailable(isAvailable) == -1) {
return -1;
}
*available = isAvailable;
- LOG(INFO) << "output: " << isAvailable;
+ RTC_LOG(INFO) << "output: " << isAvailable;
return 0;
}
int32_t AudioDeviceModuleImpl::SetSpeakerVolume(uint32_t volume) {
- LOG(INFO) << __FUNCTION__ << "(" << volume << ")";
+ RTC_LOG(INFO) << __FUNCTION__ << "(" << volume << ")";
CHECKinitialized_();
return audio_device_->SetSpeakerVolume(volume);
}
int32_t AudioDeviceModuleImpl::SpeakerVolume(uint32_t* volume) const {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized_();
uint32_t level = 0;
if (audio_device_->SpeakerVolume(level) == -1) {
return -1;
}
*volume = level;
- LOG(INFO) << "output: " << *volume;
+ RTC_LOG(INFO) << "output: " << *volume;
return 0;
}
bool AudioDeviceModuleImpl::SpeakerIsInitialized() const {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized__BOOL();
bool isInitialized = audio_device_->SpeakerIsInitialized();
- LOG(INFO) << "output: " << isInitialized;
+ RTC_LOG(INFO) << "output: " << isInitialized;
return isInitialized;
}
bool AudioDeviceModuleImpl::MicrophoneIsInitialized() const {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized__BOOL();
bool isInitialized = audio_device_->MicrophoneIsInitialized();
- LOG(INFO) << "output: " << isInitialized;
+ RTC_LOG(INFO) << "output: " << isInitialized;
return isInitialized;
}
@@ -384,117 +385,117 @@
}
int32_t AudioDeviceModuleImpl::SpeakerMuteIsAvailable(bool* available) {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized_();
bool isAvailable = false;
if (audio_device_->SpeakerMuteIsAvailable(isAvailable) == -1) {
return -1;
}
*available = isAvailable;
- LOG(INFO) << "output: " << isAvailable;
+ RTC_LOG(INFO) << "output: " << isAvailable;
return 0;
}
int32_t AudioDeviceModuleImpl::SetSpeakerMute(bool enable) {
- LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
+ RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
CHECKinitialized_();
return audio_device_->SetSpeakerMute(enable);
}
int32_t AudioDeviceModuleImpl::SpeakerMute(bool* enabled) const {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized_();
bool muted = false;
if (audio_device_->SpeakerMute(muted) == -1) {
return -1;
}
*enabled = muted;
- LOG(INFO) << "output: " << muted;
+ RTC_LOG(INFO) << "output: " << muted;
return 0;
}
int32_t AudioDeviceModuleImpl::MicrophoneMuteIsAvailable(bool* available) {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized_();
bool isAvailable = false;
if (audio_device_->MicrophoneMuteIsAvailable(isAvailable) == -1) {
return -1;
}
*available = isAvailable;
- LOG(INFO) << "output: " << isAvailable;
+ RTC_LOG(INFO) << "output: " << isAvailable;
return 0;
}
int32_t AudioDeviceModuleImpl::SetMicrophoneMute(bool enable) {
- LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
+ RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
CHECKinitialized_();
return (audio_device_->SetMicrophoneMute(enable));
}
int32_t AudioDeviceModuleImpl::MicrophoneMute(bool* enabled) const {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized_();
bool muted = false;
if (audio_device_->MicrophoneMute(muted) == -1) {
return -1;
}
*enabled = muted;
- LOG(INFO) << "output: " << muted;
+ RTC_LOG(INFO) << "output: " << muted;
return 0;
}
int32_t AudioDeviceModuleImpl::MicrophoneVolumeIsAvailable(bool* available) {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized_();
bool isAvailable = false;
if (audio_device_->MicrophoneVolumeIsAvailable(isAvailable) == -1) {
return -1;
}
*available = isAvailable;
- LOG(INFO) << "output: " << isAvailable;
+ RTC_LOG(INFO) << "output: " << isAvailable;
return 0;
}
int32_t AudioDeviceModuleImpl::SetMicrophoneVolume(uint32_t volume) {
- LOG(INFO) << __FUNCTION__ << "(" << volume << ")";
+ RTC_LOG(INFO) << __FUNCTION__ << "(" << volume << ")";
CHECKinitialized_();
return (audio_device_->SetMicrophoneVolume(volume));
}
int32_t AudioDeviceModuleImpl::MicrophoneVolume(uint32_t* volume) const {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized_();
uint32_t level = 0;
if (audio_device_->MicrophoneVolume(level) == -1) {
return -1;
}
*volume = level;
- LOG(INFO) << "output: " << *volume;
+ RTC_LOG(INFO) << "output: " << *volume;
return 0;
}
int32_t AudioDeviceModuleImpl::StereoRecordingIsAvailable(
bool* available) const {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized_();
bool isAvailable = false;
if (audio_device_->StereoRecordingIsAvailable(isAvailable) == -1) {
return -1;
}
*available = isAvailable;
- LOG(INFO) << "output: " << isAvailable;
+ RTC_LOG(INFO) << "output: " << isAvailable;
return 0;
}
int32_t AudioDeviceModuleImpl::SetStereoRecording(bool enable) {
- LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
+ RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
CHECKinitialized_();
if (audio_device_->RecordingIsInitialized()) {
- LOG(WARNING) << "recording in stereo is not supported";
+ RTC_LOG(WARNING) << "recording in stereo is not supported";
return -1;
}
if (audio_device_->SetStereoRecording(enable) == -1) {
- LOG(WARNING) << "failed to change stereo recording";
+ RTC_LOG(WARNING) << "failed to change stereo recording";
return -1;
}
int8_t nChannels(1);
@@ -506,36 +507,36 @@
}
int32_t AudioDeviceModuleImpl::StereoRecording(bool* enabled) const {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized_();
bool stereo = false;
if (audio_device_->StereoRecording(stereo) == -1) {
return -1;
}
*enabled = stereo;
- LOG(INFO) << "output: " << stereo;
+ RTC_LOG(INFO) << "output: " << stereo;
return 0;
}
int32_t AudioDeviceModuleImpl::SetRecordingChannel(const ChannelType channel) {
if (channel == kChannelBoth) {
- LOG(INFO) << __FUNCTION__ << "(both)";
+ RTC_LOG(INFO) << __FUNCTION__ << "(both)";
} else if (channel == kChannelLeft) {
- LOG(INFO) << __FUNCTION__ << "(left)";
+ RTC_LOG(INFO) << __FUNCTION__ << "(left)";
} else {
- LOG(INFO) << __FUNCTION__ << "(right)";
+ RTC_LOG(INFO) << __FUNCTION__ << "(right)";
}
CHECKinitialized_();
bool stereo = false;
if (audio_device_->StereoRecording(stereo) == -1) {
- LOG(WARNING) << "recording in stereo is not supported";
+ RTC_LOG(WARNING) << "recording in stereo is not supported";
return -1;
}
return audio_device_buffer_.SetRecordingChannel(channel);
}
int32_t AudioDeviceModuleImpl::RecordingChannel(ChannelType* channel) const {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized_();
ChannelType chType;
if (audio_device_buffer_.RecordingChannel(chType) == -1) {
@@ -543,37 +544,37 @@
}
*channel = chType;
if (*channel == kChannelBoth) {
- LOG(INFO) << "output: both";
+ RTC_LOG(INFO) << "output: both";
} else if (*channel == kChannelLeft) {
- LOG(INFO) << "output: left";
+ RTC_LOG(INFO) << "output: left";
} else {
- LOG(INFO) << "output: right";
+ RTC_LOG(INFO) << "output: right";
}
return 0;
}
int32_t AudioDeviceModuleImpl::StereoPlayoutIsAvailable(bool* available) const {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized_();
bool isAvailable = false;
if (audio_device_->StereoPlayoutIsAvailable(isAvailable) == -1) {
return -1;
}
*available = isAvailable;
- LOG(INFO) << "output: " << isAvailable;
+ RTC_LOG(INFO) << "output: " << isAvailable;
return 0;
}
int32_t AudioDeviceModuleImpl::SetStereoPlayout(bool enable) {
- LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
+ RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
CHECKinitialized_();
if (audio_device_->PlayoutIsInitialized()) {
- LOG(LERROR)
+ RTC_LOG(LERROR)
<< "unable to set stereo mode while playing side is initialized";
return -1;
}
if (audio_device_->SetStereoPlayout(enable)) {
- LOG(WARNING) << "stereo playout is not supported";
+ RTC_LOG(WARNING) << "stereo playout is not supported";
return -1;
}
int8_t nChannels(1);
@@ -585,50 +586,50 @@
}
int32_t AudioDeviceModuleImpl::StereoPlayout(bool* enabled) const {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized_();
bool stereo = false;
if (audio_device_->StereoPlayout(stereo) == -1) {
return -1;
}
*enabled = stereo;
- LOG(INFO) << "output: " << stereo;
+ RTC_LOG(INFO) << "output: " << stereo;
return 0;
}
int32_t AudioDeviceModuleImpl::SetAGC(bool enable) {
- LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
+ RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
CHECKinitialized_();
return (audio_device_->SetAGC(enable));
}
bool AudioDeviceModuleImpl::AGC() const {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized__BOOL();
return audio_device_->AGC();
}
int32_t AudioDeviceModuleImpl::PlayoutIsAvailable(bool* available) {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized_();
bool isAvailable = false;
if (audio_device_->PlayoutIsAvailable(isAvailable) == -1) {
return -1;
}
*available = isAvailable;
- LOG(INFO) << "output: " << isAvailable;
+ RTC_LOG(INFO) << "output: " << isAvailable;
return 0;
}
int32_t AudioDeviceModuleImpl::RecordingIsAvailable(bool* available) {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized_();
bool isAvailable = false;
if (audio_device_->RecordingIsAvailable(isAvailable) == -1) {
return -1;
}
*available = isAvailable;
- LOG(INFO) << "output: " << isAvailable;
+ RTC_LOG(INFO) << "output: " << isAvailable;
return 0;
}
@@ -653,21 +654,21 @@
}
int16_t AudioDeviceModuleImpl::PlayoutDevices() {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized_();
uint16_t nPlayoutDevices = audio_device_->PlayoutDevices();
- LOG(INFO) << "output: " << nPlayoutDevices;
+ RTC_LOG(INFO) << "output: " << nPlayoutDevices;
return (int16_t)(nPlayoutDevices);
}
int32_t AudioDeviceModuleImpl::SetPlayoutDevice(uint16_t index) {
- LOG(INFO) << __FUNCTION__ << "(" << index << ")";
+ RTC_LOG(INFO) << __FUNCTION__ << "(" << index << ")";
CHECKinitialized_();
return audio_device_->SetPlayoutDevice(index);
}
int32_t AudioDeviceModuleImpl::SetPlayoutDevice(WindowsDeviceType device) {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized_();
return audio_device_->SetPlayoutDevice(device);
}
@@ -676,7 +677,7 @@
uint16_t index,
char name[kAdmMaxDeviceNameSize],
char guid[kAdmMaxGuidSize]) {
- LOG(INFO) << __FUNCTION__ << "(" << index << ", ...)";
+ RTC_LOG(INFO) << __FUNCTION__ << "(" << index << ", ...)";
CHECKinitialized_();
if (name == NULL) {
return -1;
@@ -685,10 +686,10 @@
return -1;
}
if (name != NULL) {
- LOG(INFO) << "output: name = " << name;
+ RTC_LOG(INFO) << "output: name = " << name;
}
if (guid != NULL) {
- LOG(INFO) << "output: guid = " << guid;
+ RTC_LOG(INFO) << "output: guid = " << guid;
}
return 0;
}
@@ -697,7 +698,7 @@
uint16_t index,
char name[kAdmMaxDeviceNameSize],
char guid[kAdmMaxGuidSize]) {
- LOG(INFO) << __FUNCTION__ << "(" << index << ", ...)";
+ RTC_LOG(INFO) << __FUNCTION__ << "(" << index << ", ...)";
CHECKinitialized_();
if (name == NULL) {
return -1;
@@ -706,137 +707,137 @@
return -1;
}
if (name != NULL) {
- LOG(INFO) << "output: name = " << name;
+ RTC_LOG(INFO) << "output: name = " << name;
}
if (guid != NULL) {
- LOG(INFO) << "output: guid = " << guid;
+ RTC_LOG(INFO) << "output: guid = " << guid;
}
return 0;
}
int16_t AudioDeviceModuleImpl::RecordingDevices() {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized_();
uint16_t nRecordingDevices = audio_device_->RecordingDevices();
- LOG(INFO) << "output: " << nRecordingDevices;
+ RTC_LOG(INFO) << "output: " << nRecordingDevices;
return (int16_t)nRecordingDevices;
}
int32_t AudioDeviceModuleImpl::SetRecordingDevice(uint16_t index) {
- LOG(INFO) << __FUNCTION__ << "(" << index << ")";
+ RTC_LOG(INFO) << __FUNCTION__ << "(" << index << ")";
CHECKinitialized_();
return audio_device_->SetRecordingDevice(index);
}
int32_t AudioDeviceModuleImpl::SetRecordingDevice(WindowsDeviceType device) {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized_();
return audio_device_->SetRecordingDevice(device);
}
int32_t AudioDeviceModuleImpl::InitPlayout() {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized_();
if (PlayoutIsInitialized()) {
return 0;
}
int32_t result = audio_device_->InitPlayout();
- LOG(INFO) << "output: " << result;
+ RTC_LOG(INFO) << "output: " << result;
RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.InitPlayoutSuccess",
static_cast<int>(result == 0));
return result;
}
int32_t AudioDeviceModuleImpl::InitRecording() {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized_();
if (RecordingIsInitialized()) {
return 0;
}
int32_t result = audio_device_->InitRecording();
- LOG(INFO) << "output: " << result;
+ RTC_LOG(INFO) << "output: " << result;
RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.InitRecordingSuccess",
static_cast<int>(result == 0));
return result;
}
bool AudioDeviceModuleImpl::PlayoutIsInitialized() const {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized__BOOL();
return audio_device_->PlayoutIsInitialized();
}
bool AudioDeviceModuleImpl::RecordingIsInitialized() const {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized__BOOL();
return audio_device_->RecordingIsInitialized();
}
int32_t AudioDeviceModuleImpl::StartPlayout() {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized_();
if (Playing()) {
return 0;
}
audio_device_buffer_.StartPlayout();
int32_t result = audio_device_->StartPlayout();
- LOG(INFO) << "output: " << result;
+ RTC_LOG(INFO) << "output: " << result;
RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StartPlayoutSuccess",
static_cast<int>(result == 0));
return result;
}
int32_t AudioDeviceModuleImpl::StopPlayout() {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized_();
int32_t result = audio_device_->StopPlayout();
audio_device_buffer_.StopPlayout();
- LOG(INFO) << "output: " << result;
+ RTC_LOG(INFO) << "output: " << result;
RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StopPlayoutSuccess",
static_cast<int>(result == 0));
return result;
}
bool AudioDeviceModuleImpl::Playing() const {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized__BOOL();
return audio_device_->Playing();
}
int32_t AudioDeviceModuleImpl::StartRecording() {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized_();
if (Recording()) {
return 0;
}
audio_device_buffer_.StartRecording();
int32_t result = audio_device_->StartRecording();
- LOG(INFO) << "output: " << result;
+ RTC_LOG(INFO) << "output: " << result;
RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StartRecordingSuccess",
static_cast<int>(result == 0));
return result;
}
int32_t AudioDeviceModuleImpl::StopRecording() {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized_();
int32_t result = audio_device_->StopRecording();
audio_device_buffer_.StopRecording();
- LOG(INFO) << "output: " << result;
+ RTC_LOG(INFO) << "output: " << result;
RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StopRecordingSuccess",
static_cast<int>(result == 0));
return result;
}
bool AudioDeviceModuleImpl::Recording() const {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized__BOOL();
return audio_device_->Recording();
}
int32_t AudioDeviceModuleImpl::RegisterAudioCallback(
AudioTransport* audioCallback) {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
return audio_device_buffer_.RegisterAudioCallback(audioCallback);
}
@@ -844,7 +845,7 @@
CHECKinitialized_();
uint16_t delay = 0;
if (audio_device_->PlayoutDelay(delay) == -1) {
- LOG(LERROR) << "failed to retrieve the playout delay";
+ RTC_LOG(LERROR) << "failed to retrieve the playout delay";
return -1;
}
*delayMS = delay;
@@ -853,7 +854,7 @@
int32_t AudioDeviceModuleImpl::SetRecordingSampleRate(
const uint32_t samplesPerSec) {
- LOG(INFO) << __FUNCTION__ << "(" << samplesPerSec << ")";
+ RTC_LOG(INFO) << __FUNCTION__ << "(" << samplesPerSec << ")";
CHECKinitialized_();
if (audio_device_->SetRecordingSampleRate(samplesPerSec) != 0) {
return -1;
@@ -863,21 +864,21 @@
int32_t AudioDeviceModuleImpl::RecordingSampleRate(
uint32_t* samplesPerSec) const {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized_();
int32_t sampleRate = audio_device_buffer_.RecordingSampleRate();
if (sampleRate == -1) {
- LOG(LERROR) << "failed to retrieve the sample rate";
+ RTC_LOG(LERROR) << "failed to retrieve the sample rate";
return -1;
}
*samplesPerSec = sampleRate;
- LOG(INFO) << "output: " << *samplesPerSec;
+ RTC_LOG(INFO) << "output: " << *samplesPerSec;
return 0;
}
int32_t AudioDeviceModuleImpl::SetPlayoutSampleRate(
const uint32_t samplesPerSec) {
- LOG(INFO) << __FUNCTION__ << "(" << samplesPerSec << ")";
+ RTC_LOG(INFO) << __FUNCTION__ << "(" << samplesPerSec << ")";
CHECKinitialized_();
if (audio_device_->SetPlayoutSampleRate(samplesPerSec) != 0) {
return -1;
@@ -887,20 +888,20 @@
int32_t AudioDeviceModuleImpl::PlayoutSampleRate(
uint32_t* samplesPerSec) const {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized_();
int32_t sampleRate = audio_device_buffer_.PlayoutSampleRate();
if (sampleRate == -1) {
- LOG(LERROR) << "failed to retrieve the sample rate";
+ RTC_LOG(LERROR) << "failed to retrieve the sample rate";
return -1;
}
*samplesPerSec = sampleRate;
- LOG(INFO) << "output: " << *samplesPerSec;
+ RTC_LOG(INFO) << "output: " << *samplesPerSec;
return 0;
}
int32_t AudioDeviceModuleImpl::SetLoudspeakerStatus(bool enable) {
- LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
+ RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
CHECKinitialized_();
if (audio_device_->SetLoudspeakerStatus(enable) != 0) {
return -1;
@@ -909,90 +910,90 @@
}
int32_t AudioDeviceModuleImpl::GetLoudspeakerStatus(bool* enabled) const {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized_();
int32_t ok = 0;
if (audio_device_->GetLoudspeakerStatus(*enabled) != 0) {
ok = -1;
}
- LOG(INFO) << "output: " << ok;
+ RTC_LOG(INFO) << "output: " << ok;
return ok;
}
bool AudioDeviceModuleImpl::BuiltInAECIsAvailable() const {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized__BOOL();
bool isAvailable = audio_device_->BuiltInAECIsAvailable();
- LOG(INFO) << "output: " << isAvailable;
+ RTC_LOG(INFO) << "output: " << isAvailable;
return isAvailable;
}
int32_t AudioDeviceModuleImpl::EnableBuiltInAEC(bool enable) {
- LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
+ RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
CHECKinitialized_();
int32_t ok = audio_device_->EnableBuiltInAEC(enable);
- LOG(INFO) << "output: " << ok;
+ RTC_LOG(INFO) << "output: " << ok;
return ok;
}
bool AudioDeviceModuleImpl::BuiltInAGCIsAvailable() const {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized__BOOL();
bool isAvailable = audio_device_->BuiltInAGCIsAvailable();
- LOG(INFO) << "output: " << isAvailable;
+ RTC_LOG(INFO) << "output: " << isAvailable;
return isAvailable;
}
int32_t AudioDeviceModuleImpl::EnableBuiltInAGC(bool enable) {
- LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
+ RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
CHECKinitialized_();
int32_t ok = audio_device_->EnableBuiltInAGC(enable);
- LOG(INFO) << "output: " << ok;
+ RTC_LOG(INFO) << "output: " << ok;
return ok;
}
bool AudioDeviceModuleImpl::BuiltInNSIsAvailable() const {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
CHECKinitialized__BOOL();
bool isAvailable = audio_device_->BuiltInNSIsAvailable();
- LOG(INFO) << "output: " << isAvailable;
+ RTC_LOG(INFO) << "output: " << isAvailable;
return isAvailable;
}
int32_t AudioDeviceModuleImpl::EnableBuiltInNS(bool enable) {
- LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
+ RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
CHECKinitialized_();
int32_t ok = audio_device_->EnableBuiltInNS(enable);
- LOG(INFO) << "output: " << ok;
+ RTC_LOG(INFO) << "output: " << ok;
return ok;
}
#if defined(WEBRTC_IOS)
int AudioDeviceModuleImpl::GetPlayoutAudioParameters(
AudioParameters* params) const {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
int r = audio_device_->GetPlayoutAudioParameters(params);
- LOG(INFO) << "output: " << r;
+ RTC_LOG(INFO) << "output: " << r;
return r;
}
int AudioDeviceModuleImpl::GetRecordAudioParameters(
AudioParameters* params) const {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
int r = audio_device_->GetRecordAudioParameters(params);
- LOG(INFO) << "output: " << r;
+ RTC_LOG(INFO) << "output: " << r;
return r;
}
#endif // WEBRTC_IOS
AudioDeviceModuleImpl::PlatformType AudioDeviceModuleImpl::Platform() const {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
return platform_type_;
}
AudioDeviceModule::AudioLayer AudioDeviceModuleImpl::PlatformAudioLayer()
const {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
return audio_layer_;
}
diff --git a/modules/audio_device/audio_device_unittest.cc b/modules/audio_device/audio_device_unittest.cc
index 5af9192..8d44a5a 100644
--- a/modules/audio_device/audio_device_unittest.cc
+++ b/modules/audio_device/audio_device_unittest.cc
@@ -340,7 +340,7 @@
const bool typing_status,
uint32_t& new_mic_level) {
EXPECT_TRUE(rec_mode()) << "No test is expecting these callbacks.";
- LOG(INFO) << "+";
+ RTC_LOG(INFO) << "+";
// Store audio parameters once in the first callback. For all other
// callbacks, verify that the provided audio parameters are maintained and
// that each callback corresponds to 10ms for any given sample rate.
@@ -379,7 +379,7 @@
int64_t* elapsed_time_ms,
int64_t* ntp_time_ms) {
EXPECT_TRUE(play_mode()) << "No test is expecting these callbacks.";
- LOG(INFO) << "-";
+ RTC_LOG(INFO) << "-";
// Store audio parameters once in the first callback. For all other
// callbacks, verify that the provided audio parameters are maintained and
// that each callback corresponds to 10ms for any given sample rate.
diff --git a/modules/audio_device/dummy/file_audio_device.cc b/modules/audio_device/dummy/file_audio_device.cc
index 6954762..af9b569 100644
--- a/modules/audio_device/dummy/file_audio_device.cc
+++ b/modules/audio_device/dummy/file_audio_device.cc
@@ -201,7 +201,7 @@
// PLAYOUT
if (!_outputFilename.empty() &&
!_outputFile.OpenFile(_outputFilename.c_str(), false)) {
- LOG(LS_ERROR) << "Failed to open playout file: " << _outputFilename;
+ RTC_LOG(LS_ERROR) << "Failed to open playout file: " << _outputFilename;
_playing = false;
delete[] _playoutBuffer;
_playoutBuffer = NULL;
@@ -213,7 +213,8 @@
_ptrThreadPlay->Start();
_ptrThreadPlay->SetPriority(rtc::kRealtimePriority);
- LOG(LS_INFO) << "Started playout capture to output file: " << _outputFilename;
+ RTC_LOG(LS_INFO) << "Started playout capture to output file: "
+ << _outputFilename;
return 0;
}
@@ -236,7 +237,8 @@
_playoutBuffer = NULL;
_outputFile.CloseFile();
- LOG(LS_INFO) << "Stopped playout capture to output file: " << _outputFilename;
+ RTC_LOG(LS_INFO) << "Stopped playout capture to output file: "
+ << _outputFilename;
return 0;
}
@@ -256,7 +258,7 @@
if (!_inputFilename.empty() &&
!_inputFile.OpenFile(_inputFilename.c_str(), true)) {
- LOG(LS_ERROR) << "Failed to open audio input file: " << _inputFilename;
+ RTC_LOG(LS_ERROR) << "Failed to open audio input file: " << _inputFilename;
_recording = false;
delete[] _recordingBuffer;
_recordingBuffer = NULL;
@@ -269,7 +271,7 @@
_ptrThreadRec->Start();
_ptrThreadRec->SetPriority(rtc::kRealtimePriority);
- LOG(LS_INFO) << "Started recording from input file: " << _inputFilename;
+ RTC_LOG(LS_INFO) << "Started recording from input file: " << _inputFilename;
return 0;
}
@@ -293,7 +295,7 @@
}
_inputFile.CloseFile();
- LOG(LS_INFO) << "Stopped recording from input file: " << _inputFilename;
+ RTC_LOG(LS_INFO) << "Stopped recording from input file: " << _inputFilename;
return 0;
}
diff --git a/modules/audio_device/dummy/file_audio_device_factory.cc b/modules/audio_device/dummy/file_audio_device_factory.cc
index 1739953..6b38d8b 100644
--- a/modules/audio_device/dummy/file_audio_device_factory.cc
+++ b/modules/audio_device/dummy/file_audio_device_factory.cc
@@ -26,9 +26,10 @@
// Bail out here if the files haven't been set explicitly.
// audio_device_impl.cc should then fall back to dummy audio.
if (!_isConfigured) {
- LOG(LS_WARNING) << "WebRTC configured with WEBRTC_DUMMY_FILE_DEVICES but "
- << "no device files supplied. Will fall back to dummy "
- << "audio.";
+ RTC_LOG(LS_WARNING)
+ << "WebRTC configured with WEBRTC_DUMMY_FILE_DEVICES but "
+ << "no device files supplied. Will fall back to dummy "
+ << "audio.";
return nullptr;
}
diff --git a/modules/audio_device/fine_audio_buffer.cc b/modules/audio_device/fine_audio_buffer.cc
index f49f123..f582397 100644
--- a/modules/audio_device/fine_audio_buffer.cc
+++ b/modules/audio_device/fine_audio_buffer.cc
@@ -29,7 +29,7 @@
bytes_per_10_ms_(samples_per_10_ms_ * sizeof(int16_t)),
playout_buffer_(0, capacity),
record_buffer_(0, capacity) {
- LOG(INFO) << "samples_per_10_ms_:" << samples_per_10_ms_;
+ RTC_LOG(INFO) << "samples_per_10_ms_:" << samples_per_10_ms_;
}
FineAudioBuffer::~FineAudioBuffer() {}
diff --git a/modules/audio_device/ios/audio_device_ios.mm b/modules/audio_device/ios/audio_device_ios.mm
index d0a9be5..7e11fa2 100644
--- a/modules/audio_device/ios/audio_device_ios.mm
+++ b/modules/audio_device/ios/audio_device_ios.mm
@@ -36,23 +36,23 @@
namespace webrtc {
-#define LOGI() LOG(LS_INFO) << "AudioDeviceIOS::"
+#define LOGI() RTC_LOG(LS_INFO) << "AudioDeviceIOS::"
-#define LOG_AND_RETURN_IF_ERROR(error, message) \
- do { \
- OSStatus err = error; \
- if (err) { \
- LOG(LS_ERROR) << message << ": " << err; \
- return false; \
- } \
+#define LOG_AND_RETURN_IF_ERROR(error, message) \
+ do { \
+ OSStatus err = error; \
+ if (err) { \
+ RTC_LOG(LS_ERROR) << message << ": " << err; \
+ return false; \
+ } \
} while (0)
-#define LOG_IF_ERROR(error, message) \
- do { \
- OSStatus err = error; \
- if (err) { \
- LOG(LS_ERROR) << message << ": " << err; \
- } \
+#define LOG_IF_ERROR(error, message) \
+ do { \
+ OSStatus err = error; \
+ if (err) { \
+ RTC_LOG(LS_ERROR) << message << ": " << err; \
+ } \
} while (0)
// Hardcoded delay estimates based on real measurements.
@@ -80,25 +80,25 @@
// Helper method that logs essential device information strings.
static void LogDeviceInfo() {
- LOG(LS_INFO) << "LogDeviceInfo";
+ RTC_LOG(LS_INFO) << "LogDeviceInfo";
@autoreleasepool {
- LOG(LS_INFO) << " system name: " << ios::GetSystemName();
- LOG(LS_INFO) << " system version 1(2): " << ios::GetSystemVersionAsString();
- LOG(LS_INFO) << " system version 2(2): " << ios::GetSystemVersion();
- LOG(LS_INFO) << " device type: " << ios::GetDeviceType();
- LOG(LS_INFO) << " device name: " << ios::GetDeviceName();
- LOG(LS_INFO) << " process name: " << ios::GetProcessName();
- LOG(LS_INFO) << " process ID: " << ios::GetProcessID();
- LOG(LS_INFO) << " OS version: " << ios::GetOSVersionString();
- LOG(LS_INFO) << " processing cores: " << ios::GetProcessorCount();
+ RTC_LOG(LS_INFO) << " system name: " << ios::GetSystemName();
+ RTC_LOG(LS_INFO) << " system version 1(2): " << ios::GetSystemVersionAsString();
+ RTC_LOG(LS_INFO) << " system version 2(2): " << ios::GetSystemVersion();
+ RTC_LOG(LS_INFO) << " device type: " << ios::GetDeviceType();
+ RTC_LOG(LS_INFO) << " device name: " << ios::GetDeviceName();
+ RTC_LOG(LS_INFO) << " process name: " << ios::GetProcessName();
+ RTC_LOG(LS_INFO) << " process ID: " << ios::GetProcessID();
+ RTC_LOG(LS_INFO) << " OS version: " << ios::GetOSVersionString();
+ RTC_LOG(LS_INFO) << " processing cores: " << ios::GetProcessorCount();
#if defined(__IPHONE_9_0) && defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && \
__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_9_0
- LOG(LS_INFO) << " low power mode: " << ios::GetLowPowerModeEnabled();
+ RTC_LOG(LS_INFO) << " low power mode: " << ios::GetLowPowerModeEnabled();
#endif
#if TARGET_IPHONE_SIMULATOR
- LOG(LS_INFO) << " TARGET_IPHONE_SIMULATOR is defined";
+ RTC_LOG(LS_INFO) << " TARGET_IPHONE_SIMULATOR is defined";
#endif
- LOG(LS_INFO) << " DeviceIsSimulator: " << DeviceIsSimulator();
+ RTC_LOG(LS_INFO) << " DeviceIsSimulator: " << DeviceIsSimulator();
}
}
#endif // !defined(NDEBUG)
@@ -186,7 +186,7 @@
RTC_DCHECK(!playing_);
if (!audio_is_initialized_) {
if (!InitPlayOrRecord()) {
- LOG_F(LS_ERROR) << "InitPlayOrRecord failed for InitPlayout!";
+ RTC_LOG_F(LS_ERROR) << "InitPlayOrRecord failed for InitPlayout!";
return -1;
}
}
@@ -212,7 +212,7 @@
RTC_DCHECK(!recording_);
if (!audio_is_initialized_) {
if (!InitPlayOrRecord()) {
- LOG_F(LS_ERROR) << "InitPlayOrRecord failed for InitRecording!";
+ RTC_LOG_F(LS_ERROR) << "InitPlayOrRecord failed for InitRecording!";
return -1;
}
}
@@ -234,7 +234,7 @@
RTCLogError(@"StartPlayout failed to start audio unit.");
return -1;
}
- LOG(LS_INFO) << "Voice-Processing I/O audio unit is now started";
+ RTC_LOG(LS_INFO) << "Voice-Processing I/O audio unit is now started";
}
rtc::AtomicOps::ReleaseStore(&playing_, 1);
num_playout_callbacks_ = 0;
@@ -283,7 +283,7 @@
RTCLogError(@"StartRecording failed to start audio unit.");
return -1;
}
- LOG(LS_INFO) << "Voice-Processing I/O audio unit is now started";
+ RTC_LOG(LS_INFO) << "Voice-Processing I/O audio unit is now started";
}
rtc::AtomicOps::ReleaseStore(&recording_, 1);
return 0;
@@ -708,7 +708,7 @@
// 16kHz.
RTCAudioSessionConfiguration* webRTCConfig = [RTCAudioSessionConfiguration webRTCConfiguration];
if (sample_rate != webRTCConfig.sampleRate) {
- LOG(LS_WARNING) << "Unable to set the preferred sample rate";
+ RTC_LOG(LS_WARNING) << "Unable to set the preferred sample rate";
}
// At this stage, we also know the exact IO buffer duration and can add
@@ -720,8 +720,8 @@
RTC_DCHECK(playout_parameters_.is_complete());
record_parameters_.reset(sample_rate, record_parameters_.channels(), io_buffer_duration);
RTC_DCHECK(record_parameters_.is_complete());
- LOG(LS_INFO) << " frames per I/O buffer: " << playout_parameters_.frames_per_buffer();
- LOG(LS_INFO) << " bytes per I/O buffer: " << playout_parameters_.GetBytesPerBuffer();
+ RTC_LOG(LS_INFO) << " frames per I/O buffer: " << playout_parameters_.frames_per_buffer();
+ RTC_LOG(LS_INFO) << " bytes per I/O buffer: " << playout_parameters_.GetBytesPerBuffer();
RTC_DCHECK_EQ(playout_parameters_.GetBytesPerBuffer(), record_parameters_.GetBytesPerBuffer());
// Update the ADB parameters since the sample rate might have changed.
diff --git a/modules/audio_device/ios/audio_device_not_implemented_ios.mm b/modules/audio_device/ios/audio_device_not_implemented_ios.mm
index 4de2653..2022ddd 100644
--- a/modules/audio_device/ios/audio_device_not_implemented_ios.mm
+++ b/modules/audio_device/ios/audio_device_not_implemented_ios.mm
@@ -22,13 +22,13 @@
int16_t AudioDeviceIOS::PlayoutDevices() {
// TODO(henrika): improve.
- LOG_F(LS_WARNING) << "Not implemented";
+ RTC_LOG_F(LS_WARNING) << "Not implemented";
return (int16_t)1;
}
int16_t AudioDeviceIOS::RecordingDevices() {
// TODO(henrika): improve.
- LOG_F(LS_WARNING) << "Not implemented";
+ RTC_LOG_F(LS_WARNING) << "Not implemented";
return (int16_t)1;
}
@@ -81,7 +81,7 @@
}
int32_t AudioDeviceIOS::SetPlayoutDevice(uint16_t index) {
- LOG_F(LS_WARNING) << "Not implemented";
+ RTC_LOG_F(LS_WARNING) << "Not implemented";
return 0;
}
@@ -119,7 +119,7 @@
}
int32_t AudioDeviceIOS::SetStereoRecording(bool enable) {
- LOG_F(LS_WARNING) << "Not implemented";
+ RTC_LOG_F(LS_WARNING) << "Not implemented";
return -1;
}
@@ -134,7 +134,7 @@
}
int32_t AudioDeviceIOS::SetStereoPlayout(bool enable) {
- LOG_F(LS_WARNING) << "Not implemented";
+ RTC_LOG_F(LS_WARNING) << "Not implemented";
return -1;
}
@@ -194,7 +194,7 @@
}
int32_t AudioDeviceIOS::SetRecordingDevice(uint16_t index) {
- LOG_F(LS_WARNING) << "Not implemented";
+ RTC_LOG_F(LS_WARNING) << "Not implemented";
return 0;
}
diff --git a/modules/audio_device/linux/audio_device_alsa_linux.cc b/modules/audio_device/linux/audio_device_alsa_linux.cc
index 0cc484f..1e4d1f5 100644
--- a/modules/audio_device/linux/audio_device_alsa_linux.cc
+++ b/modules/audio_device/linux/audio_device_alsa_linux.cc
@@ -94,7 +94,7 @@
_recordingDelay(0),
_playoutDelay(0) {
memset(_oldKeyState, 0, sizeof(_oldKeyState));
- LOG(LS_INFO) << __FUNCTION__ << " created";
+ RTC_LOG(LS_INFO) << __FUNCTION__ << " created";
}
// ----------------------------------------------------------------------------
@@ -102,7 +102,7 @@
// ----------------------------------------------------------------------------
AudioDeviceLinuxALSA::~AudioDeviceLinuxALSA() {
- LOG(LS_INFO) << __FUNCTION__ << " destroyed";
+ RTC_LOG(LS_INFO) << __FUNCTION__ << " destroyed";
Terminate();
@@ -143,7 +143,7 @@
// Load libasound
if (!AlsaSymbolTable.Load()) {
// Alsa is not installed on this system
- LOG(LS_ERROR) << "failed to load symbol table";
+ RTC_LOG(LS_ERROR) << "failed to load symbol table";
return InitStatus::OTHER_ERROR;
}
@@ -154,7 +154,7 @@
// Get X display handle for typing detection
_XDisplay = XOpenDisplay(NULL);
if (!_XDisplay) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "failed to open X display, typing detection will not work";
}
#endif
@@ -563,7 +563,7 @@
uint32_t level(0);
if (_mixerManager.MicrophoneVolume(level) == -1) {
- LOG(LS_WARNING) << "failed to retrive current microphone level";
+ RTC_LOG(LS_WARNING) << "failed to retrive current microphone level";
return -1;
}
@@ -606,11 +606,12 @@
}
uint32_t nDevices = GetDevicesInfo(0, true);
- LOG(LS_VERBOSE) << "number of available audio output devices is " << nDevices;
+ RTC_LOG(LS_VERBOSE) << "number of available audio output devices is "
+ << nDevices;
if (index > (nDevices - 1)) {
- LOG(LS_ERROR) << "device index is out of range [0," << (nDevices - 1)
- << "]";
+ RTC_LOG(LS_ERROR) << "device index is out of range [0," << (nDevices - 1)
+ << "]";
return -1;
}
@@ -622,7 +623,7 @@
int32_t AudioDeviceLinuxALSA::SetPlayoutDevice(
AudioDeviceModule::WindowsDeviceType /*device*/) {
- LOG(LS_ERROR) << "WindowsDeviceType not supported";
+ RTC_LOG(LS_ERROR) << "WindowsDeviceType not supported";
return -1;
}
@@ -674,11 +675,12 @@
}
uint32_t nDevices = GetDevicesInfo(0, false);
- LOG(LS_VERBOSE) << "number of availiable audio input devices is " << nDevices;
+ RTC_LOG(LS_VERBOSE) << "number of availiable audio input devices is "
+ << nDevices;
if (index > (nDevices - 1)) {
- LOG(LS_ERROR) << "device index is out of range [0," << (nDevices - 1)
- << "]";
+ RTC_LOG(LS_ERROR) << "device index is out of range [0," << (nDevices - 1)
+ << "]";
return -1;
}
@@ -694,7 +696,7 @@
int32_t AudioDeviceLinuxALSA::SetRecordingDevice(
AudioDeviceModule::WindowsDeviceType /*device*/) {
- LOG(LS_ERROR) << "WindowsDeviceType not supported";
+ RTC_LOG(LS_ERROR) << "WindowsDeviceType not supported";
return -1;
}
@@ -765,7 +767,7 @@
}
// Initialize the speaker (devices might have been added or removed)
if (InitSpeaker() == -1) {
- LOG(LS_WARNING) << "InitSpeaker() failed";
+ RTC_LOG(LS_WARNING) << "InitSpeaker() failed";
}
// Start by closing any existing wave-output devices
@@ -775,8 +777,8 @@
_handlePlayout = NULL;
_playIsInitialized = false;
if (errVal < 0) {
- LOG(LS_ERROR) << "Error closing current playout sound device, error: "
- << LATE(snd_strerror)(errVal);
+ RTC_LOG(LS_ERROR) << "Error closing current playout sound device, error: "
+ << LATE(snd_strerror)(errVal);
}
}
@@ -785,7 +787,7 @@
GetDevicesInfo(2, true, _outputDeviceIndex, deviceName,
kAdmMaxDeviceNameSize);
- LOG(LS_VERBOSE) << "InitPlayout open (" << deviceName << ")";
+ RTC_LOG(LS_VERBOSE) << "InitPlayout open (" << deviceName << ")";
errVal = LATE(snd_pcm_open)(&_handlePlayout, deviceName,
SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK);
@@ -802,8 +804,8 @@
}
}
if (errVal < 0) {
- LOG(LS_ERROR) << "unable to open playback device: "
- << LATE(snd_strerror)(errVal) << " (" << errVal << ")";
+ RTC_LOG(LS_ERROR) << "unable to open playback device: "
+ << LATE(snd_strerror)(errVal) << " (" << errVal << ")";
_handlePlayout = NULL;
return -1;
}
@@ -824,8 +826,8 @@
// in us
)) < 0) { /* 0.5sec */
_playoutFramesIn10MS = 0;
- LOG(LS_ERROR) << "unable to set playback device: "
- << LATE(snd_strerror)(errVal) << " (" << errVal << ")";
+ RTC_LOG(LS_ERROR) << "unable to set playback device: "
+ << LATE(snd_strerror)(errVal) << " (" << errVal << ")";
ErrorRecovery(errVal, _handlePlayout);
errVal = LATE(snd_pcm_close)(_handlePlayout);
_handlePlayout = NULL;
@@ -835,14 +837,14 @@
errVal = LATE(snd_pcm_get_params)(_handlePlayout, &_playoutBufferSizeInFrame,
&_playoutPeriodSizeInFrame);
if (errVal < 0) {
- LOG(LS_ERROR) << "snd_pcm_get_params: " << LATE(snd_strerror)(errVal)
- << " (" << errVal << ")";
+ RTC_LOG(LS_ERROR) << "snd_pcm_get_params: " << LATE(snd_strerror)(errVal)
+ << " (" << errVal << ")";
_playoutBufferSizeInFrame = 0;
_playoutPeriodSizeInFrame = 0;
} else {
- LOG(LS_VERBOSE) << "playout snd_pcm_get_params buffer_size:"
- << _playoutBufferSizeInFrame
- << " period_size :" << _playoutPeriodSizeInFrame;
+ RTC_LOG(LS_VERBOSE) << "playout snd_pcm_get_params buffer_size:"
+ << _playoutBufferSizeInFrame
+ << " period_size :" << _playoutPeriodSizeInFrame;
}
if (_ptrAudioBuffer) {
@@ -886,7 +888,7 @@
// Initialize the microphone (devices might have been added or removed)
if (InitMicrophone() == -1) {
- LOG(LS_WARNING) << "InitMicrophone() failed";
+ RTC_LOG(LS_WARNING) << "InitMicrophone() failed";
}
// Start by closing any existing pcm-input devices
@@ -896,8 +898,9 @@
_handleRecord = NULL;
_recIsInitialized = false;
if (errVal < 0) {
- LOG(LS_ERROR) << "Error closing current recording sound device, error: "
- << LATE(snd_strerror)(errVal);
+ RTC_LOG(LS_ERROR)
+ << "Error closing current recording sound device, error: "
+ << LATE(snd_strerror)(errVal);
}
}
@@ -907,7 +910,7 @@
GetDevicesInfo(2, false, _inputDeviceIndex, deviceName,
kAdmMaxDeviceNameSize);
- LOG(LS_VERBOSE) << "InitRecording open (" << deviceName << ")";
+ RTC_LOG(LS_VERBOSE) << "InitRecording open (" << deviceName << ")";
errVal = LATE(snd_pcm_open)(&_handleRecord, deviceName,
SND_PCM_STREAM_CAPTURE, SND_PCM_NONBLOCK);
@@ -924,8 +927,8 @@
}
}
if (errVal < 0) {
- LOG(LS_ERROR) << "unable to open record device: "
- << LATE(snd_strerror)(errVal);
+ RTC_LOG(LS_ERROR) << "unable to open record device: "
+ << LATE(snd_strerror)(errVal);
_handleRecord = NULL;
return -1;
}
@@ -964,8 +967,8 @@
ALSA_CAPTURE_LATENCY // latency in us
)) < 0) {
_recordingFramesIn10MS = 0;
- LOG(LS_ERROR) << "unable to set record settings: "
- << LATE(snd_strerror)(errVal) << " (" << errVal << ")";
+ RTC_LOG(LS_ERROR) << "unable to set record settings: "
+ << LATE(snd_strerror)(errVal) << " (" << errVal << ")";
ErrorRecovery(errVal, _handleRecord);
errVal = LATE(snd_pcm_close)(_handleRecord);
_handleRecord = NULL;
@@ -976,14 +979,14 @@
errVal = LATE(snd_pcm_get_params)(_handleRecord, &_recordingBuffersizeInFrame,
&_recordingPeriodSizeInFrame);
if (errVal < 0) {
- LOG(LS_ERROR) << "snd_pcm_get_params " << LATE(snd_strerror)(errVal) << " ("
- << errVal << ")";
+ RTC_LOG(LS_ERROR) << "snd_pcm_get_params " << LATE(snd_strerror)(errVal)
+ << " (" << errVal << ")";
_recordingBuffersizeInFrame = 0;
_recordingPeriodSizeInFrame = 0;
} else {
- LOG(LS_VERBOSE) << "capture snd_pcm_get_params, buffer_size:"
- << _recordingBuffersizeInFrame
- << ", period_size:" << _recordingPeriodSizeInFrame;
+ RTC_LOG(LS_VERBOSE) << "capture snd_pcm_get_params, buffer_size:"
+ << _recordingBuffersizeInFrame
+ << ", period_size:" << _recordingPeriodSizeInFrame;
}
if (_ptrAudioBuffer) {
@@ -1025,7 +1028,7 @@
if (!_recordingBuffer)
_recordingBuffer = new int8_t[_recordingBufferSizeIn10MS];
if (!_recordingBuffer) {
- LOG(LS_ERROR) << "failed to alloc recording buffer";
+ RTC_LOG(LS_ERROR) << "failed to alloc recording buffer";
_recording = false;
return -1;
}
@@ -1038,20 +1041,20 @@
errVal = LATE(snd_pcm_prepare)(_handleRecord);
if (errVal < 0) {
- LOG(LS_ERROR) << "capture snd_pcm_prepare failed ("
- << LATE(snd_strerror)(errVal) << ")\n";
+ RTC_LOG(LS_ERROR) << "capture snd_pcm_prepare failed ("
+ << LATE(snd_strerror)(errVal) << ")\n";
// just log error
// if snd_pcm_open fails will return -1
}
errVal = LATE(snd_pcm_start)(_handleRecord);
if (errVal < 0) {
- LOG(LS_ERROR) << "capture snd_pcm_start err: "
- << LATE(snd_strerror)(errVal);
+ RTC_LOG(LS_ERROR) << "capture snd_pcm_start err: "
+ << LATE(snd_strerror)(errVal);
errVal = LATE(snd_pcm_start)(_handleRecord);
if (errVal < 0) {
- LOG(LS_ERROR) << "capture snd_pcm_start 2nd try err: "
- << LATE(snd_strerror)(errVal);
+ RTC_LOG(LS_ERROR) << "capture snd_pcm_start 2nd try err: "
+ << LATE(snd_strerror)(errVal);
StopRecording();
return -1;
}
@@ -1092,14 +1095,14 @@
// Stop and close pcm recording device.
int errVal = LATE(snd_pcm_drop)(_handleRecord);
if (errVal < 0) {
- LOG(LS_ERROR) << "Error stop recording: " << LATE(snd_strerror)(errVal);
+ RTC_LOG(LS_ERROR) << "Error stop recording: " << LATE(snd_strerror)(errVal);
return -1;
}
errVal = LATE(snd_pcm_close)(_handleRecord);
if (errVal < 0) {
- LOG(LS_ERROR) << "Error closing record sound device, error: "
- << LATE(snd_strerror)(errVal);
+ RTC_LOG(LS_ERROR) << "Error closing record sound device, error: "
+ << LATE(snd_strerror)(errVal);
return -1;
}
@@ -1142,7 +1145,7 @@
if (!_playoutBuffer)
_playoutBuffer = new int8_t[_playoutBufferSizeIn10MS];
if (!_playoutBuffer) {
- LOG(LS_ERROR) << "failed to alloc playout buf";
+ RTC_LOG(LS_ERROR) << "failed to alloc playout buf";
_playing = false;
return -1;
}
@@ -1155,8 +1158,8 @@
int errVal = LATE(snd_pcm_prepare)(_handlePlayout);
if (errVal < 0) {
- LOG(LS_ERROR) << "playout snd_pcm_prepare failed ("
- << LATE(snd_strerror)(errVal) << ")\n";
+ RTC_LOG(LS_ERROR) << "playout snd_pcm_prepare failed ("
+ << LATE(snd_strerror)(errVal) << ")\n";
// just log error
// if snd_pcm_open fails will return -1
}
@@ -1194,18 +1197,18 @@
// stop and close pcm playout device
int errVal = LATE(snd_pcm_drop)(_handlePlayout);
if (errVal < 0) {
- LOG(LS_ERROR) << "Error stop playing: " << LATE(snd_strerror)(errVal);
+ RTC_LOG(LS_ERROR) << "Error stop playing: " << LATE(snd_strerror)(errVal);
}
errVal = LATE(snd_pcm_close)(_handlePlayout);
if (errVal < 0)
- LOG(LS_ERROR) << "Error closing playout sound device, error: "
- << LATE(snd_strerror)(errVal);
+ RTC_LOG(LS_ERROR) << "Error closing playout sound device, error: "
+ << LATE(snd_strerror)(errVal);
// set the pcm input handle to NULL
_playIsInitialized = false;
_handlePlayout = NULL;
- LOG(LS_VERBOSE) << "handle_playout is now set to NULL";
+ RTC_LOG(LS_VERBOSE) << "handle_playout is now set to NULL";
return 0;
}
@@ -1252,8 +1255,8 @@
void** hints;
err = LATE(snd_device_name_hint)(card, "pcm", &hints);
if (err != 0) {
- LOG(LS_ERROR) << "GetDevicesInfo - device name hint error: "
- << LATE(snd_strerror)(err);
+ RTC_LOG(LS_ERROR) << "GetDevicesInfo - device name hint error: "
+ << LATE(snd_strerror)(err);
return -1;
}
@@ -1265,8 +1268,8 @@
err = LATE(snd_device_name_free_hint)(hints);
if (err != 0) {
- LOG(LS_ERROR) << "GetDevicesInfo - device name free hint error: "
- << LATE(snd_strerror)(err);
+ RTC_LOG(LS_ERROR) << "GetDevicesInfo - device name free hint error: "
+ << LATE(snd_strerror)(err);
}
return 0;
@@ -1285,7 +1288,7 @@
char* name = LATE(snd_device_name_get_hint)(*list, "NAME");
if (!name) {
- LOG(LS_ERROR) << "Device has no name";
+ RTC_LOG(LS_ERROR) << "Device has no name";
// Skip it.
continue;
}
@@ -1303,7 +1306,7 @@
}
if (FUNC_GET_NUM_OF_DEVICE == function) {
- LOG(LS_VERBOSE) << "Enum device " << enumCount << " - " << name;
+ RTC_LOG(LS_VERBOSE) << "Enum device " << enumCount << " - " << name;
}
if ((FUNC_GET_DEVICE_NAME == function) && (enumDeviceNo == enumCount)) {
// We have found the enum device, copy the name to buffer.
@@ -1338,8 +1341,8 @@
err = LATE(snd_device_name_free_hint)(hints);
if (err != 0) {
- LOG(LS_ERROR) << "GetDevicesInfo - device name free hint error: "
- << LATE(snd_strerror)(err);
+ RTC_LOG(LS_ERROR) << "GetDevicesInfo - device name free hint error: "
+ << LATE(snd_strerror)(err);
// Continue and return true anyway, since we did get the whole list.
}
}
@@ -1353,7 +1356,8 @@
if (keepSearching) {
// If we get here for function 1 and 2, we didn't find the specified
// enum device.
- LOG(LS_ERROR) << "GetDevicesInfo - Could not find device name or numbers";
+ RTC_LOG(LS_ERROR)
+ << "GetDevicesInfo - Could not find device name or numbers";
return -1;
}
@@ -1362,7 +1366,7 @@
int32_t AudioDeviceLinuxALSA::InputSanityCheckAfterUnlockedPeriod() const {
if (_handleRecord == NULL) {
- LOG(LS_ERROR) << "input state has been modified during unlocked period";
+ RTC_LOG(LS_ERROR) << "input state has been modified during unlocked period";
return -1;
}
return 0;
@@ -1370,7 +1374,8 @@
int32_t AudioDeviceLinuxALSA::OutputSanityCheckAfterUnlockedPeriod() const {
if (_handlePlayout == NULL) {
- LOG(LS_ERROR) << "output state has been modified during unlocked period";
+ RTC_LOG(LS_ERROR)
+ << "output state has been modified during unlocked period";
return -1;
}
return 0;
@@ -1379,13 +1384,13 @@
int32_t AudioDeviceLinuxALSA::ErrorRecovery(int32_t error,
snd_pcm_t* deviceHandle) {
int st = LATE(snd_pcm_state)(deviceHandle);
- LOG(LS_VERBOSE) << "Trying to recover from "
- << ((LATE(snd_pcm_stream)(deviceHandle) ==
- SND_PCM_STREAM_CAPTURE)
- ? "capture"
- : "playout")
- << " error: " << LATE(snd_strerror)(error) << " (" << error
- << ") (state " << st << ")";
+ RTC_LOG(LS_VERBOSE) << "Trying to recover from "
+ << ((LATE(snd_pcm_stream)(deviceHandle) ==
+ SND_PCM_STREAM_CAPTURE)
+ ? "capture"
+ : "playout")
+ << " error: " << LATE(snd_strerror)(error) << " ("
+ << error << ") (state " << st << ")";
// It is recommended to use snd_pcm_recover for all errors. If that function
// cannot handle the error, the input error code will be returned, otherwise
@@ -1419,7 +1424,7 @@
int res = LATE(snd_pcm_recover)(deviceHandle, error, 1);
if (0 == res) {
- LOG(LS_VERBOSE) << "Recovery - snd_pcm_recover OK";
+ RTC_LOG(LS_VERBOSE) << "Recovery - snd_pcm_recover OK";
if ((error == -EPIPE || error == -ESTRPIPE) && // Buf underrun/overrun.
_recording &&
@@ -1428,7 +1433,7 @@
// to get data flowing again.
int err = LATE(snd_pcm_start)(deviceHandle);
if (err != 0) {
- LOG(LS_ERROR) << "Recovery - snd_pcm_start error: " << err;
+ RTC_LOG(LS_ERROR) << "Recovery - snd_pcm_start error: " << err;
return -1;
}
}
@@ -1440,15 +1445,15 @@
// data flowing again.
int err = LATE(snd_pcm_start)(deviceHandle);
if (err != 0) {
- LOG(LS_ERROR) << "Recovery - snd_pcm_start error: "
- << LATE(snd_strerror)(err);
+ RTC_LOG(LS_ERROR) << "Recovery - snd_pcm_start error: "
+ << LATE(snd_strerror)(err);
return -1;
}
}
return -EPIPE == error ? 1 : 0;
} else {
- LOG(LS_ERROR) << "Unrecoverable alsa stream error: " << res;
+ RTC_LOG(LS_ERROR) << "Unrecoverable alsa stream error: " << res;
}
return res;
@@ -1478,8 +1483,8 @@
// return a positive number of frames ready otherwise a negative error code
avail_frames = LATE(snd_pcm_avail_update)(_handlePlayout);
if (avail_frames < 0) {
- LOG(LS_ERROR) << "playout snd_pcm_avail_update error: "
- << LATE(snd_strerror)(avail_frames);
+ RTC_LOG(LS_ERROR) << "playout snd_pcm_avail_update error: "
+ << LATE(snd_strerror)(avail_frames);
ErrorRecovery(avail_frames, _handlePlayout);
UnLock();
return true;
@@ -1489,7 +1494,7 @@
// maximum tixe in milliseconds to wait, a negative value means infinity
err = LATE(snd_pcm_wait)(_handlePlayout, 2);
if (err == 0) { // timeout occured
- LOG(LS_VERBOSE) << "playout snd_pcm_wait timeout";
+ RTC_LOG(LS_VERBOSE) << "playout snd_pcm_wait timeout";
}
return true;
@@ -1513,8 +1518,8 @@
avail_frames);
if (frames < 0) {
- LOG(LS_VERBOSE) << "playout snd_pcm_writei error: "
- << LATE(snd_strerror)(frames);
+ RTC_LOG(LS_VERBOSE) << "playout snd_pcm_writei error: "
+ << LATE(snd_strerror)(frames);
_playoutFramesLeft = 0;
ErrorRecovery(frames, _handlePlayout);
UnLock();
@@ -1542,8 +1547,8 @@
// return a positive number of frames ready otherwise a negative error code
avail_frames = LATE(snd_pcm_avail_update)(_handleRecord);
if (avail_frames < 0) {
- LOG(LS_ERROR) << "capture snd_pcm_avail_update error: "
- << LATE(snd_strerror)(avail_frames);
+ RTC_LOG(LS_ERROR) << "capture snd_pcm_avail_update error: "
+ << LATE(snd_strerror)(avail_frames);
ErrorRecovery(avail_frames, _handleRecord);
UnLock();
return true;
@@ -1553,7 +1558,7 @@
// maximum time in milliseconds to wait, a negative value means infinity
err = LATE(snd_pcm_wait)(_handleRecord, ALSA_CAPTURE_WAIT_TIMEOUT);
if (err == 0) // timeout occured
- LOG(LS_VERBOSE) << "capture snd_pcm_wait timeout";
+ RTC_LOG(LS_VERBOSE) << "capture snd_pcm_wait timeout";
return true;
}
@@ -1564,8 +1569,8 @@
frames = LATE(snd_pcm_readi)(_handleRecord, buffer,
avail_frames); // frames to be written
if (frames < 0) {
- LOG(LS_ERROR) << "capture snd_pcm_readi error: "
- << LATE(snd_strerror)(frames);
+ RTC_LOG(LS_ERROR) << "capture snd_pcm_readi error: "
+ << LATE(snd_strerror)(frames);
ErrorRecovery(frames, _handleRecord);
UnLock();
return true;
@@ -1610,7 +1615,8 @@
if (err < 0) {
// TODO(xians): Shall we call ErrorRecovery() here?
_playoutDelay = 0;
- LOG(LS_ERROR) << "playout snd_pcm_delay: " << LATE(snd_strerror)(err);
+ RTC_LOG(LS_ERROR)
+ << "playout snd_pcm_delay: " << LATE(snd_strerror)(err);
}
}
@@ -1619,7 +1625,8 @@
if (err < 0) {
// TODO(xians): Shall we call ErrorRecovery() here?
_recordingDelay = 0;
- LOG(LS_ERROR) << "capture snd_pcm_delay: " << LATE(snd_strerror)(err);
+ RTC_LOG(LS_ERROR) << "capture snd_pcm_delay: "
+ << LATE(snd_strerror)(err);
}
// TODO(xians): Shall we add 10ms buffer delay to the record delay?
@@ -1641,7 +1648,7 @@
// change is needed. Set this new mic level (received from the
// observer as return value in the callback).
if (SetMicrophoneVolume(newMicLevel) == -1)
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "the required modification of the microphone volume failed";
}
}
diff --git a/modules/audio_device/linux/audio_device_pulse_linux.cc b/modules/audio_device/linux/audio_device_pulse_linux.cc
index b9614bf..9d3b80b 100644
--- a/modules/audio_device/linux/audio_device_pulse_linux.cc
+++ b/modules/audio_device/linux/audio_device_pulse_linux.cc
@@ -81,7 +81,7 @@
_playStream(NULL),
_recStreamFlags(0),
_playStreamFlags(0) {
- LOG(LS_INFO) << __FUNCTION__ << " created";
+ RTC_LOG(LS_INFO) << __FUNCTION__ << " created";
memset(_paServerVersion, 0, sizeof(_paServerVersion));
memset(&_playBufferAttr, 0, sizeof(_playBufferAttr));
@@ -90,7 +90,7 @@
}
AudioDeviceLinuxPulse::~AudioDeviceLinuxPulse() {
- LOG(LS_INFO) << __FUNCTION__ << " destroyed";
+ RTC_LOG(LS_INFO) << __FUNCTION__ << " destroyed";
RTC_DCHECK(thread_checker_.CalledOnValidThread());
Terminate();
@@ -149,9 +149,9 @@
// Initialize PulseAudio
if (InitPulseAudio() < 0) {
- LOG(LS_ERROR) << "failed to initialize PulseAudio";
+ RTC_LOG(LS_ERROR) << "failed to initialize PulseAudio";
if (TerminatePulseAudio() < 0) {
- LOG(LS_ERROR) << "failed to terminate PulseAudio";
+ RTC_LOG(LS_ERROR) << "failed to terminate PulseAudio";
}
return InitStatus::OTHER_ERROR;
}
@@ -159,7 +159,7 @@
// Get X display handle for typing detection
_XDisplay = XOpenDisplay(NULL);
if (!_XDisplay) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "failed to open X display, typing detection will not work";
}
@@ -209,7 +209,7 @@
// Terminate PulseAudio
if (TerminatePulseAudio() < 0) {
- LOG(LS_ERROR) << "failed to terminate PulseAudio";
+ RTC_LOG(LS_ERROR) << "failed to terminate PulseAudio";
return -1;
}
@@ -624,7 +624,7 @@
uint32_t level(0);
if (_mixerManager.MicrophoneVolume(level) == -1) {
- LOG(LS_WARNING) << "failed to retrieve current microphone level";
+ RTC_LOG(LS_WARNING) << "failed to retrieve current microphone level";
return -1;
}
@@ -682,11 +682,11 @@
const uint16_t nDevices = PlayoutDevices();
- LOG(LS_VERBOSE) << "number of availiable output devices is " << nDevices;
+ RTC_LOG(LS_VERBOSE) << "number of availiable output devices is " << nDevices;
if (index > (nDevices - 1)) {
- LOG(LS_ERROR) << "device index is out of range [0," << (nDevices - 1)
- << "]";
+ RTC_LOG(LS_ERROR) << "device index is out of range [0," << (nDevices - 1)
+ << "]";
return -1;
}
@@ -698,7 +698,7 @@
int32_t AudioDeviceLinuxPulse::SetPlayoutDevice(
AudioDeviceModule::WindowsDeviceType /*device*/) {
- LOG(LS_ERROR) << "WindowsDeviceType not supported";
+ RTC_LOG(LS_ERROR) << "WindowsDeviceType not supported";
return -1;
}
@@ -803,11 +803,11 @@
const uint16_t nDevices(RecordingDevices());
- LOG(LS_VERBOSE) << "number of availiable input devices is " << nDevices;
+ RTC_LOG(LS_VERBOSE) << "number of availiable input devices is " << nDevices;
if (index > (nDevices - 1)) {
- LOG(LS_ERROR) << "device index is out of range [0," << (nDevices - 1)
- << "]";
+ RTC_LOG(LS_ERROR) << "device index is out of range [0," << (nDevices - 1)
+ << "]";
return -1;
}
@@ -819,7 +819,7 @@
int32_t AudioDeviceLinuxPulse::SetRecordingDevice(
AudioDeviceModule::WindowsDeviceType /*device*/) {
- LOG(LS_ERROR) << "WindowsDeviceType not supported";
+ RTC_LOG(LS_ERROR) << "WindowsDeviceType not supported";
return -1;
}
@@ -874,7 +874,7 @@
// Initialize the speaker (devices might have been added or removed)
if (InitSpeaker() == -1) {
- LOG(LS_WARNING) << "InitSpeaker() failed";
+ RTC_LOG(LS_WARNING) << "InitSpeaker() failed";
}
// Set the play sample specification
@@ -888,8 +888,8 @@
LATE(pa_stream_new)(_paContext, "playStream", &playSampleSpec, NULL);
if (!_playStream) {
- LOG(LS_ERROR) << "failed to create play stream, err="
- << LATE(pa_context_errno)(_paContext);
+ RTC_LOG(LS_ERROR) << "failed to create play stream, err="
+ << LATE(pa_context_errno)(_paContext);
return -1;
}
@@ -902,7 +902,8 @@
_ptrAudioBuffer->SetPlayoutChannels((uint8_t)_playChannels);
}
- LOG(LS_VERBOSE) << "stream state " << LATE(pa_stream_get_state)(_playStream);
+ RTC_LOG(LS_VERBOSE) << "stream state "
+ << LATE(pa_stream_get_state)(_playStream);
// Set stream flags
_playStreamFlags = (pa_stream_flags_t)(PA_STREAM_AUTO_TIMING_UPDATE |
@@ -921,7 +922,7 @@
const pa_sample_spec* spec = LATE(pa_stream_get_sample_spec)(_playStream);
if (!spec) {
- LOG(LS_ERROR) << "pa_stream_get_sample_spec()";
+ RTC_LOG(LS_ERROR) << "pa_stream_get_sample_spec()";
return -1;
}
@@ -977,7 +978,7 @@
// Initialize the microphone (devices might have been added or removed)
if (InitMicrophone() == -1) {
- LOG(LS_WARNING) << "InitMicrophone() failed";
+ RTC_LOG(LS_WARNING) << "InitMicrophone() failed";
}
// Set the rec sample specification
@@ -990,8 +991,8 @@
_recStream =
LATE(pa_stream_new)(_paContext, "recStream", &recSampleSpec, NULL);
if (!_recStream) {
- LOG(LS_ERROR) << "failed to create rec stream, err="
- << LATE(pa_context_errno)(_paContext);
+ RTC_LOG(LS_ERROR) << "failed to create rec stream, err="
+ << LATE(pa_context_errno)(_paContext);
return -1;
}
@@ -1020,7 +1021,7 @@
const pa_sample_spec* spec = LATE(pa_stream_get_sample_spec)(_recStream);
if (!spec) {
- LOG(LS_ERROR) << "pa_stream_get_sample_spec(rec)";
+ RTC_LOG(LS_ERROR) << "pa_stream_get_sample_spec(rec)";
return -1;
}
@@ -1077,7 +1078,7 @@
_startRec = false;
}
StopRecording();
- LOG(LS_ERROR) << "failed to activate recording";
+ RTC_LOG(LS_ERROR) << "failed to activate recording";
return -1;
}
@@ -1087,7 +1088,7 @@
// The recording state is set by the audio thread after recording
// has started.
} else {
- LOG(LS_ERROR) << "failed to activate recording";
+ RTC_LOG(LS_ERROR) << "failed to activate recording";
return -1;
}
}
@@ -1110,7 +1111,7 @@
_recIsInitialized = false;
_recording = false;
- LOG(LS_VERBOSE) << "stopping recording";
+ RTC_LOG(LS_VERBOSE) << "stopping recording";
// Stop Recording
PaLock();
@@ -1124,13 +1125,13 @@
if (LATE(pa_stream_get_state)(_recStream) != PA_STREAM_UNCONNECTED) {
// Disconnect the stream
if (LATE(pa_stream_disconnect)(_recStream) != PA_OK) {
- LOG(LS_ERROR) << "failed to disconnect rec stream, err="
- << LATE(pa_context_errno)(_paContext);
+ RTC_LOG(LS_ERROR) << "failed to disconnect rec stream, err="
+ << LATE(pa_context_errno)(_paContext);
PaUnLock();
return -1;
}
- LOG(LS_VERBOSE) << "disconnected recording";
+ RTC_LOG(LS_VERBOSE) << "disconnected recording";
}
LATE(pa_stream_unref)(_recStream);
@@ -1192,7 +1193,7 @@
_startPlay = false;
}
StopPlayout();
- LOG(LS_ERROR) << "failed to activate playout";
+ RTC_LOG(LS_ERROR) << "failed to activate playout";
return -1;
}
@@ -1202,7 +1203,7 @@
// The playing state is set by the audio thread after playout
// has started.
} else {
- LOG(LS_ERROR) << "failed to activate playing";
+ RTC_LOG(LS_ERROR) << "failed to activate playing";
return -1;
}
}
@@ -1227,7 +1228,7 @@
_sndCardPlayDelay = 0;
_sndCardRecDelay = 0;
- LOG(LS_VERBOSE) << "stopping playback";
+ RTC_LOG(LS_VERBOSE) << "stopping playback";
// Stop Playout
PaLock();
@@ -1241,13 +1242,13 @@
if (LATE(pa_stream_get_state)(_playStream) != PA_STREAM_UNCONNECTED) {
// Disconnect the stream
if (LATE(pa_stream_disconnect)(_playStream) != PA_OK) {
- LOG(LS_ERROR) << "failed to disconnect play stream, err="
- << LATE(pa_context_errno)(_paContext);
+ RTC_LOG(LS_ERROR) << "failed to disconnect play stream, err="
+ << LATE(pa_context_errno)(_paContext);
PaUnLock();
return -1;
}
- LOG(LS_VERBOSE) << "disconnected playback";
+ RTC_LOG(LS_VERBOSE) << "disconnected playback";
}
LATE(pa_stream_unref)(_playStream);
@@ -1315,26 +1316,26 @@
}
void AudioDeviceLinuxPulse::PaContextStateCallbackHandler(pa_context* c) {
- LOG(LS_VERBOSE) << "context state cb";
+ RTC_LOG(LS_VERBOSE) << "context state cb";
pa_context_state_t state = LATE(pa_context_get_state)(c);
switch (state) {
case PA_CONTEXT_UNCONNECTED:
- LOG(LS_VERBOSE) << "unconnected";
+ RTC_LOG(LS_VERBOSE) << "unconnected";
break;
case PA_CONTEXT_CONNECTING:
case PA_CONTEXT_AUTHORIZING:
case PA_CONTEXT_SETTING_NAME:
- LOG(LS_VERBOSE) << "no state";
+ RTC_LOG(LS_VERBOSE) << "no state";
break;
case PA_CONTEXT_FAILED:
case PA_CONTEXT_TERMINATED:
- LOG(LS_VERBOSE) << "failed";
+ RTC_LOG(LS_VERBOSE) << "failed";
_paStateChanged = true;
LATE(pa_threaded_mainloop_signal)(_paMainloop, 0);
break;
case PA_CONTEXT_READY:
- LOG(LS_VERBOSE) << "ready";
+ RTC_LOG(LS_VERBOSE) << "ready";
_paStateChanged = true;
LATE(pa_threaded_mainloop_signal)(_paMainloop, 0);
break;
@@ -1425,22 +1426,22 @@
}
void AudioDeviceLinuxPulse::PaStreamStateCallbackHandler(pa_stream* p) {
- LOG(LS_VERBOSE) << "stream state cb";
+ RTC_LOG(LS_VERBOSE) << "stream state cb";
pa_stream_state_t state = LATE(pa_stream_get_state)(p);
switch (state) {
case PA_STREAM_UNCONNECTED:
- LOG(LS_VERBOSE) << "unconnected";
+ RTC_LOG(LS_VERBOSE) << "unconnected";
break;
case PA_STREAM_CREATING:
- LOG(LS_VERBOSE) << "creating";
+ RTC_LOG(LS_VERBOSE) << "creating";
break;
case PA_STREAM_FAILED:
case PA_STREAM_TERMINATED:
- LOG(LS_VERBOSE) << "failed";
+ RTC_LOG(LS_VERBOSE) << "failed";
break;
case PA_STREAM_READY:
- LOG(LS_VERBOSE) << "ready";
+ RTC_LOG(LS_VERBOSE) << "ready";
break;
}
@@ -1460,7 +1461,7 @@
PaUnLock();
- LOG(LS_VERBOSE) << "checking PulseAudio version: " << _paServerVersion;
+ RTC_LOG(LS_VERBOSE) << "checking PulseAudio version: " << _paServerVersion;
return 0;
}
@@ -1558,50 +1559,50 @@
if (!PaSymbolTable.Load()) {
// Most likely the Pulse library and sound server are not installed on
// this system
- LOG(LS_ERROR) << "failed to load symbol table";
+ RTC_LOG(LS_ERROR) << "failed to load symbol table";
return -1;
}
// Create a mainloop API and connection to the default server
// the mainloop is the internal asynchronous API event loop
if (_paMainloop) {
- LOG(LS_ERROR) << "PA mainloop has already existed";
+ RTC_LOG(LS_ERROR) << "PA mainloop has already existed";
return -1;
}
_paMainloop = LATE(pa_threaded_mainloop_new)();
if (!_paMainloop) {
- LOG(LS_ERROR) << "could not create mainloop";
+ RTC_LOG(LS_ERROR) << "could not create mainloop";
return -1;
}
// Start the threaded main loop
retVal = LATE(pa_threaded_mainloop_start)(_paMainloop);
if (retVal != PA_OK) {
- LOG(LS_ERROR) << "failed to start main loop, error=" << retVal;
+ RTC_LOG(LS_ERROR) << "failed to start main loop, error=" << retVal;
return -1;
}
- LOG(LS_VERBOSE) << "mainloop running!";
+ RTC_LOG(LS_VERBOSE) << "mainloop running!";
PaLock();
_paMainloopApi = LATE(pa_threaded_mainloop_get_api)(_paMainloop);
if (!_paMainloopApi) {
- LOG(LS_ERROR) << "could not create mainloop API";
+ RTC_LOG(LS_ERROR) << "could not create mainloop API";
PaUnLock();
return -1;
}
// Create a new PulseAudio context
if (_paContext) {
- LOG(LS_ERROR) << "PA context has already existed";
+ RTC_LOG(LS_ERROR) << "PA context has already existed";
PaUnLock();
return -1;
}
_paContext = LATE(pa_context_new)(_paMainloopApi, "WEBRTC VoiceEngine");
if (!_paContext) {
- LOG(LS_ERROR) << "could not create context";
+ RTC_LOG(LS_ERROR) << "could not create context";
PaUnLock();
return -1;
}
@@ -1615,7 +1616,7 @@
LATE(pa_context_connect)(_paContext, NULL, PA_CONTEXT_NOAUTOSPAWN, NULL);
if (retVal != PA_OK) {
- LOG(LS_ERROR) << "failed to connect context, error=" << retVal;
+ RTC_LOG(LS_ERROR) << "failed to connect context, error=" << retVal;
PaUnLock();
return -1;
}
@@ -1630,13 +1631,13 @@
if (state != PA_CONTEXT_READY) {
if (state == PA_CONTEXT_FAILED) {
- LOG(LS_ERROR) << "failed to connect to PulseAudio sound server";
+ RTC_LOG(LS_ERROR) << "failed to connect to PulseAudio sound server";
} else if (state == PA_CONTEXT_TERMINATED) {
- LOG(LS_ERROR) << "PulseAudio connection terminated early";
+ RTC_LOG(LS_ERROR) << "PulseAudio connection terminated early";
} else {
// Shouldn't happen, because we only signal on one of those three
// states
- LOG(LS_ERROR) << "unknown problem connecting to PulseAudio";
+ RTC_LOG(LS_ERROR) << "unknown problem connecting to PulseAudio";
}
PaUnLock();
return -1;
@@ -1649,15 +1650,15 @@
// Check the version
if (CheckPulseAudioVersion() < 0) {
- LOG(LS_ERROR) << "PulseAudio version " << _paServerVersion
- << " not supported";
+ RTC_LOG(LS_ERROR) << "PulseAudio version " << _paServerVersion
+ << " not supported";
return -1;
}
// Initialize sampling frequency
if (InitSamplingFrequency() < 0 || sample_rate_hz_ == 0) {
- LOG(LS_ERROR) << "failed to initialize sampling frequency, set to "
- << sample_rate_hz_ << " Hz";
+ RTC_LOG(LS_ERROR) << "failed to initialize sampling frequency, set to "
+ << sample_rate_hz_ << " Hz";
return -1;
}
@@ -1698,7 +1699,7 @@
_paMainloop = NULL;
- LOG(LS_VERBOSE) << "PulseAudio terminated";
+ RTC_LOG(LS_VERBOSE) << "PulseAudio terminated";
return 0;
}
@@ -1714,7 +1715,7 @@
void AudioDeviceLinuxPulse::WaitForOperationCompletion(
pa_operation* paOperation) const {
if (!paOperation) {
- LOG(LS_ERROR) << "paOperation NULL in WaitForOperationCompletion";
+ RTC_LOG(LS_ERROR) << "paOperation NULL in WaitForOperationCompletion";
return;
}
@@ -1773,7 +1774,7 @@
}
void AudioDeviceLinuxPulse::PaStreamUnderflowCallbackHandler() {
- LOG(LS_WARNING) << "Playout underflow";
+ RTC_LOG(LS_WARNING) << "Playout underflow";
if (_configuredLatencyPlay == WEBRTC_PA_NO_LATENCY_REQUIREMENTS) {
// We didn't configure a pa_buffer_attr before, so switching to
@@ -1785,7 +1786,7 @@
const pa_sample_spec* spec = LATE(pa_stream_get_sample_spec)(_playStream);
if (!spec) {
- LOG(LS_ERROR) << "pa_stream_get_sample_spec()";
+ RTC_LOG(LS_ERROR) << "pa_stream_get_sample_spec()";
return;
}
@@ -1804,7 +1805,7 @@
pa_operation* op = LATE(pa_stream_set_buffer_attr)(
_playStream, &_playBufferAttr, NULL, NULL);
if (!op) {
- LOG(LS_ERROR) << "pa_stream_set_buffer_attr()";
+ RTC_LOG(LS_ERROR) << "pa_stream_set_buffer_attr()";
return;
}
@@ -1834,7 +1835,7 @@
// in the worker thread.
if (LATE(pa_stream_peek)(_recStream, &_tempSampleData,
&_tempSampleDataSize) != 0) {
- LOG(LS_ERROR) << "Can't read data!";
+ RTC_LOG(LS_ERROR) << "Can't read data!";
return;
}
@@ -1851,7 +1852,7 @@
}
void AudioDeviceLinuxPulse::PaStreamOverflowCallbackHandler() {
- LOG(LS_WARNING) << "Recording overflow";
+ RTC_LOG(LS_WARNING) << "Recording overflow";
}
int32_t AudioDeviceLinuxPulse::LatencyUsecs(pa_stream* stream) {
@@ -1866,14 +1867,15 @@
pa_usec_t latency;
int negative;
if (LATE(pa_stream_get_latency)(stream, &latency, &negative) != 0) {
- LOG(LS_ERROR) << "Can't query latency";
+ RTC_LOG(LS_ERROR) << "Can't query latency";
// We'd rather continue playout/capture with an incorrect delay than
// stop it altogether, so return a valid value.
return 0;
}
if (negative) {
- LOG(LS_VERBOSE) << "warning: pa_stream_get_latency reported negative delay";
+ RTC_LOG(LS_VERBOSE)
+ << "warning: pa_stream_get_latency reported negative delay";
// The delay can be negative for monitoring streams if the captured
// samples haven't been played yet. In such a case, "latency"
@@ -2006,10 +2008,10 @@
// change is needed.
// Set this new mic level (received from the observer as return
// value in the callback).
- LOG(LS_VERBOSE) << "AGC change of volume: old=" << currentMicLevel
- << " => new=" << newMicLevel;
+ RTC_LOG(LS_VERBOSE) << "AGC change of volume: old=" << currentMicLevel
+ << " => new=" << newMicLevel;
if (SetMicrophoneVolume(newMicLevel) == -1) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "the required modification of the microphone volume failed";
}
}
@@ -2031,7 +2033,7 @@
case kEventSignaled:
break;
case kEventError:
- LOG(LS_WARNING) << "EventWrapper::Wait() failed";
+ RTC_LOG(LS_WARNING) << "EventWrapper::Wait() failed";
return true;
case kEventTimeout:
return true;
@@ -2040,7 +2042,7 @@
rtc::CritScope lock(&_critSect);
if (_startPlay) {
- LOG(LS_VERBOSE) << "_startPlay true, performing initial actions";
+ RTC_LOG(LS_VERBOSE) << "_startPlay true, performing initial actions";
_startPlay = false;
_playDeviceName = NULL;
@@ -2088,18 +2090,18 @@
if (LATE(pa_stream_connect_playback)(
_playStream, _playDeviceName, &_playBufferAttr,
(pa_stream_flags_t)_playStreamFlags, ptr_cvolume, NULL) != PA_OK) {
- LOG(LS_ERROR) << "failed to connect play stream, err="
- << LATE(pa_context_errno)(_paContext);
+ RTC_LOG(LS_ERROR) << "failed to connect play stream, err="
+ << LATE(pa_context_errno)(_paContext);
}
- LOG(LS_VERBOSE) << "play stream connected";
+ RTC_LOG(LS_VERBOSE) << "play stream connected";
// Wait for state change
while (LATE(pa_stream_get_state)(_playStream) != PA_STREAM_READY) {
LATE(pa_threaded_mainloop_wait)(_paMainloop);
}
- LOG(LS_VERBOSE) << "play stream ready";
+ RTC_LOG(LS_VERBOSE) << "play stream ready";
// We can now handle write callbacks
EnableWriteCallback();
@@ -2136,8 +2138,8 @@
NULL, (int64_t)0, PA_SEEK_RELATIVE) != PA_OK) {
_writeErrors++;
if (_writeErrors > 10) {
- LOG(LS_ERROR) << "Playout error: _writeErrors=" << _writeErrors
- << ", error=" << LATE(pa_context_errno)(_paContext);
+ RTC_LOG(LS_ERROR) << "Playout error: _writeErrors=" << _writeErrors
+ << ", error=" << LATE(pa_context_errno)(_paContext);
_writeErrors = 0;
}
}
@@ -2154,7 +2156,7 @@
// AudioDeviceBuffer ensure that this callback is executed
// without taking the audio-thread lock.
UnLock();
- LOG(LS_VERBOSE) << "requesting data";
+ RTC_LOG(LS_VERBOSE) << "requesting data";
uint32_t nSamples = _ptrAudioBuffer->RequestPlayoutData(numPlaySamples);
Lock();
@@ -2165,7 +2167,8 @@
nSamples = _ptrAudioBuffer->GetPlayoutData(_playBuffer);
if (nSamples != numPlaySamples) {
- LOG(LS_ERROR) << "invalid number of output samples(" << nSamples << ")";
+ RTC_LOG(LS_ERROR) << "invalid number of output samples(" << nSamples
+ << ")";
}
size_t write = _playbackBufferSize;
@@ -2173,14 +2176,14 @@
write = _tempBufferSpace;
}
- LOG(LS_VERBOSE) << "will write";
+ RTC_LOG(LS_VERBOSE) << "will write";
PaLock();
if (LATE(pa_stream_write)(_playStream, (void*)&_playBuffer[0], write,
NULL, (int64_t)0, PA_SEEK_RELATIVE) != PA_OK) {
_writeErrors++;
if (_writeErrors > 10) {
- LOG(LS_ERROR) << "Playout error: _writeErrors=" << _writeErrors
- << ", error=" << LATE(pa_context_errno)(_paContext);
+ RTC_LOG(LS_ERROR) << "Playout error: _writeErrors=" << _writeErrors
+ << ", error=" << LATE(pa_context_errno)(_paContext);
_writeErrors = 0;
}
}
@@ -2204,7 +2207,7 @@
case kEventSignaled:
break;
case kEventError:
- LOG(LS_WARNING) << "EventWrapper::Wait() failed";
+ RTC_LOG(LS_WARNING) << "EventWrapper::Wait() failed";
return true;
case kEventTimeout:
return true;
@@ -2213,7 +2216,7 @@
rtc::CritScope lock(&_critSect);
if (_startRec) {
- LOG(LS_VERBOSE) << "_startRec true, performing initial actions";
+ RTC_LOG(LS_VERBOSE) << "_startRec true, performing initial actions";
_recDeviceName = NULL;
@@ -2227,24 +2230,24 @@
PaLock();
- LOG(LS_VERBOSE) << "connecting stream";
+ RTC_LOG(LS_VERBOSE) << "connecting stream";
// Connect the stream to a source
if (LATE(pa_stream_connect_record)(
_recStream, _recDeviceName, &_recBufferAttr,
(pa_stream_flags_t)_recStreamFlags) != PA_OK) {
- LOG(LS_ERROR) << "failed to connect rec stream, err="
- << LATE(pa_context_errno)(_paContext);
+ RTC_LOG(LS_ERROR) << "failed to connect rec stream, err="
+ << LATE(pa_context_errno)(_paContext);
}
- LOG(LS_VERBOSE) << "connected";
+ RTC_LOG(LS_VERBOSE) << "connected";
// Wait for state change
while (LATE(pa_stream_get_state)(_recStream) != PA_STREAM_READY) {
LATE(pa_threaded_mainloop_wait)(_paMainloop);
}
- LOG(LS_VERBOSE) << "done";
+ RTC_LOG(LS_VERBOSE) << "done";
// We can now handle read callbacks
EnableReadCallback();
@@ -2277,8 +2280,8 @@
while (true) {
// Ack the last thing we read
if (LATE(pa_stream_drop)(_recStream) != 0) {
- LOG(LS_WARNING) << "failed to drop, err="
- << LATE(pa_context_errno)(_paContext);
+ RTC_LOG(LS_WARNING)
+ << "failed to drop, err=" << LATE(pa_context_errno)(_paContext);
}
if (LATE(pa_stream_readable_size)(_recStream) <= 0) {
@@ -2291,8 +2294,8 @@
size_t sampleDataSize;
if (LATE(pa_stream_peek)(_recStream, &sampleData, &sampleDataSize) != 0) {
- LOG(LS_ERROR) << "RECORD_ERROR, error = "
- << LATE(pa_context_errno)(_paContext);
+ RTC_LOG(LS_ERROR) << "RECORD_ERROR, error = "
+ << LATE(pa_context_errno)(_paContext);
break;
}
diff --git a/modules/audio_device/linux/audio_mixer_manager_alsa_linux.cc b/modules/audio_device/linux/audio_mixer_manager_alsa_linux.cc
index aabf388..c1d67cf 100644
--- a/modules/audio_device/linux/audio_mixer_manager_alsa_linux.cc
+++ b/modules/audio_device/linux/audio_mixer_manager_alsa_linux.cc
@@ -28,14 +28,14 @@
_inputMixerHandle(NULL),
_outputMixerElement(NULL),
_inputMixerElement(NULL) {
- LOG(LS_INFO) << __FUNCTION__ << " created";
+ RTC_LOG(LS_INFO) << __FUNCTION__ << " created";
memset(_outputMixerStr, 0, kAdmMaxDeviceNameSize);
memset(_inputMixerStr, 0, kAdmMaxDeviceNameSize);
}
AudioMixerManagerLinuxALSA::~AudioMixerManagerLinuxALSA() {
- LOG(LS_INFO) << __FUNCTION__ << " destroyed";
+ RTC_LOG(LS_INFO) << __FUNCTION__ << " destroyed";
Close();
}
@@ -44,7 +44,7 @@
// ============================================================================
int32_t AudioMixerManagerLinuxALSA::Close() {
- LOG(LS_VERBOSE) << __FUNCTION__;
+ RTC_LOG(LS_VERBOSE) << __FUNCTION__;
rtc::CritScope lock(&_critSect);
@@ -55,27 +55,28 @@
}
int32_t AudioMixerManagerLinuxALSA::CloseSpeaker() {
- LOG(LS_VERBOSE) << __FUNCTION__;
+ RTC_LOG(LS_VERBOSE) << __FUNCTION__;
rtc::CritScope lock(&_critSect);
int errVal = 0;
if (_outputMixerHandle != NULL) {
- LOG(LS_VERBOSE) << "Closing playout mixer";
+ RTC_LOG(LS_VERBOSE) << "Closing playout mixer";
LATE(snd_mixer_free)(_outputMixerHandle);
if (errVal < 0) {
- LOG(LS_ERROR) << "Error freeing playout mixer: "
- << LATE(snd_strerror)(errVal);
+ RTC_LOG(LS_ERROR) << "Error freeing playout mixer: "
+ << LATE(snd_strerror)(errVal);
}
errVal = LATE(snd_mixer_detach)(_outputMixerHandle, _outputMixerStr);
if (errVal < 0) {
- LOG(LS_ERROR) << "Error detaching playout mixer: "
- << LATE(snd_strerror)(errVal);
+ RTC_LOG(LS_ERROR) << "Error detaching playout mixer: "
+ << LATE(snd_strerror)(errVal);
}
errVal = LATE(snd_mixer_close)(_outputMixerHandle);
if (errVal < 0) {
- LOG(LS_ERROR) << "Error snd_mixer_close(handleMixer) errVal=" << errVal;
+ RTC_LOG(LS_ERROR) << "Error snd_mixer_close(handleMixer) errVal="
+ << errVal;
}
_outputMixerHandle = NULL;
_outputMixerElement = NULL;
@@ -86,35 +87,36 @@
}
int32_t AudioMixerManagerLinuxALSA::CloseMicrophone() {
- LOG(LS_VERBOSE) << __FUNCTION__;
+ RTC_LOG(LS_VERBOSE) << __FUNCTION__;
rtc::CritScope lock(&_critSect);
int errVal = 0;
if (_inputMixerHandle != NULL) {
- LOG(LS_VERBOSE) << "Closing record mixer";
+ RTC_LOG(LS_VERBOSE) << "Closing record mixer";
LATE(snd_mixer_free)(_inputMixerHandle);
if (errVal < 0) {
- LOG(LS_ERROR) << "Error freeing record mixer: "
- << LATE(snd_strerror)(errVal);
+ RTC_LOG(LS_ERROR) << "Error freeing record mixer: "
+ << LATE(snd_strerror)(errVal);
}
- LOG(LS_VERBOSE) << "Closing record mixer 2";
+ RTC_LOG(LS_VERBOSE) << "Closing record mixer 2";
errVal = LATE(snd_mixer_detach)(_inputMixerHandle, _inputMixerStr);
if (errVal < 0) {
- LOG(LS_ERROR) << "Error detaching record mixer: "
- << LATE(snd_strerror)(errVal);
+ RTC_LOG(LS_ERROR) << "Error detaching record mixer: "
+ << LATE(snd_strerror)(errVal);
}
- LOG(LS_VERBOSE) << "Closing record mixer 3";
+ RTC_LOG(LS_VERBOSE) << "Closing record mixer 3";
errVal = LATE(snd_mixer_close)(_inputMixerHandle);
if (errVal < 0) {
- LOG(LS_ERROR) << "Error snd_mixer_close(handleMixer) errVal=" << errVal;
+ RTC_LOG(LS_ERROR) << "Error snd_mixer_close(handleMixer) errVal="
+ << errVal;
}
- LOG(LS_VERBOSE) << "Closing record mixer 4";
+ RTC_LOG(LS_VERBOSE) << "Closing record mixer 4";
_inputMixerHandle = NULL;
_inputMixerElement = NULL;
}
@@ -124,8 +126,8 @@
}
int32_t AudioMixerManagerLinuxALSA::OpenSpeaker(char* deviceName) {
- LOG(LS_VERBOSE) << "AudioMixerManagerLinuxALSA::OpenSpeaker(name="
- << deviceName << ")";
+ RTC_LOG(LS_VERBOSE) << "AudioMixerManagerLinuxALSA::OpenSpeaker(name="
+ << deviceName << ")";
rtc::CritScope lock(&_critSect);
@@ -134,21 +136,22 @@
// Close any existing output mixer handle
//
if (_outputMixerHandle != NULL) {
- LOG(LS_VERBOSE) << "Closing playout mixer";
+ RTC_LOG(LS_VERBOSE) << "Closing playout mixer";
LATE(snd_mixer_free)(_outputMixerHandle);
if (errVal < 0) {
- LOG(LS_ERROR) << "Error freeing playout mixer: "
- << LATE(snd_strerror)(errVal);
+ RTC_LOG(LS_ERROR) << "Error freeing playout mixer: "
+ << LATE(snd_strerror)(errVal);
}
errVal = LATE(snd_mixer_detach)(_outputMixerHandle, _outputMixerStr);
if (errVal < 0) {
- LOG(LS_ERROR) << "Error detaching playout mixer: "
- << LATE(snd_strerror)(errVal);
+ RTC_LOG(LS_ERROR) << "Error detaching playout mixer: "
+ << LATE(snd_strerror)(errVal);
}
errVal = LATE(snd_mixer_close)(_outputMixerHandle);
if (errVal < 0) {
- LOG(LS_ERROR) << "Error snd_mixer_close(handleMixer) errVal=" << errVal;
+ RTC_LOG(LS_ERROR) << "Error snd_mixer_close(handleMixer) errVal="
+ << errVal;
}
}
_outputMixerHandle = NULL;
@@ -156,20 +159,20 @@
errVal = LATE(snd_mixer_open)(&_outputMixerHandle, 0);
if (errVal < 0) {
- LOG(LS_ERROR) << "snd_mixer_open(&_outputMixerHandle, 0) - error";
+ RTC_LOG(LS_ERROR) << "snd_mixer_open(&_outputMixerHandle, 0) - error";
return -1;
}
char controlName[kAdmMaxDeviceNameSize] = {0};
GetControlName(controlName, deviceName);
- LOG(LS_VERBOSE) << "snd_mixer_attach(_outputMixerHandle, " << controlName
- << ")";
+ RTC_LOG(LS_VERBOSE) << "snd_mixer_attach(_outputMixerHandle, " << controlName
+ << ")";
errVal = LATE(snd_mixer_attach)(_outputMixerHandle, controlName);
if (errVal < 0) {
- LOG(LS_ERROR) << "snd_mixer_attach(_outputMixerHandle, " << controlName
- << ") error: " << LATE(snd_strerror)(errVal);
+ RTC_LOG(LS_ERROR) << "snd_mixer_attach(_outputMixerHandle, " << controlName
+ << ") error: " << LATE(snd_strerror)(errVal);
_outputMixerHandle = NULL;
return -1;
}
@@ -177,7 +180,7 @@
errVal = LATE(snd_mixer_selem_register)(_outputMixerHandle, NULL, NULL);
if (errVal < 0) {
- LOG(LS_ERROR)
+ RTC_LOG(LS_ERROR)
<< "snd_mixer_selem_register(_outputMixerHandle, NULL, NULL), "
<< "error: " << LATE(snd_strerror)(errVal);
_outputMixerHandle = NULL;
@@ -190,16 +193,16 @@
}
if (_outputMixerHandle != NULL) {
- LOG(LS_VERBOSE) << "the output mixer device is now open ("
- << _outputMixerHandle << ")";
+ RTC_LOG(LS_VERBOSE) << "the output mixer device is now open ("
+ << _outputMixerHandle << ")";
}
return 0;
}
int32_t AudioMixerManagerLinuxALSA::OpenMicrophone(char* deviceName) {
- LOG(LS_VERBOSE) << "AudioMixerManagerLinuxALSA::OpenMicrophone(name="
- << deviceName << ")";
+ RTC_LOG(LS_VERBOSE) << "AudioMixerManagerLinuxALSA::OpenMicrophone(name="
+ << deviceName << ")";
rtc::CritScope lock(&_critSect);
@@ -208,47 +211,48 @@
// Close any existing input mixer handle
//
if (_inputMixerHandle != NULL) {
- LOG(LS_VERBOSE) << "Closing record mixer";
+ RTC_LOG(LS_VERBOSE) << "Closing record mixer";
LATE(snd_mixer_free)(_inputMixerHandle);
if (errVal < 0) {
- LOG(LS_ERROR) << "Error freeing record mixer: "
- << LATE(snd_strerror)(errVal);
+ RTC_LOG(LS_ERROR) << "Error freeing record mixer: "
+ << LATE(snd_strerror)(errVal);
}
- LOG(LS_VERBOSE) << "Closing record mixer";
+ RTC_LOG(LS_VERBOSE) << "Closing record mixer";
errVal = LATE(snd_mixer_detach)(_inputMixerHandle, _inputMixerStr);
if (errVal < 0) {
- LOG(LS_ERROR) << "Error detaching record mixer: "
- << LATE(snd_strerror)(errVal);
+ RTC_LOG(LS_ERROR) << "Error detaching record mixer: "
+ << LATE(snd_strerror)(errVal);
}
- LOG(LS_VERBOSE) << "Closing record mixer";
+ RTC_LOG(LS_VERBOSE) << "Closing record mixer";
errVal = LATE(snd_mixer_close)(_inputMixerHandle);
if (errVal < 0) {
- LOG(LS_ERROR) << "Error snd_mixer_close(handleMixer) errVal=" << errVal;
+ RTC_LOG(LS_ERROR) << "Error snd_mixer_close(handleMixer) errVal="
+ << errVal;
}
- LOG(LS_VERBOSE) << "Closing record mixer";
+ RTC_LOG(LS_VERBOSE) << "Closing record mixer";
}
_inputMixerHandle = NULL;
_inputMixerElement = NULL;
errVal = LATE(snd_mixer_open)(&_inputMixerHandle, 0);
if (errVal < 0) {
- LOG(LS_ERROR) << "snd_mixer_open(&_inputMixerHandle, 0) - error";
+ RTC_LOG(LS_ERROR) << "snd_mixer_open(&_inputMixerHandle, 0) - error";
return -1;
}
char controlName[kAdmMaxDeviceNameSize] = {0};
GetControlName(controlName, deviceName);
- LOG(LS_VERBOSE) << "snd_mixer_attach(_inputMixerHandle, " << controlName
- << ")";
+ RTC_LOG(LS_VERBOSE) << "snd_mixer_attach(_inputMixerHandle, " << controlName
+ << ")";
errVal = LATE(snd_mixer_attach)(_inputMixerHandle, controlName);
if (errVal < 0) {
- LOG(LS_ERROR) << "snd_mixer_attach(_inputMixerHandle, " << controlName
- << ") error: " << LATE(snd_strerror)(errVal);
+ RTC_LOG(LS_ERROR) << "snd_mixer_attach(_inputMixerHandle, " << controlName
+ << ") error: " << LATE(snd_strerror)(errVal);
_inputMixerHandle = NULL;
return -1;
@@ -257,8 +261,9 @@
errVal = LATE(snd_mixer_selem_register)(_inputMixerHandle, NULL, NULL);
if (errVal < 0) {
- LOG(LS_ERROR) << "snd_mixer_selem_register(_inputMixerHandle, NULL, NULL), "
- << "error: " << LATE(snd_strerror)(errVal);
+ RTC_LOG(LS_ERROR)
+ << "snd_mixer_selem_register(_inputMixerHandle, NULL, NULL), "
+ << "error: " << LATE(snd_strerror)(errVal);
_inputMixerHandle = NULL;
return -1;
@@ -269,41 +274,41 @@
}
if (_inputMixerHandle != NULL) {
- LOG(LS_VERBOSE) << "the input mixer device is now open ("
- << _inputMixerHandle << ")";
+ RTC_LOG(LS_VERBOSE) << "the input mixer device is now open ("
+ << _inputMixerHandle << ")";
}
return 0;
}
bool AudioMixerManagerLinuxALSA::SpeakerIsInitialized() const {
- LOG(LS_INFO) << __FUNCTION__;
+ RTC_LOG(LS_INFO) << __FUNCTION__;
return (_outputMixerHandle != NULL);
}
bool AudioMixerManagerLinuxALSA::MicrophoneIsInitialized() const {
- LOG(LS_INFO) << __FUNCTION__;
+ RTC_LOG(LS_INFO) << __FUNCTION__;
return (_inputMixerHandle != NULL);
}
int32_t AudioMixerManagerLinuxALSA::SetSpeakerVolume(uint32_t volume) {
- LOG(LS_VERBOSE) << "AudioMixerManagerLinuxALSA::SetSpeakerVolume(volume="
- << volume << ")";
+ RTC_LOG(LS_VERBOSE) << "AudioMixerManagerLinuxALSA::SetSpeakerVolume(volume="
+ << volume << ")";
rtc::CritScope lock(&_critSect);
if (_outputMixerElement == NULL) {
- LOG(LS_WARNING) << "no avaliable output mixer element exists";
+ RTC_LOG(LS_WARNING) << "no avaliable output mixer element exists";
return -1;
}
int errVal = LATE(snd_mixer_selem_set_playback_volume_all)(
_outputMixerElement, volume);
if (errVal < 0) {
- LOG(LS_ERROR) << "Error changing master volume: "
- << LATE(snd_strerror)(errVal);
+ RTC_LOG(LS_ERROR) << "Error changing master volume: "
+ << LATE(snd_strerror)(errVal);
return -1;
}
@@ -312,7 +317,7 @@
int32_t AudioMixerManagerLinuxALSA::SpeakerVolume(uint32_t& volume) const {
if (_outputMixerElement == NULL) {
- LOG(LS_WARNING) << "no avaliable output mixer element exists";
+ RTC_LOG(LS_WARNING) << "no avaliable output mixer element exists";
return -1;
}
@@ -321,12 +326,12 @@
int errVal = LATE(snd_mixer_selem_get_playback_volume)(
_outputMixerElement, (snd_mixer_selem_channel_id_t)0, &vol);
if (errVal < 0) {
- LOG(LS_ERROR) << "Error getting outputvolume: "
- << LATE(snd_strerror)(errVal);
+ RTC_LOG(LS_ERROR) << "Error getting outputvolume: "
+ << LATE(snd_strerror)(errVal);
return -1;
}
- LOG(LS_VERBOSE) << "AudioMixerManagerLinuxALSA::SpeakerVolume() => vol="
- << vol;
+ RTC_LOG(LS_VERBOSE) << "AudioMixerManagerLinuxALSA::SpeakerVolume() => vol="
+ << vol;
volume = static_cast<uint32_t>(vol);
@@ -336,7 +341,7 @@
int32_t AudioMixerManagerLinuxALSA::MaxSpeakerVolume(
uint32_t& maxVolume) const {
if (_outputMixerElement == NULL) {
- LOG(LS_WARNING) << "no avilable output mixer element exists";
+ RTC_LOG(LS_WARNING) << "no avilable output mixer element exists";
return -1;
}
@@ -346,12 +351,12 @@
int errVal = LATE(snd_mixer_selem_get_playback_volume_range)(
_outputMixerElement, &minVol, &maxVol);
- LOG(LS_VERBOSE) << "Playout hardware volume range, min: " << minVol
- << ", max: " << maxVol;
+ RTC_LOG(LS_VERBOSE) << "Playout hardware volume range, min: " << minVol
+ << ", max: " << maxVol;
if (maxVol <= minVol) {
- LOG(LS_ERROR) << "Error getting get_playback_volume_range: "
- << LATE(snd_strerror)(errVal);
+ RTC_LOG(LS_ERROR) << "Error getting get_playback_volume_range: "
+ << LATE(snd_strerror)(errVal);
}
maxVolume = static_cast<uint32_t>(maxVol);
@@ -362,7 +367,7 @@
int32_t AudioMixerManagerLinuxALSA::MinSpeakerVolume(
uint32_t& minVolume) const {
if (_outputMixerElement == NULL) {
- LOG(LS_WARNING) << "no avaliable output mixer element exists";
+ RTC_LOG(LS_WARNING) << "no avaliable output mixer element exists";
return -1;
}
@@ -372,12 +377,12 @@
int errVal = LATE(snd_mixer_selem_get_playback_volume_range)(
_outputMixerElement, &minVol, &maxVol);
- LOG(LS_VERBOSE) << "Playout hardware volume range, min: " << minVol
- << ", max: " << maxVol;
+ RTC_LOG(LS_VERBOSE) << "Playout hardware volume range, min: " << minVol
+ << ", max: " << maxVol;
if (maxVol <= minVol) {
- LOG(LS_ERROR) << "Error getting get_playback_volume_range: "
- << LATE(snd_strerror)(errVal);
+ RTC_LOG(LS_ERROR) << "Error getting get_playback_volume_range: "
+ << LATE(snd_strerror)(errVal);
}
minVolume = static_cast<uint32_t>(minVol);
@@ -398,7 +403,7 @@
if (_outputMixerElement == NULL)
{
- LOG(LS_WARNING) << "no avaliable output mixer element exists";
+ RTC_LOG(LS_WARNING) << "no avaliable output mixer element exists";
return -1;
}
@@ -409,18 +414,18 @@
_outputMixerElement, &minVol, &maxVol);
if ((maxVol <= minVol) || (errVal != 0))
{
- LOG(LS_WARNING) << "Error getting playback volume range: "
+ RTC_LOG(LS_WARNING) << "Error getting playback volume range: "
<< snd_strerror(errVal);
}
maxVol = maxVolume;
errVal = snd_mixer_selem_set_playback_volume_range(
_outputMixerElement, minVol, maxVol);
- LOG(LS_VERBOSE) << "Playout hardware volume range, min: " << minVol
+ RTC_LOG(LS_VERBOSE) << "Playout hardware volume range, min: " << minVol
<< ", max: " << maxVol;
if (errVal != 0)
{
- LOG(LS_ERROR) << "Error setting playback volume range: "
+ RTC_LOG(LS_ERROR) << "Error setting playback volume range: "
<< snd_strerror(errVal);
return -1;
}
@@ -438,7 +443,7 @@
if (_outputMixerElement == NULL)
{
- LOG(LS_WARNING) << "no avaliable output mixer element exists";
+ RTC_LOG(LS_WARNING) << "no avaliable output mixer element exists";
return -1;
}
@@ -449,18 +454,18 @@
_outputMixerElement, &minVol, &maxVol);
if ((maxVol <= minVol) || (errVal != 0))
{
- LOG(LS_WARNING) << "Error getting playback volume range: "
+ RTC_LOG(LS_WARNING) << "Error getting playback volume range: "
<< snd_strerror(errVal);
}
minVol = minVolume;
errVal = snd_mixer_selem_set_playback_volume_range(
_outputMixerElement, minVol, maxVol);
- LOG(LS_VERBOSE) << "Playout hardware volume range, min: " << minVol
+ RTC_LOG(LS_VERBOSE) << "Playout hardware volume range, min: " << minVol
<< ", max: " << maxVol;
if (errVal != 0)
{
- LOG(LS_ERROR) << "Error setting playback volume range: "
+ RTC_LOG(LS_ERROR) << "Error setting playback volume range: "
<< snd_strerror(errVal);
return -1;
}
@@ -471,7 +476,7 @@
int32_t AudioMixerManagerLinuxALSA::SpeakerVolumeIsAvailable(bool& available) {
if (_outputMixerElement == NULL) {
- LOG(LS_WARNING) << "no avaliable output mixer element exists";
+ RTC_LOG(LS_WARNING) << "no avaliable output mixer element exists";
return -1;
}
@@ -482,7 +487,7 @@
int32_t AudioMixerManagerLinuxALSA::SpeakerMuteIsAvailable(bool& available) {
if (_outputMixerElement == NULL) {
- LOG(LS_WARNING) << "no avaliable output mixer element exists";
+ RTC_LOG(LS_WARNING) << "no avaliable output mixer element exists";
return -1;
}
@@ -492,13 +497,13 @@
}
int32_t AudioMixerManagerLinuxALSA::SetSpeakerMute(bool enable) {
- LOG(LS_VERBOSE) << "AudioMixerManagerLinuxALSA::SetSpeakerMute(enable="
- << enable << ")";
+ RTC_LOG(LS_VERBOSE) << "AudioMixerManagerLinuxALSA::SetSpeakerMute(enable="
+ << enable << ")";
rtc::CritScope lock(&_critSect);
if (_outputMixerElement == NULL) {
- LOG(LS_WARNING) << "no avaliable output mixer element exists";
+ RTC_LOG(LS_WARNING) << "no avaliable output mixer element exists";
return -1;
}
@@ -506,7 +511,7 @@
bool available(false);
SpeakerMuteIsAvailable(available);
if (!available) {
- LOG(LS_WARNING) << "it is not possible to mute the speaker";
+ RTC_LOG(LS_WARNING) << "it is not possible to mute the speaker";
return -1;
}
@@ -514,8 +519,8 @@
int errVal = LATE(snd_mixer_selem_set_playback_switch_all)(
_outputMixerElement, !enable);
if (errVal < 0) {
- LOG(LS_ERROR) << "Error setting playback switch: "
- << LATE(snd_strerror)(errVal);
+ RTC_LOG(LS_ERROR) << "Error setting playback switch: "
+ << LATE(snd_strerror)(errVal);
return -1;
}
@@ -524,7 +529,7 @@
int32_t AudioMixerManagerLinuxALSA::SpeakerMute(bool& enabled) const {
if (_outputMixerElement == NULL) {
- LOG(LS_WARNING) << "no avaliable output mixer exists";
+ RTC_LOG(LS_WARNING) << "no avaliable output mixer exists";
return -1;
}
@@ -532,7 +537,7 @@
bool available =
LATE(snd_mixer_selem_has_playback_switch)(_outputMixerElement);
if (!available) {
- LOG(LS_WARNING) << "it is not possible to mute the speaker";
+ RTC_LOG(LS_WARNING) << "it is not possible to mute the speaker";
return -1;
}
@@ -543,8 +548,8 @@
int errVal = LATE(snd_mixer_selem_get_playback_switch)(
_outputMixerElement, (snd_mixer_selem_channel_id_t)0, &value);
if (errVal < 0) {
- LOG(LS_ERROR) << "Error getting playback switch: "
- << LATE(snd_strerror)(errVal);
+ RTC_LOG(LS_ERROR) << "Error getting playback switch: "
+ << LATE(snd_strerror)(errVal);
return -1;
}
@@ -556,7 +561,7 @@
int32_t AudioMixerManagerLinuxALSA::MicrophoneMuteIsAvailable(bool& available) {
if (_inputMixerElement == NULL) {
- LOG(LS_WARNING) << "no avaliable input mixer element exists";
+ RTC_LOG(LS_WARNING) << "no avaliable input mixer element exists";
return -1;
}
@@ -565,13 +570,13 @@
}
int32_t AudioMixerManagerLinuxALSA::SetMicrophoneMute(bool enable) {
- LOG(LS_VERBOSE) << "AudioMixerManagerLinuxALSA::SetMicrophoneMute(enable="
- << enable << ")";
+ RTC_LOG(LS_VERBOSE) << "AudioMixerManagerLinuxALSA::SetMicrophoneMute(enable="
+ << enable << ")";
rtc::CritScope lock(&_critSect);
if (_inputMixerElement == NULL) {
- LOG(LS_WARNING) << "no avaliable input mixer element exists";
+ RTC_LOG(LS_WARNING) << "no avaliable input mixer element exists";
return -1;
}
@@ -579,7 +584,7 @@
bool available(false);
MicrophoneMuteIsAvailable(available);
if (!available) {
- LOG(LS_WARNING) << "it is not possible to mute the microphone";
+ RTC_LOG(LS_WARNING) << "it is not possible to mute the microphone";
return -1;
}
@@ -587,8 +592,8 @@
int errVal =
LATE(snd_mixer_selem_set_capture_switch_all)(_inputMixerElement, !enable);
if (errVal < 0) {
- LOG(LS_ERROR) << "Error setting capture switch: "
- << LATE(snd_strerror)(errVal);
+ RTC_LOG(LS_ERROR) << "Error setting capture switch: "
+ << LATE(snd_strerror)(errVal);
return -1;
}
@@ -597,14 +602,14 @@
int32_t AudioMixerManagerLinuxALSA::MicrophoneMute(bool& enabled) const {
if (_inputMixerElement == NULL) {
- LOG(LS_WARNING) << "no avaliable input mixer exists";
+ RTC_LOG(LS_WARNING) << "no avaliable input mixer exists";
return -1;
}
// Ensure that the selected microphone destination has a valid mute control.
bool available = LATE(snd_mixer_selem_has_capture_switch)(_inputMixerElement);
if (!available) {
- LOG(LS_WARNING) << "it is not possible to mute the microphone";
+ RTC_LOG(LS_WARNING) << "it is not possible to mute the microphone";
return -1;
}
@@ -615,8 +620,8 @@
int errVal = LATE(snd_mixer_selem_get_capture_switch)(
_inputMixerElement, (snd_mixer_selem_channel_id_t)0, &value);
if (errVal < 0) {
- LOG(LS_ERROR) << "Error getting capture switch: "
- << LATE(snd_strerror)(errVal);
+ RTC_LOG(LS_ERROR) << "Error getting capture switch: "
+ << LATE(snd_strerror)(errVal);
return -1;
}
@@ -629,7 +634,7 @@
int32_t AudioMixerManagerLinuxALSA::MicrophoneVolumeIsAvailable(
bool& available) {
if (_inputMixerElement == NULL) {
- LOG(LS_WARNING) << "no avaliable input mixer element exists";
+ RTC_LOG(LS_WARNING) << "no avaliable input mixer element exists";
return -1;
}
@@ -639,21 +644,22 @@
}
int32_t AudioMixerManagerLinuxALSA::SetMicrophoneVolume(uint32_t volume) {
- LOG(LS_VERBOSE) << "AudioMixerManagerLinuxALSA::SetMicrophoneVolume(volume="
- << volume << ")";
+ RTC_LOG(LS_VERBOSE)
+ << "AudioMixerManagerLinuxALSA::SetMicrophoneVolume(volume=" << volume
+ << ")";
rtc::CritScope lock(&_critSect);
if (_inputMixerElement == NULL) {
- LOG(LS_WARNING) << "no avaliable input mixer element exists";
+ RTC_LOG(LS_WARNING) << "no avaliable input mixer element exists";
return -1;
}
int errVal =
LATE(snd_mixer_selem_set_capture_volume_all)(_inputMixerElement, volume);
if (errVal < 0) {
- LOG(LS_ERROR) << "Error changing microphone volume: "
- << LATE(snd_strerror)(errVal);
+ RTC_LOG(LS_ERROR) << "Error changing microphone volume: "
+ << LATE(snd_strerror)(errVal);
return -1;
}
@@ -673,7 +679,7 @@
if (_inputMixerElement == NULL)
{
- LOG(LS_WARNING) << "no avaliable output mixer element exists";
+ RTC_LOG(LS_WARNING) << "no avaliable output mixer element exists";
return -1;
}
@@ -684,18 +690,19 @@
&minVol, &maxVol);
if ((maxVol <= minVol) || (errVal != 0))
{
- LOG(LS_WARNING) << "Error getting capture volume range: "
+ RTC_LOG(LS_WARNING) << "Error getting capture volume range: "
<< snd_strerror(errVal);
}
maxVol = (long int)maxVolume;
printf("min %d max %d", minVol, maxVol);
errVal = snd_mixer_selem_set_capture_volume_range(_inputMixerElement, minVol,
- maxVol); LOG(LS_VERBOSE) << "Capture hardware volume range, min: " << minVol
+ maxVol); RTC_LOG(LS_VERBOSE) << "Capture hardware volume range, min: " <<
+ minVol
<< ", max: " << maxVol;
if (errVal != 0)
{
- LOG(LS_ERROR) << "Error setting capture volume range: "
+ RTC_LOG(LS_ERROR) << "Error setting capture volume range: "
<< snd_strerror(errVal);
return -1;
}
@@ -713,7 +720,7 @@
if (_inputMixerElement == NULL)
{
- LOG(LS_WARNING) << "no avaliable output mixer element exists";
+ RTC_LOG(LS_WARNING) << "no avaliable output mixer element exists";
return -1;
}
@@ -725,7 +732,7 @@
if (maxVol <= minVol)
{
//maxVol = 255;
- LOG(LS_WARNING) << "Error getting capture volume range: "
+ RTC_LOG(LS_WARNING) << "Error getting capture volume range: "
<< snd_strerror(errVal);
}
@@ -733,11 +740,11 @@
minVol = (long int)minVolume;
errVal = snd_mixer_selem_set_capture_volume_range(
_inputMixerElement, minVol, maxVol);
- LOG(LS_VERBOSE) << "Capture hardware volume range, min: " << minVol
+ RTC_LOG(LS_VERBOSE) << "Capture hardware volume range, min: " << minVol
<< ", max: " << maxVol;
if (errVal != 0)
{
- LOG(LS_ERROR) << "Error setting capture volume range: "
+ RTC_LOG(LS_ERROR) << "Error setting capture volume range: "
<< snd_strerror(errVal);
return -1;
}
@@ -748,7 +755,7 @@
int32_t AudioMixerManagerLinuxALSA::MicrophoneVolume(uint32_t& volume) const {
if (_inputMixerElement == NULL) {
- LOG(LS_WARNING) << "no avaliable input mixer element exists";
+ RTC_LOG(LS_WARNING) << "no avaliable input mixer element exists";
return -1;
}
@@ -757,12 +764,12 @@
int errVal = LATE(snd_mixer_selem_get_capture_volume)(
_inputMixerElement, (snd_mixer_selem_channel_id_t)0, &vol);
if (errVal < 0) {
- LOG(LS_ERROR) << "Error getting inputvolume: "
- << LATE(snd_strerror)(errVal);
+ RTC_LOG(LS_ERROR) << "Error getting inputvolume: "
+ << LATE(snd_strerror)(errVal);
return -1;
}
- LOG(LS_VERBOSE) << "AudioMixerManagerLinuxALSA::MicrophoneVolume() => vol="
- << vol;
+ RTC_LOG(LS_VERBOSE)
+ << "AudioMixerManagerLinuxALSA::MicrophoneVolume() => vol=" << vol;
volume = static_cast<uint32_t>(vol);
@@ -772,7 +779,7 @@
int32_t AudioMixerManagerLinuxALSA::MaxMicrophoneVolume(
uint32_t& maxVolume) const {
if (_inputMixerElement == NULL) {
- LOG(LS_WARNING) << "no avaliable input mixer element exists";
+ RTC_LOG(LS_WARNING) << "no avaliable input mixer element exists";
return -1;
}
@@ -781,18 +788,18 @@
// check if we have mic volume at all
if (!LATE(snd_mixer_selem_has_capture_volume)(_inputMixerElement)) {
- LOG(LS_ERROR) << "No microphone volume available";
+ RTC_LOG(LS_ERROR) << "No microphone volume available";
return -1;
}
int errVal = LATE(snd_mixer_selem_get_capture_volume_range)(
_inputMixerElement, &minVol, &maxVol);
- LOG(LS_VERBOSE) << "Microphone hardware volume range, min: " << minVol
- << ", max: " << maxVol;
+ RTC_LOG(LS_VERBOSE) << "Microphone hardware volume range, min: " << minVol
+ << ", max: " << maxVol;
if (maxVol <= minVol) {
- LOG(LS_ERROR) << "Error getting microphone volume range: "
- << LATE(snd_strerror)(errVal);
+ RTC_LOG(LS_ERROR) << "Error getting microphone volume range: "
+ << LATE(snd_strerror)(errVal);
}
maxVolume = static_cast<uint32_t>(maxVol);
@@ -803,7 +810,7 @@
int32_t AudioMixerManagerLinuxALSA::MinMicrophoneVolume(
uint32_t& minVolume) const {
if (_inputMixerElement == NULL) {
- LOG(LS_WARNING) << "no avaliable input mixer element exists";
+ RTC_LOG(LS_WARNING) << "no avaliable input mixer element exists";
return -1;
}
@@ -813,11 +820,11 @@
int errVal = LATE(snd_mixer_selem_get_capture_volume_range)(
_inputMixerElement, &minVol, &maxVol);
- LOG(LS_VERBOSE) << "Microphone hardware volume range, min: " << minVol
- << ", max: " << maxVol;
+ RTC_LOG(LS_VERBOSE) << "Microphone hardware volume range, min: " << minVol
+ << ", max: " << maxVol;
if (maxVol <= minVol) {
- LOG(LS_ERROR) << "Error getting microphone volume range: "
- << LATE(snd_strerror)(errVal);
+ RTC_LOG(LS_ERROR) << "Error getting microphone volume range: "
+ << LATE(snd_strerror)(errVal);
}
minVolume = static_cast<uint32_t>(minVol);
@@ -832,8 +839,8 @@
int32_t AudioMixerManagerLinuxALSA::LoadMicMixerElement() const {
int errVal = LATE(snd_mixer_load)(_inputMixerHandle);
if (errVal < 0) {
- LOG(LS_ERROR) << "snd_mixer_load(_inputMixerHandle), error: "
- << LATE(snd_strerror)(errVal);
+ RTC_LOG(LS_ERROR) << "snd_mixer_load(_inputMixerHandle), error: "
+ << LATE(snd_strerror)(errVal);
_inputMixerHandle = NULL;
return -1;
}
@@ -851,10 +858,10 @@
if (strcmp(selemName, "Capture") == 0) // "Capture", "Mic"
{
_inputMixerElement = elem;
- LOG(LS_VERBOSE) << "Capture element set";
+ RTC_LOG(LS_VERBOSE) << "Capture element set";
} else if (strcmp(selemName, "Mic") == 0) {
micElem = elem;
- LOG(LS_VERBOSE) << "Mic element found";
+ RTC_LOG(LS_VERBOSE) << "Mic element found";
}
}
@@ -869,10 +876,10 @@
// We didn't find a Capture handle, use Mic.
if (micElem != NULL) {
_inputMixerElement = micElem;
- LOG(LS_VERBOSE) << "Using Mic as capture volume.";
+ RTC_LOG(LS_VERBOSE) << "Using Mic as capture volume.";
} else {
_inputMixerElement = NULL;
- LOG(LS_ERROR) << "Could not find capture volume on the mixer.";
+ RTC_LOG(LS_ERROR) << "Could not find capture volume on the mixer.";
return -1;
}
@@ -884,8 +891,8 @@
int32_t AudioMixerManagerLinuxALSA::LoadSpeakerMixerElement() const {
int errVal = LATE(snd_mixer_load)(_outputMixerHandle);
if (errVal < 0) {
- LOG(LS_ERROR) << "snd_mixer_load(_outputMixerHandle), error: "
- << LATE(snd_strerror)(errVal);
+ RTC_LOG(LS_ERROR) << "snd_mixer_load(_outputMixerHandle), error: "
+ << LATE(snd_strerror)(errVal);
_outputMixerHandle = NULL;
return -1;
}
@@ -901,19 +908,19 @@
elem = LATE(snd_mixer_elem_next)(elem), mixerIdx++) {
if (LATE(snd_mixer_selem_is_active)(elem)) {
selemName = LATE(snd_mixer_selem_get_name)(elem);
- LOG(LS_VERBOSE) << "snd_mixer_selem_get_name " << mixerIdx << ": "
- << selemName << " =" << elem;
+ RTC_LOG(LS_VERBOSE) << "snd_mixer_selem_get_name " << mixerIdx << ": "
+ << selemName << " =" << elem;
// "Master", "PCM", "Wave", "Master Mono", "PC Speaker", "PCM", "Wave"
if (strcmp(selemName, "PCM") == 0) {
_outputMixerElement = elem;
- LOG(LS_VERBOSE) << "PCM element set";
+ RTC_LOG(LS_VERBOSE) << "PCM element set";
} else if (strcmp(selemName, "Master") == 0) {
masterElem = elem;
- LOG(LS_VERBOSE) << "Master element found";
+ RTC_LOG(LS_VERBOSE) << "Master element found";
} else if (strcmp(selemName, "Speaker") == 0) {
speakerElem = elem;
- LOG(LS_VERBOSE) << "Speaker element found";
+ RTC_LOG(LS_VERBOSE) << "Speaker element found";
}
}
@@ -927,13 +934,13 @@
if (_outputMixerElement == NULL) {
if (masterElem != NULL) {
_outputMixerElement = masterElem;
- LOG(LS_VERBOSE) << "Using Master as output volume.";
+ RTC_LOG(LS_VERBOSE) << "Using Master as output volume.";
} else if (speakerElem != NULL) {
_outputMixerElement = speakerElem;
- LOG(LS_VERBOSE) << "Using Speaker as output volume.";
+ RTC_LOG(LS_VERBOSE) << "Using Speaker as output volume.";
} else {
_outputMixerElement = NULL;
- LOG(LS_ERROR) << "Could not find output volume in the mixer.";
+ RTC_LOG(LS_ERROR) << "Could not find output volume in the mixer.";
return -1;
}
}
diff --git a/modules/audio_device/linux/audio_mixer_manager_pulse_linux.cc b/modules/audio_device/linux/audio_mixer_manager_pulse_linux.cc
index 80896c9..c50d56b 100644
--- a/modules/audio_device/linux/audio_mixer_manager_pulse_linux.cc
+++ b/modules/audio_device/linux/audio_mixer_manager_pulse_linux.cc
@@ -52,12 +52,12 @@
_paSpeakerVolume(PA_VOLUME_NORM),
_paChannels(0),
_paObjectsSet(false) {
- LOG(LS_INFO) << __FUNCTION__ << " created";
+ RTC_LOG(LS_INFO) << __FUNCTION__ << " created";
}
AudioMixerManagerLinuxPulse::~AudioMixerManagerLinuxPulse() {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
- LOG(LS_INFO) << __FUNCTION__ << " destroyed";
+ RTC_LOG(LS_INFO) << __FUNCTION__ << " destroyed";
Close();
}
@@ -70,10 +70,10 @@
pa_threaded_mainloop* mainloop,
pa_context* context) {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
- LOG(LS_VERBOSE) << __FUNCTION__;
+ RTC_LOG(LS_VERBOSE) << __FUNCTION__;
if (!mainloop || !context) {
- LOG(LS_ERROR) << "could not set PulseAudio objects for mixer";
+ RTC_LOG(LS_ERROR) << "could not set PulseAudio objects for mixer";
return -1;
}
@@ -81,14 +81,14 @@
_paContext = context;
_paObjectsSet = true;
- LOG(LS_VERBOSE) << "the PulseAudio objects for the mixer has been set";
+ RTC_LOG(LS_VERBOSE) << "the PulseAudio objects for the mixer has been set";
return 0;
}
int32_t AudioMixerManagerLinuxPulse::Close() {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
- LOG(LS_VERBOSE) << __FUNCTION__;
+ RTC_LOG(LS_VERBOSE) << __FUNCTION__;
CloseSpeaker();
CloseMicrophone();
@@ -102,7 +102,7 @@
int32_t AudioMixerManagerLinuxPulse::CloseSpeaker() {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
- LOG(LS_VERBOSE) << __FUNCTION__;
+ RTC_LOG(LS_VERBOSE) << __FUNCTION__;
// Reset the index to -1
_paOutputDeviceIndex = -1;
@@ -113,7 +113,7 @@
int32_t AudioMixerManagerLinuxPulse::CloseMicrophone() {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
- LOG(LS_VERBOSE) << __FUNCTION__;
+ RTC_LOG(LS_VERBOSE) << __FUNCTION__;
// Reset the index to -1
_paInputDeviceIndex = -1;
@@ -124,7 +124,8 @@
int32_t AudioMixerManagerLinuxPulse::SetPlayStream(pa_stream* playStream) {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
- LOG(LS_VERBOSE) << "AudioMixerManagerLinuxPulse::SetPlayStream(playStream)";
+ RTC_LOG(LS_VERBOSE)
+ << "AudioMixerManagerLinuxPulse::SetPlayStream(playStream)";
_paPlayStream = playStream;
return 0;
@@ -132,7 +133,7 @@
int32_t AudioMixerManagerLinuxPulse::SetRecStream(pa_stream* recStream) {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
- LOG(LS_VERBOSE) << "AudioMixerManagerLinuxPulse::SetRecStream(recStream)";
+ RTC_LOG(LS_VERBOSE) << "AudioMixerManagerLinuxPulse::SetRecStream(recStream)";
_paRecStream = recStream;
return 0;
@@ -140,13 +141,13 @@
int32_t AudioMixerManagerLinuxPulse::OpenSpeaker(uint16_t deviceIndex) {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
- LOG(LS_VERBOSE) << "AudioMixerManagerLinuxPulse::OpenSpeaker(deviceIndex="
- << deviceIndex << ")";
+ RTC_LOG(LS_VERBOSE) << "AudioMixerManagerLinuxPulse::OpenSpeaker(deviceIndex="
+ << deviceIndex << ")";
// No point in opening the speaker
// if PA objects have not been set
if (!_paObjectsSet) {
- LOG(LS_ERROR) << "PulseAudio objects has not been set";
+ RTC_LOG(LS_ERROR) << "PulseAudio objects has not been set";
return -1;
}
@@ -154,20 +155,21 @@
// output device to control
_paOutputDeviceIndex = deviceIndex;
- LOG(LS_VERBOSE) << "the output mixer device is now open";
+ RTC_LOG(LS_VERBOSE) << "the output mixer device is now open";
return 0;
}
int32_t AudioMixerManagerLinuxPulse::OpenMicrophone(uint16_t deviceIndex) {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
- LOG(LS_VERBOSE) << "AudioMixerManagerLinuxPulse::OpenMicrophone(deviceIndex="
- << deviceIndex << ")";
+ RTC_LOG(LS_VERBOSE)
+ << "AudioMixerManagerLinuxPulse::OpenMicrophone(deviceIndex="
+ << deviceIndex << ")";
// No point in opening the microphone
// if PA objects have not been set
if (!_paObjectsSet) {
- LOG(LS_ERROR) << "PulseAudio objects have not been set";
+ RTC_LOG(LS_ERROR) << "PulseAudio objects have not been set";
return -1;
}
@@ -175,32 +177,32 @@
// input device to control
_paInputDeviceIndex = deviceIndex;
- LOG(LS_VERBOSE) << "the input mixer device is now open";
+ RTC_LOG(LS_VERBOSE) << "the input mixer device is now open";
return 0;
}
bool AudioMixerManagerLinuxPulse::SpeakerIsInitialized() const {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
- LOG(LS_INFO) << __FUNCTION__;
+ RTC_LOG(LS_INFO) << __FUNCTION__;
return (_paOutputDeviceIndex != -1);
}
bool AudioMixerManagerLinuxPulse::MicrophoneIsInitialized() const {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
- LOG(LS_INFO) << __FUNCTION__;
+ RTC_LOG(LS_INFO) << __FUNCTION__;
return (_paInputDeviceIndex != -1);
}
int32_t AudioMixerManagerLinuxPulse::SetSpeakerVolume(uint32_t volume) {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
- LOG(LS_VERBOSE) << "AudioMixerManagerLinuxPulse::SetSpeakerVolume(volume="
- << volume << ")";
+ RTC_LOG(LS_VERBOSE) << "AudioMixerManagerLinuxPulse::SetSpeakerVolume(volume="
+ << volume << ")";
if (_paOutputDeviceIndex == -1) {
- LOG(LS_WARNING) << "output device index has not been set";
+ RTC_LOG(LS_WARNING) << "output device index has not been set";
return -1;
}
@@ -214,7 +216,7 @@
// Get the number of channels from the sample specification
const pa_sample_spec* spec = LATE(pa_stream_get_sample_spec)(_paPlayStream);
if (!spec) {
- LOG(LS_ERROR) << "could not get sample specification";
+ RTC_LOG(LS_ERROR) << "could not get sample specification";
return -1;
}
@@ -239,8 +241,8 @@
}
if (setFailed) {
- LOG(LS_WARNING) << "could not set speaker volume, error="
- << LATE(pa_context_errno)(_paContext);
+ RTC_LOG(LS_WARNING) << "could not set speaker volume, error="
+ << LATE(pa_context_errno)(_paContext);
return -1;
}
@@ -250,7 +252,7 @@
int32_t AudioMixerManagerLinuxPulse::SpeakerVolume(uint32_t& volume) const {
if (_paOutputDeviceIndex == -1) {
- LOG(LS_WARNING) << "output device index has not been set";
+ RTC_LOG(LS_WARNING) << "output device index has not been set";
return -1;
}
@@ -267,8 +269,8 @@
volume = _paSpeakerVolume;
}
- LOG(LS_VERBOSE) << "AudioMixerManagerLinuxPulse::SpeakerVolume() => vol="
- << volume;
+ RTC_LOG(LS_VERBOSE) << "AudioMixerManagerLinuxPulse::SpeakerVolume() => vol="
+ << volume;
return 0;
}
@@ -276,7 +278,7 @@
int32_t AudioMixerManagerLinuxPulse::MaxSpeakerVolume(
uint32_t& maxVolume) const {
if (_paOutputDeviceIndex == -1) {
- LOG(LS_WARNING) << "output device index has not been set";
+ RTC_LOG(LS_WARNING) << "output device index has not been set";
return -1;
}
@@ -290,7 +292,7 @@
int32_t AudioMixerManagerLinuxPulse::MinSpeakerVolume(
uint32_t& minVolume) const {
if (_paOutputDeviceIndex == -1) {
- LOG(LS_WARNING) << "output device index has not been set";
+ RTC_LOG(LS_WARNING) << "output device index has not been set";
return -1;
}
@@ -302,7 +304,7 @@
int32_t AudioMixerManagerLinuxPulse::SpeakerVolumeIsAvailable(bool& available) {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
if (_paOutputDeviceIndex == -1) {
- LOG(LS_WARNING) << "output device index has not been set";
+ RTC_LOG(LS_WARNING) << "output device index has not been set";
return -1;
}
@@ -315,7 +317,7 @@
int32_t AudioMixerManagerLinuxPulse::SpeakerMuteIsAvailable(bool& available) {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
if (_paOutputDeviceIndex == -1) {
- LOG(LS_WARNING) << "output device index has not been set";
+ RTC_LOG(LS_WARNING) << "output device index has not been set";
return -1;
}
@@ -327,11 +329,11 @@
int32_t AudioMixerManagerLinuxPulse::SetSpeakerMute(bool enable) {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
- LOG(LS_VERBOSE) << "AudioMixerManagerLinuxPulse::SetSpeakerMute(enable="
- << enable << ")";
+ RTC_LOG(LS_VERBOSE) << "AudioMixerManagerLinuxPulse::SetSpeakerMute(enable="
+ << enable << ")";
if (_paOutputDeviceIndex == -1) {
- LOG(LS_WARNING) << "output device index has not been set";
+ RTC_LOG(LS_WARNING) << "output device index has not been set";
return -1;
}
@@ -359,8 +361,8 @@
}
if (setFailed) {
- LOG(LS_WARNING) << "could not mute speaker, error="
- << LATE(pa_context_errno)(_paContext);
+ RTC_LOG(LS_WARNING) << "could not mute speaker, error="
+ << LATE(pa_context_errno)(_paContext);
return -1;
}
@@ -369,7 +371,7 @@
int32_t AudioMixerManagerLinuxPulse::SpeakerMute(bool& enabled) const {
if (_paOutputDeviceIndex == -1) {
- LOG(LS_WARNING) << "output device index has not been set";
+ RTC_LOG(LS_WARNING) << "output device index has not been set";
return -1;
}
@@ -383,8 +385,8 @@
} else {
enabled = _paSpeakerMute;
}
- LOG(LS_VERBOSE) << "AudioMixerManagerLinuxPulse::SpeakerMute() => enabled="
- << enabled;
+ RTC_LOG(LS_VERBOSE)
+ << "AudioMixerManagerLinuxPulse::SpeakerMute() => enabled=" << enabled;
return 0;
}
@@ -392,7 +394,7 @@
int32_t AudioMixerManagerLinuxPulse::StereoPlayoutIsAvailable(bool& available) {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
if (_paOutputDeviceIndex == -1) {
- LOG(LS_WARNING) << "output device index has not been set";
+ RTC_LOG(LS_WARNING) << "output device index has not been set";
return -1;
}
@@ -422,7 +424,7 @@
bool& available) {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
if (_paInputDeviceIndex == -1) {
- LOG(LS_WARNING) << "input device index has not been set";
+ RTC_LOG(LS_WARNING) << "input device index has not been set";
return -1;
}
@@ -449,8 +451,9 @@
available = static_cast<bool>(_paChannels == 2);
- LOG(LS_VERBOSE) << "AudioMixerManagerLinuxPulse::StereoRecordingIsAvailable()"
- << " => available=" << available;
+ RTC_LOG(LS_VERBOSE)
+ << "AudioMixerManagerLinuxPulse::StereoRecordingIsAvailable()"
+ << " => available=" << available;
return 0;
}
@@ -459,7 +462,7 @@
bool& available) {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
if (_paInputDeviceIndex == -1) {
- LOG(LS_WARNING) << "input device index has not been set";
+ RTC_LOG(LS_WARNING) << "input device index has not been set";
return -1;
}
@@ -471,11 +474,12 @@
int32_t AudioMixerManagerLinuxPulse::SetMicrophoneMute(bool enable) {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
- LOG(LS_VERBOSE) << "AudioMixerManagerLinuxPulse::SetMicrophoneMute(enable="
- << enable << ")";
+ RTC_LOG(LS_VERBOSE)
+ << "AudioMixerManagerLinuxPulse::SetMicrophoneMute(enable=" << enable
+ << ")";
if (_paInputDeviceIndex == -1) {
- LOG(LS_WARNING) << "input device index has not been set";
+ RTC_LOG(LS_WARNING) << "input device index has not been set";
return -1;
}
@@ -506,8 +510,8 @@
LATE(pa_operation_unref)(paOperation);
if (setFailed) {
- LOG(LS_WARNING) << "could not mute microphone, error="
- << LATE(pa_context_errno)(_paContext);
+ RTC_LOG(LS_WARNING) << "could not mute microphone, error="
+ << LATE(pa_context_errno)(_paContext);
return -1;
}
@@ -517,7 +521,7 @@
int32_t AudioMixerManagerLinuxPulse::MicrophoneMute(bool& enabled) const {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
if (_paInputDeviceIndex == -1) {
- LOG(LS_WARNING) << "input device index has not been set";
+ RTC_LOG(LS_WARNING) << "input device index has not been set";
return -1;
}
@@ -539,8 +543,8 @@
enabled = static_cast<bool>(_paMute);
- LOG(LS_VERBOSE) << "AudioMixerManagerLinuxPulse::MicrophoneMute() => enabled="
- << enabled;
+ RTC_LOG(LS_VERBOSE)
+ << "AudioMixerManagerLinuxPulse::MicrophoneMute() => enabled=" << enabled;
return 0;
}
@@ -549,7 +553,7 @@
bool& available) {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
if (_paInputDeviceIndex == -1) {
- LOG(LS_WARNING) << "input device index has not been set";
+ RTC_LOG(LS_WARNING) << "input device index has not been set";
return -1;
}
@@ -560,11 +564,12 @@
}
int32_t AudioMixerManagerLinuxPulse::SetMicrophoneVolume(uint32_t volume) {
- LOG(LS_VERBOSE) << "AudioMixerManagerLinuxPulse::SetMicrophoneVolume(volume="
- << volume << ")";
+ RTC_LOG(LS_VERBOSE)
+ << "AudioMixerManagerLinuxPulse::SetMicrophoneVolume(volume=" << volume
+ << ")";
if (_paInputDeviceIndex == -1) {
- LOG(LS_WARNING) << "input device index has not been set";
+ RTC_LOG(LS_WARNING) << "input device index has not been set";
return -1;
}
@@ -615,8 +620,8 @@
LATE(pa_operation_unref)(paOperation);
if (setFailed) {
- LOG(LS_WARNING) << "could not set microphone volume, error="
- << LATE(pa_context_errno)(_paContext);
+ RTC_LOG(LS_WARNING) << "could not set microphone volume, error="
+ << LATE(pa_context_errno)(_paContext);
return -1;
}
@@ -625,7 +630,7 @@
int32_t AudioMixerManagerLinuxPulse::MicrophoneVolume(uint32_t& volume) const {
if (_paInputDeviceIndex == -1) {
- LOG(LS_WARNING) << "input device index has not been set";
+ RTC_LOG(LS_WARNING) << "input device index has not been set";
return -1;
}
@@ -649,8 +654,8 @@
volume = static_cast<uint32_t>(_paVolume);
}
- LOG(LS_VERBOSE) << "AudioMixerManagerLinuxPulse::MicrophoneVolume() => vol="
- << volume;
+ RTC_LOG(LS_VERBOSE)
+ << "AudioMixerManagerLinuxPulse::MicrophoneVolume() => vol=" << volume;
return 0;
}
@@ -658,7 +663,7 @@
int32_t AudioMixerManagerLinuxPulse::MaxMicrophoneVolume(
uint32_t& maxVolume) const {
if (_paInputDeviceIndex == -1) {
- LOG(LS_WARNING) << "input device index has not been set";
+ RTC_LOG(LS_WARNING) << "input device index has not been set";
return -1;
}
@@ -673,7 +678,7 @@
int32_t AudioMixerManagerLinuxPulse::MinMicrophoneVolume(
uint32_t& minVolume) const {
if (_paInputDeviceIndex == -1) {
- LOG(LS_WARNING) << "input device index has not been set";
+ RTC_LOG(LS_WARNING) << "input device index has not been set";
return -1;
}
@@ -715,7 +720,7 @@
int success,
void* /*pThis*/) {
if (!success) {
- LOG(LS_ERROR) << "failed to set volume";
+ RTC_LOG(LS_ERROR) << "failed to set volume";
}
}
diff --git a/modules/audio_device/linux/latebindingsymboltable_linux.cc b/modules/audio_device/linux/latebindingsymboltable_linux.cc
index 7a66c34..def4866 100644
--- a/modules/audio_device/linux/latebindingsymboltable_linux.cc
+++ b/modules/audio_device/linux/latebindingsymboltable_linux.cc
@@ -39,7 +39,7 @@
#error Not implemented
#endif
if (handle == kInvalidDllHandle) {
- LOG(LS_WARNING) << "Can't load " << dll_name << " : " << GetDllError();
+ RTC_LOG(LS_WARNING) << "Can't load " << dll_name << " : " << GetDllError();
}
return handle;
}
@@ -55,7 +55,7 @@
// https://code.google.com/p/address-sanitizer/issues/detail?id=89
#if !defined(ADDRESS_SANITIZER)
if (dlclose(handle) != 0) {
- LOG(LS_ERROR) << GetDllError();
+ RTC_LOG(LS_ERROR) << GetDllError();
}
#endif // !defined(ADDRESS_SANITIZER)
#else
@@ -70,10 +70,10 @@
*symbol = dlsym(handle, symbol_name);
char* err = dlerror();
if (err) {
- LOG(LS_ERROR) << "Error loading symbol " << symbol_name << " : " << err;
+ RTC_LOG(LS_ERROR) << "Error loading symbol " << symbol_name << " : " << err;
return false;
} else if (!*symbol) {
- LOG(LS_ERROR) << "Symbol " << symbol_name << " is NULL";
+ RTC_LOG(LS_ERROR) << "Symbol " << symbol_name << " is NULL";
return false;
}
return true;
diff --git a/modules/audio_device/mac/audio_device_mac.cc b/modules/audio_device/mac/audio_device_mac.cc
index 635bd0d..110bfcd 100644
--- a/modules/audio_device/mac/audio_device_mac.cc
+++ b/modules/audio_device/mac/audio_device_mac.cc
@@ -78,13 +78,15 @@
#ifdef WEBRTC_ARCH_BIG_ENDIAN
switch (sev) {
case rtc::LS_ERROR:
- LOG(LS_ERROR) << msg << ": " << err[0] << err[1] << err[2] << err[3];
+ RTC_LOG(LS_ERROR) << msg << ": " << err[0] << err[1] << err[2] << err[3];
break;
case rtc::LS_WARNING:
- LOG(LS_WARNING) << msg << ": " << err[0] << err[1] << err[2] << err[3];
+ RTC_LOG(LS_WARNING) << msg << ": " << err[0] << err[1] << err[2]
+ << err[3];
break;
case rtc::LS_VERBOSE:
- LOG(LS_VERBOSE) << msg << ": " << err[0] << err[1] << err[2] << err[3];
+ RTC_LOG(LS_VERBOSE) << msg << ": " << err[0] << err[1] << err[2]
+ << err[3];
break;
default:
break;
@@ -93,13 +95,15 @@
// We need to flip the characters in this case.
switch (sev) {
case rtc::LS_ERROR:
- LOG(LS_ERROR) << msg << ": " << err[3] << err[2] << err[1] << err[0];
+ RTC_LOG(LS_ERROR) << msg << ": " << err[3] << err[2] << err[1] << err[0];
break;
case rtc::LS_WARNING:
- LOG(LS_WARNING) << msg << ": " << err[3] << err[2] << err[1] << err[0];
+ RTC_LOG(LS_WARNING) << msg << ": " << err[3] << err[2] << err[1]
+ << err[0];
break;
case rtc::LS_VERBOSE:
- LOG(LS_VERBOSE) << msg << ": " << err[3] << err[2] << err[1] << err[0];
+ RTC_LOG(LS_VERBOSE) << msg << ": " << err[3] << err[2] << err[1]
+ << err[0];
break;
default:
break;
@@ -147,7 +151,7 @@
_renderBufSizeSamples(0),
prev_key_state_(),
get_mic_volume_counter_ms_(0) {
- LOG(LS_INFO) << __FUNCTION__ << " created";
+ RTC_LOG(LS_INFO) << __FUNCTION__ << " created";
RTC_DCHECK(&_stopEvent != NULL);
RTC_DCHECK(&_stopEventRec != NULL);
@@ -160,7 +164,7 @@
}
AudioDeviceMac::~AudioDeviceMac() {
- LOG(LS_INFO) << __FUNCTION__ << " destroyed";
+ RTC_LOG(LS_INFO) << __FUNCTION__ << " destroyed";
if (!_isShutDown) {
Terminate();
@@ -192,12 +196,12 @@
kern_return_t kernErr = KERN_SUCCESS;
kernErr = semaphore_destroy(mach_task_self(), _renderSemaphore);
if (kernErr != KERN_SUCCESS) {
- LOG(LS_ERROR) << "semaphore_destroy() error: " << kernErr;
+ RTC_LOG(LS_ERROR) << "semaphore_destroy() error: " << kernErr;
}
kernErr = semaphore_destroy(mach_task_self(), _captureSemaphore);
if (kernErr != KERN_SUCCESS) {
- LOG(LS_ERROR) << "semaphore_destroy() error: " << kernErr;
+ RTC_LOG(LS_ERROR) << "semaphore_destroy() error: " << kernErr;
}
delete &_stopEvent;
@@ -253,7 +257,7 @@
bufSize = PaUtil_InitializeRingBuffer(
_paRenderBuffer, sizeof(SInt16), _renderBufSizeSamples, _renderBufData);
if (bufSize == -1) {
- LOG(LS_ERROR) << "PaUtil_InitializeRingBuffer() error";
+ RTC_LOG(LS_ERROR) << "PaUtil_InitializeRingBuffer() error";
return InitStatus::PLAYOUT_ERROR;
}
}
@@ -274,7 +278,7 @@
PaUtil_InitializeRingBuffer(_paCaptureBuffer, sizeof(Float32),
_captureBufSizeSamples, _captureBufData);
if (bufSize == -1) {
- LOG(LS_ERROR) << "PaUtil_InitializeRingBuffer() error";
+ RTC_LOG(LS_ERROR) << "PaUtil_InitializeRingBuffer() error";
return InitStatus::RECORDING_ERROR;
}
}
@@ -283,14 +287,14 @@
kernErr = semaphore_create(mach_task_self(), &_renderSemaphore,
SYNC_POLICY_FIFO, 0);
if (kernErr != KERN_SUCCESS) {
- LOG(LS_ERROR) << "semaphore_create() error: " << kernErr;
+ RTC_LOG(LS_ERROR) << "semaphore_create() error: " << kernErr;
return InitStatus::OTHER_ERROR;
}
kernErr = semaphore_create(mach_task_self(), &_captureSemaphore,
SYNC_POLICY_FIFO, 0);
if (kernErr != KERN_SUCCESS) {
- LOG(LS_ERROR) << "semaphore_create() error: " << kernErr;
+ RTC_LOG(LS_ERROR) << "semaphore_create() error: " << kernErr;
return InitStatus::OTHER_ERROR;
}
@@ -306,8 +310,8 @@
int aoerr = AudioObjectSetPropertyData(
kAudioObjectSystemObject, &propertyAddress, 0, NULL, size, &runLoop);
if (aoerr != noErr) {
- LOG(LS_ERROR) << "Error in AudioObjectSetPropertyData: "
- << (const char*)&aoerr;
+ RTC_LOG(LS_ERROR) << "Error in AudioObjectSetPropertyData: "
+ << (const char*)&aoerr;
return InitStatus::OTHER_ERROR;
}
@@ -325,9 +329,9 @@
int intErr = sysctlbyname("hw.model", buf, &length, NULL, 0);
if (intErr != 0) {
- LOG(LS_ERROR) << "Error in sysctlbyname(): " << err;
+ RTC_LOG(LS_ERROR) << "Error in sysctlbyname(): " << err;
} else {
- LOG(LS_VERBOSE) << "Hardware model: " << buf;
+ RTC_LOG(LS_VERBOSE) << "Hardware model: " << buf;
if (strncmp(buf, "MacBookPro", 10) == 0) {
_macBookPro = true;
}
@@ -346,12 +350,12 @@
}
if (_recording) {
- LOG(LS_ERROR) << "Recording must be stopped";
+ RTC_LOG(LS_ERROR) << "Recording must be stopped";
return -1;
}
if (_playing) {
- LOG(LS_ERROR) << "Playback must be stopped";
+ RTC_LOG(LS_ERROR) << "Playback must be stopped";
return -1;
}
@@ -774,7 +778,7 @@
uint32_t level(0);
if (_mixerManager.MicrophoneVolume(level) == -1) {
- LOG(LS_WARNING) << "failed to retrieve current microphone level";
+ RTC_LOG(LS_WARNING) << "failed to retrieve current microphone level";
return -1;
}
@@ -820,12 +824,12 @@
AudioDeviceID playDevices[MaxNumberDevices];
uint32_t nDevices = GetNumberDevices(kAudioDevicePropertyScopeOutput,
playDevices, MaxNumberDevices);
- LOG(LS_VERBOSE) << "number of available waveform-audio output devices is "
- << nDevices;
+ RTC_LOG(LS_VERBOSE) << "number of available waveform-audio output devices is "
+ << nDevices;
if (index > (nDevices - 1)) {
- LOG(LS_ERROR) << "device index is out of range [0," << (nDevices - 1)
- << "]";
+ RTC_LOG(LS_ERROR) << "device index is out of range [0," << (nDevices - 1)
+ << "]";
return -1;
}
@@ -837,7 +841,7 @@
int32_t AudioDeviceMac::SetPlayoutDevice(
AudioDeviceModule::WindowsDeviceType /*device*/) {
- LOG(LS_ERROR) << "WindowsDeviceType not supported";
+ RTC_LOG(LS_ERROR) << "WindowsDeviceType not supported";
return -1;
}
@@ -891,12 +895,12 @@
AudioDeviceID recDevices[MaxNumberDevices];
uint32_t nDevices = GetNumberDevices(kAudioDevicePropertyScopeInput,
recDevices, MaxNumberDevices);
- LOG(LS_VERBOSE) << "number of available waveform-audio input devices is "
- << nDevices;
+ RTC_LOG(LS_VERBOSE) << "number of available waveform-audio input devices is "
+ << nDevices;
if (index > (nDevices - 1)) {
- LOG(LS_ERROR) << "device index is out of range [0," << (nDevices - 1)
- << "]";
+ RTC_LOG(LS_ERROR) << "device index is out of range [0," << (nDevices - 1)
+ << "]";
return -1;
}
@@ -908,7 +912,7 @@
int32_t AudioDeviceMac::SetRecordingDevice(
AudioDeviceModule::WindowsDeviceType /*device*/) {
- LOG(LS_ERROR) << "WindowsDeviceType not supported";
+ RTC_LOG(LS_ERROR) << "WindowsDeviceType not supported";
return -1;
}
@@ -959,7 +963,7 @@
}
int32_t AudioDeviceMac::InitPlayout() {
- LOG(LS_INFO) << "InitPlayout";
+ RTC_LOG(LS_INFO) << "InitPlayout";
rtc::CritScope lock(&_critSect);
if (_playing) {
@@ -976,7 +980,7 @@
// Initialize the speaker (devices might have been added or removed)
if (InitSpeaker() == -1) {
- LOG(LS_WARNING) << "InitSpeaker() failed";
+ RTC_LOG(LS_WARNING) << "InitSpeaker() failed";
}
if (!MicrophoneIsInitialized()) {
@@ -984,7 +988,7 @@
// one or two devices (_twoDevices)
bool available = false;
if (MicrophoneIsAvailable(available) == -1) {
- LOG(LS_WARNING) << "MicrophoneIsAvailable() failed";
+ RTC_LOG(LS_WARNING) << "MicrophoneIsAvailable() failed";
}
}
@@ -1015,10 +1019,10 @@
if (dataSource == 'ispk') {
_macBookProPanRight = true;
- LOG(LS_VERBOSE)
+ RTC_LOG(LS_VERBOSE)
<< "MacBook Pro using internal speakers; stereo panning right";
} else {
- LOG(LS_VERBOSE) << "MacBook Pro not using internal speakers";
+ RTC_LOG(LS_VERBOSE) << "MacBook Pro not using internal speakers";
}
// Add a listener to determine if the status changes.
@@ -1041,27 +1045,30 @@
}
if (_outStreamFormat.mChannelsPerFrame > N_DEVICE_CHANNELS) {
- LOG(LS_ERROR) << "Too many channels on output device (mChannelsPerFrame = "
- << _outStreamFormat.mChannelsPerFrame << ")";
+ RTC_LOG(LS_ERROR)
+ << "Too many channels on output device (mChannelsPerFrame = "
+ << _outStreamFormat.mChannelsPerFrame << ")";
return -1;
}
if (_outStreamFormat.mFormatFlags & kAudioFormatFlagIsNonInterleaved) {
- LOG(LS_ERROR) << "Non-interleaved audio data is not supported."
- << "AudioHardware streams should not have this format.";
+ RTC_LOG(LS_ERROR) << "Non-interleaved audio data is not supported."
+ << "AudioHardware streams should not have this format.";
return -1;
}
- LOG(LS_VERBOSE) << "Ouput stream format:";
- LOG(LS_VERBOSE) << "mSampleRate = " << _outStreamFormat.mSampleRate
- << ", mChannelsPerFrame = "
- << _outStreamFormat.mChannelsPerFrame;
- LOG(LS_VERBOSE) << "mBytesPerPacket = " << _outStreamFormat.mBytesPerPacket
- << ", mFramesPerPacket = "
- << _outStreamFormat.mFramesPerPacket;
- LOG(LS_VERBOSE) << "mBytesPerFrame = " << _outStreamFormat.mBytesPerFrame
- << ", mBitsPerChannel = " << _outStreamFormat.mBitsPerChannel;
- LOG(LS_VERBOSE) << "mFormatFlags = " << _outStreamFormat.mFormatFlags;
+ RTC_LOG(LS_VERBOSE) << "Ouput stream format:";
+ RTC_LOG(LS_VERBOSE) << "mSampleRate = " << _outStreamFormat.mSampleRate
+ << ", mChannelsPerFrame = "
+ << _outStreamFormat.mChannelsPerFrame;
+ RTC_LOG(LS_VERBOSE) << "mBytesPerPacket = "
+ << _outStreamFormat.mBytesPerPacket
+ << ", mFramesPerPacket = "
+ << _outStreamFormat.mFramesPerPacket;
+ RTC_LOG(LS_VERBOSE) << "mBytesPerFrame = " << _outStreamFormat.mBytesPerFrame
+ << ", mBitsPerChannel = "
+ << _outStreamFormat.mBitsPerChannel;
+ RTC_LOG(LS_VERBOSE) << "mFormatFlags = " << _outStreamFormat.mFormatFlags;
logCAMsg(rtc::LS_VERBOSE, "mFormatID",
(const char*)&_outStreamFormat.mFormatID);
@@ -1069,7 +1076,7 @@
if (_outStreamFormat.mChannelsPerFrame < 2) {
// Disable stereo playout when we only have one channel on the device.
_playChannels = 1;
- LOG(LS_VERBOSE) << "Stereo playout unavailable on this device";
+ RTC_LOG(LS_VERBOSE) << "Stereo playout unavailable on this device";
}
WEBRTC_CA_RETURN_ON_ERR(SetDesiredPlayoutFormat());
@@ -1094,7 +1101,7 @@
}
int32_t AudioDeviceMac::InitRecording() {
- LOG(LS_INFO) << "InitRecording";
+ RTC_LOG(LS_INFO) << "InitRecording";
rtc::CritScope lock(&_critSect);
if (_recording) {
@@ -1111,7 +1118,7 @@
// Initialize the microphone (devices might have been added or removed)
if (InitMicrophone() == -1) {
- LOG(LS_WARNING) << "InitMicrophone() failed";
+ RTC_LOG(LS_WARNING) << "InitMicrophone() failed";
}
if (!SpeakerIsInitialized()) {
@@ -1119,7 +1126,7 @@
// one or two devices (_twoDevices)
bool available = false;
if (SpeakerIsAvailable(available) == -1) {
- LOG(LS_WARNING) << "SpeakerIsAvailable() failed";
+ RTC_LOG(LS_WARNING) << "SpeakerIsAvailable() failed";
}
}
@@ -1148,8 +1155,9 @@
}
if (_inStreamFormat.mChannelsPerFrame > N_DEVICE_CHANNELS) {
- LOG(LS_ERROR) << "Too many channels on input device (mChannelsPerFrame = "
- << _inStreamFormat.mChannelsPerFrame << ")";
+ RTC_LOG(LS_ERROR)
+ << "Too many channels on input device (mChannelsPerFrame = "
+ << _inStreamFormat.mChannelsPerFrame << ")";
return -1;
}
@@ -1157,22 +1165,23 @@
_inStreamFormat.mSampleRate / 100 *
N_BLOCKS_IO;
if (io_block_size_samples > _captureBufSizeSamples) {
- LOG(LS_ERROR) << "Input IO block size (" << io_block_size_samples
- << ") is larger than ring buffer (" << _captureBufSizeSamples
- << ")";
+ RTC_LOG(LS_ERROR) << "Input IO block size (" << io_block_size_samples
+ << ") is larger than ring buffer ("
+ << _captureBufSizeSamples << ")";
return -1;
}
- LOG(LS_VERBOSE) << "Input stream format:";
- LOG(LS_VERBOSE) << "mSampleRate = " << _inStreamFormat.mSampleRate
- << ", mChannelsPerFrame = "
- << _inStreamFormat.mChannelsPerFrame;
- LOG(LS_VERBOSE) << "mBytesPerPacket = " << _inStreamFormat.mBytesPerPacket
- << ", mFramesPerPacket = "
- << _inStreamFormat.mFramesPerPacket;
- LOG(LS_VERBOSE) << "mBytesPerFrame = " << _inStreamFormat.mBytesPerFrame
- << ", mBitsPerChannel = " << _inStreamFormat.mBitsPerChannel;
- LOG(LS_VERBOSE) << "mFormatFlags = " << _inStreamFormat.mFormatFlags;
+ RTC_LOG(LS_VERBOSE) << "Input stream format:";
+ RTC_LOG(LS_VERBOSE) << "mSampleRate = " << _inStreamFormat.mSampleRate
+ << ", mChannelsPerFrame = "
+ << _inStreamFormat.mChannelsPerFrame;
+ RTC_LOG(LS_VERBOSE) << "mBytesPerPacket = " << _inStreamFormat.mBytesPerPacket
+ << ", mFramesPerPacket = "
+ << _inStreamFormat.mFramesPerPacket;
+ RTC_LOG(LS_VERBOSE) << "mBytesPerFrame = " << _inStreamFormat.mBytesPerFrame
+ << ", mBitsPerChannel = "
+ << _inStreamFormat.mBitsPerChannel;
+ RTC_LOG(LS_VERBOSE) << "mFormatFlags = " << _inStreamFormat.mFormatFlags;
logCAMsg(rtc::LS_VERBOSE, "mFormatID",
(const char*)&_inStreamFormat.mFormatID);
@@ -1183,7 +1192,7 @@
// Disable stereo recording when we only have one channel on the device.
_inDesiredFormat.mChannelsPerFrame = 1;
_recChannels = 1;
- LOG(LS_VERBOSE) << "Stereo recording unavailable on this device";
+ RTC_LOG(LS_VERBOSE) << "Stereo recording unavailable on this device";
}
if (_ptrAudioBuffer) {
@@ -1289,7 +1298,7 @@
}
int32_t AudioDeviceMac::StartRecording() {
- LOG(LS_INFO) << "StartRecording";
+ RTC_LOG(LS_INFO) << "StartRecording";
rtc::CritScope lock(&_critSect);
if (!_recIsInitialized) {
@@ -1301,7 +1310,7 @@
}
if (!_initialized) {
- LOG(LS_ERROR) << "Recording worker thread has not been started";
+ RTC_LOG(LS_ERROR) << "Recording worker thread has not been started";
return -1;
}
@@ -1326,7 +1335,7 @@
}
int32_t AudioDeviceMac::StopRecording() {
- LOG(LS_INFO) << "StopRecording";
+ RTC_LOG(LS_INFO) << "StopRecording";
rtc::CritScope lock(&_critSect);
if (!_recIsInitialized) {
@@ -1343,19 +1352,19 @@
_critSect.Leave(); // Cannot be under lock, risk of deadlock
if (kEventTimeout == _stopEventRec.Wait(2000)) {
rtc::CritScope critScoped(&_critSect);
- LOG(LS_WARNING) << "Timed out stopping the capture IOProc."
- << "We may have failed to detect a device removal.";
+ RTC_LOG(LS_WARNING) << "Timed out stopping the capture IOProc."
+ << "We may have failed to detect a device removal.";
WEBRTC_CA_LOG_WARN(AudioDeviceStop(_inputDeviceID, _inDeviceIOProcID));
WEBRTC_CA_LOG_WARN(
AudioDeviceDestroyIOProcID(_inputDeviceID, _inDeviceIOProcID));
}
_critSect.Enter();
_doStopRec = false;
- LOG(LS_INFO) << "Recording stopped (input device)";
+ RTC_LOG(LS_INFO) << "Recording stopped (input device)";
} else if (_recIsInitialized) {
WEBRTC_CA_LOG_WARN(
AudioDeviceDestroyIOProcID(_inputDeviceID, _inDeviceIOProcID));
- LOG(LS_INFO) << "Recording uninitialized (input device)";
+ RTC_LOG(LS_INFO) << "Recording uninitialized (input device)";
}
} else {
// We signal a stop for a shared device even when rendering has
@@ -1371,8 +1380,8 @@
_critSect.Leave(); // Cannot be under lock, risk of deadlock
if (kEventTimeout == _stopEvent.Wait(2000)) {
rtc::CritScope critScoped(&_critSect);
- LOG(LS_WARNING) << "Timed out stopping the shared IOProc."
- << "We may have failed to detect a device removal.";
+ RTC_LOG(LS_WARNING) << "Timed out stopping the shared IOProc."
+ << "We may have failed to detect a device removal.";
// We assume rendering on a shared device has stopped as well if
// the IOProc times out.
WEBRTC_CA_LOG_WARN(AudioDeviceStop(_outputDeviceID, _deviceIOProcID));
@@ -1381,11 +1390,11 @@
}
_critSect.Enter();
_doStop = false;
- LOG(LS_INFO) << "Recording stopped (shared device)";
+ RTC_LOG(LS_INFO) << "Recording stopped (shared device)";
} else if (_recIsInitialized && !_playing && !_playIsInitialized) {
WEBRTC_CA_LOG_WARN(
AudioDeviceDestroyIOProcID(_outputDeviceID, _deviceIOProcID));
- LOG(LS_INFO) << "Recording uninitialized (shared device)";
+ RTC_LOG(LS_INFO) << "Recording uninitialized (shared device)";
}
}
@@ -1430,7 +1439,7 @@
}
int32_t AudioDeviceMac::StartPlayout() {
- LOG(LS_INFO) << "StartPlayout";
+ RTC_LOG(LS_INFO) << "StartPlayout";
rtc::CritScope lock(&_critSect);
if (!_playIsInitialized) {
@@ -1457,7 +1466,7 @@
}
int32_t AudioDeviceMac::StopPlayout() {
- LOG(LS_INFO) << "StopPlayout";
+ RTC_LOG(LS_INFO) << "StopPlayout";
rtc::CritScope lock(&_critSect);
if (!_playIsInitialized) {
@@ -1479,8 +1488,8 @@
_critSect.Leave(); // Cannot be under lock, risk of deadlock
if (kEventTimeout == _stopEvent.Wait(2000)) {
rtc::CritScope critScoped(&_critSect);
- LOG(LS_WARNING) << "Timed out stopping the render IOProc."
- << "We may have failed to detect a device removal.";
+ RTC_LOG(LS_WARNING) << "Timed out stopping the render IOProc."
+ << "We may have failed to detect a device removal.";
// We assume capturing on a shared device has stopped as well if the
// IOProc times out.
@@ -1490,15 +1499,15 @@
}
_critSect.Enter();
_doStop = false;
- LOG(LS_INFO) << "Playout stopped";
+ RTC_LOG(LS_INFO) << "Playout stopped";
} else if (_twoDevices && _playIsInitialized) {
WEBRTC_CA_LOG_WARN(
AudioDeviceDestroyIOProcID(_outputDeviceID, _deviceIOProcID));
- LOG(LS_INFO) << "Playout uninitialized (output device)";
+ RTC_LOG(LS_INFO) << "Playout uninitialized (output device)";
} else if (!_twoDevices && _playIsInitialized && !_recIsInitialized) {
WEBRTC_CA_LOG_WARN(
AudioDeviceDestroyIOProcID(_outputDeviceID, _deviceIOProcID));
- LOG(LS_INFO) << "Playout uninitialized (shared device)";
+ RTC_LOG(LS_INFO) << "Playout uninitialized (shared device)";
}
// Setting this signal will allow the worker thread to be stopped.
@@ -1565,7 +1574,7 @@
WEBRTC_CA_RETURN_ON_ERR(AudioObjectGetPropertyDataSize(
kAudioObjectSystemObject, &propertyAddress, 0, NULL, &size));
if (size == 0) {
- LOG(LS_WARNING) << "No devices";
+ RTC_LOG(LS_WARNING) << "No devices";
return 0;
}
@@ -1595,7 +1604,7 @@
scopedDeviceIds[numberScopedDevices] = usedID;
numberScopedDevices++;
} else {
- LOG(LS_WARNING) << "GetNumberDevices(): Default device unknown";
+ RTC_LOG(LS_WARNING) << "GetNumberDevices(): Default device unknown";
}
// Then list the rest of the devices
@@ -1631,7 +1640,7 @@
if (bufferList->mNumberBuffers > 0) {
if (numberScopedDevices >= deviceListLength) {
- LOG(LS_ERROR) << "Device list is not long enough";
+ RTC_LOG(LS_ERROR) << "Device list is not long enough";
listOK = false;
break;
}
@@ -1679,7 +1688,7 @@
if (numberDevices < 0) {
return -1;
} else if (numberDevices == 0) {
- LOG(LS_ERROR) << "No devices";
+ RTC_LOG(LS_ERROR) << "No devices";
return -1;
}
@@ -1703,7 +1712,7 @@
WEBRTC_CA_RETURN_ON_ERR(AudioObjectGetPropertyData(
kAudioObjectSystemObject, &propertyAddress, 0, NULL, &size, &usedID));
if (usedID == kAudioDeviceUnknown) {
- LOG(LS_WARNING) << "GetDeviceName(): Default device unknown";
+ RTC_LOG(LS_WARNING) << "GetDeviceName(): Default device unknown";
} else {
isDefaultDevice = true;
}
@@ -1760,7 +1769,7 @@
if (numberDevices < 0) {
return -1;
} else if (numberDevices == 0) {
- LOG(LS_ERROR) << "InitDevice(): No devices";
+ RTC_LOG(LS_ERROR) << "InitDevice(): No devices";
return -1;
}
@@ -1772,7 +1781,7 @@
WEBRTC_CA_RETURN_ON_ERR(AudioObjectGetPropertyData(
kAudioObjectSystemObject, &propertyAddress, 0, NULL, &size, &deviceId));
if (deviceId == kAudioDeviceUnknown) {
- LOG(LS_WARNING) << "No default device exists";
+ RTC_LOG(LS_WARNING) << "No default device exists";
} else {
isDefaultDevice = true;
}
@@ -1802,9 +1811,9 @@
0, NULL, &size, devManf));
if (isInput) {
- LOG(LS_INFO) << "Input device: " << devManf << " " << devName;
+ RTC_LOG(LS_INFO) << "Input device: " << devManf << " " << devName;
} else {
- LOG(LS_INFO) << "Output device: " << devManf << " " << devName;
+ RTC_LOG(LS_INFO) << "Output device: " << devManf << " " << devName;
}
return 0;
@@ -1900,10 +1909,10 @@
_renderLatencyUs +=
static_cast<uint32_t>((1.0e6 * latency) / _outStreamFormat.mSampleRate);
- LOG(LS_VERBOSE) << "initial playout status: _renderDelayOffsetSamples="
- << _renderDelayOffsetSamples
- << ", _renderDelayUs=" << _renderDelayUs
- << ", _renderLatencyUs=" << _renderLatencyUs;
+ RTC_LOG(LS_VERBOSE) << "initial playout status: _renderDelayOffsetSamples="
+ << _renderDelayOffsetSamples
+ << ", _renderDelayUs=" << _renderDelayUs
+ << ", _renderLatencyUs=" << _renderLatencyUs;
return 0;
}
@@ -1925,7 +1934,7 @@
const AudioObjectID objectId,
const UInt32 numberAddresses,
const AudioObjectPropertyAddress addresses[]) {
- LOG(LS_VERBOSE) << "AudioDeviceMac::implObjectListenerProc()";
+ RTC_LOG(LS_VERBOSE) << "AudioDeviceMac::implObjectListenerProc()";
for (UInt32 i = 0; i < numberAddresses; i++) {
if (addresses[i].mSelector == kAudioHardwarePropertyDevices) {
@@ -1945,7 +1954,7 @@
int32_t AudioDeviceMac::HandleDeviceChange() {
OSStatus err = noErr;
- LOG(LS_VERBOSE) << "kAudioHardwarePropertyDevices";
+ RTC_LOG(LS_VERBOSE) << "kAudioHardwarePropertyDevices";
// A device has changed. Check if our registered devices have been removed.
// Ensure the devices have been initialized, meaning the IDs are valid.
@@ -1958,7 +1967,7 @@
&size, &deviceIsAlive);
if (err == kAudioHardwareBadDeviceError || deviceIsAlive == 0) {
- LOG(LS_WARNING) << "Capture device is not alive (probably removed)";
+ RTC_LOG(LS_WARNING) << "Capture device is not alive (probably removed)";
AtomicSet32(&_captureDeviceIsAlive, 0);
_mixerManager.CloseMicrophone();
} else if (err != noErr) {
@@ -1977,7 +1986,7 @@
&size, &deviceIsAlive);
if (err == kAudioHardwareBadDeviceError || deviceIsAlive == 0) {
- LOG(LS_WARNING) << "Render device is not alive (probably removed)";
+ RTC_LOG(LS_WARNING) << "Render device is not alive (probably removed)";
AtomicSet32(&_renderDeviceIsAlive, 0);
_mixerManager.CloseSpeaker();
} else if (err != noErr) {
@@ -1995,7 +2004,7 @@
const AudioObjectPropertyAddress propertyAddress) {
OSStatus err = noErr;
- LOG(LS_VERBOSE) << "Stream format changed";
+ RTC_LOG(LS_VERBOSE) << "Stream format changed";
if (objectId != _inputDeviceID && objectId != _outputDeviceID) {
return 0;
@@ -2014,25 +2023,27 @@
}
if (streamFormat.mChannelsPerFrame > N_DEVICE_CHANNELS) {
- LOG(LS_ERROR) << "Too many channels on device (mChannelsPerFrame = "
- << streamFormat.mChannelsPerFrame << ")";
+ RTC_LOG(LS_ERROR) << "Too many channels on device (mChannelsPerFrame = "
+ << streamFormat.mChannelsPerFrame << ")";
return -1;
}
if (_ptrAudioBuffer && streamFormat.mChannelsPerFrame != _recChannels) {
- LOG(LS_ERROR) << "Changing channels not supported (mChannelsPerFrame = "
- << streamFormat.mChannelsPerFrame << ")";
+ RTC_LOG(LS_ERROR) << "Changing channels not supported (mChannelsPerFrame = "
+ << streamFormat.mChannelsPerFrame << ")";
return -1;
}
- LOG(LS_VERBOSE) << "Stream format:";
- LOG(LS_VERBOSE) << "mSampleRate = " << streamFormat.mSampleRate
- << ", mChannelsPerFrame = " << streamFormat.mChannelsPerFrame;
- LOG(LS_VERBOSE) << "mBytesPerPacket = " << streamFormat.mBytesPerPacket
- << ", mFramesPerPacket = " << streamFormat.mFramesPerPacket;
- LOG(LS_VERBOSE) << "mBytesPerFrame = " << streamFormat.mBytesPerFrame
- << ", mBitsPerChannel = " << streamFormat.mBitsPerChannel;
- LOG(LS_VERBOSE) << "mFormatFlags = " << streamFormat.mFormatFlags;
+ RTC_LOG(LS_VERBOSE) << "Stream format:";
+ RTC_LOG(LS_VERBOSE) << "mSampleRate = " << streamFormat.mSampleRate
+ << ", mChannelsPerFrame = "
+ << streamFormat.mChannelsPerFrame;
+ RTC_LOG(LS_VERBOSE) << "mBytesPerPacket = " << streamFormat.mBytesPerPacket
+ << ", mFramesPerPacket = "
+ << streamFormat.mFramesPerPacket;
+ RTC_LOG(LS_VERBOSE) << "mBytesPerFrame = " << streamFormat.mBytesPerFrame
+ << ", mBitsPerChannel = " << streamFormat.mBitsPerChannel;
+ RTC_LOG(LS_VERBOSE) << "mFormatFlags = " << streamFormat.mFormatFlags;
logCAMsg(rtc::LS_VERBOSE, "mFormatID", (const char*)&streamFormat.mFormatID);
if (propertyAddress.mScope == kAudioDevicePropertyScopeInput) {
@@ -2040,9 +2051,9 @@
streamFormat.mSampleRate / 100 *
N_BLOCKS_IO;
if (io_block_size_samples > _captureBufSizeSamples) {
- LOG(LS_ERROR) << "Input IO block size (" << io_block_size_samples
- << ") is larger than ring buffer ("
- << _captureBufSizeSamples << ")";
+ RTC_LOG(LS_ERROR) << "Input IO block size (" << io_block_size_samples
+ << ") is larger than ring buffer ("
+ << _captureBufSizeSamples << ")";
return -1;
}
@@ -2054,7 +2065,7 @@
// Disable stereo recording when we only have one channel on the device.
_inDesiredFormat.mChannelsPerFrame = 1;
_recChannels = 1;
- LOG(LS_VERBOSE) << "Stereo recording unavailable on this device";
+ RTC_LOG(LS_VERBOSE) << "Stereo recording unavailable on this device";
}
// Recreate the converter with the new format
@@ -2069,7 +2080,7 @@
// Our preferred format to work with
if (_outStreamFormat.mChannelsPerFrame < 2) {
_playChannels = 1;
- LOG(LS_VERBOSE) << "Stereo playout unavailable on this device";
+ RTC_LOG(LS_VERBOSE) << "Stereo playout unavailable on this device";
}
WEBRTC_CA_RETURN_ON_ERR(SetDesiredPlayoutFormat());
}
@@ -2083,7 +2094,7 @@
if (_macBookPro &&
propertyAddress.mScope == kAudioDevicePropertyScopeOutput) {
- LOG(LS_VERBOSE) << "Data source changed";
+ RTC_LOG(LS_VERBOSE) << "Data source changed";
_macBookProPanRight = false;
UInt32 dataSource = 0;
@@ -2092,10 +2103,10 @@
objectId, &propertyAddress, 0, NULL, &size, &dataSource));
if (dataSource == 'ispk') {
_macBookProPanRight = true;
- LOG(LS_VERBOSE)
+ RTC_LOG(LS_VERBOSE)
<< "MacBook Pro using internal speakers; stereo panning right";
} else {
- LOG(LS_VERBOSE) << "MacBook Pro not using internal speakers";
+ RTC_LOG(LS_VERBOSE) << "MacBook Pro not using internal speakers";
}
}
@@ -2110,11 +2121,11 @@
// We don't log the notification, as it's sent from the HAL's IO thread. We
// don't want to slow it down even further.
if (propertyAddress.mScope == kAudioDevicePropertyScopeInput) {
- // LOG(LS_WARNING) << "Capture processor // overload";
+ // RTC_LOG(LS_WARNING) << "Capture processor // overload";
//_callback->ProblemIsReported(
// SndCardStreamObserver::ERecordingProblem);
} else {
- // LOG(LS_WARNING) << "Render processor overload";
+ // RTC_LOG(LS_WARNING) << "Render processor overload";
//_callback->ProblemIsReported(
// SndCardStreamObserver::EPlaybackProblem);
}
@@ -2205,7 +2216,7 @@
WEBRTC_CA_LOG_WARN(
AudioDeviceDestroyIOProcID(_outputDeviceID, _deviceIOProcID));
if (err == noErr) {
- LOG(LS_VERBOSE) << "Playout or shared device stopped";
+ RTC_LOG(LS_VERBOSE) << "Playout or shared device stopped";
}
}
@@ -2234,7 +2245,7 @@
if (err != noErr) {
if (err == 1) {
// This is our own error.
- LOG(LS_ERROR) << "Error in AudioConverterFillComplexBuffer()";
+ RTC_LOG(LS_ERROR) << "Error in AudioConverterFillComplexBuffer()";
return 1;
} else {
logCAMsg(rtc::LS_ERROR, "Error in AudioConverterFillComplexBuffer()",
@@ -2275,7 +2286,7 @@
kern_return_t kernErr = semaphore_signal_all(_renderSemaphore);
if (kernErr != KERN_SUCCESS) {
- LOG(LS_ERROR) << "semaphore_signal_all() error: " << kernErr;
+ RTC_LOG(LS_ERROR) << "semaphore_signal_all() error: " << kernErr;
return 1;
}
@@ -2298,7 +2309,7 @@
WEBRTC_CA_LOG_WARN(
AudioDeviceDestroyIOProcID(_inputDeviceID, _inDeviceIOProcID));
if (err == noErr) {
- LOG(LS_VERBOSE) << "Recording device stopped";
+ RTC_LOG(LS_VERBOSE) << "Recording device stopped";
}
_doStopRec = false;
@@ -2335,7 +2346,7 @@
kern_return_t kernErr = semaphore_signal_all(_captureSemaphore);
if (kernErr != KERN_SUCCESS) {
- LOG(LS_ERROR) << "semaphore_signal_all() error: " << kernErr;
+ RTC_LOG(LS_ERROR) << "semaphore_signal_all() error: " << kernErr;
}
return err;
@@ -2361,7 +2372,7 @@
return 1;
}
} else if (kernErr != KERN_SUCCESS) {
- LOG(LS_ERROR) << "semaphore_wait() error: " << kernErr;
+ RTC_LOG(LS_ERROR) << "semaphore_wait() error: " << kernErr;
}
}
@@ -2403,14 +2414,14 @@
return false;
}
} else if (kernErr != KERN_SUCCESS) {
- LOG(LS_ERROR) << "semaphore_timedwait() error: " << kernErr;
+ RTC_LOG(LS_ERROR) << "semaphore_timedwait() error: " << kernErr;
}
}
int8_t playBuffer[4 * ENGINE_PLAY_BUF_SIZE_IN_SAMPLES];
if (!_ptrAudioBuffer) {
- LOG(LS_ERROR) << "capture AudioBuffer is invalid";
+ RTC_LOG(LS_ERROR) << "capture AudioBuffer is invalid";
return false;
}
@@ -2420,7 +2431,7 @@
nSamples = _ptrAudioBuffer->GetPlayoutData(playBuffer);
if (nSamples != ENGINE_PLAY_BUF_SIZE_IN_SAMPLES) {
- LOG(LS_ERROR) << "invalid number of output samples(" << nSamples << ")";
+ RTC_LOG(LS_ERROR) << "invalid number of output samples(" << nSamples << ")";
}
uint32_t nOutSamples = nSamples * _outDesiredFormat.mChannelsPerFrame;
@@ -2497,7 +2508,7 @@
static_cast<int32_t>(1e-3 * (captureDelayUs + _captureLatencyUs) + 0.5);
if (!_ptrAudioBuffer) {
- LOG(LS_ERROR) << "capture AudioBuffer is invalid";
+ RTC_LOG(LS_ERROR) << "capture AudioBuffer is invalid";
return false;
}
@@ -2533,10 +2544,10 @@
// a change is needed.
// Set this new mic level (received from the observer as return
// value in the callback).
- LOG(LS_VERBOSE) << "AGC change of volume: old=" << currentMicLevel
- << " => new=" << newMicLevel;
+ RTC_LOG(LS_VERBOSE) << "AGC change of volume: old=" << currentMicLevel
+ << " => new=" << newMicLevel;
if (SetMicrophoneVolume(newMicLevel) == -1) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "the required modification of the microphone volume failed";
}
}
diff --git a/modules/audio_device/mac/audio_mixer_manager_mac.cc b/modules/audio_device/mac/audio_mixer_manager_mac.cc
index 928fae7..0e7d0fc 100644
--- a/modules/audio_device/mac/audio_mixer_manager_mac.cc
+++ b/modules/audio_device/mac/audio_mixer_manager_mac.cc
@@ -44,11 +44,11 @@
_outputDeviceID(kAudioObjectUnknown),
_noInputChannels(0),
_noOutputChannels(0) {
- LOG(LS_INFO) << __FUNCTION__ << " created";
+ RTC_LOG(LS_INFO) << __FUNCTION__ << " created";
}
AudioMixerManagerMac::~AudioMixerManagerMac() {
- LOG(LS_INFO) << __FUNCTION__ << " destroyed";
+ RTC_LOG(LS_INFO) << __FUNCTION__ << " destroyed";
Close();
}
@@ -57,7 +57,7 @@
// ============================================================================
int32_t AudioMixerManagerMac::Close() {
- LOG(LS_VERBOSE) << __FUNCTION__;
+ RTC_LOG(LS_VERBOSE) << __FUNCTION__;
rtc::CritScope lock(&_critSect);
@@ -68,7 +68,7 @@
}
int32_t AudioMixerManagerMac::CloseSpeaker() {
- LOG(LS_VERBOSE) << __FUNCTION__;
+ RTC_LOG(LS_VERBOSE) << __FUNCTION__;
rtc::CritScope lock(&_critSect);
@@ -79,7 +79,7 @@
}
int32_t AudioMixerManagerMac::CloseMicrophone() {
- LOG(LS_VERBOSE) << __FUNCTION__;
+ RTC_LOG(LS_VERBOSE) << __FUNCTION__;
rtc::CritScope lock(&_critSect);
@@ -90,7 +90,8 @@
}
int32_t AudioMixerManagerMac::OpenSpeaker(AudioDeviceID deviceID) {
- LOG(LS_VERBOSE) << "AudioMixerManagerMac::OpenSpeaker(id=" << deviceID << ")";
+ RTC_LOG(LS_VERBOSE) << "AudioMixerManagerMac::OpenSpeaker(id=" << deviceID
+ << ")";
rtc::CritScope lock(&_critSect);
@@ -109,14 +110,14 @@
_outputDeviceID, &propertyAddress, 0, NULL, &size, &hogPid));
if (hogPid == -1) {
- LOG(LS_VERBOSE) << "No process has hogged the input device";
+ RTC_LOG(LS_VERBOSE) << "No process has hogged the input device";
}
// getpid() is apparently "always successful"
else if (hogPid == getpid()) {
- LOG(LS_VERBOSE) << "Our process has hogged the input device";
+ RTC_LOG(LS_VERBOSE) << "Our process has hogged the input device";
} else {
- LOG(LS_WARNING) << "Another process (pid = " << static_cast<int>(hogPid)
- << ") has hogged the input device";
+ RTC_LOG(LS_WARNING) << "Another process (pid = " << static_cast<int>(hogPid)
+ << ") has hogged the input device";
return -1;
}
@@ -137,8 +138,8 @@
}
int32_t AudioMixerManagerMac::OpenMicrophone(AudioDeviceID deviceID) {
- LOG(LS_VERBOSE) << "AudioMixerManagerMac::OpenMicrophone(id=" << deviceID
- << ")";
+ RTC_LOG(LS_VERBOSE) << "AudioMixerManagerMac::OpenMicrophone(id=" << deviceID
+ << ")";
rtc::CritScope lock(&_critSect);
@@ -155,14 +156,14 @@
WEBRTC_CA_RETURN_ON_ERR(AudioObjectGetPropertyData(
_inputDeviceID, &propertyAddress, 0, NULL, &size, &hogPid));
if (hogPid == -1) {
- LOG(LS_VERBOSE) << "No process has hogged the input device";
+ RTC_LOG(LS_VERBOSE) << "No process has hogged the input device";
}
// getpid() is apparently "always successful"
else if (hogPid == getpid()) {
- LOG(LS_VERBOSE) << "Our process has hogged the input device";
+ RTC_LOG(LS_VERBOSE) << "Our process has hogged the input device";
} else {
- LOG(LS_WARNING) << "Another process (pid = " << static_cast<int>(hogPid)
- << ") has hogged the input device";
+ RTC_LOG(LS_WARNING) << "Another process (pid = " << static_cast<int>(hogPid)
+ << ") has hogged the input device";
return -1;
}
@@ -183,25 +184,25 @@
}
bool AudioMixerManagerMac::SpeakerIsInitialized() const {
- LOG(LS_INFO) << __FUNCTION__;
+ RTC_LOG(LS_INFO) << __FUNCTION__;
return (_outputDeviceID != kAudioObjectUnknown);
}
bool AudioMixerManagerMac::MicrophoneIsInitialized() const {
- LOG(LS_INFO) << __FUNCTION__;
+ RTC_LOG(LS_INFO) << __FUNCTION__;
return (_inputDeviceID != kAudioObjectUnknown);
}
int32_t AudioMixerManagerMac::SetSpeakerVolume(uint32_t volume) {
- LOG(LS_VERBOSE) << "AudioMixerManagerMac::SetSpeakerVolume(volume=" << volume
- << ")";
+ RTC_LOG(LS_VERBOSE) << "AudioMixerManagerMac::SetSpeakerVolume(volume="
+ << volume << ")";
rtc::CritScope lock(&_critSect);
if (_outputDeviceID == kAudioObjectUnknown) {
- LOG(LS_WARNING) << "device ID has not been set";
+ RTC_LOG(LS_WARNING) << "device ID has not been set";
return -1;
}
@@ -244,7 +245,7 @@
}
if (!success) {
- LOG(LS_WARNING) << "Unable to set a volume on any output channel";
+ RTC_LOG(LS_WARNING) << "Unable to set a volume on any output channel";
return -1;
}
@@ -253,7 +254,7 @@
int32_t AudioMixerManagerMac::SpeakerVolume(uint32_t& volume) const {
if (_outputDeviceID == kAudioObjectUnknown) {
- LOG(LS_WARNING) << "device ID has not been set";
+ RTC_LOG(LS_WARNING) << "device ID has not been set";
return -1;
}
@@ -294,7 +295,7 @@
}
if (channels == 0) {
- LOG(LS_WARNING) << "Unable to get a volume on any channel";
+ RTC_LOG(LS_WARNING) << "Unable to get a volume on any channel";
return -1;
}
@@ -303,14 +304,14 @@
volume = static_cast<uint32_t>(255 * vol / channels + 0.5);
}
- LOG(LS_VERBOSE) << "AudioMixerManagerMac::SpeakerVolume() => vol=" << vol;
+ RTC_LOG(LS_VERBOSE) << "AudioMixerManagerMac::SpeakerVolume() => vol=" << vol;
return 0;
}
int32_t AudioMixerManagerMac::MaxSpeakerVolume(uint32_t& maxVolume) const {
if (_outputDeviceID == kAudioObjectUnknown) {
- LOG(LS_WARNING) << "device ID has not been set";
+ RTC_LOG(LS_WARNING) << "device ID has not been set";
return -1;
}
@@ -323,7 +324,7 @@
int32_t AudioMixerManagerMac::MinSpeakerVolume(uint32_t& minVolume) const {
if (_outputDeviceID == kAudioObjectUnknown) {
- LOG(LS_WARNING) << "device ID has not been set";
+ RTC_LOG(LS_WARNING) << "device ID has not been set";
return -1;
}
@@ -336,7 +337,7 @@
int32_t AudioMixerManagerMac::SpeakerVolumeIsAvailable(bool& available) {
if (_outputDeviceID == kAudioObjectUnknown) {
- LOG(LS_WARNING) << "device ID has not been set";
+ RTC_LOG(LS_WARNING) << "device ID has not been set";
return -1;
}
@@ -362,8 +363,8 @@
&isSettable);
if (err != noErr || !isSettable) {
available = false;
- LOG(LS_WARNING) << "Volume cannot be set for output channel " << i
- << ", err=" << err;
+ RTC_LOG(LS_WARNING) << "Volume cannot be set for output channel " << i
+ << ", err=" << err;
return -1;
}
}
@@ -374,7 +375,7 @@
int32_t AudioMixerManagerMac::SpeakerMuteIsAvailable(bool& available) {
if (_outputDeviceID == kAudioObjectUnknown) {
- LOG(LS_WARNING) << "device ID has not been set";
+ RTC_LOG(LS_WARNING) << "device ID has not been set";
return -1;
}
@@ -400,8 +401,8 @@
&isSettable);
if (err != noErr || !isSettable) {
available = false;
- LOG(LS_WARNING) << "Mute cannot be set for output channel " << i
- << ", err=" << err;
+ RTC_LOG(LS_WARNING) << "Mute cannot be set for output channel " << i
+ << ", err=" << err;
return -1;
}
}
@@ -411,13 +412,13 @@
}
int32_t AudioMixerManagerMac::SetSpeakerMute(bool enable) {
- LOG(LS_VERBOSE) << "AudioMixerManagerMac::SetSpeakerMute(enable=" << enable
- << ")";
+ RTC_LOG(LS_VERBOSE) << "AudioMixerManagerMac::SetSpeakerMute(enable="
+ << enable << ")";
rtc::CritScope lock(&_critSect);
if (_outputDeviceID == kAudioObjectUnknown) {
- LOG(LS_WARNING) << "device ID has not been set";
+ RTC_LOG(LS_WARNING) << "device ID has not been set";
return -1;
}
@@ -456,7 +457,7 @@
}
if (!success) {
- LOG(LS_WARNING) << "Unable to set mute on any input channel";
+ RTC_LOG(LS_WARNING) << "Unable to set mute on any input channel";
return -1;
}
@@ -465,7 +466,7 @@
int32_t AudioMixerManagerMac::SpeakerMute(bool& enabled) const {
if (_outputDeviceID == kAudioObjectUnknown) {
- LOG(LS_WARNING) << "device ID has not been set";
+ RTC_LOG(LS_WARNING) << "device ID has not been set";
return -1;
}
@@ -505,7 +506,7 @@
}
if (channels == 0) {
- LOG(LS_WARNING) << "Unable to get mute for any channel";
+ RTC_LOG(LS_WARNING) << "Unable to get mute for any channel";
return -1;
}
@@ -514,15 +515,15 @@
enabled = static_cast<bool>(muted);
}
- LOG(LS_VERBOSE) << "AudioMixerManagerMac::SpeakerMute() => enabled="
- << enabled;
+ RTC_LOG(LS_VERBOSE) << "AudioMixerManagerMac::SpeakerMute() => enabled="
+ << enabled;
return 0;
}
int32_t AudioMixerManagerMac::StereoPlayoutIsAvailable(bool& available) {
if (_outputDeviceID == kAudioObjectUnknown) {
- LOG(LS_WARNING) << "device ID has not been set";
+ RTC_LOG(LS_WARNING) << "device ID has not been set";
return -1;
}
@@ -532,7 +533,7 @@
int32_t AudioMixerManagerMac::StereoRecordingIsAvailable(bool& available) {
if (_inputDeviceID == kAudioObjectUnknown) {
- LOG(LS_WARNING) << "device ID has not been set";
+ RTC_LOG(LS_WARNING) << "device ID has not been set";
return -1;
}
@@ -542,7 +543,7 @@
int32_t AudioMixerManagerMac::MicrophoneMuteIsAvailable(bool& available) {
if (_inputDeviceID == kAudioObjectUnknown) {
- LOG(LS_WARNING) << "device ID has not been set";
+ RTC_LOG(LS_WARNING) << "device ID has not been set";
return -1;
}
@@ -568,8 +569,8 @@
&isSettable);
if (err != noErr || !isSettable) {
available = false;
- LOG(LS_WARNING) << "Mute cannot be set for output channel " << i
- << ", err=" << err;
+ RTC_LOG(LS_WARNING) << "Mute cannot be set for output channel " << i
+ << ", err=" << err;
return -1;
}
}
@@ -579,13 +580,13 @@
}
int32_t AudioMixerManagerMac::SetMicrophoneMute(bool enable) {
- LOG(LS_VERBOSE) << "AudioMixerManagerMac::SetMicrophoneMute(enable=" << enable
- << ")";
+ RTC_LOG(LS_VERBOSE) << "AudioMixerManagerMac::SetMicrophoneMute(enable="
+ << enable << ")";
rtc::CritScope lock(&_critSect);
if (_inputDeviceID == kAudioObjectUnknown) {
- LOG(LS_WARNING) << "device ID has not been set";
+ RTC_LOG(LS_WARNING) << "device ID has not been set";
return -1;
}
@@ -624,7 +625,7 @@
}
if (!success) {
- LOG(LS_WARNING) << "Unable to set mute on any input channel";
+ RTC_LOG(LS_WARNING) << "Unable to set mute on any input channel";
return -1;
}
@@ -633,7 +634,7 @@
int32_t AudioMixerManagerMac::MicrophoneMute(bool& enabled) const {
if (_inputDeviceID == kAudioObjectUnknown) {
- LOG(LS_WARNING) << "device ID has not been set";
+ RTC_LOG(LS_WARNING) << "device ID has not been set";
return -1;
}
@@ -673,7 +674,7 @@
}
if (channels == 0) {
- LOG(LS_WARNING) << "Unable to get mute for any channel";
+ RTC_LOG(LS_WARNING) << "Unable to get mute for any channel";
return -1;
}
@@ -682,15 +683,15 @@
enabled = static_cast<bool>(muted);
}
- LOG(LS_VERBOSE) << "AudioMixerManagerMac::MicrophoneMute() => enabled="
- << enabled;
+ RTC_LOG(LS_VERBOSE) << "AudioMixerManagerMac::MicrophoneMute() => enabled="
+ << enabled;
return 0;
}
int32_t AudioMixerManagerMac::MicrophoneVolumeIsAvailable(bool& available) {
if (_inputDeviceID == kAudioObjectUnknown) {
- LOG(LS_WARNING) << "device ID has not been set";
+ RTC_LOG(LS_WARNING) << "device ID has not been set";
return -1;
}
@@ -716,8 +717,8 @@
&isSettable);
if (err != noErr || !isSettable) {
available = false;
- LOG(LS_WARNING) << "Volume cannot be set for input channel " << i
- << ", err=" << err;
+ RTC_LOG(LS_WARNING) << "Volume cannot be set for input channel " << i
+ << ", err=" << err;
return -1;
}
}
@@ -727,13 +728,13 @@
}
int32_t AudioMixerManagerMac::SetMicrophoneVolume(uint32_t volume) {
- LOG(LS_VERBOSE) << "AudioMixerManagerMac::SetMicrophoneVolume(volume="
- << volume << ")";
+ RTC_LOG(LS_VERBOSE) << "AudioMixerManagerMac::SetMicrophoneVolume(volume="
+ << volume << ")";
rtc::CritScope lock(&_critSect);
if (_inputDeviceID == kAudioObjectUnknown) {
- LOG(LS_WARNING) << "device ID has not been set";
+ RTC_LOG(LS_WARNING) << "device ID has not been set";
return -1;
}
@@ -776,7 +777,7 @@
}
if (!success) {
- LOG(LS_WARNING) << "Unable to set a level on any input channel";
+ RTC_LOG(LS_WARNING) << "Unable to set a level on any input channel";
return -1;
}
@@ -785,7 +786,7 @@
int32_t AudioMixerManagerMac::MicrophoneVolume(uint32_t& volume) const {
if (_inputDeviceID == kAudioObjectUnknown) {
- LOG(LS_WARNING) << "device ID has not been set";
+ RTC_LOG(LS_WARNING) << "device ID has not been set";
return -1;
}
@@ -826,7 +827,7 @@
}
if (channels == 0) {
- LOG(LS_WARNING) << "Unable to get a level on any channel";
+ RTC_LOG(LS_WARNING) << "Unable to get a level on any channel";
return -1;
}
@@ -835,15 +836,15 @@
volume = static_cast<uint32_t>(255 * volFloat32 / channels + 0.5);
}
- LOG(LS_VERBOSE) << "AudioMixerManagerMac::MicrophoneVolume() => vol="
- << volume;
+ RTC_LOG(LS_VERBOSE) << "AudioMixerManagerMac::MicrophoneVolume() => vol="
+ << volume;
return 0;
}
int32_t AudioMixerManagerMac::MaxMicrophoneVolume(uint32_t& maxVolume) const {
if (_inputDeviceID == kAudioObjectUnknown) {
- LOG(LS_WARNING) << "device ID has not been set";
+ RTC_LOG(LS_WARNING) << "device ID has not been set";
return -1;
}
@@ -856,7 +857,7 @@
int32_t AudioMixerManagerMac::MinMicrophoneVolume(uint32_t& minVolume) const {
if (_inputDeviceID == kAudioObjectUnknown) {
- LOG(LS_WARNING) << "device ID has not been set";
+ RTC_LOG(LS_WARNING) << "device ID has not been set";
return -1;
}
@@ -882,10 +883,11 @@
#ifdef WEBRTC_ARCH_BIG_ENDIAN
switch (sev) {
case rtc::LS_ERROR:
- LOG(LS_ERROR) << msg << ": " << err[0] << err[1] << err[2] << err[3];
+ RTC_LOG(LS_ERROR) << msg << ": " << err[0] << err[1] << err[2] << err[3];
break;
case rtc::LS_WARNING:
- LOG(LS_WARNING) << msg << ": " << err[0] << err[1] << err[2] << err[3];
+ RTC_LOG(LS_WARNING) << msg << ": " << err[0] << err[1] << err[2]
+ << err[3];
break;
default:
break;
@@ -894,10 +896,11 @@
// We need to flip the characters in this case.
switch (sev) {
case rtc::LS_ERROR:
- LOG(LS_ERROR) << msg << ": " << err[3] << err[2] << err[1] << err[0];
+ RTC_LOG(LS_ERROR) << msg << ": " << err[3] << err[2] << err[1] << err[0];
break;
case rtc::LS_WARNING:
- LOG(LS_WARNING) << msg << ": " << err[3] << err[2] << err[1] << err[0];
+ RTC_LOG(LS_WARNING) << msg << ": " << err[3] << err[2] << err[1]
+ << err[0];
break;
default:
break;
diff --git a/modules/audio_device/win/audio_device_core_win.cc b/modules/audio_device/win/audio_device_core_win.cc
index 32c3f94..badfa77 100644
--- a/modules/audio_device/win/audio_device_core_win.cc
+++ b/modules/audio_device/win/audio_device_core_win.cc
@@ -171,7 +171,7 @@
// ----------------------------------------------------------------------------
bool AudioDeviceWindowsCore::CoreAudioIsSupported() {
- LOG(LS_VERBOSE) << __FUNCTION__;
+ RTC_LOG(LS_VERBOSE) << __FUNCTION__;
bool MMDeviceIsAvailable(false);
bool coreAudioIsSupported(false);
@@ -211,7 +211,7 @@
// Perform the test.
BOOL isVistaRTMorXP = VerifyVersionInfo(&osvi, dwTypeMask, dwlConditionMask);
if (isVistaRTMorXP != 0) {
- LOG(LS_VERBOSE)
+ RTC_LOG(LS_VERBOSE)
<< "*** Windows Core Audio is only supported on Vista SP1 or later"
<< " => will revert to the Wave API ***";
return false;
@@ -263,12 +263,12 @@
(void**)&pIMMD);
if (FAILED(hr)) {
- LOG(LS_ERROR) << "AudioDeviceWindowsCore::CoreAudioIsSupported()"
- << " Failed to create the required COM object (hr=" << hr
- << ")";
- LOG(LS_VERBOSE) << "AudioDeviceWindowsCore::CoreAudioIsSupported()"
- << " CoCreateInstance(MMDeviceEnumerator) failed (hr=" << hr
- << ")";
+ RTC_LOG(LS_ERROR) << "AudioDeviceWindowsCore::CoreAudioIsSupported()"
+ << " Failed to create the required COM object (hr=" << hr
+ << ")";
+ RTC_LOG(LS_VERBOSE) << "AudioDeviceWindowsCore::CoreAudioIsSupported()"
+ << " CoCreateInstance(MMDeviceEnumerator) failed (hr="
+ << hr << ")";
const DWORD dwFlags =
FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS;
@@ -289,12 +289,12 @@
StringCchPrintf(buf, MAXERRORLENGTH, TEXT("Error details: "));
StringCchCat(buf, MAXERRORLENGTH, errorText);
- LOG(LS_VERBOSE) << buf;
+ RTC_LOG(LS_VERBOSE) << buf;
} else {
MMDeviceIsAvailable = true;
- LOG(LS_VERBOSE) << "AudioDeviceWindowsCore::CoreAudioIsSupported()"
- << " CoCreateInstance(MMDeviceEnumerator) succeeded (hr="
- << hr << ")";
+ RTC_LOG(LS_VERBOSE)
+ << "AudioDeviceWindowsCore::CoreAudioIsSupported()"
+ << " CoCreateInstance(MMDeviceEnumerator) succeeded (hr=" << hr << ")";
SAFE_RELEASE(pIMMD);
}
@@ -329,9 +329,9 @@
ok |= p->InitMicrophone();
}
if (ok) {
- LOG(LS_WARNING) << "AudioDeviceWindowsCore::CoreAudioIsSupported()"
- << " Failed to use Core Audio Recording for device id="
- << i;
+ RTC_LOG(LS_WARNING)
+ << "AudioDeviceWindowsCore::CoreAudioIsSupported()"
+ << " Failed to use Core Audio Recording for device id=" << i;
}
}
@@ -345,9 +345,9 @@
ok |= p->InitSpeaker();
}
if (ok) {
- LOG(LS_WARNING) << "AudioDeviceWindowsCore::CoreAudioIsSupported()"
- << " Failed to use Core Audio Playout for device id="
- << i;
+ RTC_LOG(LS_WARNING)
+ << "AudioDeviceWindowsCore::CoreAudioIsSupported()"
+ << " Failed to use Core Audio Playout for device id=" << i;
}
}
@@ -361,10 +361,10 @@
}
if (coreAudioIsSupported) {
- LOG(LS_VERBOSE) << "*** Windows Core Audio is supported ***";
+ RTC_LOG(LS_VERBOSE) << "*** Windows Core Audio is supported ***";
} else {
- LOG(LS_VERBOSE) << "*** Windows Core Audio is NOT supported"
- << " => will revert to the Wave API ***";
+ RTC_LOG(LS_VERBOSE) << "*** Windows Core Audio is NOT supported"
+ << " => will revert to the Wave API ***";
}
return (coreAudioIsSupported);
@@ -438,7 +438,7 @@
_inputDeviceIndex(0),
_outputDeviceIndex(0),
_newMicLevel(0) {
- LOG(LS_INFO) << __FUNCTION__ << " created";
+ RTC_LOG(LS_INFO) << __FUNCTION__ << " created";
assert(_comInit.succeeded());
// Try to load the Avrt DLL
@@ -448,8 +448,8 @@
if (_avrtLibrary) {
// Handle is valid (should only happen if OS larger than vista & win7).
// Try to get the function addresses.
- LOG(LS_VERBOSE) << "AudioDeviceWindowsCore::AudioDeviceWindowsCore()"
- << " The Avrt DLL module is now loaded";
+ RTC_LOG(LS_VERBOSE) << "AudioDeviceWindowsCore::AudioDeviceWindowsCore()"
+ << " The Avrt DLL module is now loaded";
_PAvRevertMmThreadCharacteristics =
(PAvRevertMmThreadCharacteristics)GetProcAddress(
@@ -462,12 +462,15 @@
if (_PAvRevertMmThreadCharacteristics &&
_PAvSetMmThreadCharacteristicsA && _PAvSetMmThreadPriority) {
- LOG(LS_VERBOSE) << "AudioDeviceWindowsCore::AudioDeviceWindowsCore()"
- << " AvRevertMmThreadCharacteristics() is OK";
- LOG(LS_VERBOSE) << "AudioDeviceWindowsCore::AudioDeviceWindowsCore()"
- << " AvSetMmThreadCharacteristicsA() is OK";
- LOG(LS_VERBOSE) << "AudioDeviceWindowsCore::AudioDeviceWindowsCore()"
- << " AvSetMmThreadPriority() is OK";
+ RTC_LOG(LS_VERBOSE)
+ << "AudioDeviceWindowsCore::AudioDeviceWindowsCore()"
+ << " AvRevertMmThreadCharacteristics() is OK";
+ RTC_LOG(LS_VERBOSE)
+ << "AudioDeviceWindowsCore::AudioDeviceWindowsCore()"
+ << " AvSetMmThreadCharacteristicsA() is OK";
+ RTC_LOG(LS_VERBOSE)
+ << "AudioDeviceWindowsCore::AudioDeviceWindowsCore()"
+ << " AvSetMmThreadPriority() is OK";
_winSupportAvrt = true;
}
}
@@ -533,7 +536,7 @@
// ----------------------------------------------------------------------------
AudioDeviceWindowsCore::~AudioDeviceWindowsCore() {
- LOG(LS_INFO) << __FUNCTION__ << " destroyed";
+ RTC_LOG(LS_INFO) << __FUNCTION__ << " destroyed";
Terminate();
@@ -581,11 +584,12 @@
if (_avrtLibrary) {
BOOL freeOK = FreeLibrary(_avrtLibrary);
if (!freeOK) {
- LOG(LS_WARNING) << "AudioDeviceWindowsCore::~AudioDeviceWindowsCore()"
- << " failed to free the loaded Avrt DLL module correctly";
+ RTC_LOG(LS_WARNING)
+ << "AudioDeviceWindowsCore::~AudioDeviceWindowsCore()"
+ << " failed to free the loaded Avrt DLL module correctly";
} else {
- LOG(LS_WARNING) << "AudioDeviceWindowsCore::~AudioDeviceWindowsCore()"
- << " the Avrt DLL module is now unloaded";
+ RTC_LOG(LS_WARNING) << "AudioDeviceWindowsCore::~AudioDeviceWindowsCore()"
+ << " the Avrt DLL module is now unloaded";
}
}
}
@@ -699,8 +703,8 @@
if (_usingOutputDeviceIndex) {
int16_t nDevices = PlayoutDevices();
if (_outputDeviceIndex > (nDevices - 1)) {
- LOG(LS_ERROR) << "current device selection is invalid => unable to"
- << " initialize";
+ RTC_LOG(LS_ERROR) << "current device selection is invalid => unable to"
+ << " initialize";
return -1;
}
}
@@ -721,7 +725,7 @@
}
if (ret != 0 || (_ptrDeviceOut == NULL)) {
- LOG(LS_ERROR) << "failed to initialize the rendering enpoint device";
+ RTC_LOG(LS_ERROR) << "failed to initialize the rendering enpoint device";
SAFE_RELEASE(_ptrDeviceOut);
return -1;
}
@@ -730,7 +734,7 @@
ret = _ptrDeviceOut->Activate(__uuidof(IAudioSessionManager), CLSCTX_ALL,
NULL, (void**)&pManager);
if (ret != 0 || pManager == NULL) {
- LOG(LS_ERROR) << "failed to initialize the render manager";
+ RTC_LOG(LS_ERROR) << "failed to initialize the render manager";
SAFE_RELEASE(pManager);
return -1;
}
@@ -738,7 +742,7 @@
SAFE_RELEASE(_ptrRenderSimpleVolume);
ret = pManager->GetSimpleAudioVolume(NULL, FALSE, &_ptrRenderSimpleVolume);
if (ret != 0 || _ptrRenderSimpleVolume == NULL) {
- LOG(LS_ERROR) << "failed to initialize the render simple volume";
+ RTC_LOG(LS_ERROR) << "failed to initialize the render simple volume";
SAFE_RELEASE(pManager);
SAFE_RELEASE(_ptrRenderSimpleVolume);
return -1;
@@ -768,8 +772,8 @@
if (_usingInputDeviceIndex) {
int16_t nDevices = RecordingDevices();
if (_inputDeviceIndex > (nDevices - 1)) {
- LOG(LS_ERROR) << "current device selection is invalid => unable to"
- << " initialize";
+ RTC_LOG(LS_ERROR) << "current device selection is invalid => unable to"
+ << " initialize";
return -1;
}
}
@@ -790,7 +794,7 @@
}
if (ret != 0 || (_ptrDeviceIn == NULL)) {
- LOG(LS_ERROR) << "failed to initialize the capturing enpoint device";
+ RTC_LOG(LS_ERROR) << "failed to initialize the capturing enpoint device";
SAFE_RELEASE(_ptrDeviceIn);
return -1;
}
@@ -799,7 +803,7 @@
ret = _ptrDeviceIn->Activate(__uuidof(IAudioEndpointVolume), CLSCTX_ALL, NULL,
reinterpret_cast<void**>(&_ptrCaptureVolume));
if (ret != 0 || _ptrCaptureVolume == NULL) {
- LOG(LS_ERROR) << "failed to initialize the capture volume";
+ RTC_LOG(LS_ERROR) << "failed to initialize the capture volume";
SAFE_RELEASE(_ptrCaptureVolume);
return -1;
}
@@ -1325,8 +1329,8 @@
// ----------------------------------------------------------------------------
int32_t AudioDeviceWindowsCore::SetMicrophoneVolume(uint32_t volume) {
- LOG(LS_VERBOSE) << "AudioDeviceWindowsCore::SetMicrophoneVolume(volume="
- << volume << ")";
+ RTC_LOG(LS_VERBOSE) << "AudioDeviceWindowsCore::SetMicrophoneVolume(volume="
+ << volume << ")";
{
rtc::CritScope lock(&_critSect);
@@ -1405,7 +1409,7 @@
// ----------------------------------------------------------------------------
int32_t AudioDeviceWindowsCore::MaxMicrophoneVolume(uint32_t& maxVolume) const {
- LOG(LS_VERBOSE) << __FUNCTION__;
+ RTC_LOG(LS_VERBOSE) << __FUNCTION__;
if (!_microphoneIsInitialized) {
return -1;
@@ -1458,8 +1462,8 @@
UINT nDevices = PlayoutDevices();
if (index < 0 || index > (nDevices - 1)) {
- LOG(LS_ERROR) << "device index is out of range [0," << (nDevices - 1)
- << "]";
+ RTC_LOG(LS_ERROR) << "device index is out of range [0," << (nDevices - 1)
+ << "]";
return -1;
}
@@ -1483,7 +1487,7 @@
// Get the endpoint device's friendly-name
if (_GetDeviceName(_ptrDeviceOut, szDeviceName, bufferLen) == 0) {
- LOG(LS_VERBOSE) << "friendly name: \"" << szDeviceName << "\"";
+ RTC_LOG(LS_VERBOSE) << "friendly name: \"" << szDeviceName << "\"";
}
_usingOutputDeviceIndex = true;
@@ -1533,7 +1537,7 @@
// Get the endpoint device's friendly-name
if (_GetDeviceName(_ptrDeviceOut, szDeviceName, bufferLen) == 0) {
- LOG(LS_VERBOSE) << "friendly name: \"" << szDeviceName << "\"";
+ RTC_LOG(LS_VERBOSE) << "friendly name: \"" << szDeviceName << "\"";
}
_usingOutputDeviceIndex = false;
@@ -1558,7 +1562,7 @@
if (index == (uint16_t)(-1)) {
defaultCommunicationDevice = true;
index = 0;
- LOG(LS_VERBOSE) << "Default Communication endpoint device will be used";
+ RTC_LOG(LS_VERBOSE) << "Default Communication endpoint device will be used";
}
if ((index > (nDevices - 1)) || (name == NULL)) {
@@ -1589,8 +1593,9 @@
// Convert the endpoint device's friendly-name to UTF-8
if (WideCharToMultiByte(CP_UTF8, 0, szDeviceName, -1, name,
kAdmMaxDeviceNameSize, NULL, NULL) == 0) {
- LOG(LS_ERROR) << "WideCharToMultiByte(CP_UTF8) failed with error code "
- << GetLastError();
+ RTC_LOG(LS_ERROR)
+ << "WideCharToMultiByte(CP_UTF8) failed with error code "
+ << GetLastError();
}
}
@@ -1607,8 +1612,9 @@
// Convert the endpoint device's ID string to UTF-8
if (WideCharToMultiByte(CP_UTF8, 0, szDeviceName, -1, guid, kAdmMaxGuidSize,
NULL, NULL) == 0) {
- LOG(LS_ERROR) << "WideCharToMultiByte(CP_UTF8) failed with error code "
- << GetLastError();
+ RTC_LOG(LS_ERROR)
+ << "WideCharToMultiByte(CP_UTF8) failed with error code "
+ << GetLastError();
}
}
@@ -1632,7 +1638,7 @@
if (index == (uint16_t)(-1)) {
defaultCommunicationDevice = true;
index = 0;
- LOG(LS_VERBOSE) << "Default Communication endpoint device will be used";
+ RTC_LOG(LS_VERBOSE) << "Default Communication endpoint device will be used";
}
if ((index > (nDevices - 1)) || (name == NULL)) {
@@ -1663,8 +1669,9 @@
// Convert the endpoint device's friendly-name to UTF-8
if (WideCharToMultiByte(CP_UTF8, 0, szDeviceName, -1, name,
kAdmMaxDeviceNameSize, NULL, NULL) == 0) {
- LOG(LS_ERROR) << "WideCharToMultiByte(CP_UTF8) failed with error code "
- << GetLastError();
+ RTC_LOG(LS_ERROR)
+ << "WideCharToMultiByte(CP_UTF8) failed with error code "
+ << GetLastError();
}
}
@@ -1681,8 +1688,9 @@
// Convert the endpoint device's ID string to UTF-8
if (WideCharToMultiByte(CP_UTF8, 0, szDeviceName, -1, guid, kAdmMaxGuidSize,
NULL, NULL) == 0) {
- LOG(LS_ERROR) << "WideCharToMultiByte(CP_UTF8) failed with error code "
- << GetLastError();
+ RTC_LOG(LS_ERROR)
+ << "WideCharToMultiByte(CP_UTF8) failed with error code "
+ << GetLastError();
}
}
@@ -1717,8 +1725,8 @@
UINT nDevices = RecordingDevices();
if (index < 0 || index > (nDevices - 1)) {
- LOG(LS_ERROR) << "device index is out of range [0," << (nDevices - 1)
- << "]";
+ RTC_LOG(LS_ERROR) << "device index is out of range [0," << (nDevices - 1)
+ << "]";
return -1;
}
@@ -1742,7 +1750,7 @@
// Get the endpoint device's friendly-name
if (_GetDeviceName(_ptrDeviceIn, szDeviceName, bufferLen) == 0) {
- LOG(LS_VERBOSE) << "friendly name: \"" << szDeviceName << "\"";
+ RTC_LOG(LS_VERBOSE) << "friendly name: \"" << szDeviceName << "\"";
}
_usingInputDeviceIndex = true;
@@ -1792,7 +1800,7 @@
// Get the endpoint device's friendly-name
if (_GetDeviceName(_ptrDeviceIn, szDeviceName, bufferLen) == 0) {
- LOG(LS_VERBOSE) << "friendly name: \"" << szDeviceName << "\"";
+ RTC_LOG(LS_VERBOSE) << "friendly name: \"" << szDeviceName << "\"";
}
_usingInputDeviceIndex = false;
@@ -1862,7 +1870,7 @@
// Initialize the speaker (devices might have been added or removed)
if (InitSpeaker() == -1) {
- LOG(LS_WARNING) << "InitSpeaker() failed";
+ RTC_LOG(LS_WARNING) << "InitSpeaker() failed";
}
// Ensure that the updated rendering endpoint device is valid
@@ -1893,21 +1901,22 @@
// processing (mixing) of shared-mode streams.
hr = _ptrClientOut->GetMixFormat(&pWfxOut);
if (SUCCEEDED(hr)) {
- LOG(LS_VERBOSE) << "Audio Engine's current rendering mix format:";
+ RTC_LOG(LS_VERBOSE) << "Audio Engine's current rendering mix format:";
// format type
- LOG(LS_VERBOSE) << "wFormatTag : 0x" << std::hex << pWfxOut->wFormatTag
- << std::dec << " (" << pWfxOut->wFormatTag << ")";
+ RTC_LOG(LS_VERBOSE) << "wFormatTag : 0x" << std::hex
+ << pWfxOut->wFormatTag << std::dec << " ("
+ << pWfxOut->wFormatTag << ")";
// number of channels (i.e. mono, stereo...)
- LOG(LS_VERBOSE) << "nChannels : " << pWfxOut->nChannels;
+ RTC_LOG(LS_VERBOSE) << "nChannels : " << pWfxOut->nChannels;
// sample rate
- LOG(LS_VERBOSE) << "nSamplesPerSec : " << pWfxOut->nSamplesPerSec;
+ RTC_LOG(LS_VERBOSE) << "nSamplesPerSec : " << pWfxOut->nSamplesPerSec;
// for buffer estimation
- LOG(LS_VERBOSE) << "nAvgBytesPerSec: " << pWfxOut->nAvgBytesPerSec;
+ RTC_LOG(LS_VERBOSE) << "nAvgBytesPerSec: " << pWfxOut->nAvgBytesPerSec;
// block size of data
- LOG(LS_VERBOSE) << "nBlockAlign : " << pWfxOut->nBlockAlign;
+ RTC_LOG(LS_VERBOSE) << "nBlockAlign : " << pWfxOut->nBlockAlign;
// number of bits per sample of mono data
- LOG(LS_VERBOSE) << "wBitsPerSample : " << pWfxOut->wBitsPerSample;
- LOG(LS_VERBOSE) << "cbSize : " << pWfxOut->cbSize;
+ RTC_LOG(LS_VERBOSE) << "wBitsPerSample : " << pWfxOut->wBitsPerSample;
+ RTC_LOG(LS_VERBOSE) << "cbSize : " << pWfxOut->cbSize;
}
// Set wave format
@@ -1936,17 +1945,18 @@
break;
} else {
if (pWfxClosestMatch) {
- LOG(INFO) << "nChannels=" << Wfx.nChannels
- << ", nSamplesPerSec=" << Wfx.nSamplesPerSec
- << " is not supported. Closest match: "
- << "nChannels=" << pWfxClosestMatch->nChannels
- << ", nSamplesPerSec=" << pWfxClosestMatch->nSamplesPerSec;
+ RTC_LOG(INFO) << "nChannels=" << Wfx.nChannels
+ << ", nSamplesPerSec=" << Wfx.nSamplesPerSec
+ << " is not supported. Closest match: "
+ << "nChannels=" << pWfxClosestMatch->nChannels
+ << ", nSamplesPerSec="
+ << pWfxClosestMatch->nSamplesPerSec;
CoTaskMemFree(pWfxClosestMatch);
pWfxClosestMatch = NULL;
} else {
- LOG(INFO) << "nChannels=" << Wfx.nChannels
- << ", nSamplesPerSec=" << Wfx.nSamplesPerSec
- << " is not supported. No closest match.";
+ RTC_LOG(INFO) << "nChannels=" << Wfx.nChannels
+ << ", nSamplesPerSec=" << Wfx.nSamplesPerSec
+ << " is not supported. No closest match.";
}
}
}
@@ -1970,20 +1980,21 @@
_devicePlayBlockSize = Wfx.nSamplesPerSec / 100;
_playChannels = Wfx.nChannels;
- LOG(LS_VERBOSE) << "VoE selected this rendering format:";
- LOG(LS_VERBOSE) << "wFormatTag : 0x" << std::hex << Wfx.wFormatTag
- << std::dec << " (" << Wfx.wFormatTag << ")";
- LOG(LS_VERBOSE) << "nChannels : " << Wfx.nChannels;
- LOG(LS_VERBOSE) << "nSamplesPerSec : " << Wfx.nSamplesPerSec;
- LOG(LS_VERBOSE) << "nAvgBytesPerSec : " << Wfx.nAvgBytesPerSec;
- LOG(LS_VERBOSE) << "nBlockAlign : " << Wfx.nBlockAlign;
- LOG(LS_VERBOSE) << "wBitsPerSample : " << Wfx.wBitsPerSample;
- LOG(LS_VERBOSE) << "cbSize : " << Wfx.cbSize;
- LOG(LS_VERBOSE) << "Additional settings:";
- LOG(LS_VERBOSE) << "_playAudioFrameSize: " << _playAudioFrameSize;
- LOG(LS_VERBOSE) << "_playBlockSizeInFrames : "
- << _playBlockSizeInFrames;
- LOG(LS_VERBOSE) << "_playChannels : " << _playChannels;
+ RTC_LOG(LS_VERBOSE) << "VoE selected this rendering format:";
+ RTC_LOG(LS_VERBOSE) << "wFormatTag : 0x" << std::hex
+ << Wfx.wFormatTag << std::dec << " (" << Wfx.wFormatTag
+ << ")";
+ RTC_LOG(LS_VERBOSE) << "nChannels : " << Wfx.nChannels;
+ RTC_LOG(LS_VERBOSE) << "nSamplesPerSec : " << Wfx.nSamplesPerSec;
+ RTC_LOG(LS_VERBOSE) << "nAvgBytesPerSec : " << Wfx.nAvgBytesPerSec;
+ RTC_LOG(LS_VERBOSE) << "nBlockAlign : " << Wfx.nBlockAlign;
+ RTC_LOG(LS_VERBOSE) << "wBitsPerSample : " << Wfx.wBitsPerSample;
+ RTC_LOG(LS_VERBOSE) << "cbSize : " << Wfx.cbSize;
+ RTC_LOG(LS_VERBOSE) << "Additional settings:";
+ RTC_LOG(LS_VERBOSE) << "_playAudioFrameSize: " << _playAudioFrameSize;
+ RTC_LOG(LS_VERBOSE) << "_playBlockSizeInFrames : "
+ << _playBlockSizeInFrames;
+ RTC_LOG(LS_VERBOSE) << "_playChannels : " << _playChannels;
}
// Create a rendering stream.
@@ -2025,7 +2036,7 @@
NULL); // session GUID
if (FAILED(hr)) {
- LOG(LS_ERROR) << "IAudioClient::Initialize() failed:";
+ RTC_LOG(LS_ERROR) << "IAudioClient::Initialize() failed:";
}
EXIT_ON_ERROR(hr);
@@ -2038,7 +2049,7 @@
// AudioDeviceImplementation has been created, hence the AudioDeviceBuffer
// does not exist. It is OK to end up here since we don't initiate any media
// in CoreAudioIsSupported().
- LOG(LS_VERBOSE)
+ RTC_LOG(LS_VERBOSE)
<< "AudioDeviceBuffer must be attached before streaming can start";
}
@@ -2047,9 +2058,9 @@
UINT bufferFrameCount(0);
hr = _ptrClientOut->GetBufferSize(&bufferFrameCount);
if (SUCCEEDED(hr)) {
- LOG(LS_VERBOSE) << "IAudioClient::GetBufferSize() => " << bufferFrameCount
- << " (<=> " << bufferFrameCount * _playAudioFrameSize
- << " bytes)";
+ RTC_LOG(LS_VERBOSE) << "IAudioClient::GetBufferSize() => "
+ << bufferFrameCount << " (<=> "
+ << bufferFrameCount * _playAudioFrameSize << " bytes)";
}
// Set the event handle that the system signals when an audio buffer is ready
@@ -2069,7 +2080,7 @@
CoTaskMemFree(pWfxOut);
CoTaskMemFree(pWfxClosestMatch);
- LOG(LS_VERBOSE) << "render side is now initialized";
+ RTC_LOG(LS_VERBOSE) << "render side is now initialized";
return 0;
Exit:
@@ -2137,7 +2148,7 @@
_ptrAudioBuffer->SetRecordingChannels(_recChannels);
} else {
// Refer to InitRecording() for comments.
- LOG(LS_VERBOSE)
+ RTC_LOG(LS_VERBOSE)
<< "AudioDeviceBuffer must be attached before streaming can start";
}
@@ -2151,7 +2162,7 @@
}
_recIsInitialized = true;
- LOG(LS_VERBOSE) << "Capture side is now initialized";
+ RTC_LOG(LS_VERBOSE) << "Capture side is now initialized";
return 0;
}
@@ -2182,7 +2193,7 @@
// Initialize the microphone (devices might have been added or removed)
if (InitMicrophone() == -1) {
- LOG(LS_WARNING) << "InitMicrophone() failed";
+ RTC_LOG(LS_WARNING) << "InitMicrophone() failed";
}
// Ensure that the updated capturing endpoint device is valid
@@ -2210,21 +2221,22 @@
// processing (mixing) of shared-mode streams.
hr = _ptrClientIn->GetMixFormat(&pWfxIn);
if (SUCCEEDED(hr)) {
- LOG(LS_VERBOSE) << "Audio Engine's current capturing mix format:";
+ RTC_LOG(LS_VERBOSE) << "Audio Engine's current capturing mix format:";
// format type
- LOG(LS_VERBOSE) << "wFormatTag : 0x" << std::hex << pWfxIn->wFormatTag
- << std::dec << " (" << pWfxIn->wFormatTag << ")";
+ RTC_LOG(LS_VERBOSE) << "wFormatTag : 0x" << std::hex
+ << pWfxIn->wFormatTag << std::dec << " ("
+ << pWfxIn->wFormatTag << ")";
// number of channels (i.e. mono, stereo...)
- LOG(LS_VERBOSE) << "nChannels : " << pWfxIn->nChannels;
+ RTC_LOG(LS_VERBOSE) << "nChannels : " << pWfxIn->nChannels;
// sample rate
- LOG(LS_VERBOSE) << "nSamplesPerSec : " << pWfxIn->nSamplesPerSec;
+ RTC_LOG(LS_VERBOSE) << "nSamplesPerSec : " << pWfxIn->nSamplesPerSec;
// for buffer estimation
- LOG(LS_VERBOSE) << "nAvgBytesPerSec: " << pWfxIn->nAvgBytesPerSec;
+ RTC_LOG(LS_VERBOSE) << "nAvgBytesPerSec: " << pWfxIn->nAvgBytesPerSec;
// block size of data
- LOG(LS_VERBOSE) << "nBlockAlign : " << pWfxIn->nBlockAlign;
+ RTC_LOG(LS_VERBOSE) << "nBlockAlign : " << pWfxIn->nBlockAlign;
// number of bits per sample of mono data
- LOG(LS_VERBOSE) << "wBitsPerSample : " << pWfxIn->wBitsPerSample;
- LOG(LS_VERBOSE) << "cbSize : " << pWfxIn->cbSize;
+ RTC_LOG(LS_VERBOSE) << "wBitsPerSample : " << pWfxIn->wBitsPerSample;
+ RTC_LOG(LS_VERBOSE) << "cbSize : " << pWfxIn->cbSize;
}
// Set wave format
@@ -2258,17 +2270,18 @@
break;
} else {
if (pWfxClosestMatch) {
- LOG(INFO) << "nChannels=" << Wfx.Format.nChannels
- << ", nSamplesPerSec=" << Wfx.Format.nSamplesPerSec
- << " is not supported. Closest match: "
- << "nChannels=" << pWfxClosestMatch->nChannels
- << ", nSamplesPerSec=" << pWfxClosestMatch->nSamplesPerSec;
+ RTC_LOG(INFO) << "nChannels=" << Wfx.Format.nChannels
+ << ", nSamplesPerSec=" << Wfx.Format.nSamplesPerSec
+ << " is not supported. Closest match: "
+ << "nChannels=" << pWfxClosestMatch->nChannels
+ << ", nSamplesPerSec="
+ << pWfxClosestMatch->nSamplesPerSec;
CoTaskMemFree(pWfxClosestMatch);
pWfxClosestMatch = NULL;
} else {
- LOG(INFO) << "nChannels=" << Wfx.Format.nChannels
- << ", nSamplesPerSec=" << Wfx.Format.nSamplesPerSec
- << " is not supported. No closest match.";
+ RTC_LOG(INFO) << "nChannels=" << Wfx.Format.nChannels
+ << ", nSamplesPerSec=" << Wfx.Format.nSamplesPerSec
+ << " is not supported. No closest match.";
}
}
}
@@ -2282,20 +2295,20 @@
_recBlockSize = Wfx.Format.nSamplesPerSec / 100;
_recChannels = Wfx.Format.nChannels;
- LOG(LS_VERBOSE) << "VoE selected this capturing format:";
- LOG(LS_VERBOSE) << "wFormatTag : 0x" << std::hex
- << Wfx.Format.wFormatTag << std::dec << " ("
- << Wfx.Format.wFormatTag << ")";
- LOG(LS_VERBOSE) << "nChannels : " << Wfx.Format.nChannels;
- LOG(LS_VERBOSE) << "nSamplesPerSec : " << Wfx.Format.nSamplesPerSec;
- LOG(LS_VERBOSE) << "nAvgBytesPerSec : " << Wfx.Format.nAvgBytesPerSec;
- LOG(LS_VERBOSE) << "nBlockAlign : " << Wfx.Format.nBlockAlign;
- LOG(LS_VERBOSE) << "wBitsPerSample : " << Wfx.Format.wBitsPerSample;
- LOG(LS_VERBOSE) << "cbSize : " << Wfx.Format.cbSize;
- LOG(LS_VERBOSE) << "Additional settings:";
- LOG(LS_VERBOSE) << "_recAudioFrameSize: " << _recAudioFrameSize;
- LOG(LS_VERBOSE) << "_recBlockSize : " << _recBlockSize;
- LOG(LS_VERBOSE) << "_recChannels : " << _recChannels;
+ RTC_LOG(LS_VERBOSE) << "VoE selected this capturing format:";
+ RTC_LOG(LS_VERBOSE) << "wFormatTag : 0x" << std::hex
+ << Wfx.Format.wFormatTag << std::dec << " ("
+ << Wfx.Format.wFormatTag << ")";
+ RTC_LOG(LS_VERBOSE) << "nChannels : " << Wfx.Format.nChannels;
+ RTC_LOG(LS_VERBOSE) << "nSamplesPerSec : " << Wfx.Format.nSamplesPerSec;
+ RTC_LOG(LS_VERBOSE) << "nAvgBytesPerSec : " << Wfx.Format.nAvgBytesPerSec;
+ RTC_LOG(LS_VERBOSE) << "nBlockAlign : " << Wfx.Format.nBlockAlign;
+ RTC_LOG(LS_VERBOSE) << "wBitsPerSample : " << Wfx.Format.wBitsPerSample;
+ RTC_LOG(LS_VERBOSE) << "cbSize : " << Wfx.Format.cbSize;
+ RTC_LOG(LS_VERBOSE) << "Additional settings:";
+ RTC_LOG(LS_VERBOSE) << "_recAudioFrameSize: " << _recAudioFrameSize;
+ RTC_LOG(LS_VERBOSE) << "_recBlockSize : " << _recBlockSize;
+ RTC_LOG(LS_VERBOSE) << "_recChannels : " << _recChannels;
}
// Create a capturing stream.
@@ -2312,7 +2325,7 @@
NULL); // session GUID
if (hr != S_OK) {
- LOG(LS_ERROR) << "IAudioClient::Initialize() failed:";
+ RTC_LOG(LS_ERROR) << "IAudioClient::Initialize() failed:";
}
EXIT_ON_ERROR(hr);
@@ -2325,7 +2338,7 @@
// AudioDeviceImplementation has been created, hence the AudioDeviceBuffer
// does not exist. It is OK to end up here since we don't initiate any media
// in CoreAudioIsSupported().
- LOG(LS_VERBOSE)
+ RTC_LOG(LS_VERBOSE)
<< "AudioDeviceBuffer must be attached before streaming can start";
}
@@ -2334,9 +2347,9 @@
UINT bufferFrameCount(0);
hr = _ptrClientIn->GetBufferSize(&bufferFrameCount);
if (SUCCEEDED(hr)) {
- LOG(LS_VERBOSE) << "IAudioClient::GetBufferSize() => " << bufferFrameCount
- << " (<=> " << bufferFrameCount * _recAudioFrameSize
- << " bytes)";
+ RTC_LOG(LS_VERBOSE) << "IAudioClient::GetBufferSize() => "
+ << bufferFrameCount << " (<=> "
+ << bufferFrameCount * _recAudioFrameSize << " bytes)";
}
// Set the event handle that the system signals when an audio buffer is ready
@@ -2356,7 +2369,7 @@
CoTaskMemFree(pWfxIn);
CoTaskMemFree(pWfxClosestMatch);
- LOG(LS_VERBOSE) << "capture side is now initialized";
+ RTC_LOG(LS_VERBOSE) << "capture side is now initialized";
return 0;
Exit:
@@ -2397,8 +2410,9 @@
if (!_playing) {
// The DMO won't provide us captured output data unless we
// give it render data to process.
- LOG(LS_ERROR) << "Playout must be started before recording when using"
- << " the built-in AEC";
+ RTC_LOG(LS_ERROR)
+ << "Playout must be started before recording when using"
+ << " the built-in AEC";
return -1;
}
}
@@ -2406,7 +2420,7 @@
assert(_hRecThread == NULL);
_hRecThread = CreateThread(NULL, 0, lpStartAddress, this, 0, NULL);
if (_hRecThread == NULL) {
- LOG(LS_ERROR) << "failed to create the recording thread";
+ RTC_LOG(LS_ERROR) << "failed to create the recording thread";
return -1;
}
@@ -2417,7 +2431,7 @@
_hGetCaptureVolumeThread =
CreateThread(NULL, 0, GetCaptureVolumeThread, this, 0, NULL);
if (_hGetCaptureVolumeThread == NULL) {
- LOG(LS_ERROR) << "failed to create the volume getter thread";
+ RTC_LOG(LS_ERROR) << "failed to create the volume getter thread";
return -1;
}
@@ -2425,17 +2439,17 @@
_hSetCaptureVolumeThread =
CreateThread(NULL, 0, SetCaptureVolumeThread, this, 0, NULL);
if (_hSetCaptureVolumeThread == NULL) {
- LOG(LS_ERROR) << "failed to create the volume setter thread";
+ RTC_LOG(LS_ERROR) << "failed to create the volume setter thread";
return -1;
}
} // critScoped
DWORD ret = WaitForSingleObject(_hCaptureStartedEvent, 1000);
if (ret != WAIT_OBJECT_0) {
- LOG(LS_VERBOSE) << "capturing did not start up properly";
+ RTC_LOG(LS_VERBOSE) << "capturing did not start up properly";
return -1;
}
- LOG(LS_VERBOSE) << "capture audio stream has now started...";
+ RTC_LOG(LS_VERBOSE) << "capture audio stream has now started...";
_recording = true;
@@ -2456,7 +2470,7 @@
_Lock();
if (_hRecThread == NULL) {
- LOG(LS_VERBOSE)
+ RTC_LOG(LS_VERBOSE)
<< "no capturing stream is active => close down WASAPI only";
SAFE_RELEASE(_ptrClientIn);
SAFE_RELEASE(_ptrCaptureClient);
@@ -2467,35 +2481,36 @@
}
// Stop the driving thread...
- LOG(LS_VERBOSE) << "closing down the webrtc_core_audio_capture_thread...";
+ RTC_LOG(LS_VERBOSE) << "closing down the webrtc_core_audio_capture_thread...";
// Manual-reset event; it will remain signalled to stop all capture threads.
SetEvent(_hShutdownCaptureEvent);
_UnLock();
DWORD ret = WaitForSingleObject(_hRecThread, 2000);
if (ret != WAIT_OBJECT_0) {
- LOG(LS_ERROR) << "failed to close down webrtc_core_audio_capture_thread";
+ RTC_LOG(LS_ERROR)
+ << "failed to close down webrtc_core_audio_capture_thread";
err = -1;
} else {
- LOG(LS_VERBOSE) << "webrtc_core_audio_capture_thread is now closed";
+ RTC_LOG(LS_VERBOSE) << "webrtc_core_audio_capture_thread is now closed";
}
ret = WaitForSingleObject(_hGetCaptureVolumeThread, 2000);
if (ret != WAIT_OBJECT_0) {
// the thread did not stop as it should
- LOG(LS_ERROR) << "failed to close down volume getter thread";
+ RTC_LOG(LS_ERROR) << "failed to close down volume getter thread";
err = -1;
} else {
- LOG(LS_VERBOSE) << "volume getter thread is now closed";
+ RTC_LOG(LS_VERBOSE) << "volume getter thread is now closed";
}
ret = WaitForSingleObject(_hSetCaptureVolumeThread, 2000);
if (ret != WAIT_OBJECT_0) {
// the thread did not stop as it should
- LOG(LS_ERROR) << "failed to close down volume setter thread";
+ RTC_LOG(LS_ERROR) << "failed to close down volume setter thread";
err = -1;
} else {
- LOG(LS_VERBOSE) << "volume setter thread is now closed";
+ RTC_LOG(LS_VERBOSE) << "volume setter thread is now closed";
}
_Lock();
@@ -2585,7 +2600,7 @@
assert(_hPlayThread == NULL);
_hPlayThread = CreateThread(NULL, 0, WSAPIRenderThread, this, 0, NULL);
if (_hPlayThread == NULL) {
- LOG(LS_ERROR) << "failed to create the playout thread";
+ RTC_LOG(LS_ERROR) << "failed to create the playout thread";
return -1;
}
@@ -2595,12 +2610,12 @@
DWORD ret = WaitForSingleObject(_hRenderStartedEvent, 1000);
if (ret != WAIT_OBJECT_0) {
- LOG(LS_VERBOSE) << "rendering did not start up properly";
+ RTC_LOG(LS_VERBOSE) << "rendering did not start up properly";
return -1;
}
_playing = true;
- LOG(LS_VERBOSE) << "rendering audio stream has now started...";
+ RTC_LOG(LS_VERBOSE) << "rendering audio stream has now started...";
return 0;
}
@@ -2618,7 +2633,7 @@
rtc::CritScope critScoped(&_critSect);
if (_hPlayThread == NULL) {
- LOG(LS_VERBOSE)
+ RTC_LOG(LS_VERBOSE)
<< "no rendering stream is active => close down WASAPI only";
SAFE_RELEASE(_ptrClientOut);
SAFE_RELEASE(_ptrRenderClient);
@@ -2628,14 +2643,15 @@
}
// stop the driving thread...
- LOG(LS_VERBOSE) << "closing down the webrtc_core_audio_render_thread...";
+ RTC_LOG(LS_VERBOSE)
+ << "closing down the webrtc_core_audio_render_thread...";
SetEvent(_hShutdownRenderEvent);
} // critScoped
DWORD ret = WaitForSingleObject(_hPlayThread, 2000);
if (ret != WAIT_OBJECT_0) {
// the thread did not stop as it should
- LOG(LS_ERROR) << "failed to close down webrtc_core_audio_render_thread";
+ RTC_LOG(LS_ERROR) << "failed to close down webrtc_core_audio_render_thread";
CloseHandle(_hPlayThread);
_hPlayThread = NULL;
_playIsInitialized = false;
@@ -2645,7 +2661,7 @@
{
rtc::CritScope critScoped(&_critSect);
- LOG(LS_VERBOSE) << "webrtc_core_audio_render_thread is now closed";
+ RTC_LOG(LS_VERBOSE) << "webrtc_core_audio_render_thread is now closed";
// to reset this event manually at each time we finish with it,
// in case that the render thread has exited before StopPlayout(),
@@ -2669,7 +2685,7 @@
// We still permit the playout to shutdown, and trace a warning.
// Otherwise, VoE can get into a state which will never permit
// playout to stop properly.
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "Recording should be stopped before playout when using the"
<< " built-in AEC";
}
@@ -2758,7 +2774,7 @@
case WAIT_TIMEOUT: // timeout notification
break;
default: // unexpected error
- LOG(LS_WARNING) << "unknown wait termination on get volume thread";
+ RTC_LOG(LS_WARNING) << "unknown wait termination on get volume thread";
return 1;
}
}
@@ -2775,7 +2791,7 @@
case WAIT_OBJECT_0 + 1: // _hSetCaptureVolumeEvent
break;
default: // unexpected error
- LOG(LS_WARNING) << "unknown wait termination on set volume thread";
+ RTC_LOG(LS_WARNING) << "unknown wait termination on set volume thread";
return 1;
}
@@ -2784,7 +2800,7 @@
_UnLock();
if (SetMicrophoneVolume(newMicLevel) == -1) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "the required modification of the microphone volume failed";
}
}
@@ -2803,7 +2819,7 @@
// Initialize COM as MTA in this thread.
ScopedCOMInitializer comInit(ScopedCOMInitializer::kMTA);
if (!comInit.succeeded()) {
- LOG(LS_ERROR) << "failed to initialize COM in render thread";
+ RTC_LOG(LS_ERROR) << "failed to initialize COM in render thread";
return 1;
}
@@ -2817,14 +2833,14 @@
hMmTask = _PAvSetMmThreadCharacteristicsA("Pro Audio", &taskIndex);
if (hMmTask) {
if (FALSE == _PAvSetMmThreadPriority(hMmTask, AVRT_PRIORITY_CRITICAL)) {
- LOG(LS_WARNING) << "failed to boost play-thread using MMCSS";
+ RTC_LOG(LS_WARNING) << "failed to boost play-thread using MMCSS";
}
- LOG(LS_VERBOSE)
+ RTC_LOG(LS_VERBOSE)
<< "render thread is now registered with MMCSS (taskIndex="
<< taskIndex << ")";
} else {
- LOG(LS_WARNING) << "failed to enable MMCSS on render thread (err="
- << GetLastError() << ")";
+ RTC_LOG(LS_WARNING) << "failed to enable MMCSS on render thread (err="
+ << GetLastError() << ")";
_TraceCOMError(GetLastError());
}
}
@@ -2840,15 +2856,15 @@
UINT32 bufferLength = 0;
hr = _ptrClientOut->GetBufferSize(&bufferLength);
EXIT_ON_ERROR(hr);
- LOG(LS_VERBOSE) << "[REND] size of buffer : " << bufferLength;
+ RTC_LOG(LS_VERBOSE) << "[REND] size of buffer : " << bufferLength;
// Get maximum latency for the current stream (will not change for the
// lifetime of the IAudioClient object).
//
REFERENCE_TIME latency;
_ptrClientOut->GetStreamLatency(&latency);
- LOG(LS_VERBOSE) << "[REND] max stream latency : " << (DWORD)latency << " ("
- << (double)(latency / 10000.0) << " ms)";
+ RTC_LOG(LS_VERBOSE) << "[REND] max stream latency : " << (DWORD)latency
+ << " (" << (double)(latency / 10000.0) << " ms)";
// Get the length of the periodic interval separating successive processing
// passes by the audio engine on the data in the endpoint buffer.
@@ -2863,8 +2879,8 @@
REFERENCE_TIME devPeriod = 0;
REFERENCE_TIME devPeriodMin = 0;
_ptrClientOut->GetDevicePeriod(&devPeriod, &devPeriodMin);
- LOG(LS_VERBOSE) << "[REND] device period : " << (DWORD)devPeriod
- << " (" << (double)(devPeriod / 10000.0) << " ms)";
+ RTC_LOG(LS_VERBOSE) << "[REND] device period : " << (DWORD)devPeriod
+ << " (" << (double)(devPeriod / 10000.0) << " ms)";
// Derive initial rendering delay.
// Example: 10*(960/480) + 15 = 20 + 15 = 35ms
@@ -2873,11 +2889,12 @@
(int)((latency + devPeriod) / 10000);
_sndCardPlayDelay = playout_delay;
_writtenSamples = 0;
- LOG(LS_VERBOSE) << "[REND] initial delay : " << playout_delay;
+ RTC_LOG(LS_VERBOSE) << "[REND] initial delay : " << playout_delay;
double endpointBufferSizeMS =
10.0 * ((double)bufferLength / (double)_devicePlayBlockSize);
- LOG(LS_VERBOSE) << "[REND] endpointBufferSizeMS : " << endpointBufferSizeMS;
+ RTC_LOG(LS_VERBOSE) << "[REND] endpointBufferSizeMS : "
+ << endpointBufferSizeMS;
// Before starting the stream, fill the rendering buffer with silence.
//
@@ -2893,7 +2910,7 @@
hr = _ptrClientOut->GetService(__uuidof(IAudioClock), (void**)&clock);
if (FAILED(hr)) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "failed to get IAudioClock interface from the IAudioClient";
}
@@ -2920,10 +2937,10 @@
case WAIT_OBJECT_0 + 1: // _hRenderSamplesReadyEvent
break;
case WAIT_TIMEOUT: // timeout notification
- LOG(LS_WARNING) << "render event timed out after 0.5 seconds";
+ RTC_LOG(LS_WARNING) << "render event timed out after 0.5 seconds";
goto Exit;
default: // unexpected error
- LOG(LS_WARNING) << "unknown wait termination on render side";
+ RTC_LOG(LS_WARNING) << "unknown wait termination on render side";
goto Exit;
}
@@ -2934,7 +2951,7 @@
// during the unlocked period.
if (_ptrRenderClient == NULL || _ptrClientOut == NULL) {
_UnLock();
- LOG(LS_ERROR)
+ RTC_LOG(LS_ERROR)
<< "output state has been modified during unlocked period";
goto Exit;
}
@@ -2973,7 +2990,7 @@
if (nSamples == -1) {
_UnLock();
- LOG(LS_ERROR) << "failed to read data from render client";
+ RTC_LOG(LS_ERROR) << "failed to read data from render client";
goto Exit;
}
@@ -2981,12 +2998,13 @@
// during the unlocked period
if (_ptrRenderClient == NULL || _ptrClientOut == NULL) {
_UnLock();
- LOG(LS_ERROR) << "output state has been modified during unlocked"
- << " period";
+ RTC_LOG(LS_ERROR)
+ << "output state has been modified during unlocked"
+ << " period";
goto Exit;
}
if (nSamples != static_cast<int32_t>(_playBlockSizeInSamples)) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "nSamples(" << nSamples << ") != _playBlockSizeInSamples("
<< _playBlockSizeInSamples << ")";
}
@@ -3053,9 +3071,10 @@
_TraceCOMError(hr);
}
}
- LOG(LS_ERROR) << "Playout error: rendering thread has ended pre-maturely";
+ RTC_LOG(LS_ERROR)
+ << "Playout error: rendering thread has ended pre-maturely";
} else {
- LOG(LS_VERBOSE) << "_Rendering thread is now terminated properly";
+ RTC_LOG(LS_VERBOSE) << "_Rendering thread is now terminated properly";
}
_UnLock();
@@ -3075,14 +3094,14 @@
_hMmTask = _PAvSetMmThreadCharacteristicsA("Pro Audio", &taskIndex);
if (_hMmTask) {
if (!_PAvSetMmThreadPriority(_hMmTask, AVRT_PRIORITY_CRITICAL)) {
- LOG(LS_WARNING) << "failed to boost rec-thread using MMCSS";
+ RTC_LOG(LS_WARNING) << "failed to boost rec-thread using MMCSS";
}
- LOG(LS_VERBOSE)
+ RTC_LOG(LS_VERBOSE)
<< "capture thread is now registered with MMCSS (taskIndex="
<< taskIndex << ")";
} else {
- LOG(LS_WARNING) << "failed to enable MMCSS on capture thread (err="
- << GetLastError() << ")";
+ RTC_LOG(LS_WARNING) << "failed to enable MMCSS on capture thread (err="
+ << GetLastError() << ")";
_TraceCOMError(GetLastError());
}
}
@@ -3107,7 +3126,7 @@
// Initialize COM as MTA in this thread.
ScopedCOMInitializer comInit(ScopedCOMInitializer::kMTA);
if (!comInit.succeeded()) {
- LOG(LS_ERROR) << "failed to initialize COM in polling DMO thread";
+ RTC_LOG(LS_ERROR) << "failed to initialize COM in polling DMO thread";
return 1;
}
@@ -3132,7 +3151,7 @@
case WAIT_TIMEOUT: // timeout notification
break;
default: // unexpected error
- LOG(LS_WARNING) << "Unknown wait termination on capture side";
+ RTC_LOG(LS_WARNING) << "Unknown wait termination on capture side";
hr = -1; // To signal an error callback.
keepRecording = false;
break;
@@ -3213,9 +3232,10 @@
RevertCaptureThreadPriority();
if (FAILED(hr)) {
- LOG(LS_ERROR) << "Recording error: capturing thread has ended prematurely";
+ RTC_LOG(LS_ERROR)
+ << "Recording error: capturing thread has ended prematurely";
} else {
- LOG(LS_VERBOSE) << "Capturing thread is now terminated properly";
+ RTC_LOG(LS_VERBOSE) << "Capturing thread is now terminated properly";
}
return hr;
@@ -3240,7 +3260,7 @@
// Initialize COM as MTA in this thread.
ScopedCOMInitializer comInit(ScopedCOMInitializer::kMTA);
if (!comInit.succeeded()) {
- LOG(LS_ERROR) << "failed to initialize COM in capture thread";
+ RTC_LOG(LS_ERROR) << "failed to initialize COM in capture thread";
return 1;
}
@@ -3257,13 +3277,13 @@
//
UINT32 bufferLength = 0;
if (_ptrClientIn == NULL) {
- LOG(LS_ERROR)
+ RTC_LOG(LS_ERROR)
<< "input state has been modified before capture loop starts.";
return 1;
}
hr = _ptrClientIn->GetBufferSize(&bufferLength);
EXIT_ON_ERROR(hr);
- LOG(LS_VERBOSE) << "[CAPT] size of buffer : " << bufferLength;
+ RTC_LOG(LS_VERBOSE) << "[CAPT] size of buffer : " << bufferLength;
// Allocate memory for sync buffer.
// It is used for compensation between native 44.1 and internal 44.0 and
@@ -3274,16 +3294,16 @@
if (syncBuffer == NULL) {
return (DWORD)E_POINTER;
}
- LOG(LS_VERBOSE) << "[CAPT] size of sync buffer : " << syncBufferSize
- << " [bytes]";
+ RTC_LOG(LS_VERBOSE) << "[CAPT] size of sync buffer : " << syncBufferSize
+ << " [bytes]";
// Get maximum latency for the current stream (will not change for the
// lifetime of the IAudioClient object).
//
REFERENCE_TIME latency;
_ptrClientIn->GetStreamLatency(&latency);
- LOG(LS_VERBOSE) << "[CAPT] max stream latency : " << (DWORD)latency << " ("
- << (double)(latency / 10000.0) << " ms)";
+ RTC_LOG(LS_VERBOSE) << "[CAPT] max stream latency : " << (DWORD)latency
+ << " (" << (double)(latency / 10000.0) << " ms)";
// Get the length of the periodic interval separating successive processing
// passes by the audio engine on the data in the endpoint buffer.
@@ -3291,15 +3311,16 @@
REFERENCE_TIME devPeriod = 0;
REFERENCE_TIME devPeriodMin = 0;
_ptrClientIn->GetDevicePeriod(&devPeriod, &devPeriodMin);
- LOG(LS_VERBOSE) << "[CAPT] device period : " << (DWORD)devPeriod
- << " (" << (double)(devPeriod / 10000.0) << " ms)";
+ RTC_LOG(LS_VERBOSE) << "[CAPT] device period : " << (DWORD)devPeriod
+ << " (" << (double)(devPeriod / 10000.0) << " ms)";
double extraDelayMS = (double)((latency + devPeriod) / 10000.0);
- LOG(LS_VERBOSE) << "[CAPT] extraDelayMS : " << extraDelayMS;
+ RTC_LOG(LS_VERBOSE) << "[CAPT] extraDelayMS : " << extraDelayMS;
double endpointBufferSizeMS =
10.0 * ((double)bufferLength / (double)_recBlockSize);
- LOG(LS_VERBOSE) << "[CAPT] endpointBufferSizeMS : " << endpointBufferSizeMS;
+ RTC_LOG(LS_VERBOSE) << "[CAPT] endpointBufferSizeMS : "
+ << endpointBufferSizeMS;
// Start up the capturing stream.
//
@@ -3325,10 +3346,10 @@
case WAIT_OBJECT_0 + 1: // _hCaptureSamplesReadyEvent
break;
case WAIT_TIMEOUT: // timeout notification
- LOG(LS_WARNING) << "capture event timed out after 0.5 seconds";
+ RTC_LOG(LS_WARNING) << "capture event timed out after 0.5 seconds";
goto Exit;
default: // unexpected error
- LOG(LS_WARNING) << "unknown wait termination on capture side";
+ RTC_LOG(LS_WARNING) << "unknown wait termination on capture side";
goto Exit;
}
@@ -3345,7 +3366,8 @@
// during the unlocked period.
if (_ptrCaptureClient == NULL || _ptrClientIn == NULL) {
_UnLock();
- LOG(LS_ERROR) << "input state has been modified during unlocked period";
+ RTC_LOG(LS_ERROR)
+ << "input state has been modified during unlocked period";
goto Exit;
}
@@ -3370,7 +3392,7 @@
if (flags & AUDCLNT_BUFFERFLAGS_SILENT) {
// Treat all of the data in the packet as silence and ignore the
// actual data values.
- LOG(LS_WARNING) << "AUDCLNT_BUFFERFLAGS_SILENT";
+ RTC_LOG(LS_WARNING) << "AUDCLNT_BUFFERFLAGS_SILENT";
pData = NULL;
}
@@ -3420,8 +3442,8 @@
// during the unlocked period
if (_ptrCaptureClient == NULL || _ptrClientIn == NULL) {
_UnLock();
- LOG(LS_ERROR) << "input state has been modified during"
- << " unlocked period";
+ RTC_LOG(LS_ERROR) << "input state has been modified during"
+ << " unlocked period";
goto Exit;
}
}
@@ -3440,7 +3462,7 @@
// The VQE will only deliver non-zero microphone levels when a
// change is needed. Set this new mic level (received from the
// observer as return value in the callback).
- LOG(LS_VERBOSE) << "AGC change of volume: new=" << newMicLevel;
+ RTC_LOG(LS_VERBOSE) << "AGC change of volume: new=" << newMicLevel;
// We store this outside of the audio buffer to avoid
// having it overwritten by the getter thread.
_newMicLevel = newMicLevel;
@@ -3455,9 +3477,9 @@
// processing loop after shutting down the current client by calling
// IAudioClient::Stop, IAudioClient::Reset, and releasing the audio
// client.
- LOG(LS_ERROR) << "IAudioCaptureClient::GetBuffer returned"
- << " AUDCLNT_E_BUFFER_ERROR, hr = 0x" << std::hex << hr
- << std::dec;
+ RTC_LOG(LS_ERROR) << "IAudioCaptureClient::GetBuffer returned"
+ << " AUDCLNT_E_BUFFER_ERROR, hr = 0x" << std::hex
+ << hr << std::dec;
goto Exit;
}
@@ -3494,9 +3516,10 @@
}
}
- LOG(LS_ERROR) << "Recording error: capturing thread has ended pre-maturely";
+ RTC_LOG(LS_ERROR)
+ << "Recording error: capturing thread has ended pre-maturely";
} else {
- LOG(LS_VERBOSE) << "_Capturing thread is now terminated properly";
+ RTC_LOG(LS_VERBOSE) << "_Capturing thread is now terminated properly";
}
SAFE_RELEASE(_ptrClientIn);
@@ -3513,13 +3536,13 @@
int32_t AudioDeviceWindowsCore::EnableBuiltInAEC(bool enable) {
if (_recIsInitialized) {
- LOG(LS_ERROR)
+ RTC_LOG(LS_ERROR)
<< "Attempt to set Windows AEC with recording already initialized";
return -1;
}
if (_dmo == NULL) {
- LOG(LS_ERROR)
+ RTC_LOG(LS_ERROR)
<< "Built-in AEC DMO was not initialized properly at create time";
return -1;
}
@@ -3615,8 +3638,8 @@
DWORD devIndex = static_cast<uint32_t>(outDevIndex << 16) +
static_cast<uint32_t>(0x0000ffff & inDevIndex);
- LOG(LS_VERBOSE) << "Capture device index: " << inDevIndex
- << ", render device index: " << outDevIndex;
+ RTC_LOG(LS_VERBOSE) << "Capture device index: " << inDevIndex
+ << ", render device index: " << outDevIndex;
if (SetVtI4Property(ps, MFPKEY_WMAAECMA_DEVICE_INDEXES, devIndex) == -1) {
return -1;
}
@@ -3665,7 +3688,7 @@
// ----------------------------------------------------------------------------
int32_t AudioDeviceWindowsCore::_RefreshDeviceList(EDataFlow dir) {
- LOG(LS_VERBOSE) << __FUNCTION__;
+ RTC_LOG(LS_VERBOSE) << __FUNCTION__;
HRESULT hr = S_OK;
IMMDeviceCollection* pCollection = NULL;
@@ -3701,7 +3724,7 @@
// ----------------------------------------------------------------------------
int16_t AudioDeviceWindowsCore::_DeviceListCount(EDataFlow dir) {
- LOG(LS_VERBOSE) << __FUNCTION__;
+ RTC_LOG(LS_VERBOSE) << __FUNCTION__;
HRESULT hr = S_OK;
UINT count = 0;
@@ -3737,7 +3760,7 @@
int index,
LPWSTR szBuffer,
int bufferLen) {
- LOG(LS_VERBOSE) << __FUNCTION__;
+ RTC_LOG(LS_VERBOSE) << __FUNCTION__;
HRESULT hr = S_OK;
IMMDevice* pDevice = NULL;
@@ -3774,7 +3797,7 @@
ERole role,
LPWSTR szBuffer,
int bufferLen) {
- LOG(LS_VERBOSE) << __FUNCTION__;
+ RTC_LOG(LS_VERBOSE) << __FUNCTION__;
HRESULT hr = S_OK;
IMMDevice* pDevice = NULL;
@@ -3811,7 +3834,7 @@
int index,
LPWSTR szBuffer,
int bufferLen) {
- LOG(LS_VERBOSE) << __FUNCTION__;
+ RTC_LOG(LS_VERBOSE) << __FUNCTION__;
HRESULT hr = S_OK;
IMMDevice* pDevice = NULL;
@@ -3848,7 +3871,7 @@
ERole role,
LPWSTR szBuffer,
int bufferLen) {
- LOG(LS_VERBOSE) << __FUNCTION__;
+ RTC_LOG(LS_VERBOSE) << __FUNCTION__;
HRESULT hr = S_OK;
IMMDevice* pDevice = NULL;
@@ -3873,7 +3896,7 @@
int32_t AudioDeviceWindowsCore::_GetDefaultDeviceIndex(EDataFlow dir,
ERole role,
int* index) {
- LOG(LS_VERBOSE) << __FUNCTION__;
+ RTC_LOG(LS_VERBOSE) << __FUNCTION__;
HRESULT hr = S_OK;
WCHAR szDefaultDeviceID[MAX_PATH] = {0};
@@ -3894,7 +3917,7 @@
}
if (!collection) {
- LOG(LS_ERROR) << "Device collection not valid";
+ RTC_LOG(LS_ERROR) << "Device collection not valid";
return -1;
}
@@ -3932,7 +3955,7 @@
}
if (*index == -1) {
- LOG(LS_ERROR) << "Unable to find collection index for default device";
+ RTC_LOG(LS_ERROR) << "Unable to find collection index for default device";
return -1;
}
@@ -3946,7 +3969,7 @@
int32_t AudioDeviceWindowsCore::_GetDeviceName(IMMDevice* pDevice,
LPWSTR pszBuffer,
int bufferLen) {
- LOG(LS_VERBOSE) << __FUNCTION__;
+ RTC_LOG(LS_VERBOSE) << __FUNCTION__;
static const WCHAR szDefault[] = L"<Device not available>";
@@ -3960,8 +3983,8 @@
if (pDevice != NULL) {
hr = pDevice->OpenPropertyStore(STGM_READ, &pProps);
if (FAILED(hr)) {
- LOG(LS_ERROR) << "IMMDevice::OpenPropertyStore failed, hr = 0x"
- << std::hex << hr << std::dec;
+ RTC_LOG(LS_ERROR) << "IMMDevice::OpenPropertyStore failed, hr = 0x"
+ << std::hex << hr << std::dec;
}
}
@@ -3972,22 +3995,22 @@
// Get the endpoint device's friendly-name property.
hr = pProps->GetValue(PKEY_Device_FriendlyName, &varName);
if (FAILED(hr)) {
- LOG(LS_ERROR) << "IPropertyStore::GetValue failed, hr = 0x" << std::hex
- << hr << std::dec;
+ RTC_LOG(LS_ERROR) << "IPropertyStore::GetValue failed, hr = 0x"
+ << std::hex << hr << std::dec;
}
}
if ((SUCCEEDED(hr)) && (VT_EMPTY == varName.vt)) {
hr = E_FAIL;
- LOG(LS_ERROR) << "IPropertyStore::GetValue returned no value,"
- << " hr = 0x" << std::hex << hr << std::dec;
+ RTC_LOG(LS_ERROR) << "IPropertyStore::GetValue returned no value,"
+ << " hr = 0x" << std::hex << hr << std::dec;
}
if ((SUCCEEDED(hr)) && (VT_LPWSTR != varName.vt)) {
// The returned value is not a wide null terminated string.
hr = E_UNEXPECTED;
- LOG(LS_ERROR) << "IPropertyStore::GetValue returned unexpected"
- << " type, hr = 0x" << std::hex << hr << std::dec;
+ RTC_LOG(LS_ERROR) << "IPropertyStore::GetValue returned unexpected"
+ << " type, hr = 0x" << std::hex << hr << std::dec;
}
if (SUCCEEDED(hr) && (varName.pwszVal != NULL)) {
@@ -4011,7 +4034,7 @@
int32_t AudioDeviceWindowsCore::_GetDeviceID(IMMDevice* pDevice,
LPWSTR pszBuffer,
int bufferLen) {
- LOG(LS_VERBOSE) << __FUNCTION__;
+ RTC_LOG(LS_VERBOSE) << __FUNCTION__;
static const WCHAR szDefault[] = L"<Device not available>";
@@ -4044,7 +4067,7 @@
int32_t AudioDeviceWindowsCore::_GetDefaultDevice(EDataFlow dir,
ERole role,
IMMDevice** ppDevice) {
- LOG(LS_VERBOSE) << __FUNCTION__;
+ RTC_LOG(LS_VERBOSE) << __FUNCTION__;
HRESULT hr(S_OK);
@@ -4098,7 +4121,7 @@
int32_t AudioDeviceWindowsCore::_EnumerateEndpointDevicesAll(
EDataFlow dataFlow) const {
- LOG(LS_VERBOSE) << __FUNCTION__;
+ RTC_LOG(LS_VERBOSE) << __FUNCTION__;
assert(_ptrEnumerator != NULL);
@@ -4127,9 +4150,11 @@
hr = pCollection->GetCount(&count);
EXIT_ON_ERROR(hr);
if (dataFlow == eRender)
- LOG(LS_VERBOSE) << "#rendering endpoint devices (counting all): " << count;
+ RTC_LOG(LS_VERBOSE) << "#rendering endpoint devices (counting all): "
+ << count;
else if (dataFlow == eCapture)
- LOG(LS_VERBOSE) << "#capturing endpoint devices (counting all): " << count;
+ RTC_LOG(LS_VERBOSE) << "#capturing endpoint devices (counting all): "
+ << count;
if (count == 0) {
return 0;
@@ -4137,7 +4162,7 @@
// Each loop prints the name of an endpoint device.
for (ULONG i = 0; i < count; i++) {
- LOG(LS_VERBOSE) << "Endpoint " << i << ":";
+ RTC_LOG(LS_VERBOSE) << "Endpoint " << i << ":";
// Get pointer to endpoint number i.
// Output: IMMDevice interface.
@@ -4150,7 +4175,7 @@
// audio endpoint devices)
hr = pEndpoint->GetId(&pwszID);
CONTINUE_ON_ERROR(hr);
- LOG(LS_VERBOSE) << "ID string : " << pwszID;
+ RTC_LOG(LS_VERBOSE) << "ID string : " << pwszID;
// Retrieve an interface to the device's property store.
// Output: IPropertyStore interface.
@@ -4167,24 +4192,24 @@
// Example: "Speakers (Realtek High Definition Audio)"
hr = pProps->GetValue(PKEY_Device_FriendlyName, &varName);
CONTINUE_ON_ERROR(hr);
- LOG(LS_VERBOSE) << "friendly name: \"" << varName.pwszVal << "\"";
+ RTC_LOG(LS_VERBOSE) << "friendly name: \"" << varName.pwszVal << "\"";
// Get the endpoint's current device state
DWORD dwState;
hr = pEndpoint->GetState(&dwState);
CONTINUE_ON_ERROR(hr);
if (dwState & DEVICE_STATE_ACTIVE)
- LOG(LS_VERBOSE) << "state (0x" << std::hex << dwState << std::dec
- << ") : *ACTIVE*";
+ RTC_LOG(LS_VERBOSE) << "state (0x" << std::hex << dwState << std::dec
+ << ") : *ACTIVE*";
if (dwState & DEVICE_STATE_DISABLED)
- LOG(LS_VERBOSE) << "state (0x" << std::hex << dwState << std::dec
- << ") : DISABLED";
+ RTC_LOG(LS_VERBOSE) << "state (0x" << std::hex << dwState << std::dec
+ << ") : DISABLED";
if (dwState & DEVICE_STATE_NOTPRESENT)
- LOG(LS_VERBOSE) << "state (0x" << std::hex << dwState << std::dec
- << ") : NOTPRESENT";
+ RTC_LOG(LS_VERBOSE) << "state (0x" << std::hex << dwState << std::dec
+ << ") : NOTPRESENT";
if (dwState & DEVICE_STATE_UNPLUGGED)
- LOG(LS_VERBOSE) << "state (0x" << std::hex << dwState << std::dec
- << ") : UNPLUGGED";
+ RTC_LOG(LS_VERBOSE) << "state (0x" << std::hex << dwState << std::dec
+ << ") : UNPLUGGED";
// Check the hardware volume capabilities.
DWORD dwHwSupportMask = 0;
@@ -4195,23 +4220,23 @@
CONTINUE_ON_ERROR(hr);
if (dwHwSupportMask & ENDPOINT_HARDWARE_SUPPORT_VOLUME)
// The audio endpoint device supports a hardware volume control
- LOG(LS_VERBOSE) << "hwmask (0x" << std::hex << dwHwSupportMask << std::dec
- << ") : HARDWARE_SUPPORT_VOLUME";
+ RTC_LOG(LS_VERBOSE) << "hwmask (0x" << std::hex << dwHwSupportMask
+ << std::dec << ") : HARDWARE_SUPPORT_VOLUME";
if (dwHwSupportMask & ENDPOINT_HARDWARE_SUPPORT_MUTE)
// The audio endpoint device supports a hardware mute control
- LOG(LS_VERBOSE) << "hwmask (0x" << std::hex << dwHwSupportMask << std::dec
- << ") : HARDWARE_SUPPORT_MUTE";
+ RTC_LOG(LS_VERBOSE) << "hwmask (0x" << std::hex << dwHwSupportMask
+ << std::dec << ") : HARDWARE_SUPPORT_MUTE";
if (dwHwSupportMask & ENDPOINT_HARDWARE_SUPPORT_METER)
// The audio endpoint device supports a hardware peak meter
- LOG(LS_VERBOSE) << "hwmask (0x" << std::hex << dwHwSupportMask << std::dec
- << ") : HARDWARE_SUPPORT_METER";
+ RTC_LOG(LS_VERBOSE) << "hwmask (0x" << std::hex << dwHwSupportMask
+ << std::dec << ") : HARDWARE_SUPPORT_METER";
// Check the channel count (#channels in the audio stream that enters or
// leaves the audio endpoint device)
UINT nChannelCount(0);
hr = pEndpointVolume->GetChannelCount(&nChannelCount);
CONTINUE_ON_ERROR(hr);
- LOG(LS_VERBOSE) << "#channels : " << nChannelCount;
+ RTC_LOG(LS_VERBOSE) << "#channels : " << nChannelCount;
if (dwHwSupportMask & ENDPOINT_HARDWARE_SUPPORT_VOLUME) {
// Get the volume range.
@@ -4221,9 +4246,9 @@
hr = pEndpointVolume->GetVolumeRange(&fLevelMinDB, &fLevelMaxDB,
&fVolumeIncrementDB);
CONTINUE_ON_ERROR(hr);
- LOG(LS_VERBOSE) << "volume range : " << fLevelMinDB << " (min), "
- << fLevelMaxDB << " (max), " << fVolumeIncrementDB
- << " (inc) [dB]";
+ RTC_LOG(LS_VERBOSE) << "volume range : " << fLevelMinDB << " (min), "
+ << fLevelMaxDB << " (max), " << fVolumeIncrementDB
+ << " (inc) [dB]";
// The volume range from vmin = fLevelMinDB to vmax = fLevelMaxDB is
// divided into n uniform intervals of size vinc = fVolumeIncrementDB,
@@ -4231,7 +4256,7 @@
// measured in decibels. The client can set the volume level to one of n +
// 1 discrete values in the range from vmin to vmax.
int n = (int)((fLevelMaxDB - fLevelMinDB) / fVolumeIncrementDB);
- LOG(LS_VERBOSE) << "#intervals : " << n;
+ RTC_LOG(LS_VERBOSE) << "#intervals : " << n;
// Get information about the current step in the volume range.
// This method represents the volume level of the audio stream that enters
@@ -4245,12 +4270,12 @@
UINT nStepCount(0);
hr = pEndpointVolume->GetVolumeStepInfo(&nStep, &nStepCount);
CONTINUE_ON_ERROR(hr);
- LOG(LS_VERBOSE) << "volume steps : " << nStep << " (nStep), "
- << nStepCount << " (nStepCount)";
+ RTC_LOG(LS_VERBOSE) << "volume steps : " << nStep << " (nStep), "
+ << nStepCount << " (nStepCount)";
}
Next:
if (FAILED(hr)) {
- LOG(LS_VERBOSE) << "Error when logging device information";
+ RTC_LOG(LS_VERBOSE) << "Error when logging device information";
}
CoTaskMemFree(pwszID);
pwszID = NULL;
@@ -4298,10 +4323,10 @@
errorText[messageLength - 1] = '\0';
}
- LOG(LS_ERROR) << "Core Audio method failed (hr=" << hr << ")";
+ RTC_LOG(LS_ERROR) << "Core Audio method failed (hr=" << hr << ")";
StringCchPrintf(buf, MAXERRORLENGTH, TEXT("Error details: "));
StringCchCat(buf, MAXERRORLENGTH, errorText);
- LOG(LS_ERROR) << WideToUTF8(buf);
+ RTC_LOG(LS_ERROR) << WideToUTF8(buf);
}
// ----------------------------------------------------------------------------
diff --git a/modules/audio_mixer/audio_mixer_impl.cc b/modules/audio_mixer/audio_mixer_impl.cc
index 9ff5774..34b4ae5 100644
--- a/modules/audio_mixer/audio_mixer_impl.cc
+++ b/modules/audio_mixer/audio_mixer_impl.cc
@@ -197,7 +197,7 @@
OutputFrequency(), &source_and_status->audio_frame);
if (audio_frame_info == Source::AudioFrameInfo::kError) {
- LOG_F(LS_WARNING) << "failed to GetAudioFrameWithInfo() from source";
+ RTC_LOG_F(LS_WARNING) << "failed to GetAudioFrameWithInfo() from source";
continue;
}
audio_source_mixing_data_list.emplace_back(
@@ -243,7 +243,7 @@
return (*iter)->is_mixed;
}
- LOG(LS_ERROR) << "Audio source unknown";
+ RTC_LOG(LS_ERROR) << "Audio source unknown";
return false;
}
} // namespace webrtc
diff --git a/modules/audio_mixer/frame_combiner.cc b/modules/audio_mixer/frame_combiner.cc
index 8000904..09faf56 100644
--- a/modules/audio_mixer/frame_combiner.cc
+++ b/modules/audio_mixer/frame_combiner.cc
@@ -112,7 +112,7 @@
RTC_DCHECK(limiter);
const int error = limiter->ProcessStream(audio_frame_for_mixing);
if (error != limiter->kNoError) {
- LOG_F(LS_ERROR) << "Error from AudioProcessing: " << error;
+ RTC_LOG_F(LS_ERROR) << "Error from AudioProcessing: " << error;
RTC_NOTREACHED();
}
diff --git a/modules/audio_processing/aec3/block_processor.cc b/modules/audio_processing/aec3/block_processor.cc
index 1629785..953b5f4 100644
--- a/modules/audio_processing/aec3/block_processor.cc
+++ b/modules/audio_processing/aec3/block_processor.cc
@@ -102,14 +102,14 @@
// been a render buffer overrun as the buffer alignment may be noncausal.
delay_controller_->Reset();
render_buffer_->Reset();
- LOG(LS_WARNING) << "Reset due to detected render buffer overrun.";
+ RTC_LOG(LS_WARNING) << "Reset due to detected render buffer overrun.";
}
// Update the render buffers with new render data, filling the buffers with
// empty blocks when there is no render data available.
render_buffer_underrun = !render_buffer_->UpdateBuffers();
if (render_buffer_underrun) {
- LOG(LS_WARNING) << "Render API jitter buffer underrun.";
+ RTC_LOG(LS_WARNING) << "Render API jitter buffer underrun.";
}
// Compute and and apply the render delay required to achieve proper signal
@@ -132,7 +132,7 @@
delay_controller_->Reset();
render_buffer_->Reset();
delay_change = true;
- LOG(LS_WARNING) << "Reset due to noncausal delay.";
+ RTC_LOG(LS_WARNING) << "Reset due to noncausal delay.";
}
// Remove the echo from the capture signal.
diff --git a/modules/audio_processing/agc/agc_manager_direct.cc b/modules/audio_processing/agc/agc_manager_direct.cc
index 7d93d7d..944cfb7 100644
--- a/modules/audio_processing/agc/agc_manager_direct.cc
+++ b/modules/audio_processing/agc/agc_manager_direct.cc
@@ -171,19 +171,20 @@
// example, what happens when we change devices.
if (gctrl_->set_mode(GainControl::kFixedDigital) != 0) {
- LOG(LS_ERROR) << "set_mode(GainControl::kFixedDigital) failed.";
+ RTC_LOG(LS_ERROR) << "set_mode(GainControl::kFixedDigital) failed.";
return -1;
}
if (gctrl_->set_target_level_dbfs(2) != 0) {
- LOG(LS_ERROR) << "set_target_level_dbfs(2) failed.";
+ RTC_LOG(LS_ERROR) << "set_target_level_dbfs(2) failed.";
return -1;
}
if (gctrl_->set_compression_gain_db(kDefaultCompressionGain) != 0) {
- LOG(LS_ERROR) << "set_compression_gain_db(kDefaultCompressionGain) failed.";
+ RTC_LOG(LS_ERROR)
+ << "set_compression_gain_db(kDefaultCompressionGain) failed.";
return -1;
}
if (gctrl_->enable_limiter(true) != 0) {
- LOG(LS_ERROR) << "enable_limiter(true) failed.";
+ RTC_LOG(LS_ERROR) << "enable_limiter(true) failed.";
return -1;
}
return 0;
@@ -215,8 +216,8 @@
// gain is increased, through SetMaxLevel().
float clipped_ratio = agc_->AnalyzePreproc(audio, length);
if (clipped_ratio > kClippedRatioThreshold) {
- LOG(LS_INFO) << "[agc] Clipping detected. clipped_ratio="
- << clipped_ratio;
+ RTC_LOG(LS_INFO) << "[agc] Clipping detected. clipped_ratio="
+ << clipped_ratio;
// Always decrease the maximum level, even if the current level is below
// threshold.
SetMaxLevel(std::max(clipped_level_min_, max_level_ - kClippedLevelStep));
@@ -249,7 +250,7 @@
}
if (agc_->Process(audio, length, sample_rate_hz) != 0) {
- LOG(LS_ERROR) << "Agc::Process failed";
+ RTC_LOG(LS_ERROR) << "Agc::Process failed";
RTC_NOTREACHED();
}
@@ -265,18 +266,20 @@
return;
}
if (voe_level == 0) {
- LOG(LS_INFO) << "[agc] VolumeCallbacks returned level=0, taking no action.";
+ RTC_LOG(LS_INFO)
+ << "[agc] VolumeCallbacks returned level=0, taking no action.";
return;
}
if (voe_level > kMaxMicLevel) {
- LOG(LS_ERROR) << "VolumeCallbacks returned an invalid level=" << voe_level;
+ RTC_LOG(LS_ERROR) << "VolumeCallbacks returned an invalid level="
+ << voe_level;
return;
}
if (voe_level > level_ + kLevelQuantizationSlack ||
voe_level < level_ - kLevelQuantizationSlack) {
- LOG(LS_INFO) << "[agc] Mic volume was manually adjusted. Updating "
- << "stored level from " << level_ << " to " << voe_level;
+ RTC_LOG(LS_INFO) << "[agc] Mic volume was manually adjusted. Updating "
+ << "stored level from " << level_ << " to " << voe_level;
level_ = voe_level;
// Always allow the user to increase the volume.
if (level_ > max_level_) {
@@ -295,9 +298,9 @@
}
volume_callbacks_->SetMicVolume(new_level);
- LOG(LS_INFO) << "[agc] voe_level=" << voe_level << ", "
- << "level_=" << level_ << ", "
- << "new_level=" << new_level;
+ RTC_LOG(LS_INFO) << "[agc] voe_level=" << voe_level << ", "
+ << "level_=" << level_ << ", "
+ << "new_level=" << new_level;
level_ = new_level;
}
@@ -311,8 +314,8 @@
(kMaxMicLevel - clipped_level_min_) *
kSurplusCompressionGain +
0.5f);
- LOG(LS_INFO) << "[agc] max_level_=" << max_level_
- << ", max_compression_gain_=" << max_compression_gain_;
+ RTC_LOG(LS_INFO) << "[agc] max_level_=" << max_level_
+ << ", max_compression_gain_=" << max_compression_gain_;
}
void AgcManagerDirect::SetCaptureMuted(bool muted) {
@@ -341,19 +344,20 @@
// 2) Independent of interpretation of |level| == 0 we should raise it so the
// AGC can do its job properly.
if (level == 0 && !startup_) {
- LOG(LS_INFO) << "[agc] VolumeCallbacks returned level=0, taking no action.";
+ RTC_LOG(LS_INFO)
+ << "[agc] VolumeCallbacks returned level=0, taking no action.";
return 0;
}
if (level > kMaxMicLevel) {
- LOG(LS_ERROR) << "VolumeCallbacks returned an invalid level=" << level;
+ RTC_LOG(LS_ERROR) << "VolumeCallbacks returned an invalid level=" << level;
return -1;
}
- LOG(LS_INFO) << "[agc] Initial GetMicVolume()=" << level;
+ RTC_LOG(LS_INFO) << "[agc] Initial GetMicVolume()=" << level;
int minLevel = startup_ ? startup_min_level_ : kMinMicLevel;
if (level < minLevel) {
level = minLevel;
- LOG(LS_INFO) << "[agc] Initial volume too low, raising to " << level;
+ RTC_LOG(LS_INFO) << "[agc] Initial volume too low, raising to " << level;
volume_callbacks_->SetMicVolume(level);
}
agc_->Reset();
@@ -405,9 +409,9 @@
const int residual_gain =
rtc::SafeClamp(rms_error - raw_compression, -kMaxResidualGainChange,
kMaxResidualGainChange);
- LOG(LS_INFO) << "[agc] rms_error=" << rms_error << ", "
- << "target_compression=" << target_compression_ << ", "
- << "residual_gain=" << residual_gain;
+ RTC_LOG(LS_INFO) << "[agc] rms_error=" << rms_error << ", "
+ << "target_compression=" << target_compression_ << ", "
+ << "residual_gain=" << residual_gain;
if (residual_gain == 0)
return;
@@ -448,8 +452,8 @@
compression_ = new_compression;
compression_accumulator_ = new_compression;
if (gctrl_->set_compression_gain_db(compression_) != 0) {
- LOG(LS_ERROR) << "set_compression_gain_db(" << compression_
- << ") failed.";
+ RTC_LOG(LS_ERROR) << "set_compression_gain_db(" << compression_
+ << ") failed.";
}
}
}
diff --git a/modules/audio_processing/audio_processing_impl.cc b/modules/audio_processing/audio_processing_impl.cc
index 5e53853..5e47f1a 100644
--- a/modules/audio_processing/audio_processing_impl.cc
+++ b/modules/audio_processing/audio_processing_impl.cc
@@ -403,8 +403,8 @@
// implemented.
private_submodules_->gain_controller2.reset(new GainController2());
- LOG(LS_INFO) << "Capture post processor activated: "
- << !!private_submodules_->capture_post_processor;
+ RTC_LOG(LS_INFO) << "Capture post processor activated: "
+ << !!private_submodules_->capture_post_processor;
}
SetExtraOptions(config);
@@ -660,11 +660,11 @@
bool config_ok = LevelController::Validate(config_.level_controller);
if (!config_ok) {
- LOG(LS_ERROR) << "AudioProcessing module config error" << std::endl
- << "level_controller: "
- << LevelController::ToString(config_.level_controller)
- << std::endl
- << "Reverting to default parameter set";
+ RTC_LOG(LS_ERROR) << "AudioProcessing module config error" << std::endl
+ << "level_controller: "
+ << LevelController::ToString(config_.level_controller)
+ << std::endl
+ << "Reverting to default parameter set";
config_.level_controller = AudioProcessing::Config::LevelController();
}
@@ -682,15 +682,15 @@
// the level controller regardless of whether it is enabled or not.
InitializeLevelController();
}
- LOG(LS_INFO) << "Level controller activated: "
- << capture_nonlocked_.level_controller_enabled;
+ RTC_LOG(LS_INFO) << "Level controller activated: "
+ << capture_nonlocked_.level_controller_enabled;
private_submodules_->level_controller->ApplyConfig(config_.level_controller);
InitializeLowCutFilter();
- LOG(LS_INFO) << "Highpass filter activated: "
- << config_.high_pass_filter.enabled;
+ RTC_LOG(LS_INFO) << "Highpass filter activated: "
+ << config_.high_pass_filter.enabled;
// Deprecated way of activating AEC3.
// TODO(gustaf): Remove when possible.
@@ -700,23 +700,23 @@
echo_control_factory_ =
std::unique_ptr<EchoControlFactory>(new EchoCanceller3Factory());
InitializeEchoController();
- LOG(LS_INFO) << "Echo canceller 3 activated: "
- << capture_nonlocked_.echo_controller_enabled;
+ RTC_LOG(LS_INFO) << "Echo canceller 3 activated: "
+ << capture_nonlocked_.echo_controller_enabled;
}
config_ok = GainController2::Validate(config_.gain_controller2);
if (!config_ok) {
- LOG(LS_ERROR) << "AudioProcessing module config error" << std::endl
- << "Gain Controller 2: "
- << GainController2::ToString(config_.gain_controller2)
- << std::endl
- << "Reverting to default parameter set";
+ RTC_LOG(LS_ERROR) << "AudioProcessing module config error" << std::endl
+ << "Gain Controller 2: "
+ << GainController2::ToString(config_.gain_controller2)
+ << std::endl
+ << "Reverting to default parameter set";
config_.gain_controller2 = AudioProcessing::Config::GainController2();
}
InitializeGainController2();
private_submodules_->gain_controller2->ApplyConfig(config_.gain_controller2);
- LOG(LS_INFO) << "Gain Controller 2 activated: "
- << config_.gain_controller2.enabled;
+ RTC_LOG(LS_INFO) << "Gain Controller 2 activated: "
+ << config_.gain_controller2.enabled;
}
void AudioProcessingImpl::SetExtraOptions(const webrtc::Config& config) {
diff --git a/modules/audio_processing/echo_control_mobile_impl.cc b/modules/audio_processing/echo_control_mobile_impl.cc
index ad3c731..ecb1810 100644
--- a/modules/audio_processing/echo_control_mobile_impl.cc
+++ b/modules/audio_processing/echo_control_mobile_impl.cc
@@ -354,7 +354,7 @@
}
if (stream_properties_->sample_rate_hz > AudioProcessing::kSampleRate16kHz) {
- LOG(LS_ERROR) << "AECM only supports 16 kHz or lower sample rates";
+ RTC_LOG(LS_ERROR) << "AECM only supports 16 kHz or lower sample rates";
}
cancellers_.resize(
diff --git a/modules/audio_processing/intelligibility/intelligibility_enhancer.cc b/modules/audio_processing/intelligibility/intelligibility_enhancer.cc
index 65cad19..588310a 100644
--- a/modules/audio_processing/intelligibility/intelligibility_enhancer.cc
+++ b/modules/audio_processing/intelligibility/intelligibility_enhancer.cc
@@ -124,11 +124,12 @@
// Don't rely on this log, since the destructor isn't called when the
// app/tab is killed.
if (num_chunks_ > 0) {
- LOG(LS_INFO) << "Intelligibility Enhancer was active for "
- << 100.f * static_cast<float>(num_active_chunks_) / num_chunks_
- << "% of the call.";
+ RTC_LOG(LS_INFO) << "Intelligibility Enhancer was active for "
+ << 100.f * static_cast<float>(num_active_chunks_) /
+ num_chunks_
+ << "% of the call.";
} else {
- LOG(LS_INFO) << "Intelligibility Enhancer processed no chunk.";
+ RTC_LOG(LS_INFO) << "Intelligibility Enhancer processed no chunk.";
}
}
@@ -206,8 +207,8 @@
(noise_power + std::numeric_limits<float>::epsilon());
if (is_active_) {
if (snr_ > kMaxActiveSNR) {
- LOG(LS_INFO) << "Intelligibility Enhancer was deactivated at chunk "
- << num_chunks_;
+ RTC_LOG(LS_INFO) << "Intelligibility Enhancer was deactivated at chunk "
+ << num_chunks_;
is_active_ = false;
// Set the target gains to unity.
float* gains = gain_applier_.target();
@@ -217,8 +218,8 @@
}
} else {
if (snr_ < kMinInactiveSNR) {
- LOG(LS_INFO) << "Intelligibility Enhancer was activated at chunk "
- << num_chunks_;
+ RTC_LOG(LS_INFO) << "Intelligibility Enhancer was activated at chunk "
+ << num_chunks_;
is_active_ = true;
}
}
diff --git a/modules/audio_processing/level_controller/level_controller.cc b/modules/audio_processing/level_controller/level_controller.cc
index a600ac7..6343ef7 100644
--- a/modules/audio_processing/level_controller/level_controller.cc
+++ b/modules/audio_processing/level_controller/level_controller.cc
@@ -156,21 +156,21 @@
const int frame_peak_level_dbfs = static_cast<int>(
10 * log10(frame_peak_level * frame_peak_level + 1e-10f) - kdBFSOffset);
- LOG(LS_INFO) << "Level Controller metrics: {"
- << "Max noise power: " << max_noise_power_dbfs << " dBFS, "
- << "Average noise power: " << average_noise_power_dbfs
- << " dBFS, "
- << "Max long term peak level: " << max_peak_level_dbfs
- << " dBFS, "
- << "Average long term peak level: " << average_peak_level_dbfs
- << " dBFS, "
- << "Max gain: " << max_gain_db << " dB, "
- << "Average gain: " << average_gain_db << " dB, "
- << "Long term peak level: " << long_term_peak_level_dbfs
- << " dBFS, "
- << "Last frame peak level: " << frame_peak_level_dbfs
- << " dBFS"
- << "}";
+ RTC_LOG(LS_INFO) << "Level Controller metrics: {"
+ << "Max noise power: " << max_noise_power_dbfs << " dBFS, "
+ << "Average noise power: " << average_noise_power_dbfs
+ << " dBFS, "
+ << "Max long term peak level: " << max_peak_level_dbfs
+ << " dBFS, "
+ << "Average long term peak level: "
+ << average_peak_level_dbfs << " dBFS, "
+ << "Max gain: " << max_gain_db << " dB, "
+ << "Average gain: " << average_gain_db << " dB, "
+ << "Long term peak level: " << long_term_peak_level_dbfs
+ << " dBFS, "
+ << "Last frame peak level: " << frame_peak_level_dbfs
+ << " dBFS"
+ << "}";
Reset();
}
diff --git a/modules/audio_processing/residual_echo_detector.cc b/modules/audio_processing/residual_echo_detector.cc
index 0f03046..b35c155 100644
--- a/modules/audio_processing/residual_echo_detector.cc
+++ b/modules/audio_processing/residual_echo_detector.cc
@@ -141,19 +141,19 @@
read_index -= kLookbackFrames;
}
RTC_DCHECK_LT(read_index, render_power_.size());
- LOG_F(LS_ERROR) << "Echo detector internal state: {"
- << "Echo likelihood: " << echo_likelihood_
- << ", Best Delay: " << best_delay << ", Covariance: "
- << covariances_[best_delay].covariance()
- << ", Last capture power: " << capture_power
- << ", Capture mean: " << capture_mean
- << ", Capture_standard deviation: "
- << capture_std_deviation
- << ", Last render power: " << render_power_[read_index]
- << ", Render mean: " << render_power_mean_[read_index]
- << ", Render standard deviation: "
- << render_power_std_dev_[read_index]
- << ", Reliability: " << reliability_ << "}";
+ RTC_LOG_F(LS_ERROR) << "Echo detector internal state: {"
+ << "Echo likelihood: " << echo_likelihood_
+ << ", Best Delay: " << best_delay << ", Covariance: "
+ << covariances_[best_delay].covariance()
+ << ", Last capture power: " << capture_power
+ << ", Capture mean: " << capture_mean
+ << ", Capture_standard deviation: "
+ << capture_std_deviation << ", Last render power: "
+ << render_power_[read_index]
+ << ", Render mean: " << render_power_mean_[read_index]
+ << ", Render standard deviation: "
+ << render_power_std_dev_[read_index]
+ << ", Reliability: " << reliability_ << "}";
log_counter_++;
}
}
diff --git a/modules/audio_processing/test/audio_processing_simulator.cc b/modules/audio_processing/test/audio_processing_simulator.cc
index 20bad81..416fd98 100644
--- a/modules/audio_processing/test/audio_processing_simulator.cc
+++ b/modules/audio_processing/test/audio_processing_simulator.cc
@@ -98,7 +98,7 @@
}
if (settings_.simulate_mic_gain)
- LOG(LS_VERBOSE) << "Simulating analog mic gain";
+ RTC_LOG(LS_VERBOSE) << "Simulating analog mic gain";
}
AudioProcessingSimulator::~AudioProcessingSimulator() {
diff --git a/modules/audio_processing/test/conversational_speech/generator_unittest.cc b/modules/audio_processing/test/conversational_speech/generator_unittest.cc
index 7e874b0..064e8c8 100644
--- a/modules/audio_processing/test/conversational_speech/generator_unittest.cc
+++ b/modules/audio_processing/test/conversational_speech/generator_unittest.cc
@@ -663,7 +663,7 @@
rtc::Pathname output_path(audiotracks_path);
output_path.AppendFolder("output");
CreateDir(output_path.pathname());
- LOG(LS_VERBOSE) << "simulator output path: " << output_path.pathname();
+ RTC_LOG(LS_VERBOSE) << "simulator output path: " << output_path.pathname();
auto generated_audiotrak_pairs = conversational_speech::Simulate(
multiend_call, output_path.pathname());
EXPECT_EQ(2u, generated_audiotrak_pairs->size());
@@ -673,7 +673,7 @@
const MockWavReaderFactory::Params expeted_params = {
sample_rate, 1u, sample_rate * expected_duration_seconds};
for (const auto& it : *generated_audiotrak_pairs) {
- LOG(LS_VERBOSE) << "checking far/near-end for <" << it.first << ">";
+ RTC_LOG(LS_VERBOSE) << "checking far/near-end for <" << it.first << ">";
CheckAudioTrackParams(
wav_reader_factory, it.second.near_end, expeted_params);
CheckAudioTrackParams(
diff --git a/modules/audio_processing/test/conversational_speech/mock_wavreader_factory.cc b/modules/audio_processing/test/conversational_speech/mock_wavreader_factory.cc
index d2c107a..76f5c80 100644
--- a/modules/audio_processing/test/conversational_speech/mock_wavreader_factory.cc
+++ b/modules/audio_processing/test/conversational_speech/mock_wavreader_factory.cc
@@ -46,7 +46,7 @@
// If not found, use default parameters.
if (it == audiotrack_names_params_.end()) {
- LOG(LS_VERBOSE) << "using default parameters for " << filepath;
+ RTC_LOG(LS_VERBOSE) << "using default parameters for " << filepath;
return std::unique_ptr<WavReaderInterface>(
new MockWavReader(default_params_.sample_rate,
default_params_.num_channels,
@@ -54,10 +54,10 @@
}
// Found, use the audiotrack-specific parameters.
- LOG(LS_VERBOSE) << "using ad-hoc parameters for " << filepath;
- LOG(LS_VERBOSE) << "sample_rate " << it->second.sample_rate;
- LOG(LS_VERBOSE) << "num_channels " << it->second.num_channels;
- LOG(LS_VERBOSE) << "num_samples " << it->second.num_samples;
+ RTC_LOG(LS_VERBOSE) << "using ad-hoc parameters for " << filepath;
+ RTC_LOG(LS_VERBOSE) << "sample_rate " << it->second.sample_rate;
+ RTC_LOG(LS_VERBOSE) << "num_channels " << it->second.num_channels;
+ RTC_LOG(LS_VERBOSE) << "num_samples " << it->second.num_samples;
return std::unique_ptr<WavReaderInterface>(
new MockWavReader(it->second.sample_rate,
it->second.num_channels,
diff --git a/modules/audio_processing/test/conversational_speech/multiend_call.cc b/modules/audio_processing/test/conversational_speech/multiend_call.cc
index 7c42442..76cf774 100644
--- a/modules/audio_processing/test/conversational_speech/multiend_call.cc
+++ b/modules/audio_processing/test/conversational_speech/multiend_call.cc
@@ -59,12 +59,13 @@
if (sample_rate_hz_ == 0) {
sample_rate_hz_ = wavreader->SampleRate();
} else if (sample_rate_hz_ != wavreader->SampleRate()) {
- LOG(LS_ERROR) << "All the audio tracks should have the same sample rate.";
+ RTC_LOG(LS_ERROR)
+ << "All the audio tracks should have the same sample rate.";
return false;
}
if (wavreader->NumChannels() != 1) {
- LOG(LS_ERROR) << "Only mono audio tracks supported.";
+ RTC_LOG(LS_ERROR) << "Only mono audio tracks supported.";
return false;
}
@@ -118,14 +119,14 @@
turn.offset, it->second->SampleRate());
std::size_t begin_timestamp = last_turn.end + offset_samples;
std::size_t end_timestamp = begin_timestamp + it->second->NumSamples();
- LOG(LS_INFO) << "turn #" << turn_index << " " << begin_timestamp
- << "-" << end_timestamp << " ms";
+ RTC_LOG(LS_INFO) << "turn #" << turn_index << " " << begin_timestamp << "-"
+ << end_timestamp << " ms";
// The order is invalid if the offset is negative and its absolute value is
// larger then the duration of the previous turn.
if (offset_samples < 0 && -offset_samples > static_cast<int>(
last_turn.end - last_turn.begin)) {
- LOG(LS_ERROR) << "invalid order";
+ RTC_LOG(LS_ERROR) << "invalid order";
return false;
}
@@ -133,7 +134,7 @@
// current interval falls in the last two turns.
if (turn_index > 1 && in_interval(begin_timestamp, last_turn)
&& in_interval(begin_timestamp, second_last_turn)) {
- LOG(LS_ERROR) << "cross-talk with 3+ speakers";
+ RTC_LOG(LS_ERROR) << "cross-talk with 3+ speakers";
return false;
}
@@ -158,8 +159,7 @@
// Detect self cross-talk.
for (const std::string& speaker_name : speaker_names_) {
- LOG(LS_INFO) << "checking self cross-talk for <"
- << speaker_name << ">";
+ RTC_LOG(LS_INFO) << "checking self cross-talk for <" << speaker_name << ">";
// Copy all turns for this speaker to new vector.
std::vector<SpeakingTurn> speaking_turns_for_name;
@@ -177,7 +177,7 @@
return a.end > b.begin; });
if (overlap != speaking_turns_for_name.end()) {
- LOG(LS_ERROR) << "Self cross-talk detected";
+ RTC_LOG(LS_ERROR) << "Self cross-talk detected";
return false;
}
}
diff --git a/modules/audio_processing/test/conversational_speech/simulator.cc b/modules/audio_processing/test/conversational_speech/simulator.cc
index 4f3091a..84a9ef5 100644
--- a/modules/audio_processing/test/conversational_speech/simulator.cc
+++ b/modules/audio_processing/test/conversational_speech/simulator.cc
@@ -43,13 +43,13 @@
for (const auto& speaker_name : speaker_names) {
const rtc::Pathname near_end_path(
output_path, "s_" + speaker_name + "-near_end.wav");
- LOG(LS_VERBOSE) << "The near-end audio track will be created in "
- << near_end_path.pathname() << ".";
+ RTC_LOG(LS_VERBOSE) << "The near-end audio track will be created in "
+ << near_end_path.pathname() << ".";
const rtc::Pathname far_end_path(
output_path, "s_" + speaker_name + "-far_end.wav");
- LOG(LS_VERBOSE) << "The far-end audio track will be created in "
- << far_end_path.pathname() << ".";
+ RTC_LOG(LS_VERBOSE) << "The far-end audio track will be created in "
+ << far_end_path.pathname() << ".";
// Add to map.
speaker_output_file_paths_map->emplace(
diff --git a/modules/audio_processing/test/fake_recording_device.cc b/modules/audio_processing/test/fake_recording_device.cc
index bd6b644..ccf5080 100644
--- a/modules/audio_processing/test/fake_recording_device.cc
+++ b/modules/audio_processing/test/fake_recording_device.cc
@@ -127,7 +127,7 @@
void FakeRecordingDevice::SetMicLevel(const int level) {
RTC_CHECK(worker_);
if (level != worker_->mic_level())
- LOG(LS_INFO) << "Simulate mic level update: " << level;
+ RTC_LOG(LS_INFO) << "Simulate mic level update: " << level;
worker_->set_mic_level(level);
}
diff --git a/modules/audio_processing/test/py_quality_assessment/quality_assessment/apm_vad.cc b/modules/audio_processing/test/py_quality_assessment/quality_assessment/apm_vad.cc
index ccbd02a..a6184b5 100644
--- a/modules/audio_processing/test/py_quality_assessment/quality_assessment/apm_vad.cc
+++ b/modules/audio_processing/test/py_quality_assessment/quality_assessment/apm_vad.cc
@@ -35,17 +35,18 @@
// Open wav input file and check properties.
WavReader wav_reader(FLAG_i);
if (wav_reader.num_channels() != 1) {
- LOG(LS_ERROR) << "Only mono wav files supported";
+ RTC_LOG(LS_ERROR) << "Only mono wav files supported";
return 1;
}
if (wav_reader.sample_rate() > kMaxSampleRate) {
- LOG(LS_ERROR) << "Beyond maximum sample rate (" << kMaxSampleRate << ")";
+ RTC_LOG(LS_ERROR) << "Beyond maximum sample rate (" << kMaxSampleRate
+ << ")";
return 1;
}
const size_t audio_frame_len = rtc::CheckedDivExact(
kAudioFrameLengthMilliseconds * wav_reader.sample_rate(), 1000);
if (audio_frame_len > kMaxFrameLen) {
- LOG(LS_ERROR) << "The frame size and/or the sample rate are too large.";
+ RTC_LOG(LS_ERROR) << "The frame size and/or the sample rate are too large.";
return 1;
}
diff --git a/modules/audio_processing/test/py_quality_assessment/quality_assessment/vad.cc b/modules/audio_processing/test/py_quality_assessment/quality_assessment/vad.cc
index 90aa338..191cb1e 100644
--- a/modules/audio_processing/test/py_quality_assessment/quality_assessment/vad.cc
+++ b/modules/audio_processing/test/py_quality_assessment/quality_assessment/vad.cc
@@ -37,17 +37,18 @@
// Open wav input file and check properties.
WavReader wav_reader(FLAG_i);
if (wav_reader.num_channels() != 1) {
- LOG(LS_ERROR) << "Only mono wav files supported";
+ RTC_LOG(LS_ERROR) << "Only mono wav files supported";
return 1;
}
if (wav_reader.sample_rate() > kMaxSampleRate) {
- LOG(LS_ERROR) << "Beyond maximum sample rate (" << kMaxSampleRate << ")";
+ RTC_LOG(LS_ERROR) << "Beyond maximum sample rate (" << kMaxSampleRate
+ << ")";
return 1;
}
const size_t audio_frame_length = rtc::CheckedDivExact(
kAudioFrameLengthMilliseconds * wav_reader.sample_rate(), 1000);
if (audio_frame_length > kMaxFrameLen) {
- LOG(LS_ERROR) << "The frame size and/or the sample rate are too large.";
+ RTC_LOG(LS_ERROR) << "The frame size and/or the sample rate are too large.";
return 1;
}
diff --git a/modules/audio_processing/transient/transient_suppressor.cc b/modules/audio_processing/transient/transient_suppressor.cc
index 3ac947a..9bbd7d9 100644
--- a/modules/audio_processing/transient/transient_suppressor.cc
+++ b/modules/audio_processing/transient/transient_suppressor.cc
@@ -295,7 +295,7 @@
if (keypress_counter_ > kIsTypingThreshold) {
if (!suppression_enabled_) {
- LOG(LS_INFO) << "[ts] Transient suppression is now enabled.";
+ RTC_LOG(LS_INFO) << "[ts] Transient suppression is now enabled.";
}
suppression_enabled_ = true;
keypress_counter_ = 0;
@@ -304,7 +304,7 @@
if (detection_enabled_ &&
++chunks_since_keypress_ > kChunksUntilNotTyping) {
if (suppression_enabled_) {
- LOG(LS_INFO) << "[ts] Transient suppression is now disabled.";
+ RTC_LOG(LS_INFO) << "[ts] Transient suppression is now disabled.";
}
detection_enabled_ = false;
suppression_enabled_ = false;
diff --git a/modules/bitrate_controller/bitrate_controller_impl.cc b/modules/bitrate_controller/bitrate_controller_impl.cc
index c7fe322..5b9b9ad 100644
--- a/modules/bitrate_controller/bitrate_controller_impl.cc
+++ b/modules/bitrate_controller/bitrate_controller_impl.cc
@@ -209,8 +209,9 @@
report_block.extended_highest_sequence_number;
}
if (total_number_of_packets < 0) {
- LOG(LS_WARNING) << "Received report block where extended high sequence "
- "number goes backwards, ignoring.";
+ RTC_LOG(LS_WARNING)
+ << "Received report block where extended high sequence "
+ "number goes backwards, ignoring.";
return;
}
if (total_number_of_packets == 0)
diff --git a/modules/bitrate_controller/send_side_bandwidth_estimation.cc b/modules/bitrate_controller/send_side_bandwidth_estimation.cc
index 9e9118b..86096a1 100644
--- a/modules/bitrate_controller/send_side_bandwidth_estimation.cc
+++ b/modules/bitrate_controller/send_side_bandwidth_estimation.cc
@@ -94,8 +94,8 @@
<< "Bitrate must be smaller enough to avoid overflows.";
return true;
}
- LOG(LS_WARNING) << "Failed to parse parameters for BweLossExperiment "
- "experiment from field trial string. Using default.";
+ RTC_LOG(LS_WARNING) << "Failed to parse parameters for BweLossExperiment "
+ "experiment from field trial string. Using default.";
*low_loss_threshold = kDefaultLowLossThreshold;
*high_loss_threshold = kDefaultHighLossThreshold;
*bitrate_threshold_kbps = kDefaultBitrateThresholdKbps;
@@ -138,9 +138,9 @@
if (ReadBweLossExperimentParameters(&low_loss_threshold_,
&high_loss_threshold_,
&bitrate_threshold_kbps)) {
- LOG(LS_INFO) << "Enabled BweLossExperiment with parameters "
- << low_loss_threshold_ << ", " << high_loss_threshold_
- << ", " << bitrate_threshold_kbps;
+ RTC_LOG(LS_INFO) << "Enabled BweLossExperiment with parameters "
+ << low_loss_threshold_ << ", " << high_loss_threshold_
+ << ", " << bitrate_threshold_kbps;
bitrate_threshold_bps_ = bitrate_threshold_kbps * 1000;
}
}
@@ -351,8 +351,8 @@
(last_timeout_ms_ == -1 ||
now_ms - last_timeout_ms_ > kTimeoutIntervalMs)) {
if (in_timeout_experiment_) {
- LOG(LS_WARNING) << "Feedback timed out (" << time_since_feedback_ms
- << " ms), reducing bitrate.";
+ RTC_LOG(LS_WARNING) << "Feedback timed out (" << time_since_feedback_ms
+ << " ms), reducing bitrate.";
new_bitrate *= 0.8;
// Reset accumulators since we've already acted on missing feedback and
// shouldn't to act again on these old lost packets.
@@ -404,9 +404,10 @@
if (bitrate_bps < min_bitrate_configured_) {
if (last_low_bitrate_log_ms_ == -1 ||
now_ms - last_low_bitrate_log_ms_ > kLowBitrateLogPeriodMs) {
- LOG(LS_WARNING) << "Estimated available bandwidth " << bitrate_bps / 1000
- << " kbps is below configured min bitrate "
- << min_bitrate_configured_ / 1000 << " kbps.";
+ RTC_LOG(LS_WARNING) << "Estimated available bandwidth "
+ << bitrate_bps / 1000
+ << " kbps is below configured min bitrate "
+ << min_bitrate_configured_ / 1000 << " kbps.";
last_low_bitrate_log_ms_ = now_ms;
}
bitrate_bps = min_bitrate_configured_;
diff --git a/modules/congestion_controller/delay_based_bwe.cc b/modules/congestion_controller/delay_based_bwe.cc
index 35c15ef..fda0e61 100644
--- a/modules/congestion_controller/delay_based_bwe.cc
+++ b/modules/congestion_controller/delay_based_bwe.cc
@@ -60,10 +60,10 @@
if (parsed_values == 1) {
if (window_size > 1)
return window_size;
- LOG(WARNING) << "Window size must be greater than 1.";
+ RTC_LOG(WARNING) << "Window size must be greater than 1.";
}
- LOG(LS_WARNING) << "Failed to parse parameters for BweTrendlineFilter "
- "experiment from field trial string. Using default.";
+ RTC_LOG(LS_WARNING) << "Failed to parse parameters for BweTrendlineFilter "
+ "experiment from field trial string. Using default.";
return kDefaultTrendlineWindowSize;
}
} // namespace
@@ -104,7 +104,7 @@
prev_state_(BandwidthUsage::kBwNormal),
in_sparse_update_experiment_(
webrtc::field_trial::IsEnabled(kBweSparseUpdateExperiment)) {
- LOG(LS_INFO)
+ RTC_LOG(LS_INFO)
<< "Using Trendline filter for delay change estimation with window size "
<< trendline_window_size_;
}
@@ -123,7 +123,7 @@
// all acks were too late and that the send time history had
// timed out. We should reduce the rate when this occurs.
if (packet_feedback_vector.empty()) {
- LOG(LS_WARNING) << "Very late feedback received.";
+ RTC_LOG(LS_WARNING) << "Very late feedback received.";
return DelayBasedBwe::Result();
}
@@ -179,8 +179,8 @@
result.updated = true;
result.probe = false;
result.target_bitrate_bps = rate_control_.LatestEstimate();
- LOG(LS_WARNING) << "Long feedback delay detected, reducing BWE to "
- << result.target_bitrate_bps;
+ RTC_LOG(LS_WARNING) << "Long feedback delay detected, reducing BWE to "
+ << result.target_bitrate_bps;
return result;
}
@@ -321,7 +321,7 @@
}
void DelayBasedBwe::SetStartBitrate(int start_bitrate_bps) {
- LOG(LS_WARNING) << "BWE Setting start bitrate to: " << start_bitrate_bps;
+ RTC_LOG(LS_WARNING) << "BWE Setting start bitrate to: " << start_bitrate_bps;
rate_control_.SetStartBitrate(start_bitrate_bps);
}
diff --git a/modules/congestion_controller/probe_bitrate_estimator.cc b/modules/congestion_controller/probe_bitrate_estimator.cc
index 0c1e23f..8c5934d 100644
--- a/modules/congestion_controller/probe_bitrate_estimator.cc
+++ b/modules/congestion_controller/probe_bitrate_estimator.cc
@@ -101,10 +101,10 @@
if (send_interval_ms <= 0 || send_interval_ms > kMaxProbeIntervalMs ||
receive_interval_ms <= 0 || receive_interval_ms > kMaxProbeIntervalMs) {
- LOG(LS_INFO) << "Probing unsuccessful, invalid send/receive interval"
- << " [cluster id: " << cluster_id
- << "] [send interval: " << send_interval_ms << " ms]"
- << " [receive interval: " << receive_interval_ms << " ms]";
+ RTC_LOG(LS_INFO) << "Probing unsuccessful, invalid send/receive interval"
+ << " [cluster id: " << cluster_id
+ << "] [send interval: " << send_interval_ms << " ms]"
+ << " [receive interval: " << receive_interval_ms << " ms]";
if (event_log_) {
event_log_->Log(rtc::MakeUnique<RtcEventProbeResultFailure>(
cluster_id, ProbeFailureReason::kInvalidSendReceiveInterval));
@@ -127,29 +127,30 @@
float ratio = receive_bps / send_bps;
if (ratio > kMaxValidRatio) {
- LOG(LS_INFO) << "Probing unsuccessful, receive/send ratio too high"
- << " [cluster id: " << cluster_id << "] [send: " << send_size
- << " bytes / " << send_interval_ms
- << " ms = " << send_bps / 1000 << " kb/s]"
- << " [receive: " << receive_size << " bytes / "
- << receive_interval_ms << " ms = " << receive_bps / 1000
- << " kb/s]"
- << " [ratio: " << receive_bps / 1000 << " / "
- << send_bps / 1000 << " = " << ratio << " > kMaxValidRatio ("
- << kMaxValidRatio << ")]";
+ RTC_LOG(LS_INFO) << "Probing unsuccessful, receive/send ratio too high"
+ << " [cluster id: " << cluster_id
+ << "] [send: " << send_size << " bytes / "
+ << send_interval_ms << " ms = " << send_bps / 1000
+ << " kb/s]"
+ << " [receive: " << receive_size << " bytes / "
+ << receive_interval_ms << " ms = " << receive_bps / 1000
+ << " kb/s]"
+ << " [ratio: " << receive_bps / 1000 << " / "
+ << send_bps / 1000 << " = " << ratio
+ << " > kMaxValidRatio (" << kMaxValidRatio << ")]";
if (event_log_) {
event_log_->Log(rtc::MakeUnique<RtcEventProbeResultFailure>(
cluster_id, ProbeFailureReason::kInvalidSendReceiveRatio));
}
return -1;
}
- LOG(LS_INFO) << "Probing successful"
- << " [cluster id: " << cluster_id << "] [send: " << send_size
- << " bytes / " << send_interval_ms << " ms = " << send_bps / 1000
- << " kb/s]"
- << " [receive: " << receive_size << " bytes / "
- << receive_interval_ms << " ms = " << receive_bps / 1000
- << " kb/s]";
+ RTC_LOG(LS_INFO) << "Probing successful"
+ << " [cluster id: " << cluster_id << "] [send: " << send_size
+ << " bytes / " << send_interval_ms
+ << " ms = " << send_bps / 1000 << " kb/s]"
+ << " [receive: " << receive_size << " bytes / "
+ << receive_interval_ms << " ms = " << receive_bps / 1000
+ << " kb/s]";
float res = std::min(send_bps, receive_bps);
// If we're receiving at significantly lower bitrate than we were sending at,
diff --git a/modules/congestion_controller/probe_controller.cc b/modules/congestion_controller/probe_controller.cc
index 0ee0c8f..f50f2cd 100644
--- a/modules/congestion_controller/probe_controller.cc
+++ b/modules/congestion_controller/probe_controller.cc
@@ -159,9 +159,9 @@
if (state_ == State::kWaitingForProbingResult) {
// Continue probing if probing results indicate channel has greater
// capacity.
- LOG(LS_INFO) << "Measured bitrate: " << bitrate_bps
- << " Minimum to probe further: "
- << min_bitrate_to_probe_further_bps_;
+ RTC_LOG(LS_INFO) << "Measured bitrate: " << bitrate_bps
+ << " Minimum to probe further: "
+ << min_bitrate_to_probe_further_bps_;
if (min_bitrate_to_probe_further_bps_ != kExponentialProbingDisabled &&
bitrate_bps > min_bitrate_to_probe_further_bps_) {
@@ -212,7 +212,7 @@
if (min_expected_probe_result_bps > estimated_bitrate_bps_ &&
time_since_drop_ms < kBitrateDropTimeoutMs &&
time_since_probe_ms > kMinTimeBetweenAlrProbesMs) {
- LOG(LS_INFO) << "Detected big bandwidth drop, start probing.";
+ RTC_LOG(LS_INFO) << "Detected big bandwidth drop, start probing.";
// Track how often we probe in response to bandwidth drop in ALR.
RTC_HISTOGRAM_COUNTS_10000(
"WebRTC.BWE.BweDropProbingIntervalInS",
@@ -251,7 +251,7 @@
mid_call_probing_waiting_for_result_ = false;
if (state_ == State::kWaitingForProbingResult) {
- LOG(LS_INFO) << "kWaitingForProbingResult: timeout";
+ RTC_LOG(LS_INFO) << "kWaitingForProbingResult: timeout";
state_ = State::kProbingComplete;
min_bitrate_to_probe_further_bps_ = kExponentialProbingDisabled;
}
diff --git a/modules/congestion_controller/receive_side_congestion_controller.cc b/modules/congestion_controller/receive_side_congestion_controller.cc
index 23610de..11e66ef 100644
--- a/modules/congestion_controller/receive_side_congestion_controller.cc
+++ b/modules/congestion_controller/receive_side_congestion_controller.cc
@@ -83,7 +83,7 @@
if (header.extension.hasAbsoluteSendTime) {
// If we see AST in header, switch RBE strategy immediately.
if (!using_absolute_send_time_) {
- LOG(LS_INFO)
+ RTC_LOG(LS_INFO)
<< "WrappingBitrateEstimator: Switching to absolute send time RBE.";
using_absolute_send_time_ = true;
PickEstimator();
@@ -94,8 +94,9 @@
if (using_absolute_send_time_) {
++packets_since_absolute_send_time_;
if (packets_since_absolute_send_time_ >= kTimeOffsetSwitchThreshold) {
- LOG(LS_INFO) << "WrappingBitrateEstimator: Switching to transmission "
- << "time offset RBE.";
+ RTC_LOG(LS_INFO)
+ << "WrappingBitrateEstimator: Switching to transmission "
+ << "time offset RBE.";
using_absolute_send_time_ = false;
PickEstimator();
}
diff --git a/modules/congestion_controller/send_side_congestion_controller.cc b/modules/congestion_controller/send_side_congestion_controller.cc
index 8eb2140..6c44b3eb 100644
--- a/modules/congestion_controller/send_side_congestion_controller.cc
+++ b/modules/congestion_controller/send_side_congestion_controller.cc
@@ -127,8 +127,8 @@
delay_based_bwe_->SetMinBitrate(min_bitrate_bps_);
if (in_cwnd_experiment_ &&
!ReadCwndExperimentParameter(&accepted_queue_ms_)) {
- LOG(LS_WARNING) << "Failed to parse parameters for CwndExperiment "
- "from field trial string. Experiment disabled.";
+ RTC_LOG(LS_WARNING) << "Failed to parse parameters for CwndExperiment "
+ "from field trial string. Experiment disabled.";
in_cwnd_experiment_ = false;
}
}
@@ -234,8 +234,8 @@
}
void SendSideCongestionController::SignalNetworkState(NetworkState state) {
- LOG(LS_INFO) << "SignalNetworkState "
- << (state == kNetworkUp ? "Up" : "Down");
+ RTC_LOG(LS_INFO) << "SignalNetworkState "
+ << (state == kNetworkUp ? "Up" : "Down");
{
rtc::CritScope cs(&network_state_lock_);
pause_pacer_ = state == kNetworkDown;
@@ -353,12 +353,12 @@
std::max<size_t>((*min_rtt_ms + accepted_queue_ms_) *
last_reported_bitrate_bps_ / 1000 / 8,
kMinCwndBytes);
- LOG(LS_INFO) << clock_->TimeInMilliseconds()
- << " Outstanding bytes: " << num_outstanding_bytes
- << " pacer queue: " << pacer_->QueueInMs()
- << " max outstanding: " << max_outstanding_bytes;
- LOG(LS_INFO) << "Feedback rtt: " << *min_rtt_ms
- << " Bitrate: " << last_reported_bitrate_bps_;
+ RTC_LOG(LS_INFO) << clock_->TimeInMilliseconds()
+ << " Outstanding bytes: " << num_outstanding_bytes
+ << " pacer queue: " << pacer_->QueueInMs()
+ << " max outstanding: " << max_outstanding_bytes;
+ RTC_LOG(LS_INFO) << "Feedback rtt: " << *min_rtt_ms
+ << " Bitrate: " << last_reported_bitrate_bps_;
pause_pacer_ = num_outstanding_bytes > max_outstanding_bytes;
}
@@ -427,8 +427,8 @@
(bitrate_bps > 0 && (last_reported_fraction_loss_ != fraction_loss ||
last_reported_rtt_ != rtt));
if (changed && (last_reported_bitrate_bps_ == 0 || bitrate_bps == 0)) {
- LOG(LS_INFO) << "Bitrate estimate state changed, BWE: " << bitrate_bps
- << " bps.";
+ RTC_LOG(LS_INFO) << "Bitrate estimate state changed, BWE: " << bitrate_bps
+ << " bps.";
}
last_reported_bitrate_bps_ = bitrate_bps;
last_reported_fraction_loss_ = fraction_loss;
diff --git a/modules/congestion_controller/transport_feedback_adapter.cc b/modules/congestion_controller/transport_feedback_adapter.cc
index 100c286..df74789 100644
--- a/modules/congestion_controller/transport_feedback_adapter.cc
+++ b/modules/congestion_controller/transport_feedback_adapter.cc
@@ -127,7 +127,7 @@
std::vector<PacketFeedback> packet_feedback_vector;
if (feedback.GetPacketStatusCount() == 0) {
- LOG(LS_INFO) << "Empty transport feedback packet received.";
+ RTC_LOG(LS_INFO) << "Empty transport feedback packet received.";
return packet_feedback_vector;
}
packet_feedback_vector.reserve(feedback.GetPacketStatusCount());
@@ -174,9 +174,9 @@
}
if (failed_lookups > 0) {
- LOG(LS_WARNING) << "Failed to lookup send time for " << failed_lookups
- << " packet" << (failed_lookups > 1 ? "s" : "")
- << ". Send time history too small?";
+ RTC_LOG(LS_WARNING) << "Failed to lookup send time for " << failed_lookups
+ << " packet" << (failed_lookups > 1 ? "s" : "")
+ << ". Send time history too small?";
}
if (feedback_rtt > -1) {
feedback_rtts_.push_back(feedback_rtt);
diff --git a/modules/desktop_capture/cropping_window_capturer.cc b/modules/desktop_capture/cropping_window_capturer.cc
index bae5106..35008ca 100644
--- a/modules/desktop_capture/cropping_window_capturer.cc
+++ b/modules/desktop_capture/cropping_window_capturer.cc
@@ -77,20 +77,20 @@
DesktopCapturer::Result result,
std::unique_ptr<DesktopFrame> screen_frame) {
if (!ShouldUseScreenCapturer()) {
- LOG(LS_INFO) << "Window no longer on top when ScreenCapturer finishes";
+ RTC_LOG(LS_INFO) << "Window no longer on top when ScreenCapturer finishes";
window_capturer_->CaptureFrame();
return;
}
if (result != Result::SUCCESS) {
- LOG(LS_WARNING) << "ScreenCapturer failed to capture a frame";
+ RTC_LOG(LS_WARNING) << "ScreenCapturer failed to capture a frame";
callback_->OnCaptureResult(result, nullptr);
return;
}
DesktopRect window_rect = GetWindowRectInVirtualScreen();
if (window_rect.is_empty()) {
- LOG(LS_WARNING) << "Window rect is empty";
+ RTC_LOG(LS_WARNING) << "Window rect is empty";
callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr);
return;
}
diff --git a/modules/desktop_capture/cropping_window_capturer_win.cc b/modules/desktop_capture/cropping_window_capturer_win.cc
index fc58697..6707236 100644
--- a/modules/desktop_capture/cropping_window_capturer_win.cc
+++ b/modules/desktop_capture/cropping_window_capturer_win.cc
@@ -243,7 +243,7 @@
DesktopRect window_rect;
HWND hwnd = reinterpret_cast<HWND>(selected_window());
if (!GetCroppedWindowRect(hwnd, &window_rect, /* original_rect */ nullptr)) {
- LOG(LS_WARNING) << "Failed to get window info: " << GetLastError();
+ RTC_LOG(LS_WARNING) << "Failed to get window info: " << GetLastError();
return window_rect;
}
window_rect.IntersectWith(window_region_rect_);
diff --git a/modules/desktop_capture/desktop_frame_win.cc b/modules/desktop_capture/desktop_frame_win.cc
index a6cc52b..fbc1200 100644
--- a/modules/desktop_capture/desktop_frame_win.cc
+++ b/modules/desktop_capture/desktop_frame_win.cc
@@ -56,7 +56,8 @@
HBITMAP bitmap = CreateDIBSection(hdc, &bmi, DIB_RGB_COLORS, &data,
section_handle, 0);
if (!bitmap) {
- LOG(LS_WARNING) << "Failed to allocate new window frame " << GetLastError();
+ RTC_LOG(LS_WARNING) << "Failed to allocate new window frame "
+ << GetLastError();
return nullptr;
}
diff --git a/modules/desktop_capture/mac/desktop_configuration_monitor.cc b/modules/desktop_capture/mac/desktop_configuration_monitor.cc
index b8bcdd9..4eeee32 100644
--- a/modules/desktop_capture/mac/desktop_configuration_monitor.cc
+++ b/modules/desktop_capture/mac/desktop_configuration_monitor.cc
@@ -24,7 +24,7 @@
CGError err = CGDisplayRegisterReconfigurationCallback(
DesktopConfigurationMonitor::DisplaysReconfiguredCallback, this);
if (err != kCGErrorSuccess) {
- LOG(LS_ERROR) << "CGDisplayRegisterReconfigurationCallback " << err;
+ RTC_LOG(LS_ERROR) << "CGDisplayRegisterReconfigurationCallback " << err;
abort();
}
display_configuration_capture_event_->Set();
@@ -37,13 +37,13 @@
CGError err = CGDisplayRemoveReconfigurationCallback(
DesktopConfigurationMonitor::DisplaysReconfiguredCallback, this);
if (err != kCGErrorSuccess)
- LOG(LS_ERROR) << "CGDisplayRemoveReconfigurationCallback " << err;
+ RTC_LOG(LS_ERROR) << "CGDisplayRemoveReconfigurationCallback " << err;
}
void DesktopConfigurationMonitor::Lock() {
if (!display_configuration_capture_event_->Wait(
kDisplayConfigurationEventTimeoutMs)) {
- LOG_F(LS_ERROR) << "Event wait timed out.";
+ RTC_LOG_F(LS_ERROR) << "Event wait timed out.";
abort();
}
}
@@ -72,7 +72,7 @@
// from accessing display memory until the reconfiguration completes.
if (!display_configuration_capture_event_->Wait(
kDisplayConfigurationEventTimeoutMs)) {
- LOG_F(LS_ERROR) << "Event wait timed out.";
+ RTC_LOG_F(LS_ERROR) << "Event wait timed out.";
abort();
}
}
diff --git a/modules/desktop_capture/mac/full_screen_chrome_window_detector.cc b/modules/desktop_capture/mac/full_screen_chrome_window_detector.cc
index 96786ad..a9f334f 100644
--- a/modules/desktop_capture/mac/full_screen_chrome_window_detector.cc
+++ b/modules/desktop_capture/mac/full_screen_chrome_window_detector.cc
@@ -160,7 +160,7 @@
if (static_cast<CGWindowID>(window.id) != full_screen_window_id)
continue;
- LOG(LS_WARNING) << "The full-screen window exists in the list.";
+ RTC_LOG(LS_WARNING) << "The full-screen window exists in the list.";
return kCGNullWindowID;
}
diff --git a/modules/desktop_capture/mouse_cursor_monitor_win.cc b/modules/desktop_capture/mouse_cursor_monitor_win.cc
index 929ff4b..a50743c 100644
--- a/modules/desktop_capture/mouse_cursor_monitor_win.cc
+++ b/modules/desktop_capture/mouse_cursor_monitor_win.cc
@@ -104,7 +104,8 @@
CURSORINFO cursor_info;
cursor_info.cbSize = sizeof(CURSORINFO);
if (!GetCursorInfo(&cursor_info)) {
- LOG_F(LS_ERROR) << "Unable to get cursor info. Error = " << GetLastError();
+ RTC_LOG_F(LS_ERROR) << "Unable to get cursor info. Error = "
+ << GetLastError();
return;
}
diff --git a/modules/desktop_capture/mouse_cursor_monitor_x11.cc b/modules/desktop_capture/mouse_cursor_monitor_x11.cc
index 8435627..aeb864e 100644
--- a/modules/desktop_capture/mouse_cursor_monitor_x11.cc
+++ b/modules/desktop_capture/mouse_cursor_monitor_x11.cc
@@ -39,8 +39,8 @@
unsigned int num_children;
if (!XQueryTree(display, window, &root, &parent, &children,
&num_children)) {
- LOG(LS_ERROR) << "Failed to query for child windows although window"
- << "does not have a valid WM_STATE.";
+ RTC_LOG(LS_ERROR) << "Failed to query for child windows although window"
+ << "does not have a valid WM_STATE.";
return None;
}
if (children)
@@ -148,7 +148,7 @@
CaptureCursor();
} else {
- LOG(LS_INFO) << "X server does not support XFixes.";
+ RTC_LOG(LS_INFO) << "X server does not support XFixes.";
}
}
diff --git a/modules/desktop_capture/screen_capturer_integration_test.cc b/modules/desktop_capture/screen_capturer_integration_test.cc
index 198e764..0104a56 100644
--- a/modules/desktop_capture/screen_capturer_integration_test.cc
+++ b/modules/desktop_capture/screen_capturer_integration_test.cc
@@ -102,13 +102,15 @@
const int kRectSize = 32;
std::unique_ptr<ScreenDrawer> drawer = ScreenDrawer::Create();
if (!drawer || drawer->DrawableRegion().is_empty()) {
- LOG(LS_WARNING) << "No ScreenDrawer implementation for current platform.";
+ RTC_LOG(LS_WARNING)
+ << "No ScreenDrawer implementation for current platform.";
return;
}
if (drawer->DrawableRegion().width() < kTestArea ||
drawer->DrawableRegion().height() < kTestArea) {
- LOG(LS_WARNING) << "ScreenDrawer::DrawableRegion() is too small for the "
- "CaptureUpdatedRegion tests.";
+ RTC_LOG(LS_WARNING)
+ << "ScreenDrawer::DrawableRegion() is too small for the "
+ "CaptureUpdatedRegion tests.";
return;
}
@@ -163,7 +165,7 @@
bool CreateDirectxCapturer() {
if (!ScreenCapturerWinDirectx::IsSupported()) {
- LOG(LS_WARNING) << "Directx capturer is not supported";
+ RTC_LOG(LS_WARNING) << "Directx capturer is not supported";
return false;
}
diff --git a/modules/desktop_capture/screen_capturer_mac.mm b/modules/desktop_capture/screen_capturer_mac.mm
index bd116dd..01911e1 100644
--- a/modules/desktop_capture/screen_capturer_mac.mm
+++ b/modules/desktop_capture/screen_capturer_mac.mm
@@ -484,7 +484,7 @@
if (config) {
displays_to_capture.push_back(*config);
} else {
- LOG(LS_ERROR) << "The selected screen cannot be found for capturing.";
+ RTC_LOG(LS_ERROR) << "The selected screen cannot be found for capturing.";
return false;
}
} else {
@@ -547,9 +547,8 @@
// Verify that the image has 32-bit depth.
int bits_per_pixel = CGImageGetBitsPerPixel(image);
if (bits_per_pixel / 8 != DesktopFrame::kBytesPerPixel) {
- LOG(LS_ERROR) << "CGDisplayCreateImage() returned imaged with "
- << bits_per_pixel
- << " bits per pixel. Only 32-bit depth is supported.";
+ RTC_LOG(LS_ERROR) << "CGDisplayCreateImage() returned imaged with " << bits_per_pixel
+ << " bits per pixel. Only 32-bit depth is supported.";
CFRelease(image);
if (excluded_image)
CFRelease(excluded_image);
diff --git a/modules/desktop_capture/screen_capturer_unittest.cc b/modules/desktop_capture/screen_capturer_unittest.cc
index d8123ca..9ed4f4c 100644
--- a/modules/desktop_capture/screen_capturer_unittest.cc
+++ b/modules/desktop_capture/screen_capturer_unittest.cc
@@ -51,7 +51,7 @@
bool CreateDirectxCapturer() {
if (!ScreenCapturerWinDirectx::IsSupported()) {
- LOG(LS_WARNING) << "Directx capturer is not supported";
+ RTC_LOG(LS_WARNING) << "Directx capturer is not supported";
return false;
}
diff --git a/modules/desktop_capture/screen_capturer_x11.cc b/modules/desktop_capture/screen_capturer_x11.cc
index 0a860a5..3acd2a8 100644
--- a/modules/desktop_capture/screen_capturer_x11.cc
+++ b/modules/desktop_capture/screen_capturer_x11.cc
@@ -138,14 +138,14 @@
root_window_ = RootWindow(display(), DefaultScreen(display()));
if (root_window_ == BadValue) {
- LOG(LS_ERROR) << "Unable to get the root window";
+ RTC_LOG(LS_ERROR) << "Unable to get the root window";
DeinitXlib();
return false;
}
gc_ = XCreateGC(display(), root_window_, 0, NULL);
if (gc_ == NULL) {
- LOG(LS_ERROR) << "Unable to get graphics context";
+ RTC_LOG(LS_ERROR) << "Unable to get graphics context";
DeinitXlib();
return false;
}
@@ -158,14 +158,14 @@
&xfixes_error_base_)) {
has_xfixes_ = true;
} else {
- LOG(LS_INFO) << "X server does not support XFixes.";
+ RTC_LOG(LS_INFO) << "X server does not support XFixes.";
}
// Register for changes to the dimensions of the root window.
XSelectInput(display(), root_window_, StructureNotifyMask);
if (!x_server_pixel_buffer_.Init(display(), DefaultRootWindow(display()))) {
- LOG(LS_ERROR) << "Failed to initialize pixel buffer.";
+ RTC_LOG(LS_ERROR) << "Failed to initialize pixel buffer.";
return false;
}
@@ -185,7 +185,7 @@
// Check for XDamage extension.
if (!XDamageQueryExtension(display(), &damage_event_base_,
&damage_error_base_)) {
- LOG(LS_INFO) << "X server does not support XDamage.";
+ RTC_LOG(LS_INFO) << "X server does not support XDamage.";
return;
}
@@ -198,7 +198,7 @@
damage_handle_ = XDamageCreate(display(), root_window_,
XDamageReportNonEmpty);
if (!damage_handle_) {
- LOG(LS_ERROR) << "Unable to initialize XDamage.";
+ RTC_LOG(LS_ERROR) << "Unable to initialize XDamage.";
return;
}
@@ -206,7 +206,7 @@
damage_region_ = XFixesCreateRegion(display(), 0, 0);
if (!damage_region_) {
XDamageDestroy(display(), damage_handle_);
- LOG(LS_ERROR) << "Unable to create XFixes region.";
+ RTC_LOG(LS_ERROR) << "Unable to create XFixes region.";
return;
}
@@ -214,7 +214,7 @@
damage_event_base_ + XDamageNotify, this);
use_damage_ = true;
- LOG(LS_INFO) << "Using XDamage extension.";
+ RTC_LOG(LS_INFO) << "Using XDamage extension.";
}
void ScreenCapturerLinux::Start(Callback* callback) {
@@ -354,8 +354,8 @@
helper_.ClearInvalidRegion();
if (!x_server_pixel_buffer_.Init(display(), DefaultRootWindow(display()))) {
- LOG(LS_ERROR) << "Failed to initialize pixel buffer after screen "
- "configuration change.";
+ RTC_LOG(LS_ERROR) << "Failed to initialize pixel buffer after screen "
+ "configuration change.";
}
}
diff --git a/modules/desktop_capture/screen_drawer_lock_posix.cc b/modules/desktop_capture/screen_drawer_lock_posix.cc
index 0f6c38a..095189b 100644
--- a/modules/desktop_capture/screen_drawer_lock_posix.cc
+++ b/modules/desktop_capture/screen_drawer_lock_posix.cc
@@ -31,7 +31,7 @@
ScreenDrawerLockPosix::ScreenDrawerLockPosix(const char* name) {
semaphore_ = sem_open(name, O_CREAT, S_IRWXU | S_IRWXG | S_IRWXO, 1);
if (semaphore_ == SEM_FAILED) {
- LOG_ERRNO(LS_ERROR) << "Failed to create named semaphore with " << name;
+ RTC_LOG_ERRNO(LS_ERROR) << "Failed to create named semaphore with " << name;
RTC_NOTREACHED();
}
diff --git a/modules/desktop_capture/screen_drawer_unittest.cc b/modules/desktop_capture/screen_drawer_unittest.cc
index b30e900..349edbc 100644
--- a/modules/desktop_capture/screen_drawer_unittest.cc
+++ b/modules/desktop_capture/screen_drawer_unittest.cc
@@ -109,13 +109,15 @@
TEST(ScreenDrawerTest, DISABLED_DrawRectangles) {
std::unique_ptr<ScreenDrawer> drawer = ScreenDrawer::Create();
if (!drawer) {
- LOG(LS_WARNING) << "No ScreenDrawer implementation for current platform.";
+ RTC_LOG(LS_WARNING)
+ << "No ScreenDrawer implementation for current platform.";
return;
}
if (drawer->DrawableRegion().is_empty()) {
- LOG(LS_WARNING) << "ScreenDrawer of current platform does not provide a "
- "non-empty DrawableRegion().";
+ RTC_LOG(LS_WARNING)
+ << "ScreenDrawer of current platform does not provide a "
+ "non-empty DrawableRegion().";
return;
}
diff --git a/modules/desktop_capture/win/cursor.cc b/modules/desktop_capture/win/cursor.cc
index 7b9f5b5..38dc02b 100644
--- a/modules/desktop_capture/win/cursor.cc
+++ b/modules/desktop_capture/win/cursor.cc
@@ -112,8 +112,8 @@
MouseCursor* CreateMouseCursorFromHCursor(HDC dc, HCURSOR cursor) {
ICONINFO iinfo;
if (!GetIconInfo(cursor, &iinfo)) {
- LOG_F(LS_ERROR) << "Unable to get cursor icon info. Error = "
- << GetLastError();
+ RTC_LOG_F(LS_ERROR) << "Unable to get cursor icon info. Error = "
+ << GetLastError();
return NULL;
}
@@ -128,8 +128,8 @@
// Get |scoped_mask| dimensions.
BITMAP bitmap_info;
if (!GetObject(scoped_mask, sizeof(bitmap_info), &bitmap_info)) {
- LOG_F(LS_ERROR) << "Unable to get bitmap info. Error = "
- << GetLastError();
+ RTC_LOG_F(LS_ERROR) << "Unable to get bitmap info. Error = "
+ << GetLastError();
return NULL;
}
@@ -156,8 +156,8 @@
mask_data.get(),
reinterpret_cast<BITMAPINFO*>(&bmi),
DIB_RGB_COLORS)) {
- LOG_F(LS_ERROR) << "Unable to get bitmap bits. Error = "
- << GetLastError();
+ RTC_LOG_F(LS_ERROR) << "Unable to get bitmap bits. Error = "
+ << GetLastError();
return NULL;
}
@@ -176,8 +176,8 @@
image->data(),
reinterpret_cast<BITMAPINFO*>(&bmi),
DIB_RGB_COLORS)) {
- LOG_F(LS_ERROR) << "Unable to get bitmap bits. Error = "
- << GetLastError();
+ RTC_LOG_F(LS_ERROR) << "Unable to get bitmap bits. Error = "
+ << GetLastError();
return NULL;
}
diff --git a/modules/desktop_capture/win/d3d_device.cc b/modules/desktop_capture/win/d3d_device.cc
index 23b5474..c2b78c1 100644
--- a/modules/desktop_capture/win/d3d_device.cc
+++ b/modules/desktop_capture/win/d3d_device.cc
@@ -26,7 +26,7 @@
bool D3dDevice::Initialize(const ComPtr<IDXGIAdapter>& adapter) {
dxgi_adapter_ = adapter;
if (!dxgi_adapter_) {
- LOG(LS_WARNING) << "An empty IDXGIAdapter instance has been received.";
+ RTC_LOG(LS_WARNING) << "An empty IDXGIAdapter instance has been received.";
return false;
}
@@ -38,25 +38,28 @@
nullptr, 0, D3D11_SDK_VERSION, d3d_device_.GetAddressOf(), &feature_level,
context_.GetAddressOf());
if (error.Error() != S_OK || !d3d_device_ || !context_) {
- LOG(LS_WARNING) << "D3D11CreateDeivce returns error "
- << error.ErrorMessage() << " with code " << error.Error();
+ RTC_LOG(LS_WARNING) << "D3D11CreateDeivce returns error "
+ << error.ErrorMessage() << " with code "
+ << error.Error();
return false;
}
if (feature_level < D3D_FEATURE_LEVEL_11_0) {
- LOG(LS_WARNING) << "D3D11CreateDevice returns an instance without DirectX "
- "11 support, level " << feature_level
- << ". Following initialization may fail.";
+ RTC_LOG(LS_WARNING)
+ << "D3D11CreateDevice returns an instance without DirectX "
+ "11 support, level "
+ << feature_level << ". Following initialization may fail.";
// D3D_FEATURE_LEVEL_11_0 is not officially documented on MSDN to be a
// requirement of Dxgi duplicator APIs.
}
error = d3d_device_.As(&dxgi_device_);
if (error.Error() != S_OK || !dxgi_device_) {
- LOG(LS_WARNING) << "ID3D11Device is not an implementation of IDXGIDevice, "
- "this usually means the system does not support DirectX "
- "11. Error "
- << error.ErrorMessage() << " with code " << error.Error();
+ RTC_LOG(LS_WARNING)
+ << "ID3D11Device is not an implementation of IDXGIDevice, "
+ "this usually means the system does not support DirectX "
+ "11. Error "
+ << error.ErrorMessage() << " with code " << error.Error();
return false;
}
@@ -69,7 +72,7 @@
_com_error error = CreateDXGIFactory1(__uuidof(IDXGIFactory1),
reinterpret_cast<void**>(factory.GetAddressOf()));
if (error.Error() != S_OK || !factory) {
- LOG(LS_WARNING) << "Cannot create IDXGIFactory1.";
+ RTC_LOG(LS_WARNING) << "Cannot create IDXGIFactory1.";
return std::vector<D3dDevice>();
}
@@ -85,9 +88,10 @@
} else if (error.Error() == DXGI_ERROR_NOT_FOUND) {
break;
} else {
- LOG(LS_WARNING) << "IDXGIFactory1::EnumAdapters returns an unexpected "
- "error "
- << error.ErrorMessage() << " with code " << error.Error();
+ RTC_LOG(LS_WARNING)
+ << "IDXGIFactory1::EnumAdapters returns an unexpected "
+ "error "
+ << error.ErrorMessage() << " with code " << error.Error();
}
}
return result;
diff --git a/modules/desktop_capture/win/desktop.cc b/modules/desktop_capture/win/desktop.cc
index 0df509e..34842b3 100644
--- a/modules/desktop_capture/win/desktop.cc
+++ b/modules/desktop_capture/win/desktop.cc
@@ -22,8 +22,8 @@
Desktop::~Desktop() {
if (own_ && desktop_ != NULL) {
if (!::CloseDesktop(desktop_)) {
- LOG(LS_ERROR) << "Failed to close the owned desktop handle: "
- << GetLastError();
+ RTC_LOG(LS_ERROR) << "Failed to close the owned desktop handle: "
+ << GetLastError();
}
}
}
@@ -41,7 +41,7 @@
std::vector<WCHAR> buffer(length);
if (!GetUserObjectInformationW(desktop_, UOI_NAME, &buffer[0],
length * sizeof(WCHAR), &length)) {
- LOG(LS_ERROR) << "Failed to query the desktop name: " << GetLastError();
+ RTC_LOG(LS_ERROR) << "Failed to query the desktop name: " << GetLastError();
return false;
}
@@ -63,8 +63,8 @@
bool Desktop::SetThreadDesktop() const {
if (!::SetThreadDesktop(desktop_)) {
- LOG(LS_ERROR) << "Failed to assign the desktop to the current thread: "
- << GetLastError();
+ RTC_LOG(LS_ERROR) << "Failed to assign the desktop to the current thread: "
+ << GetLastError();
return false;
}
@@ -78,8 +78,8 @@
DESKTOP_SWITCHDESKTOP | GENERIC_WRITE;
HDESK desktop = OpenDesktop(desktop_name, 0, FALSE, desired_access);
if (desktop == NULL) {
- LOG(LS_ERROR) << "Failed to open the desktop '" << desktop_name << "': "
- << GetLastError();
+ RTC_LOG(LS_ERROR) << "Failed to open the desktop '" << desktop_name
+ << "': " << GetLastError();
return NULL;
}
@@ -98,9 +98,10 @@
Desktop* Desktop::GetThreadDesktop() {
HDESK desktop = ::GetThreadDesktop(GetCurrentThreadId());
if (desktop == NULL) {
- LOG(LS_ERROR) << "Failed to retrieve the handle of the desktop assigned to "
- "the current thread: "
- << GetLastError();
+ RTC_LOG(LS_ERROR)
+ << "Failed to retrieve the handle of the desktop assigned to "
+ "the current thread: "
+ << GetLastError();
return NULL;
}
diff --git a/modules/desktop_capture/win/dxgi_adapter_duplicator.cc b/modules/desktop_capture/win/dxgi_adapter_duplicator.cc
index 959f969..c4cd982 100644
--- a/modules/desktop_capture/win/dxgi_adapter_duplicator.cc
+++ b/modules/desktop_capture/win/dxgi_adapter_duplicator.cc
@@ -53,17 +53,17 @@
}
if (error.Error() == DXGI_ERROR_NOT_CURRENTLY_AVAILABLE) {
- LOG(LS_WARNING) << "IDXGIAdapter::EnumOutputs returns "
- "NOT_CURRENTLY_AVAILABLE. This may happen when "
- "running in session 0.";
+ RTC_LOG(LS_WARNING) << "IDXGIAdapter::EnumOutputs returns "
+ "NOT_CURRENTLY_AVAILABLE. This may happen when "
+ "running in session 0.";
break;
}
if (error.Error() != S_OK || !output) {
- LOG(LS_WARNING) << "IDXGIAdapter::EnumOutputs returns an unexpected "
- "result "
- << error.ErrorMessage() << " with error code"
- << error.Error();
+ RTC_LOG(LS_WARNING) << "IDXGIAdapter::EnumOutputs returns an unexpected "
+ "result "
+ << error.ErrorMessage() << " with error code"
+ << error.Error();
continue;
}
@@ -74,36 +74,39 @@
ComPtr<IDXGIOutput1> output1;
error = output.As(&output1);
if (error.Error() != S_OK || !output1) {
- LOG(LS_WARNING) << "Failed to convert IDXGIOutput to IDXGIOutput1, "
- "this usually means the system does not support "
- "DirectX 11";
+ RTC_LOG(LS_WARNING)
+ << "Failed to convert IDXGIOutput to IDXGIOutput1, "
+ "this usually means the system does not support "
+ "DirectX 11";
continue;
}
DxgiOutputDuplicator duplicator(device_, output1, desc);
if (!duplicator.Initialize()) {
- LOG(LS_WARNING) << "Failed to initialize DxgiOutputDuplicator on "
- "output "
- << i;
+ RTC_LOG(LS_WARNING) << "Failed to initialize DxgiOutputDuplicator on "
+ "output "
+ << i;
continue;
}
duplicators_.push_back(std::move(duplicator));
desktop_rect_.UnionWith(duplicators_.back().desktop_rect());
} else {
- LOG(LS_ERROR) << (desc.AttachedToDesktop ? "Attached" : "Detached")
- << " output " << i << " (" << desc.DesktopCoordinates.top
- << ", " << desc.DesktopCoordinates.left << ") - ("
- << desc.DesktopCoordinates.bottom << ", "
- << desc.DesktopCoordinates.right << ") is ignored.";
+ RTC_LOG(LS_ERROR) << (desc.AttachedToDesktop ? "Attached" : "Detached")
+ << " output " << i << " ("
+ << desc.DesktopCoordinates.top << ", "
+ << desc.DesktopCoordinates.left << ") - ("
+ << desc.DesktopCoordinates.bottom << ", "
+ << desc.DesktopCoordinates.right << ") is ignored.";
}
} else {
- LOG(LS_WARNING) << "Failed to get output description of device " << i
- << ", ignore.";
+ RTC_LOG(LS_WARNING) << "Failed to get output description of device " << i
+ << ", ignore.";
}
}
if (duplicators_.empty()) {
- LOG(LS_WARNING) << "Cannot initialize any DxgiOutputDuplicator instance.";
+ RTC_LOG(LS_WARNING)
+ << "Cannot initialize any DxgiOutputDuplicator instance.";
}
return !duplicators_.empty();
diff --git a/modules/desktop_capture/win/dxgi_duplicator_controller.cc b/modules/desktop_capture/win/dxgi_duplicator_controller.cc
index 2fe5e0c..2da12a6 100644
--- a/modules/desktop_capture/win/dxgi_duplicator_controller.cc
+++ b/modules/desktop_capture/win/dxgi_duplicator_controller.cc
@@ -59,8 +59,9 @@
bool DxgiDuplicatorController::IsCurrentSessionSupported() {
DWORD session_id = 0;
if (!::ProcessIdToSessionId(::GetCurrentProcessId(), &session_id)) {
- LOG(LS_WARNING) << "Failed to retrieve current session Id, current binary "
- "may not have required priviledge.";
+ RTC_LOG(LS_WARNING)
+ << "Failed to retrieve current session Id, current binary "
+ "may not have required priviledge.";
return false;
}
return session_id != 0;
@@ -78,8 +79,8 @@
int refcount = (--refcount_);
RTC_DCHECK(refcount >= 0);
if (refcount == 0) {
- LOG(LS_WARNING) << "Count of references reaches zero, "
- "DxgiDuplicatorController will be unloaded.";
+ RTC_LOG(LS_WARNING) << "Count of references reaches zero, "
+ "DxgiDuplicatorController will be unloaded.";
Unload();
}
}
@@ -97,8 +98,8 @@
*info = d3d_info_;
}
if (!result) {
- LOG(LS_WARNING) << "Failed to initialize DXGI components, the D3dInfo "
- "retrieved may not accurate or out of date.";
+ RTC_LOG(LS_WARNING) << "Failed to initialize DXGI components, the D3dInfo "
+ "retrieved may not accurate or out of date.";
}
return result;
}
@@ -164,8 +165,8 @@
if (!Initialize()) {
if (succeeded_duplications_ == 0 && !IsCurrentSessionSupported()) {
- LOG(LS_WARNING) << "Current binary is running in session 0. DXGI "
- "components cannot be initialized.";
+ RTC_LOG(LS_WARNING) << "Current binary is running in session 0. DXGI "
+ "components cannot be initialized.";
return Result::UNSUPPORTED_SESSION;
}
@@ -233,7 +234,7 @@
std::vector<D3dDevice> devices = D3dDevice::EnumDevices();
if (devices.empty()) {
- LOG(LS_WARNING) << "No D3dDevice found.";
+ RTC_LOG(LS_WARNING) << "No D3dDevice found.";
return false;
}
@@ -255,9 +256,9 @@
// taking effect, so we should continually try other adapters. This usually
// happens when a non-official virtual adapter is installed on the system.
if (!duplicator.Initialize()) {
- LOG(LS_WARNING) << "Failed to initialize DxgiAdapterDuplicator on "
- "adapter "
- << i;
+ RTC_LOG(LS_WARNING) << "Failed to initialize DxgiAdapterDuplicator on "
+ "adapter "
+ << i;
continue;
}
RTC_DCHECK(!duplicator.desktop_rect().is_empty());
@@ -277,7 +278,8 @@
identity_++;
if (duplicators_.empty()) {
- LOG(LS_WARNING) << "Cannot initialize any DxgiAdapterDuplicator instance.";
+ RTC_LOG(LS_WARNING)
+ << "Cannot initialize any DxgiAdapterDuplicator instance.";
}
return !duplicators_.empty();
@@ -460,8 +462,10 @@
return false;
}
if (rtc::TimeMillis() - start_ms > timeout_ms) {
- LOG(LS_ERROR) << "Failed to capture " << frames_to_skip << " frames "
- "within " << timeout_ms << " milliseconds.";
+ RTC_LOG(LS_ERROR) << "Failed to capture " << frames_to_skip
+ << " frames "
+ "within "
+ << timeout_ms << " milliseconds.";
return false;
}
}
diff --git a/modules/desktop_capture/win/dxgi_frame.cc b/modules/desktop_capture/win/dxgi_frame.cc
index 453905a..b51fcca 100644
--- a/modules/desktop_capture/win/dxgi_frame.cc
+++ b/modules/desktop_capture/win/dxgi_frame.cc
@@ -46,7 +46,7 @@
frame.reset(new BasicDesktopFrame(size));
}
if (!frame) {
- LOG(LS_WARNING) << "DxgiFrame cannot create a new DesktopFrame.";
+ RTC_LOG(LS_WARNING) << "DxgiFrame cannot create a new DesktopFrame.";
return false;
}
// DirectX capturer won't paint each pixel in the frame due to its one
diff --git a/modules/desktop_capture/win/dxgi_output_duplicator.cc b/modules/desktop_capture/win/dxgi_output_duplicator.cc
index ae1c000..b920821 100644
--- a/modules/desktop_capture/win/dxgi_output_duplicator.cc
+++ b/modules/desktop_capture/win/dxgi_output_duplicator.cc
@@ -103,28 +103,30 @@
output_->DuplicateOutput(static_cast<IUnknown*>(device_.d3d_device()),
duplication_.GetAddressOf());
if (error.Error() != S_OK || !duplication_) {
- LOG(LS_WARNING) << "Failed to duplicate output from IDXGIOutput1, error "
- << error.ErrorMessage() << ", with code " << error.Error();
+ RTC_LOG(LS_WARNING)
+ << "Failed to duplicate output from IDXGIOutput1, error "
+ << error.ErrorMessage() << ", with code " << error.Error();
return false;
}
memset(&desc_, 0, sizeof(desc_));
duplication_->GetDesc(&desc_);
if (desc_.ModeDesc.Format != DXGI_FORMAT_B8G8R8A8_UNORM) {
- LOG(LS_ERROR) << "IDXGIDuplicateOutput does not use RGBA (8 bit) "
- "format, which is required by downstream components, "
- "format is "
- << desc_.ModeDesc.Format;
+ RTC_LOG(LS_ERROR) << "IDXGIDuplicateOutput does not use RGBA (8 bit) "
+ "format, which is required by downstream components, "
+ "format is "
+ << desc_.ModeDesc.Format;
return false;
}
if (static_cast<int>(desc_.ModeDesc.Width) != desktop_rect_.width() ||
static_cast<int>(desc_.ModeDesc.Height) != desktop_rect_.height()) {
- LOG(LS_ERROR) << "IDXGIDuplicateOutput does not return a same size as its "
- "IDXGIOutput1, size returned by IDXGIDuplicateOutput is "
- << desc_.ModeDesc.Width << " x " << desc_.ModeDesc.Height
- << ", size returned by IDXGIOutput1 is "
- << desktop_rect_.width() << " x " << desktop_rect_.height();
+ RTC_LOG(LS_ERROR)
+ << "IDXGIDuplicateOutput does not return a same size as its "
+ "IDXGIOutput1, size returned by IDXGIDuplicateOutput is "
+ << desc_.ModeDesc.Width << " x " << desc_.ModeDesc.Height
+ << ", size returned by IDXGIOutput1 is " << desktop_rect_.width()
+ << " x " << desktop_rect_.height();
return false;
}
@@ -138,9 +140,9 @@
RTC_DCHECK(duplication_);
_com_error error = duplication_->ReleaseFrame();
if (error.Error() != S_OK) {
- LOG(LS_ERROR) << "Failed to release frame from IDXGIOutputDuplication, "
- "error"
- << error.ErrorMessage() << ", code " << error.Error();
+ RTC_LOG(LS_ERROR) << "Failed to release frame from IDXGIOutputDuplication, "
+ "error"
+ << error.ErrorMessage() << ", code " << error.Error();
return false;
}
return true;
@@ -164,8 +166,8 @@
_com_error error = duplication_->AcquireNextFrame(
kAcquireTimeoutMs, &frame_info, resource.GetAddressOf());
if (error.Error() != S_OK && error.Error() != DXGI_ERROR_WAIT_TIMEOUT) {
- LOG(LS_ERROR) << "Failed to capture frame, error " << error.ErrorMessage()
- << ", code " << error.Error();
+ RTC_LOG(LS_ERROR) << "Failed to capture frame, error "
+ << error.ErrorMessage() << ", code " << error.Error();
return false;
}
@@ -268,8 +270,8 @@
updated_region->Clear();
if (frame_info.TotalMetadataBufferSize == 0) {
// This should not happen, since frame_info.AccumulatedFrames > 0.
- LOG(LS_ERROR) << "frame_info.AccumulatedFrames > 0, "
- "but TotalMetadataBufferSize == 0";
+ RTC_LOG(LS_ERROR) << "frame_info.AccumulatedFrames > 0, "
+ "but TotalMetadataBufferSize == 0";
return false;
}
@@ -285,8 +287,8 @@
_com_error error = duplication_->GetFrameMoveRects(
static_cast<UINT>(metadata_.capacity()), move_rects, &buff_size);
if (error.Error() != S_OK) {
- LOG(LS_ERROR) << "Failed to get move rectangles, error "
- << error.ErrorMessage() << ", code " << error.Error();
+ RTC_LOG(LS_ERROR) << "Failed to get move rectangles, error "
+ << error.ErrorMessage() << ", code " << error.Error();
return false;
}
move_rects_count = buff_size / sizeof(DXGI_OUTDUPL_MOVE_RECT);
@@ -297,8 +299,8 @@
static_cast<UINT>(metadata_.capacity()) - buff_size, dirty_rects,
&buff_size);
if (error.Error() != S_OK) {
- LOG(LS_ERROR) << "Failed to get dirty rectangles, error "
- << error.ErrorMessage() << ", code " << error.Error();
+ RTC_LOG(LS_ERROR) << "Failed to get dirty rectangles, error "
+ << error.ErrorMessage() << ", code " << error.Error();
return false;
}
dirty_rects_count = buff_size / sizeof(RECT);
@@ -327,11 +329,11 @@
move_rects->DestinationRect.bottom),
unrotated_size_, rotation_));
} else {
- LOG(LS_INFO) << "Unmoved move_rect detected, ["
- << move_rects->DestinationRect.left << ", "
- << move_rects->DestinationRect.top << "] - ["
- << move_rects->DestinationRect.right << ", "
- << move_rects->DestinationRect.bottom << "].";
+ RTC_LOG(LS_INFO) << "Unmoved move_rect detected, ["
+ << move_rects->DestinationRect.left << ", "
+ << move_rects->DestinationRect.top << "] - ["
+ << move_rects->DestinationRect.right << ", "
+ << move_rects->DestinationRect.bottom << "].";
}
move_rects++;
move_rects_count--;
diff --git a/modules/desktop_capture/win/dxgi_texture.cc b/modules/desktop_capture/win/dxgi_texture.cc
index f0942a9..8f1d034 100644
--- a/modules/desktop_capture/win/dxgi_texture.cc
+++ b/modules/desktop_capture/win/dxgi_texture.cc
@@ -49,9 +49,9 @@
__uuidof(ID3D11Texture2D),
reinterpret_cast<void**>(texture.GetAddressOf()));
if (error.Error() != S_OK || !texture) {
- LOG(LS_ERROR) << "Failed to convert IDXGIResource to ID3D11Texture2D, "
- "error "
- << error.ErrorMessage() << ", code " << error.Error();
+ RTC_LOG(LS_ERROR) << "Failed to convert IDXGIResource to ID3D11Texture2D, "
+ "error "
+ << error.ErrorMessage() << ", code " << error.Error();
return false;
}
diff --git a/modules/desktop_capture/win/dxgi_texture_mapping.cc b/modules/desktop_capture/win/dxgi_texture_mapping.cc
index 0105195..dfe8259 100644
--- a/modules/desktop_capture/win/dxgi_texture_mapping.cc
+++ b/modules/desktop_capture/win/dxgi_texture_mapping.cc
@@ -35,9 +35,10 @@
_com_error error = duplication_->MapDesktopSurface(rect());
if (error.Error() != S_OK) {
*rect() = {0};
- LOG(LS_ERROR) << "Failed to map the IDXGIOutputDuplication to a bitmap, "
- "error "
- << error.ErrorMessage() << ", code " << error.Error();
+ RTC_LOG(LS_ERROR)
+ << "Failed to map the IDXGIOutputDuplication to a bitmap, "
+ "error "
+ << error.ErrorMessage() << ", code " << error.Error();
return false;
}
@@ -47,8 +48,8 @@
bool DxgiTextureMapping::DoRelease() {
_com_error error = duplication_->UnMapDesktopSurface();
if (error.Error() != S_OK) {
- LOG(LS_ERROR) << "Failed to unmap the IDXGIOutputDuplication, error "
- << error.ErrorMessage() << ", code " << error.Error();
+ RTC_LOG(LS_ERROR) << "Failed to unmap the IDXGIOutputDuplication, error "
+ << error.ErrorMessage() << ", code " << error.Error();
return false;
}
return true;
diff --git a/modules/desktop_capture/win/dxgi_texture_staging.cc b/modules/desktop_capture/win/dxgi_texture_staging.cc
index 5741b88..e3e9157 100644
--- a/modules/desktop_capture/win/dxgi_texture_staging.cc
+++ b/modules/desktop_capture/win/dxgi_texture_staging.cc
@@ -64,15 +64,17 @@
_com_error error = device_.d3d_device()->CreateTexture2D(
&desc, nullptr, stage_.GetAddressOf());
if (error.Error() != S_OK || !stage_) {
- LOG(LS_ERROR) << "Failed to create a new ID3D11Texture2D as stage, error "
- << error.ErrorMessage() << ", code " << error.Error();
+ RTC_LOG(LS_ERROR)
+ << "Failed to create a new ID3D11Texture2D as stage, error "
+ << error.ErrorMessage() << ", code " << error.Error();
return false;
}
error = stage_.As(&surface_);
if (error.Error() != S_OK || !surface_) {
- LOG(LS_ERROR) << "Failed to convert ID3D11Texture2D to IDXGISurface, error "
- << error.ErrorMessage() << ", code " << error.Error();
+ RTC_LOG(LS_ERROR)
+ << "Failed to convert ID3D11Texture2D to IDXGISurface, error "
+ << error.ErrorMessage() << ", code " << error.Error();
return false;
}
@@ -108,8 +110,8 @@
_com_error error = surface_->Map(rect(), DXGI_MAP_READ);
if (error.Error() != S_OK) {
*rect() = {0};
- LOG(LS_ERROR) << "Failed to map the IDXGISurface to a bitmap, error "
- << error.ErrorMessage() << ", code " << error.Error();
+ RTC_LOG(LS_ERROR) << "Failed to map the IDXGISurface to a bitmap, error "
+ << error.ErrorMessage() << ", code " << error.Error();
return false;
}
diff --git a/modules/desktop_capture/win/screen_capturer_win_directx.cc b/modules/desktop_capture/win/screen_capturer_win_directx.cc
index 5356ad3..b03d2e1 100644
--- a/modules/desktop_capture/win/screen_capturer_win_directx.cc
+++ b/modules/desktop_capture/win/screen_capturer_win_directx.cc
@@ -136,26 +136,27 @@
using DuplicateResult = DxgiDuplicatorController::Result;
if (result != DuplicateResult::SUCCEEDED) {
- LOG(LS_ERROR) << "DxgiDuplicatorController failed to capture desktop, "
- "error code "
- << DxgiDuplicatorController::ResultName(result);
+ RTC_LOG(LS_ERROR) << "DxgiDuplicatorController failed to capture desktop, "
+ "error code "
+ << DxgiDuplicatorController::ResultName(result);
}
switch (result) {
case DuplicateResult::UNSUPPORTED_SESSION: {
- LOG(LS_ERROR) << "Current binary is running on a session not supported "
- "by DirectX screen capturer.";
+ RTC_LOG(LS_ERROR)
+ << "Current binary is running on a session not supported "
+ "by DirectX screen capturer.";
callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr);
break;
}
case DuplicateResult::FRAME_PREPARE_FAILED: {
- LOG(LS_ERROR) << "Failed to allocate a new DesktopFrame.";
+ RTC_LOG(LS_ERROR) << "Failed to allocate a new DesktopFrame.";
// This usually means we do not have enough memory or SharedMemoryFactory
// cannot work correctly.
callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr);
break;
}
case DuplicateResult::INVALID_MONITOR_ID: {
- LOG(LS_ERROR) << "Invalid monitor id " << current_screen_id_;
+ RTC_LOG(LS_ERROR) << "Invalid monitor id " << current_screen_id_;
callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr);
break;
}
diff --git a/modules/desktop_capture/win/screen_capturer_win_gdi.cc b/modules/desktop_capture/win/screen_capturer_win_gdi.cc
index ab5a156..2c299fc 100644
--- a/modules/desktop_capture/win/screen_capturer_win_gdi.cc
+++ b/modules/desktop_capture/win/screen_capturer_win_gdi.cc
@@ -211,7 +211,7 @@
screen_rect.height(), desktop_dc_, screen_rect.left(), screen_rect.top(),
SRCCOPY | CAPTUREBLT) != FALSE);
if (!result) {
- LOG_GLE(LS_WARNING) << "BitBlt failed";
+ RTC_LOG_GLE(LS_WARNING) << "BitBlt failed";
}
// Select back the previously selected object to that the device contect
diff --git a/modules/desktop_capture/win/screen_capturer_win_magnifier.cc b/modules/desktop_capture/win/screen_capturer_win_magnifier.cc
index 36261ab..d52b028 100644
--- a/modules/desktop_capture/win/screen_capturer_win_magnifier.cc
+++ b/modules/desktop_capture/win/screen_capturer_win_magnifier.cc
@@ -65,7 +65,7 @@
callback_ = callback;
if (!InitializeMagnifier()) {
- LOG_F(LS_WARNING) << "Magnifier initialization failed.";
+ RTC_LOG_F(LS_WARNING) << "Magnifier initialization failed.";
}
}
@@ -77,7 +77,7 @@
void ScreenCapturerWinMagnifier::CaptureFrame() {
RTC_DCHECK(callback_);
if (!magnifier_initialized_) {
- LOG_F(LS_WARNING) << "Magnifier initialization failed.";
+ RTC_LOG_F(LS_WARNING) << "Magnifier initialization failed.";
callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr);
return;
}
@@ -104,7 +104,7 @@
// CaptureImage may fail in some situations, e.g. windows8 metro mode. So
// defer to the fallback capturer if magnifier capturer did not work.
if (!CaptureImage(rect)) {
- LOG_F(LS_WARNING) << "Magnifier capturer failed to capture a frame.";
+ RTC_LOG_F(LS_WARNING) << "Magnifier capturer failed to capture a frame.";
callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr);
return;
}
@@ -149,9 +149,10 @@
BOOL result = SetWindowPos(magnifier_window_, NULL, rect.left(), rect.top(),
rect.width(), rect.height(), 0);
if (!result) {
- LOG_F(LS_WARNING) << "Failed to call SetWindowPos: " << GetLastError()
- << ". Rect = {" << rect.left() << ", " << rect.top()
- << ", " << rect.right() << ", " << rect.bottom() << "}";
+ RTC_LOG_F(LS_WARNING) << "Failed to call SetWindowPos: " << GetLastError()
+ << ". Rect = {" << rect.left() << ", " << rect.top()
+ << ", " << rect.right() << ", " << rect.bottom()
+ << "}";
return false;
}
@@ -165,9 +166,10 @@
result = set_window_source_func_(magnifier_window_, native_rect);
if (!result) {
- LOG_F(LS_WARNING) << "Failed to call MagSetWindowSource: " << GetLastError()
- << ". Rect = {" << rect.left() << ", " << rect.top()
- << ", " << rect.right() << ", " << rect.bottom() << "}";
+ RTC_LOG_F(LS_WARNING) << "Failed to call MagSetWindowSource: "
+ << GetLastError() << ". Rect = {" << rect.left()
+ << ", " << rect.top() << ", " << rect.right() << ", "
+ << rect.bottom() << "}";
return false;
}
@@ -201,8 +203,8 @@
if (GetSystemMetrics(SM_CMONITORS) != 1) {
// Do not try to use the magnifier in multi-screen setup (where the API
// crashes sometimes).
- LOG_F(LS_WARNING) << "Magnifier capturer cannot work on multi-screen "
- "system.";
+ RTC_LOG_F(LS_WARNING) << "Magnifier capturer cannot work on multi-screen "
+ "system.";
return false;
}
@@ -228,15 +230,15 @@
if (!mag_initialize_func_ || !mag_uninitialize_func_ ||
!set_window_source_func_ || !set_window_filter_list_func_ ||
!set_image_scaling_callback_func_) {
- LOG_F(LS_WARNING) << "Failed to initialize ScreenCapturerWinMagnifier: "
- << "library functions missing.";
+ RTC_LOG_F(LS_WARNING) << "Failed to initialize ScreenCapturerWinMagnifier: "
+ << "library functions missing.";
return false;
}
BOOL result = mag_initialize_func_();
if (!result) {
- LOG_F(LS_WARNING) << "Failed to initialize ScreenCapturerWinMagnifier: "
- << "error from MagInitialize " << GetLastError();
+ RTC_LOG_F(LS_WARNING) << "Failed to initialize ScreenCapturerWinMagnifier: "
+ << "error from MagInitialize " << GetLastError();
return false;
}
@@ -247,8 +249,8 @@
&hInstance);
if (!result) {
mag_uninitialize_func_();
- LOG_F(LS_WARNING) << "Failed to initialize ScreenCapturerWinMagnifier: "
- << "error from GetModulehandleExA " << GetLastError();
+ RTC_LOG_F(LS_WARNING) << "Failed to initialize ScreenCapturerWinMagnifier: "
+ << "error from GetModulehandleExA " << GetLastError();
return false;
}
@@ -270,8 +272,9 @@
0, 0, 0, nullptr, nullptr, hInstance, nullptr);
if (!host_window_) {
mag_uninitialize_func_();
- LOG_F(LS_WARNING) << "Failed to initialize ScreenCapturerWinMagnifier: "
- << "error from creating host window " << GetLastError();
+ RTC_LOG_F(LS_WARNING) << "Failed to initialize ScreenCapturerWinMagnifier: "
+ << "error from creating host window "
+ << GetLastError();
return false;
}
@@ -281,9 +284,9 @@
host_window_, nullptr, hInstance, nullptr);
if (!magnifier_window_) {
mag_uninitialize_func_();
- LOG_F(LS_WARNING) << "Failed to initialize ScreenCapturerWinMagnifier: "
- << "error from creating magnifier window "
- << GetLastError();
+ RTC_LOG_F(LS_WARNING) << "Failed to initialize ScreenCapturerWinMagnifier: "
+ << "error from creating magnifier window "
+ << GetLastError();
return false;
}
@@ -296,9 +299,9 @@
&ScreenCapturerWinMagnifier::OnMagImageScalingCallback);
if (!result) {
mag_uninitialize_func_();
- LOG_F(LS_WARNING) << "Failed to initialize ScreenCapturerWinMagnifier: "
- << "error from MagSetImageScalingCallback "
- << GetLastError();
+ RTC_LOG_F(LS_WARNING) << "Failed to initialize ScreenCapturerWinMagnifier: "
+ << "error from MagSetImageScalingCallback "
+ << GetLastError();
return false;
}
@@ -307,9 +310,9 @@
magnifier_window_, MW_FILTERMODE_EXCLUDE, 1, &excluded_window_);
if (!result) {
mag_uninitialize_func_();
- LOG_F(LS_WARNING) << "Failed to initialize ScreenCapturerWinMagnifier: "
- << "error from MagSetWindowFilterList "
- << GetLastError();
+ RTC_LOG_F(LS_WARNING)
+ << "Failed to initialize ScreenCapturerWinMagnifier: "
+ << "error from MagSetWindowFilterList " << GetLastError();
return false;
}
}
@@ -330,13 +333,14 @@
header.height != static_cast<UINT>(current_frame->size().height()) ||
header.stride != static_cast<UINT>(current_frame->stride()) ||
captured_bytes_per_pixel != DesktopFrame::kBytesPerPixel) {
- LOG_F(LS_WARNING) << "Output format does not match the captured format: "
- << "width = " << header.width << ", "
- << "height = " << header.height << ", "
- << "stride = " << header.stride << ", "
- << "bpp = " << captured_bytes_per_pixel << ", "
- << "pixel format RGBA ? "
- << (header.format == GUID_WICPixelFormat32bppRGBA) << ".";
+ RTC_LOG_F(LS_WARNING)
+ << "Output format does not match the captured format: "
+ << "width = " << header.width << ", "
+ << "height = " << header.height << ", "
+ << "stride = " << header.stride << ", "
+ << "bpp = " << captured_bytes_per_pixel << ", "
+ << "pixel format RGBA ? "
+ << (header.format == GUID_WICPixelFormat32bppRGBA) << ".";
return;
}
diff --git a/modules/desktop_capture/window_capturer_mac.mm b/modules/desktop_capture/window_capturer_mac.mm
index aa55fd5..bbdcdd5 100644
--- a/modules/desktop_capture/window_capturer_mac.mm
+++ b/modules/desktop_capture/window_capturer_mac.mm
@@ -112,7 +112,7 @@
CGWindowListCreateDescriptionFromArray(window_id_array);
if (!window_array || 0 == CFArrayGetCount(window_array)) {
// Could not find the window. It might have been closed.
- LOG(LS_INFO) << "Window not found";
+ RTC_LOG(LS_INFO) << "Window not found";
CFRelease(window_id_array);
return false;
}
@@ -180,7 +180,7 @@
int bits_per_pixel = CGImageGetBitsPerPixel(window_image);
if (bits_per_pixel != 32) {
- LOG(LS_ERROR) << "Unsupported window image depth: " << bits_per_pixel;
+ RTC_LOG(LS_ERROR) << "Unsupported window image depth: " << bits_per_pixel;
CFRelease(window_image);
callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr);
return;
diff --git a/modules/desktop_capture/window_capturer_win.cc b/modules/desktop_capture/window_capturer_win.cc
index 6c43658..414eddf 100644
--- a/modules/desktop_capture/window_capturer_win.cc
+++ b/modules/desktop_capture/window_capturer_win.cc
@@ -200,7 +200,7 @@
void WindowCapturerWin::CaptureFrame() {
if (!window_) {
- LOG(LS_ERROR) << "Window hasn't been selected: " << GetLastError();
+ RTC_LOG(LS_ERROR) << "Window hasn't been selected: " << GetLastError();
callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr);
return;
}
@@ -214,7 +214,8 @@
DesktopRect cropped_rect;
DesktopRect original_rect;
if (!GetWindowDrawableRect(window_, &cropped_rect, &original_rect)) {
- LOG(LS_WARNING) << "Failed to get drawable window area: " << GetLastError();
+ RTC_LOG(LS_WARNING) << "Failed to get drawable window area: "
+ << GetLastError();
callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr);
return;
}
@@ -237,7 +238,7 @@
HDC window_dc = GetWindowDC(window_);
if (!window_dc) {
- LOG(LS_WARNING) << "Failed to get window DC: " << GetLastError();
+ RTC_LOG(LS_WARNING) << "Failed to get window DC: " << GetLastError();
callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr);
return;
}
@@ -322,7 +323,7 @@
if (result) {
callback_->OnCaptureResult(Result::SUCCESS, std::move(frame));
} else {
- LOG(LS_ERROR) << "Both PrintWindow() and BitBlt() failed.";
+ RTC_LOG(LS_ERROR) << "Both PrintWindow() and BitBlt() failed.";
callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr);
}
}
diff --git a/modules/desktop_capture/window_capturer_x11.cc b/modules/desktop_capture/window_capturer_x11.cc
index dc1c6fa..8985ab1 100644
--- a/modules/desktop_capture/window_capturer_x11.cc
+++ b/modules/desktop_capture/window_capturer_x11.cc
@@ -81,7 +81,7 @@
(major_version > 0 || minor_version >= 2)) {
has_composite_extension_ = true;
} else {
- LOG(LS_INFO) << "Xcomposite extension not available or too old.";
+ RTC_LOG(LS_INFO) << "Xcomposite extension not available or too old.";
}
x_display_->AddEventHandler(ConfigureNotify, this);
@@ -136,7 +136,7 @@
int status = XQueryTree(
display(), selected_window_, &root, &parent, &children, &num_children);
if (status == 0) {
- LOG(LS_ERROR) << "Failed to query for the root window.";
+ RTC_LOG(LS_ERROR) << "Failed to query for the root window.";
return false;
}
@@ -182,7 +182,7 @@
void WindowCapturerLinux::CaptureFrame() {
if (!x_server_pixel_buffer_.IsWindowValid()) {
- LOG(LS_INFO) << "The window is no longer valid.";
+ RTC_LOG(LS_INFO) << "The window is no longer valid.";
callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr);
return;
}
@@ -193,7 +193,7 @@
// Without the Xcomposite extension we capture when the whole window is
// visible on screen and not covered by any other window. This is not
// something we want so instead, just bail out.
- LOG(LS_INFO) << "No Xcomposite extension detected.";
+ RTC_LOG(LS_INFO) << "No Xcomposite extension detected.";
callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr);
return;
}
@@ -235,7 +235,8 @@
if (!DesktopRectFromXAttributes(xce).equals(
x_server_pixel_buffer_.window_rect())) {
if (!x_server_pixel_buffer_.Init(display(), selected_window_)) {
- LOG(LS_ERROR) << "Failed to initialize pixel buffer after resizing.";
+ RTC_LOG(LS_ERROR)
+ << "Failed to initialize pixel buffer after resizing.";
}
}
}
@@ -259,8 +260,8 @@
&cnt);
if (status >= Success && cnt && *list) {
if (cnt > 1) {
- LOG(LS_INFO) << "Window has " << cnt
- << " text properties, only using the first one.";
+ RTC_LOG(LS_INFO) << "Window has " << cnt
+ << " text properties, only using the first one.";
}
*title = *list;
result = true;
diff --git a/modules/desktop_capture/window_finder_unittest.cc b/modules/desktop_capture/window_finder_unittest.cc
index 4f8a5e4..1d2375e 100644
--- a/modules/desktop_capture/window_finder_unittest.cc
+++ b/modules/desktop_capture/window_finder_unittest.cc
@@ -90,21 +90,24 @@
#endif
std::unique_ptr<WindowFinder> finder = WindowFinder::Create(options);
if (!finder) {
- LOG(LS_WARNING) << "No WindowFinder implementation for current platform.";
+ RTC_LOG(LS_WARNING)
+ << "No WindowFinder implementation for current platform.";
return;
}
std::unique_ptr<ScreenDrawer> drawer = ScreenDrawer::Create();
if (!drawer) {
- LOG(LS_WARNING) << "No ScreenDrawer implementation for current platform.";
+ RTC_LOG(LS_WARNING)
+ << "No ScreenDrawer implementation for current platform.";
return;
}
if (drawer->window_id() == kNullWindowId) {
// TODO(zijiehe): WindowFinderTest can use a dedicated window without
// relying on ScreenDrawer.
- LOG(LS_WARNING) << "ScreenDrawer implementation for current platform does "
- "create a window.";
+ RTC_LOG(LS_WARNING)
+ << "ScreenDrawer implementation for current platform does "
+ "create a window.";
return;
}
@@ -112,8 +115,9 @@
// several spots, at least one of them should succeed.
const DesktopRect region = drawer->DrawableRegion();
if (region.is_empty()) {
- LOG(LS_WARNING) << "ScreenDrawer::DrawableRegion() is too small for the "
- "WindowFinderTest.";
+ RTC_LOG(LS_WARNING)
+ << "ScreenDrawer::DrawableRegion() is too small for the "
+ "WindowFinderTest.";
return;
}
@@ -142,7 +146,8 @@
#endif
std::unique_ptr<WindowFinder> finder = WindowFinder::Create(options);
if (!finder) {
- LOG(LS_WARNING) << "No WindowFinder implementation for current platform.";
+ RTC_LOG(LS_WARNING)
+ << "No WindowFinder implementation for current platform.";
return;
}
diff --git a/modules/desktop_capture/x11/shared_x_display.cc b/modules/desktop_capture/x11/shared_x_display.cc
index dacb934..ff2cba5 100644
--- a/modules/desktop_capture/x11/shared_x_display.cc
+++ b/modules/desktop_capture/x11/shared_x_display.cc
@@ -35,7 +35,7 @@
Display* display =
XOpenDisplay(display_name.empty() ? NULL : display_name.c_str());
if (!display) {
- LOG(LS_ERROR) << "Unable to open display";
+ RTC_LOG(LS_ERROR) << "Unable to open display";
return NULL;
}
return new SharedXDisplay(display);
diff --git a/modules/desktop_capture/x11/window_list_utils.cc b/modules/desktop_capture/x11/window_list_utils.cc
index 13542ba..65c7edf 100644
--- a/modules/desktop_capture/x11/window_list_utils.cc
+++ b/modules/desktop_capture/x11/window_list_utils.cc
@@ -110,8 +110,8 @@
unsigned int num_children;
if (!XQueryTree(cache->display(), window, &root, &parent, &children,
&num_children)) {
- LOG(LS_ERROR) << "Failed to query for child windows although window"
- << "does not have a valid WM_STATE.";
+ RTC_LOG(LS_ERROR) << "Failed to query for child windows although window"
+ << "does not have a valid WM_STATE.";
return 0;
}
::Window app_window = 0;
@@ -196,8 +196,8 @@
&num_children) == 0 ||
error_trap.GetLastErrorAndDisable() != 0) {
failed_screens++;
- LOG(LS_ERROR) << "Failed to query for child windows for screen "
- << screen;
+ RTC_LOG(LS_ERROR) << "Failed to query for child windows for screen "
+ << screen;
continue;
}
}
diff --git a/modules/desktop_capture/x11/x_server_pixel_buffer.cc b/modules/desktop_capture/x11/x_server_pixel_buffer.cc
index 988404e..ab1b95a 100644
--- a/modules/desktop_capture/x11/x_server_pixel_buffer.cc
+++ b/modules/desktop_capture/x11/x_server_pixel_buffer.cc
@@ -221,18 +221,19 @@
if (error_trap.GetLastErrorAndDisable() != 0)
using_shm = false;
if (using_shm) {
- LOG(LS_VERBOSE) << "Using X shared memory segment "
- << shm_segment_info_->shmid;
+ RTC_LOG(LS_VERBOSE)
+ << "Using X shared memory segment " << shm_segment_info_->shmid;
}
}
} else {
- LOG(LS_WARNING) << "Failed to get shared memory segment. "
- "Performance may be degraded.";
+ RTC_LOG(LS_WARNING) << "Failed to get shared memory segment. "
+ "Performance may be degraded.";
}
}
if (!using_shm) {
- LOG(LS_WARNING) << "Not using shared memory. Performance may be degraded.";
+ RTC_LOG(LS_WARNING)
+ << "Not using shared memory. Performance may be degraded.";
ReleaseSharedMemorySegment();
return;
}
@@ -243,9 +244,9 @@
shmctl(shm_segment_info_->shmid, IPC_RMID, 0);
shm_segment_info_->shmid = -1;
- LOG(LS_VERBOSE) << "Using X shared memory extension v"
- << major << "." << minor
- << " with" << (have_pixmaps ? "" : "out") << " pixmaps.";
+ RTC_LOG(LS_VERBOSE) << "Using X shared memory extension v" << major << "."
+ << minor << " with" << (have_pixmaps ? "" : "out")
+ << " pixmaps.";
}
bool XServerPixelBuffer::InitPixmaps(int depth) {
diff --git a/modules/media_file/media_file_impl.cc b/modules/media_file/media_file_impl.cc
index 7aaf30d..0fd9d9e 100644
--- a/modules/media_file/media_file_impl.cc
+++ b/modules/media_file/media_file_impl.cc
@@ -40,14 +40,14 @@
_openFile(false),
_fileName(),
_ptrCallback(NULL) {
- LOG(LS_INFO) << "MediaFileImpl()";
+ RTC_LOG(LS_INFO) << "MediaFileImpl()";
codec_info_.plname[0] = '\0';
_fileName[0] = '\0';
}
MediaFileImpl::~MediaFileImpl() {
- LOG(LS_INFO) << "~MediaFileImpl()";
+ RTC_LOG(LS_INFO) << "~MediaFileImpl()";
{
rtc::CritScope lock(&_crit);
@@ -71,26 +71,26 @@
}
int64_t MediaFileImpl::TimeUntilNextProcess() {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "TimeUntilNextProcess: This method is not used by MediaFile class.";
return -1;
}
void MediaFileImpl::Process() {
- LOG(LS_WARNING) << "Process: This method is not used by MediaFile class.";
+ RTC_LOG(LS_WARNING) << "Process: This method is not used by MediaFile class.";
}
int32_t MediaFileImpl::PlayoutAudioData(int8_t* buffer,
size_t& dataLengthInBytes) {
- LOG(LS_INFO) << "MediaFileImpl::PlayoutData(buffer= "
- << static_cast<void*>(buffer)
- << ", bufLen= " << dataLengthInBytes << ")";
+ RTC_LOG(LS_INFO) << "MediaFileImpl::PlayoutData(buffer= "
+ << static_cast<void*>(buffer)
+ << ", bufLen= " << dataLengthInBytes << ")";
const size_t bufferLengthInBytes = dataLengthInBytes;
dataLengthInBytes = 0;
if (buffer == NULL || bufferLengthInBytes == 0) {
- LOG(LS_ERROR) << "Buffer pointer or length is NULL!";
+ RTC_LOG(LS_ERROR) << "Buffer pointer or length is NULL!";
return -1;
}
@@ -99,12 +99,12 @@
rtc::CritScope lock(&_crit);
if (!_playingActive) {
- LOG(LS_WARNING) << "Not currently playing!";
+ RTC_LOG(LS_WARNING) << "Not currently playing!";
return -1;
}
if (!_ptrFileUtilityObj) {
- LOG(LS_ERROR) << "Playing, but no FileUtility object!";
+ RTC_LOG(LS_ERROR) << "Playing, but no FileUtility object!";
StopPlaying();
return -1;
}
@@ -134,7 +134,7 @@
}
break;
default: {
- LOG(LS_ERROR) << "Invalid file format: " << _fileFormat;
+ RTC_LOG(LS_ERROR) << "Invalid file format: " << _fileFormat;
assert(false);
break;
}
@@ -182,16 +182,16 @@
int32_t MediaFileImpl::PlayoutStereoData(int8_t* bufferLeft,
int8_t* bufferRight,
size_t& dataLengthInBytes) {
- LOG(LS_INFO) << "MediaFileImpl::PlayoutStereoData(Left = "
- << static_cast<void*>(bufferLeft)
- << ", Right = " << static_cast<void*>(bufferRight)
- << ", Len= " << dataLengthInBytes << ")";
+ RTC_LOG(LS_INFO) << "MediaFileImpl::PlayoutStereoData(Left = "
+ << static_cast<void*>(bufferLeft)
+ << ", Right = " << static_cast<void*>(bufferRight)
+ << ", Len= " << dataLengthInBytes << ")";
const size_t bufferLengthInBytes = dataLengthInBytes;
dataLengthInBytes = 0;
if (bufferLeft == NULL || bufferRight == NULL || bufferLengthInBytes == 0) {
- LOG(LS_ERROR) << "A buffer pointer or the length is NULL!";
+ RTC_LOG(LS_ERROR) << "A buffer pointer or the length is NULL!";
return -1;
}
@@ -201,12 +201,13 @@
rtc::CritScope lock(&_crit);
if (!_playingActive || !_isStereo) {
- LOG(LS_WARNING) << "Not currently playing stereo!";
+ RTC_LOG(LS_WARNING) << "Not currently playing stereo!";
return -1;
}
if (!_ptrFileUtilityObj) {
- LOG(LS_ERROR) << "Playing stereo, but the FileUtility objects is NULL!";
+ RTC_LOG(LS_ERROR)
+ << "Playing stereo, but the FileUtility objects is NULL!";
StopPlaying();
return -1;
}
@@ -219,7 +220,7 @@
*_ptrInStream, bufferLeft, bufferRight, bufferLengthInBytes);
break;
default:
- LOG(LS_ERROR)
+ RTC_LOG(LS_ERROR)
<< "Trying to read non-WAV as stereo audio (not supported)";
break;
}
@@ -274,20 +275,20 @@
// Check that the file will play longer than notificationTimeMs ms.
if ((startPointMs && stopPointMs && !loop) &&
(notificationTimeMs > (stopPointMs - startPointMs))) {
- LOG(LS_ERROR) << "specified notification time is longer than amount of"
- << " ms that will be played";
+ RTC_LOG(LS_ERROR) << "specified notification time is longer than amount of"
+ << " ms that will be played";
return -1;
}
FileWrapper* inputStream = FileWrapper::Create();
if (inputStream == NULL) {
- LOG(LS_INFO) << "Failed to allocate input stream for file " << fileName;
+ RTC_LOG(LS_INFO) << "Failed to allocate input stream for file " << fileName;
return -1;
}
if (!inputStream->OpenFile(fileName, true)) {
delete inputStream;
- LOG(LS_ERROR) << "Could not open input file " << fileName;
+ RTC_LOG(LS_ERROR) << "Could not open input file " << fileName;
return -1;
}
@@ -333,21 +334,22 @@
rtc::CritScope lock(&_crit);
if (_playingActive || _recordingActive) {
- LOG(LS_ERROR)
+ RTC_LOG(LS_ERROR)
<< "StartPlaying called, but already playing or recording file "
<< ((_fileName[0] == '\0') ? "(name not set)" : _fileName);
return -1;
}
if (_ptrFileUtilityObj != NULL) {
- LOG(LS_ERROR) << "StartPlaying called, but FileUtilityObj already exists!";
+ RTC_LOG(LS_ERROR)
+ << "StartPlaying called, but FileUtilityObj already exists!";
StopPlaying();
return -1;
}
_ptrFileUtilityObj = new ModuleFileUtility();
if (_ptrFileUtilityObj == NULL) {
- LOG(LS_INFO) << "Failed to create FileUtilityObj!";
+ RTC_LOG(LS_INFO) << "Failed to create FileUtilityObj!";
return -1;
}
@@ -355,7 +357,7 @@
case kFileFormatWavFile: {
if (_ptrFileUtilityObj->InitWavReading(stream, startPointMs,
stopPointMs) == -1) {
- LOG(LS_ERROR) << "Not a valid WAV file!";
+ RTC_LOG(LS_ERROR) << "Not a valid WAV file!";
StopPlaying();
return -1;
}
@@ -365,7 +367,7 @@
case kFileFormatCompressedFile: {
if (_ptrFileUtilityObj->InitCompressedReading(stream, startPointMs,
stopPointMs) == -1) {
- LOG(LS_ERROR) << "Not a valid Compressed file!";
+ RTC_LOG(LS_ERROR) << "Not a valid Compressed file!";
StopPlaying();
return -1;
}
@@ -382,7 +384,7 @@
if (!ValidFrequency(codecInst->plfreq) ||
_ptrFileUtilityObj->InitPCMReading(stream, startPointMs, stopPointMs,
codecInst->plfreq) == -1) {
- LOG(LS_ERROR) << "Not a valid raw 8 or 16 KHz PCM file!";
+ RTC_LOG(LS_ERROR) << "Not a valid raw 8 or 16 KHz PCM file!";
StopPlaying();
return -1;
}
@@ -395,7 +397,7 @@
// prevents codecInst from being NULL here.
assert(codecInst != NULL);
if (_ptrFileUtilityObj->InitPreEncodedReading(stream, *codecInst) == -1) {
- LOG(LS_ERROR) << "Not a valid PreEncoded file!";
+ RTC_LOG(LS_ERROR) << "Not a valid PreEncoded file!";
StopPlaying();
return -1;
}
@@ -404,20 +406,20 @@
break;
}
default: {
- LOG(LS_ERROR) << "Invalid file format: " << format;
+ RTC_LOG(LS_ERROR) << "Invalid file format: " << format;
assert(false);
break;
}
}
if (_ptrFileUtilityObj->codec_info(codec_info_) == -1) {
- LOG(LS_ERROR) << "Failed to retrieve codec info!";
+ RTC_LOG(LS_ERROR) << "Failed to retrieve codec info!";
StopPlaying();
return -1;
}
_isStereo = (codec_info_.channels == 2);
if (_isStereo && (_fileFormat != kFileFormatWavFile)) {
- LOG(LS_WARNING) << "Stereo is only allowed for WAV files";
+ RTC_LOG(LS_WARNING) << "Stereo is only allowed for WAV files";
StopPlaying();
return -1;
}
@@ -449,7 +451,7 @@
codec_info_.plname[0] = '\0';
if (!_playingActive) {
- LOG(LS_WARNING) << "playing is not active!";
+ RTC_LOG(LS_WARNING) << "playing is not active!";
return -1;
}
@@ -458,19 +460,19 @@
}
bool MediaFileImpl::IsPlaying() {
- LOG(LS_VERBOSE) << "MediaFileImpl::IsPlaying()";
+ RTC_LOG(LS_VERBOSE) << "MediaFileImpl::IsPlaying()";
rtc::CritScope lock(&_crit);
return _playingActive;
}
int32_t MediaFileImpl::IncomingAudioData(const int8_t* buffer,
const size_t bufferLengthInBytes) {
- LOG(LS_INFO) << "MediaFile::IncomingData(buffer= "
- << static_cast<const void*>(buffer)
- << ", bufLen= " << bufferLengthInBytes << ")";
+ RTC_LOG(LS_INFO) << "MediaFile::IncomingData(buffer= "
+ << static_cast<const void*>(buffer)
+ << ", bufLen= " << bufferLengthInBytes << ")";
if (buffer == NULL || bufferLengthInBytes == 0) {
- LOG(LS_ERROR) << "Buffer pointer or length is NULL!";
+ RTC_LOG(LS_ERROR) << "Buffer pointer or length is NULL!";
return -1;
}
@@ -480,11 +482,11 @@
rtc::CritScope lock(&_crit);
if (!_recordingActive) {
- LOG(LS_WARNING) << "Not currently recording!";
+ RTC_LOG(LS_WARNING) << "Not currently recording!";
return -1;
}
if (_ptrOutStream == NULL) {
- LOG(LS_ERROR) << "Recording is active, but output stream is NULL!";
+ RTC_LOG(LS_ERROR) << "Recording is active, but output stream is NULL!";
assert(false);
return -1;
}
@@ -523,7 +525,7 @@
*_ptrOutStream, buffer, bufferLengthInBytes);
break;
default:
- LOG(LS_ERROR) << "Invalid file format: " << _fileFormat;
+ RTC_LOG(LS_ERROR) << "Invalid file format: " << _fileFormat;
assert(false);
break;
}
@@ -547,7 +549,7 @@
}
}
if (bytesWritten < (int32_t)bufferLengthInBytes) {
- LOG(LS_WARNING) << "Failed to write all requested bytes!";
+ RTC_LOG(LS_WARNING) << "Failed to write all requested bytes!";
StopRecording();
recordingEnded = true;
}
@@ -582,14 +584,14 @@
FileWrapper* outputStream = FileWrapper::Create();
if (outputStream == NULL) {
- LOG(LS_INFO) << "Failed to allocate memory for output stream";
+ RTC_LOG(LS_INFO) << "Failed to allocate memory for output stream";
return -1;
}
if (!outputStream->OpenFile(fileName, false)) {
delete outputStream;
- LOG(LS_ERROR) << "Could not open output file '" << fileName
- << "' for writing!";
+ RTC_LOG(LS_ERROR) << "Could not open output file '" << fileName
+ << "' for writing!";
return -1;
}
@@ -623,14 +625,14 @@
rtc::CritScope lock(&_crit);
if (_recordingActive || _playingActive) {
- LOG(LS_ERROR)
+ RTC_LOG(LS_ERROR)
<< "StartRecording called, but already recording or playing file "
<< _fileName << "!";
return -1;
}
if (_ptrFileUtilityObj != NULL) {
- LOG(LS_ERROR)
+ RTC_LOG(LS_ERROR)
<< "StartRecording called, but fileUtilityObj already exists!";
StopRecording();
return -1;
@@ -638,7 +640,7 @@
_ptrFileUtilityObj = new ModuleFileUtility();
if (_ptrFileUtilityObj == NULL) {
- LOG(LS_INFO) << "Cannot allocate fileUtilityObj!";
+ RTC_LOG(LS_INFO) << "Cannot allocate fileUtilityObj!";
return -1;
}
@@ -647,7 +649,7 @@
switch (format) {
case kFileFormatWavFile: {
if (_ptrFileUtilityObj->InitWavWriting(stream, codecInst) == -1) {
- LOG(LS_ERROR) << "Failed to initialize WAV file!";
+ RTC_LOG(LS_ERROR) << "Failed to initialize WAV file!";
delete _ptrFileUtilityObj;
_ptrFileUtilityObj = NULL;
return -1;
@@ -658,7 +660,7 @@
case kFileFormatCompressedFile: {
// Write compression codec name at beginning of file
if (_ptrFileUtilityObj->InitCompressedWriting(stream, codecInst) == -1) {
- LOG(LS_ERROR) << "Failed to initialize Compressed file!";
+ RTC_LOG(LS_ERROR) << "Failed to initialize Compressed file!";
delete _ptrFileUtilityObj;
_ptrFileUtilityObj = NULL;
return -1;
@@ -672,7 +674,7 @@
case kFileFormatPcm48kHzFile: {
if (!ValidFrequency(codecInst.plfreq) ||
_ptrFileUtilityObj->InitPCMWriting(stream, codecInst.plfreq) == -1) {
- LOG(LS_ERROR) << "Failed to initialize PCM file!";
+ RTC_LOG(LS_ERROR) << "Failed to initialize PCM file!";
delete _ptrFileUtilityObj;
_ptrFileUtilityObj = NULL;
return -1;
@@ -682,7 +684,7 @@
}
case kFileFormatPreencodedFile: {
if (_ptrFileUtilityObj->InitPreEncodedWriting(stream, codecInst) == -1) {
- LOG(LS_ERROR) << "Failed to initialize Pre-Encoded file!";
+ RTC_LOG(LS_ERROR) << "Failed to initialize Pre-Encoded file!";
delete _ptrFileUtilityObj;
_ptrFileUtilityObj = NULL;
return -1;
@@ -692,7 +694,7 @@
break;
}
default: {
- LOG(LS_ERROR) << "Invalid file format " << format << " specified!";
+ RTC_LOG(LS_ERROR) << "Invalid file format " << format << " specified!";
delete _ptrFileUtilityObj;
_ptrFileUtilityObj = NULL;
return -1;
@@ -701,14 +703,15 @@
_isStereo = (tmpAudioCodec.channels == 2);
if (_isStereo) {
if (_fileFormat != kFileFormatWavFile) {
- LOG(LS_WARNING) << "Stereo is only allowed for WAV files";
+ RTC_LOG(LS_WARNING) << "Stereo is only allowed for WAV files";
StopRecording();
return -1;
}
if ((STR_NCASE_CMP(tmpAudioCodec.plname, "L16", 4) != 0) &&
(STR_NCASE_CMP(tmpAudioCodec.plname, "PCMU", 5) != 0) &&
(STR_NCASE_CMP(tmpAudioCodec.plname, "PCMA", 5) != 0)) {
- LOG(LS_WARNING) << "Stereo is only allowed for codec PCMU, PCMA and L16 ";
+ RTC_LOG(LS_WARNING)
+ << "Stereo is only allowed for codec PCMU, PCMA and L16 ";
StopRecording();
return -1;
}
@@ -724,7 +727,7 @@
int32_t MediaFileImpl::StopRecording() {
rtc::CritScope lock(&_crit);
if (!_recordingActive) {
- LOG(LS_WARNING) << "recording is not active!";
+ RTC_LOG(LS_WARNING) << "recording is not active!";
return -1;
}
@@ -757,7 +760,7 @@
}
bool MediaFileImpl::IsRecording() {
- LOG(LS_VERBOSE) << "MediaFileImpl::IsRecording()";
+ RTC_LOG(LS_VERBOSE) << "MediaFileImpl::IsRecording()";
rtc::CritScope lock(&_crit);
return _recordingActive;
}
@@ -773,7 +776,7 @@
}
bool MediaFileImpl::IsStereo() {
- LOG(LS_VERBOSE) << "MediaFileImpl::IsStereo()";
+ RTC_LOG(LS_VERBOSE) << "MediaFileImpl::IsStereo()";
rtc::CritScope lock(&_crit);
return _isStereo;
}
@@ -798,7 +801,7 @@
ModuleFileUtility* utilityObj = new ModuleFileUtility();
if (utilityObj == NULL) {
- LOG(LS_ERROR) << "failed to allocate utility object!";
+ RTC_LOG(LS_ERROR) << "failed to allocate utility object!";
return -1;
}
@@ -827,13 +830,13 @@
int32_t MediaFileImpl::codec_info(CodecInst& codecInst) const {
rtc::CritScope lock(&_crit);
if (!_playingActive && !_recordingActive) {
- LOG(LS_ERROR) << "Neither playout nor recording has been initialized!";
+ RTC_LOG(LS_ERROR) << "Neither playout nor recording has been initialized!";
return -1;
}
if (codec_info_.pltype == 0 && codec_info_.plname[0] == '\0') {
- LOG(LS_ERROR) << "The CodecInst for "
- << (_playingActive ? "Playback" : "Recording")
- << " is unknown!";
+ RTC_LOG(LS_ERROR) << "The CodecInst for "
+ << (_playingActive ? "Playback" : "Recording")
+ << " is unknown!";
return -1;
}
memcpy(&codecInst, &codec_info_, sizeof(CodecInst));
@@ -847,7 +850,7 @@
format == kFileFormatPcm8kHzFile || format == kFileFormatPcm16kHzFile ||
format == kFileFormatPcm32kHzFile ||
format == kFileFormatPcm48kHzFile) {
- LOG(LS_ERROR) << "Codec info required for file format specified!";
+ RTC_LOG(LS_ERROR) << "Codec info required for file format specified!";
return false;
}
}
@@ -856,7 +859,7 @@
bool MediaFileImpl::ValidFileName(const char* fileName) {
if ((fileName == NULL) || (fileName[0] == '\0')) {
- LOG(LS_ERROR) << "FileName not specified!";
+ RTC_LOG(LS_ERROR) << "FileName not specified!";
return false;
}
return true;
@@ -869,11 +872,11 @@
return true;
}
if (stopPointMs && (startPointMs >= stopPointMs)) {
- LOG(LS_ERROR) << "startPointMs must be less than stopPointMs!";
+ RTC_LOG(LS_ERROR) << "startPointMs must be less than stopPointMs!";
return false;
}
if (stopPointMs && ((stopPointMs - startPointMs) < 20)) {
- LOG(LS_ERROR) << "minimum play duration for files is 20 ms!";
+ RTC_LOG(LS_ERROR) << "minimum play duration for files is 20 ms!";
return false;
}
return true;
@@ -884,7 +887,7 @@
(frequency == 48000)) {
return true;
}
- LOG(LS_ERROR) << "Frequency should be 8000, 16000, 32000, or 48000 (Hz)";
+ RTC_LOG(LS_ERROR) << "Frequency should be 8000, 16000, 32000, or 48000 (Hz)";
return false;
}
} // namespace webrtc
diff --git a/modules/media_file/media_file_utility.cc b/modules/media_file/media_file_utility.cc
index d8ba066..8c602bc 100644
--- a/modules/media_file/media_file_utility.cc
+++ b/modules/media_file/media_file_utility.cc
@@ -57,13 +57,13 @@
_reading(false),
_writing(false),
_tempData() {
- LOG(LS_INFO) << "ModuleFileUtility::ModuleFileUtility()";
+ RTC_LOG(LS_INFO) << "ModuleFileUtility::ModuleFileUtility()";
memset(&codec_info_, 0, sizeof(CodecInst));
codec_info_.pltype = -1;
}
ModuleFileUtility::~ModuleFileUtility() {
- LOG(LS_INFO) << "ModuleFileUtility::~ModuleFileUtility()";
+ RTC_LOG(LS_INFO) << "ModuleFileUtility::~ModuleFileUtility()";
}
int32_t ModuleFileUtility::ReadWavHeader(InStream& wav) {
@@ -80,7 +80,7 @@
_dataSize = 0;
int len = wav.Read(&RIFFheaderObj, sizeof(WAVE_RIFF_header));
if (len != static_cast<int>(sizeof(WAVE_RIFF_header))) {
- LOG(LS_ERROR) << "Not a wave file (too short)";
+ RTC_LOG(LS_ERROR) << "Not a wave file (too short)";
return -1;
}
@@ -88,14 +88,14 @@
tmpStr[i] = RIFFheaderObj.ckID[i];
}
if (strcmp(tmpStr, "RIFF") != 0) {
- LOG(LS_ERROR) << "Not a wave file (does not have RIFF)";
+ RTC_LOG(LS_ERROR) << "Not a wave file (does not have RIFF)";
return -1;
}
for (i = 0; i < 4; i++) {
tmpStr[i] = RIFFheaderObj.wave_ckID[i];
}
if (strcmp(tmpStr, "WAVE") != 0) {
- LOG(LS_ERROR) << "Not a wave file (does not have WAVE)";
+ RTC_LOG(LS_ERROR) << "Not a wave file (does not have WAVE)";
return -1;
}
@@ -139,14 +139,14 @@
(int16_t)((uint32_t)tmpStr2[0] + (((uint32_t)tmpStr2[1]) << 8));
if (CHUNKheaderObj.fmt_ckSize < sizeof(WAVE_FMTINFO_header)) {
- LOG(LS_ERROR) << "Chunk size is too small";
+ RTC_LOG(LS_ERROR) << "Chunk size is too small";
return -1;
}
for (i = 0; i < CHUNKheaderObj.fmt_ckSize - sizeof(WAVE_FMTINFO_header);
i++) {
len = wav.Read(&dummyRead, 1);
if (len != 1) {
- LOG(LS_ERROR) << "File corrupted, reached EOF (reading fmt)";
+ RTC_LOG(LS_ERROR) << "File corrupted, reached EOF (reading fmt)";
return -1;
}
}
@@ -159,7 +159,7 @@
for (i = 0; i < CHUNKheaderObj.fmt_ckSize; i++) {
len = wav.Read(&dummyRead, 1);
if (len != 1) {
- LOG(LS_ERROR) << "File corrupted, reached EOF (reading other)";
+ RTC_LOG(LS_ERROR) << "File corrupted, reached EOF (reading other)";
return -1;
}
}
@@ -180,20 +180,20 @@
if ((_wavFormatObj.formatTag != kWavFormatPcm) &&
(_wavFormatObj.formatTag != kWavFormatALaw) &&
(_wavFormatObj.formatTag != kWavFormatMuLaw)) {
- LOG(LS_ERROR) << "Coding formatTag value=" << _wavFormatObj.formatTag
- << " not supported!";
+ RTC_LOG(LS_ERROR) << "Coding formatTag value=" << _wavFormatObj.formatTag
+ << " not supported!";
return -1;
}
if ((_wavFormatObj.nChannels < 1) || (_wavFormatObj.nChannels > 2)) {
- LOG(LS_ERROR) << "nChannels value=" << _wavFormatObj.nChannels
- << " not supported!";
+ RTC_LOG(LS_ERROR) << "nChannels value=" << _wavFormatObj.nChannels
+ << " not supported!";
return -1;
}
if ((_wavFormatObj.nBitsPerSample != 8) &&
(_wavFormatObj.nBitsPerSample != 16)) {
- LOG(LS_ERROR) << "nBitsPerSample value=" << _wavFormatObj.nBitsPerSample
- << " not supported!";
+ RTC_LOG(LS_ERROR) << "nBitsPerSample value=" << _wavFormatObj.nBitsPerSample
+ << " not supported!";
return -1;
}
@@ -266,12 +266,12 @@
codec_info_.pacsize = 480;
codec_info_.plfreq = 48000;
} else {
- LOG(LS_ERROR) << "Unsupported PCM frequency!";
+ RTC_LOG(LS_ERROR) << "Unsupported PCM frequency!";
return -1;
}
break;
default:
- LOG(LS_ERROR) << "unknown WAV format TAG!";
+ RTC_LOG(LS_ERROR) << "unknown WAV format TAG!";
return -1;
break;
}
@@ -284,7 +284,7 @@
_reading = false;
if (ReadWavHeader(wav) == -1) {
- LOG(LS_ERROR) << "failed to read WAV header!";
+ RTC_LOG(LS_ERROR) << "failed to read WAV header!";
return -1;
}
@@ -302,7 +302,7 @@
_playoutPositionMs += 10;
} else // Must have reached EOF before start position!
{
- LOG(LS_ERROR) << "InitWavReading(), EOF before start position";
+ RTC_LOG(LS_ERROR) << "InitWavReading(), EOF before start position";
return -1;
}
}
@@ -326,9 +326,9 @@
int32_t ModuleFileUtility::ReadWavDataAsMono(InStream& wav,
int8_t* outData,
const size_t bufferSize) {
- LOG(LS_VERBOSE) << "ModuleFileUtility::ReadWavDataAsMono(wav= " << &wav
- << ", outData= " << static_cast<void*>(outData)
- << ", bufSize= " << bufferSize << ")";
+ RTC_LOG(LS_VERBOSE) << "ModuleFileUtility::ReadWavDataAsMono(wav= " << &wav
+ << ", outData= " << static_cast<void*>(outData)
+ << ", bufSize= " << bufferSize << ")";
// The number of bytes that should be read from file.
const size_t totalBytesNeeded = _readSizeBytes;
@@ -336,16 +336,16 @@
const size_t bytesRequested =
(codec_info_.channels == 2) ? totalBytesNeeded >> 1 : totalBytesNeeded;
if (bufferSize < bytesRequested) {
- LOG(LS_ERROR) << "ReadWavDataAsMono: output buffer is too short!";
+ RTC_LOG(LS_ERROR) << "ReadWavDataAsMono: output buffer is too short!";
return -1;
}
if (outData == NULL) {
- LOG(LS_ERROR) << "ReadWavDataAsMono: output buffer NULL!";
+ RTC_LOG(LS_ERROR) << "ReadWavDataAsMono: output buffer NULL!";
return -1;
}
if (!_reading) {
- LOG(LS_ERROR) << "ReadWavDataAsMono: no longer reading file.";
+ RTC_LOG(LS_ERROR) << "ReadWavDataAsMono: no longer reading file.";
return -1;
}
@@ -356,7 +356,8 @@
return 0;
}
if (bytesRead < 0) {
- LOG(LS_ERROR) << "ReadWavDataAsMono: failed to read data from WAV file.";
+ RTC_LOG(LS_ERROR)
+ << "ReadWavDataAsMono: failed to read data from WAV file.";
return -1;
}
// Output data is should be mono.
@@ -381,22 +382,22 @@
int8_t* outDataLeft,
int8_t* outDataRight,
const size_t bufferSize) {
- LOG(LS_VERBOSE) << "ModuleFileUtility::ReadWavDataAsStereo(wav= " << &wav
- << ", outLeft= " << static_cast<void*>(outDataLeft)
- << ", outRight= " << static_cast<void*>(outDataRight)
- << ", bufSize= " << bufferSize << ")";
+ RTC_LOG(LS_VERBOSE) << "ModuleFileUtility::ReadWavDataAsStereo(wav= " << &wav
+ << ", outLeft= " << static_cast<void*>(outDataLeft)
+ << ", outRight= " << static_cast<void*>(outDataRight)
+ << ", bufSize= " << bufferSize << ")";
if ((outDataLeft == NULL) || (outDataRight == NULL)) {
- LOG(LS_ERROR) << "ReadWavDataAsStereo: an input buffer is NULL!";
+ RTC_LOG(LS_ERROR) << "ReadWavDataAsStereo: an input buffer is NULL!";
return -1;
}
if (codec_info_.channels != 2) {
- LOG(LS_ERROR)
+ RTC_LOG(LS_ERROR)
<< "ReadWavDataAsStereo: WAV file does not contain stereo data!";
return -1;
}
if (!_reading) {
- LOG(LS_ERROR) << "ReadWavDataAsStereo: no longer reading file.";
+ RTC_LOG(LS_ERROR) << "ReadWavDataAsStereo: no longer reading file.";
return -1;
}
@@ -406,14 +407,15 @@
// buffers.
const size_t bytesRequested = totalBytesNeeded >> 1;
if (bufferSize < bytesRequested) {
- LOG(LS_ERROR) << "ReadWavDataAsStereo: Output buffers are too short!";
+ RTC_LOG(LS_ERROR) << "ReadWavDataAsStereo: Output buffers are too short!";
assert(false);
return -1;
}
int32_t bytesRead = ReadWavData(wav, _tempData, totalBytesNeeded);
if (bytesRead <= 0) {
- LOG(LS_ERROR) << "ReadWavDataAsStereo: failed to read data from WAV file.";
+ RTC_LOG(LS_ERROR)
+ << "ReadWavDataAsStereo: failed to read data from WAV file.";
return -1;
}
@@ -436,8 +438,8 @@
outRight[i] = sampleData[(2 * i) + 1];
}
} else {
- LOG(LS_ERROR) << "ReadWavStereoData: unsupported sample size "
- << _bytesPerSample << "!";
+ RTC_LOG(LS_ERROR) << "ReadWavStereoData: unsupported sample size "
+ << _bytesPerSample << "!";
assert(false);
return -1;
}
@@ -447,12 +449,12 @@
int32_t ModuleFileUtility::ReadWavData(InStream& wav,
uint8_t* buffer,
size_t dataLengthInBytes) {
- LOG(LS_VERBOSE) << "ModuleFileUtility::ReadWavData(wav= " << &wav
- << ", buffer= " << static_cast<void*>(buffer)
- << ", dataLen= " << dataLengthInBytes << ")";
+ RTC_LOG(LS_VERBOSE) << "ModuleFileUtility::ReadWavData(wav= " << &wav
+ << ", buffer= " << static_cast<void*>(buffer)
+ << ", dataLen= " << dataLengthInBytes << ")";
if (buffer == NULL) {
- LOG(LS_ERROR) << "ReadWavDataAsMono: output buffer NULL!";
+ RTC_LOG(LS_ERROR) << "ReadWavDataAsMono: output buffer NULL!";
return -1;
}
@@ -511,7 +513,7 @@
int32_t ModuleFileUtility::InitWavWriting(OutStream& wav,
const CodecInst& codecInst) {
if (set_codec_info(codecInst) != 0) {
- LOG(LS_ERROR) << "codecInst identifies unsupported codec!";
+ RTC_LOG(LS_ERROR) << "codecInst identifies unsupported codec!";
return -1;
}
_writing = false;
@@ -536,7 +538,7 @@
return -1;
}
} else {
- LOG(LS_ERROR) << "codecInst identifies unsupported codec for WAV file!";
+ RTC_LOG(LS_ERROR) << "codecInst identifies unsupported codec for WAV file!";
return -1;
}
_writing = true;
@@ -547,12 +549,12 @@
int32_t ModuleFileUtility::WriteWavData(OutStream& out,
const int8_t* buffer,
const size_t dataLength) {
- LOG(LS_VERBOSE) << "ModuleFileUtility::WriteWavData(out= " << &out
- << ", buf= " << static_cast<const void*>(buffer)
- << ", dataLen= " << dataLength << ")";
+ RTC_LOG(LS_VERBOSE) << "ModuleFileUtility::WriteWavData(out= " << &out
+ << ", buf= " << static_cast<const void*>(buffer)
+ << ", dataLen= " << dataLength << ")";
if (buffer == NULL) {
- LOG(LS_ERROR) << "WriteWavData: input buffer NULL!";
+ RTC_LOG(LS_ERROR) << "WriteWavData: input buffer NULL!";
return -1;
}
@@ -616,11 +618,11 @@
(MediaFileUtility_CodecType)preEncodedID;
if (set_codec_info(cinst) != 0) {
- LOG(LS_ERROR) << "Pre-encoded file send codec mismatch!";
+ RTC_LOG(LS_ERROR) << "Pre-encoded file send codec mismatch!";
return -1;
}
if (codecType != _codecId) {
- LOG(LS_ERROR) << "Pre-encoded file format codec mismatch!";
+ RTC_LOG(LS_ERROR) << "Pre-encoded file format codec mismatch!";
return -1;
}
memcpy(&codec_info_, &cinst, sizeof(CodecInst));
@@ -631,12 +633,12 @@
int32_t ModuleFileUtility::ReadPreEncodedData(InStream& in,
int8_t* outData,
const size_t bufferSize) {
- LOG(LS_VERBOSE) << "ModuleFileUtility::ReadPreEncodedData(in= " << &in
- << ", outData= " << static_cast<void*>(outData)
- << ", bufferSize= " << bufferSize << ")";
+ RTC_LOG(LS_VERBOSE) << "ModuleFileUtility::ReadPreEncodedData(in= " << &in
+ << ", outData= " << static_cast<void*>(outData)
+ << ", bufferSize= " << bufferSize << ")";
if (outData == NULL) {
- LOG(LS_ERROR) << "output buffer NULL";
+ RTC_LOG(LS_ERROR) << "output buffer NULL";
}
size_t frameLen;
@@ -654,8 +656,8 @@
}
frameLen = buf[0] + buf[1] * 256;
if (bufferSize < frameLen) {
- LOG(LS_ERROR) << "buffer not large enough to read " << frameLen
- << " bytes of pre-encoded data!";
+ RTC_LOG(LS_ERROR) << "buffer not large enough to read " << frameLen
+ << " bytes of pre-encoded data!";
return -1;
}
return in.Read(outData, frameLen);
@@ -664,7 +666,7 @@
int32_t ModuleFileUtility::InitPreEncodedWriting(OutStream& out,
const CodecInst& codecInst) {
if (set_codec_info(codecInst) != 0) {
- LOG(LS_ERROR) << "CodecInst not recognized!";
+ RTC_LOG(LS_ERROR) << "CodecInst not recognized!";
return -1;
}
_writing = true;
@@ -676,12 +678,12 @@
int32_t ModuleFileUtility::WritePreEncodedData(OutStream& out,
const int8_t* buffer,
const size_t dataLength) {
- LOG(LS_VERBOSE) << "ModuleFileUtility::WritePreEncodedData(out= " << &out
- << " , inData= " << static_cast<const void*>(buffer)
- << ", dataLen= " << dataLength << ")";
+ RTC_LOG(LS_VERBOSE) << "ModuleFileUtility::WritePreEncodedData(out= " << &out
+ << " , inData= " << static_cast<const void*>(buffer)
+ << ", dataLen= " << dataLength << ")";
if (buffer == NULL) {
- LOG(LS_ERROR) << "buffer NULL";
+ RTC_LOG(LS_ERROR) << "buffer NULL";
}
size_t bytesWritten = 0;
@@ -704,8 +706,8 @@
int32_t ModuleFileUtility::InitCompressedReading(InStream& in,
const uint32_t start,
const uint32_t stop) {
- LOG(LS_VERBOSE) << "ModuleFileUtility::InitCompressedReading(in= " << &in
- << ", start= " << start << ", stop= " << stop << ")";
+ RTC_LOG(LS_VERBOSE) << "ModuleFileUtility::InitCompressedReading(in= " << &in
+ << ", start= " << start << ", stop= " << stop << ")";
#if defined(WEBRTC_CODEC_ILBC)
int16_t read_len = 0;
@@ -780,14 +782,14 @@
int32_t ModuleFileUtility::ReadCompressedData(InStream& in,
int8_t* outData,
size_t bufferSize) {
- LOG(LS_VERBOSE) << "ModuleFileUtility::ReadCompressedData(in=" << &in
- << ", outData=" << static_cast<void*>(outData)
- << ", bytes=" << bufferSize << ")";
+ RTC_LOG(LS_VERBOSE) << "ModuleFileUtility::ReadCompressedData(in=" << &in
+ << ", outData=" << static_cast<void*>(outData)
+ << ", bytes=" << bufferSize << ")";
int bytesRead = 0;
if (!_reading) {
- LOG(LS_ERROR) << "not currently reading!";
+ RTC_LOG(LS_ERROR) << "not currently reading!";
return -1;
}
@@ -801,7 +803,7 @@
byteSize = 38;
}
if (bufferSize < byteSize) {
- LOG(LS_ERROR)
+ RTC_LOG(LS_ERROR)
<< "output buffer is too short to read ILBC compressed data.";
assert(false);
return -1;
@@ -824,7 +826,8 @@
}
#endif
if (bytesRead == 0) {
- LOG(LS_ERROR) << "ReadCompressedData() no bytes read, codec not supported";
+ RTC_LOG(LS_ERROR)
+ << "ReadCompressedData() no bytes read, codec not supported";
return -1;
}
@@ -841,8 +844,8 @@
int32_t ModuleFileUtility::InitCompressedWriting(OutStream& out,
const CodecInst& codecInst) {
- LOG(LS_VERBOSE) << "ModuleFileUtility::InitCompressedWriting(out= " << &out
- << ", codecName= " << codecInst.plname << ")";
+ RTC_LOG(LS_VERBOSE) << "ModuleFileUtility::InitCompressedWriting(out= "
+ << &out << ", codecName= " << codecInst.plname << ")";
_writing = false;
@@ -855,7 +858,7 @@
_codecId = kCodecIlbc30Ms;
out.Write("#!iLBC30\n", 9);
} else {
- LOG(LS_ERROR) << "codecInst defines unsupported compression codec!";
+ RTC_LOG(LS_ERROR) << "codecInst defines unsupported compression codec!";
return -1;
}
memcpy(&codec_info_, &codecInst, sizeof(CodecInst));
@@ -864,19 +867,19 @@
}
#endif
- LOG(LS_ERROR) << "codecInst defines unsupported compression codec!";
+ RTC_LOG(LS_ERROR) << "codecInst defines unsupported compression codec!";
return -1;
}
int32_t ModuleFileUtility::WriteCompressedData(OutStream& out,
const int8_t* buffer,
const size_t dataLength) {
- LOG(LS_VERBOSE) << "ModuleFileUtility::WriteCompressedData(out= " << &out
- << ", buf= " << static_cast<const void*>(buffer)
- << ", dataLen= " << dataLength << ")";
+ RTC_LOG(LS_VERBOSE) << "ModuleFileUtility::WriteCompressedData(out= " << &out
+ << ", buf= " << static_cast<const void*>(buffer)
+ << ", dataLen= " << dataLength << ")";
if (buffer == NULL) {
- LOG(LS_ERROR) << "buffer NULL";
+ RTC_LOG(LS_ERROR) << "buffer NULL";
}
if (!out.Write(buffer, dataLength)) {
@@ -889,9 +892,9 @@
const uint32_t start,
const uint32_t stop,
uint32_t freq) {
- LOG(LS_VERBOSE) << "ModuleFileUtility::InitPCMReading(pcm= " << &pcm
- << ", start=" << start << ", stop=" << stop
- << ", freq=" << freq << ")";
+ RTC_LOG(LS_VERBOSE) << "ModuleFileUtility::InitPCMReading(pcm= " << &pcm
+ << ", start=" << start << ", stop=" << stop
+ << ", freq=" << freq << ")";
int8_t dummy[320];
int read_len;
@@ -953,18 +956,19 @@
int32_t ModuleFileUtility::ReadPCMData(InStream& pcm,
int8_t* outData,
size_t bufferSize) {
- LOG(LS_VERBOSE) << "ModuleFileUtility::ReadPCMData(pcm= " << &pcm
- << ", outData= " << static_cast<void*>(outData)
- << ", bufSize= " << bufferSize << ")";
+ RTC_LOG(LS_VERBOSE) << "ModuleFileUtility::ReadPCMData(pcm= " << &pcm
+ << ", outData= " << static_cast<void*>(outData)
+ << ", bufSize= " << bufferSize << ")";
if (outData == NULL) {
- LOG(LS_ERROR) << "buffer NULL";
+ RTC_LOG(LS_ERROR) << "buffer NULL";
}
// Readsize for 10ms of audio data (2 bytes per sample).
size_t bytesRequested = static_cast<size_t>(2 * codec_info_.plfreq / 100);
if (bufferSize < bytesRequested) {
- LOG(LS_ERROR) << "ReadPCMData: buffer not long enough for a 10ms frame.";
+ RTC_LOG(LS_ERROR)
+ << "ReadPCMData: buffer not long enough for a 10ms frame.";
assert(false);
return -1;
}
@@ -987,14 +991,14 @@
}
}
if (bytesRead <= 0) {
- LOG(LS_ERROR) << "ReadPCMData: Failed to rewind audio file.";
+ RTC_LOG(LS_ERROR) << "ReadPCMData: Failed to rewind audio file.";
return -1;
}
}
}
if (bytesRead <= 0) {
- LOG(LS_VERBOSE) << "ReadPCMData: end of file";
+ RTC_LOG(LS_VERBOSE) << "ReadPCMData: end of file";
return -1;
}
_playoutPositionMs += 10;
@@ -1049,7 +1053,7 @@
}
if ((_codecId != kCodecL16_8Khz) && (_codecId != kCodecL16_16kHz) &&
(_codecId != kCodecL16_32Khz) && (_codecId != kCodecL16_48Khz)) {
- LOG(LS_ERROR) << "CodecInst is not 8KHz, 16KHz, 32kHz or 48kHz PCM!";
+ RTC_LOG(LS_ERROR) << "CodecInst is not 8KHz, 16KHz, 32kHz or 48kHz PCM!";
return -1;
}
_writing = true;
@@ -1060,12 +1064,12 @@
int32_t ModuleFileUtility::WritePCMData(OutStream& out,
const int8_t* buffer,
const size_t dataLength) {
- LOG(LS_VERBOSE) << "ModuleFileUtility::WritePCMData(out= " << &out
- << ", buf= " << static_cast<const void*>(buffer)
- << ", dataLen= " << dataLength << ")";
+ RTC_LOG(LS_VERBOSE) << "ModuleFileUtility::WritePCMData(out= " << &out
+ << ", buf= " << static_cast<const void*>(buffer)
+ << ", dataLen= " << dataLength << ")";
if (buffer == NULL) {
- LOG(LS_ERROR) << "buffer NULL";
+ RTC_LOG(LS_ERROR) << "buffer NULL";
}
if (!out.Write(buffer, dataLength)) {
@@ -1077,11 +1081,11 @@
}
int32_t ModuleFileUtility::codec_info(CodecInst& codecInst) {
- LOG(LS_VERBOSE) << "ModuleFileUtility::codec_info(codecInst= " << &codecInst
- << ")";
+ RTC_LOG(LS_VERBOSE) << "ModuleFileUtility::codec_info(codecInst= "
+ << &codecInst << ")";
if (!_reading && !_writing) {
- LOG(LS_ERROR) << "CodecInst: not currently reading audio file!";
+ RTC_LOG(LS_ERROR) << "CodecInst: not currently reading audio file!";
return -1;
}
memcpy(&codecInst, &codec_info_, sizeof(CodecInst));
@@ -1137,31 +1141,31 @@
const FileFormats fileFormat,
const uint32_t freqInHz) {
if (fileName == NULL) {
- LOG(LS_ERROR) << "filename NULL";
+ RTC_LOG(LS_ERROR) << "filename NULL";
return -1;
}
int32_t time_in_ms = -1;
struct stat file_size;
if (stat(fileName, &file_size) == -1) {
- LOG(LS_ERROR) << "failed to retrieve file size with stat!";
+ RTC_LOG(LS_ERROR) << "failed to retrieve file size with stat!";
return -1;
}
FileWrapper* inStreamObj = FileWrapper::Create();
if (inStreamObj == NULL) {
- LOG(LS_INFO) << "failed to create InStream object!";
+ RTC_LOG(LS_INFO) << "failed to create InStream object!";
return -1;
}
if (!inStreamObj->OpenFile(fileName, true)) {
delete inStreamObj;
- LOG(LS_ERROR) << "failed to open file " << fileName << "!";
+ RTC_LOG(LS_ERROR) << "failed to open file " << fileName << "!";
return -1;
}
switch (fileFormat) {
case kFileFormatWavFile: {
if (ReadWavHeader(*inStreamObj) == -1) {
- LOG(LS_ERROR) << "failed to read WAV file header!";
+ RTC_LOG(LS_ERROR) << "failed to read WAV file header!";
return -1;
}
time_in_ms =
@@ -1214,11 +1218,11 @@
break;
}
case kFileFormatPreencodedFile: {
- LOG(LS_ERROR) << "cannot determine duration of Pre-Encoded file!";
+ RTC_LOG(LS_ERROR) << "cannot determine duration of Pre-Encoded file!";
break;
}
default:
- LOG(LS_ERROR) << "unsupported file format " << fileFormat << "!";
+ RTC_LOG(LS_ERROR) << "unsupported file format " << fileFormat << "!";
break;
}
inStreamObj->CloseFile();
@@ -1227,7 +1231,7 @@
}
uint32_t ModuleFileUtility::PlayoutPositionMs() {
- LOG(LS_VERBOSE) << "ModuleFileUtility::PlayoutPosition()";
+ RTC_LOG(LS_VERBOSE) << "ModuleFileUtility::PlayoutPosition()";
return _reading ? _playoutPositionMs : 0;
}
diff --git a/modules/pacing/alr_detector.cc b/modules/pacing/alr_detector.cc
index 1c29e0a..c262251 100644
--- a/modules/pacing/alr_detector.cc
+++ b/modules/pacing/alr_detector.cc
@@ -100,19 +100,19 @@
&settings.alr_stop_budget_level_percent,
&settings.group_id) == 6) {
ret.emplace(settings);
- LOG(LS_INFO) << "Using ALR experiment settings: "
- "pacing factor: "
- << settings.pacing_factor << ", max pacer queue length: "
- << settings.max_paced_queue_time
- << ", ALR start bandwidth usage percent: "
- << settings.alr_bandwidth_usage_percent
- << ", ALR end budget level percent: "
- << settings.alr_start_budget_level_percent
- << ", ALR end budget level percent: "
- << settings.alr_stop_budget_level_percent
- << ", ALR experiment group ID: " << settings.group_id;
+ RTC_LOG(LS_INFO) << "Using ALR experiment settings: "
+ "pacing factor: "
+ << settings.pacing_factor << ", max pacer queue length: "
+ << settings.max_paced_queue_time
+ << ", ALR start bandwidth usage percent: "
+ << settings.alr_bandwidth_usage_percent
+ << ", ALR end budget level percent: "
+ << settings.alr_start_budget_level_percent
+ << ", ALR end budget level percent: "
+ << settings.alr_stop_budget_level_percent
+ << ", ALR experiment group ID: " << settings.group_id;
} else {
- LOG(LS_INFO) << "Failed to parse ALR experiment: " << experiment_name;
+ RTC_LOG(LS_INFO) << "Failed to parse ALR experiment: " << experiment_name;
}
return ret;
diff --git a/modules/pacing/bitrate_prober.cc b/modules/pacing/bitrate_prober.cc
index 08c000d..1dc77c5 100644
--- a/modules/pacing/bitrate_prober.cc
+++ b/modules/pacing/bitrate_prober.cc
@@ -62,11 +62,11 @@
if (enable) {
if (probing_state_ == ProbingState::kDisabled) {
probing_state_ = ProbingState::kInactive;
- LOG(LS_INFO) << "Bandwidth probing enabled, set to inactive";
+ RTC_LOG(LS_INFO) << "Bandwidth probing enabled, set to inactive";
}
} else {
probing_state_ = ProbingState::kDisabled;
- LOG(LS_INFO) << "Bandwidth probing disabled";
+ RTC_LOG(LS_INFO) << "Bandwidth probing disabled";
}
}
@@ -108,10 +108,10 @@
cluster.pace_info.probe_cluster_min_probes,
cluster.pace_info.probe_cluster_min_bytes));
- LOG(LS_INFO) << "Probe cluster (bitrate:min bytes:min packets): ("
- << cluster.pace_info.send_bitrate_bps << ":"
- << cluster.pace_info.probe_cluster_min_bytes << ":"
- << cluster.pace_info.probe_cluster_min_probes << ")";
+ RTC_LOG(LS_INFO) << "Probe cluster (bitrate:min bytes:min packets): ("
+ << cluster.pace_info.send_bitrate_bps << ":"
+ << cluster.pace_info.probe_cluster_min_bytes << ":"
+ << cluster.pace_info.probe_cluster_min_probes << ")";
// If we are already probing, continue to do so. Otherwise set it to
// kInactive and wait for OnIncomingPacket to start the probing.
if (probing_state_ != ProbingState::kActive)
diff --git a/modules/pacing/paced_sender.cc b/modules/pacing/paced_sender.cc
index 319d441..e02faa4 100644
--- a/modules/pacing/paced_sender.cc
+++ b/modules/pacing/paced_sender.cc
@@ -89,7 +89,7 @@
{
rtc::CritScope cs(&critsect_);
if (!paused_)
- LOG(LS_INFO) << "PacedSender paused.";
+ RTC_LOG(LS_INFO) << "PacedSender paused.";
paused_ = true;
packets_->SetPauseState(true, clock_->TimeInMilliseconds());
}
@@ -103,7 +103,7 @@
{
rtc::CritScope cs(&critsect_);
if (paused_)
- LOG(LS_INFO) << "PacedSender resumed.";
+ RTC_LOG(LS_INFO) << "PacedSender resumed.";
paused_ = false;
packets_->SetPauseState(false, clock_->TimeInMilliseconds());
}
@@ -121,7 +121,7 @@
void PacedSender::SetEstimatedBitrate(uint32_t bitrate_bps) {
if (bitrate_bps == 0)
- LOG(LS_ERROR) << "PacedSender is not designed to handle 0 bitrate.";
+ RTC_LOG(LS_ERROR) << "PacedSender is not designed to handle 0 bitrate.";
rtc::CritScope cs(&critsect_);
estimated_bitrate_bps_ = bitrate_bps;
padding_budget_->set_target_rate_kbps(
@@ -309,7 +309,7 @@
}
void PacedSender::ProcessThreadAttached(ProcessThread* process_thread) {
- LOG(LS_INFO) << "ProcessThreadAttached 0x" << std::hex << process_thread;
+ RTC_LOG(LS_INFO) << "ProcessThreadAttached 0x" << std::hex << process_thread;
process_thread_ = process_thread;
}
diff --git a/modules/remote_bitrate_estimator/aimd_rate_control.cc b/modules/remote_bitrate_estimator/aimd_rate_control.cc
index 25d756c..b83a3c6 100644
--- a/modules/remote_bitrate_estimator/aimd_rate_control.cc
+++ b/modules/remote_bitrate_estimator/aimd_rate_control.cc
@@ -41,15 +41,15 @@
sscanf(experiment_string.c_str(), "Enabled-%f", &backoff_factor);
if (parsed_values == 1) {
if (backoff_factor >= 1.0f) {
- LOG(WARNING) << "Back-off factor must be less than 1.";
+ RTC_LOG(WARNING) << "Back-off factor must be less than 1.";
} else if (backoff_factor <= 0.0f) {
- LOG(WARNING) << "Back-off factor must be greater than 0.";
+ RTC_LOG(WARNING) << "Back-off factor must be greater than 0.";
} else {
return backoff_factor;
}
}
- LOG(LS_WARNING) << "Failed to parse parameters for AimdRateControl "
- "experiment from field trial string. Using default.";
+ RTC_LOG(LS_WARNING) << "Failed to parse parameters for AimdRateControl "
+ "experiment from field trial string. Using default.";
return kDefaultBackoffFactor;
}
@@ -71,7 +71,7 @@
in_experiment_(!AdaptiveThresholdExperimentIsDisabled()),
smoothing_experiment_(
webrtc::field_trial::IsEnabled("WebRTC-Audio-BandwidthSmoothing")) {
- LOG(LS_INFO) << "Using aimd rate control with back off factor " << beta_;
+ RTC_LOG(LS_INFO) << "Using aimd rate control with back off factor " << beta_;
}
AimdRateControl::~AimdRateControl() {}
diff --git a/modules/remote_bitrate_estimator/inter_arrival.cc b/modules/remote_bitrate_estimator/inter_arrival.cc
index 3c448dd..ef3ca8b 100644
--- a/modules/remote_bitrate_estimator/inter_arrival.cc
+++ b/modules/remote_bitrate_estimator/inter_arrival.cc
@@ -62,9 +62,10 @@
prev_timestamp_group_.last_system_time_ms;
if (*arrival_time_delta_ms - system_time_delta_ms >=
kArrivalTimeOffsetThresholdMs) {
- LOG(LS_WARNING) << "The arrival time clock offset has changed (diff = "
- << *arrival_time_delta_ms - system_time_delta_ms
- << " ms), resetting.";
+ RTC_LOG(LS_WARNING)
+ << "The arrival time clock offset has changed (diff = "
+ << *arrival_time_delta_ms - system_time_delta_ms
+ << " ms), resetting.";
Reset();
return false;
}
@@ -73,9 +74,10 @@
// arrival timestamp.
++num_consecutive_reordered_packets_;
if (num_consecutive_reordered_packets_ >= kReorderedResetThreshold) {
- LOG(LS_WARNING) << "Packets are being reordered on the path from the "
- "socket to the bandwidth estimator. Ignoring this "
- "packet for bandwidth estimation, resetting.";
+ RTC_LOG(LS_WARNING)
+ << "Packets are being reordered on the path from the "
+ "socket to the bandwidth estimator. Ignoring this "
+ "packet for bandwidth estimation, resetting.";
Reset();
}
return false;
diff --git a/modules/remote_bitrate_estimator/overuse_estimator.cc b/modules/remote_bitrate_estimator/overuse_estimator.cc
index ffed5e3..3d8ab2a 100644
--- a/modules/remote_bitrate_estimator/overuse_estimator.cc
+++ b/modules/remote_bitrate_estimator/overuse_estimator.cc
@@ -113,8 +113,9 @@
E_[0][0] * E_[1][1] - E_[0][1] * E_[1][0] >= 0 && E_[0][0] >= 0;
assert(positive_semi_definite);
if (!positive_semi_definite) {
- LOG(LS_ERROR) << "The over-use estimator's covariance matrix is no longer "
- "semi-definite.";
+ RTC_LOG(LS_ERROR)
+ << "The over-use estimator's covariance matrix is no longer "
+ "semi-definite.";
}
slope_ = slope_ + K[0] * residual;
diff --git a/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc b/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc
index ce8924d..f020b21 100644
--- a/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc
+++ b/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc
@@ -92,7 +92,7 @@
last_update_ms_(-1),
uma_recorded_(false) {
RTC_DCHECK(observer_);
- LOG(LS_INFO) << "RemoteBitrateEstimatorAbsSendTime: Instantiating.";
+ RTC_LOG(LS_INFO) << "RemoteBitrateEstimatorAbsSendTime: Instantiating.";
}
void RemoteBitrateEstimatorAbsSendTime::ComputeClusters(
@@ -154,11 +154,11 @@
} else {
int send_bitrate_bps = it->mean_size * 8 * 1000 / it->send_mean_ms;
int recv_bitrate_bps = it->mean_size * 8 * 1000 / it->recv_mean_ms;
- LOG(LS_INFO) << "Probe failed, sent at " << send_bitrate_bps
- << " bps, received at " << recv_bitrate_bps
- << " bps. Mean send delta: " << it->send_mean_ms
- << " ms, mean recv delta: " << it->recv_mean_ms
- << " ms, num probes: " << it->count;
+ RTC_LOG(LS_INFO) << "Probe failed, sent at " << send_bitrate_bps
+ << " bps, received at " << recv_bitrate_bps
+ << " bps. Mean send delta: " << it->send_mean_ms
+ << " ms, mean recv delta: " << it->recv_mean_ms
+ << " ms, num probes: " << it->count;
break;
}
}
@@ -184,12 +184,12 @@
// Make sure that a probe sent on a lower bitrate than our estimate can't
// reduce the estimate.
if (IsBitrateImproving(probe_bitrate_bps)) {
- LOG(LS_INFO) << "Probe successful, sent at "
- << best_it->GetSendBitrateBps() << " bps, received at "
- << best_it->GetRecvBitrateBps()
- << " bps. Mean send delta: " << best_it->send_mean_ms
- << " ms, mean recv delta: " << best_it->recv_mean_ms
- << " ms, num probes: " << best_it->count;
+ RTC_LOG(LS_INFO) << "Probe successful, sent at "
+ << best_it->GetSendBitrateBps() << " bps, received at "
+ << best_it->GetRecvBitrateBps()
+ << " bps. Mean send delta: " << best_it->send_mean_ms
+ << " ms, mean recv delta: " << best_it->recv_mean_ms
+ << " ms, num probes: " << best_it->count;
remote_rate_.SetEstimate(probe_bitrate_bps, now_ms);
return ProbeResult::kBitrateUpdated;
}
@@ -217,8 +217,9 @@
const RTPHeader& header) {
RTC_DCHECK_RUNS_SERIALIZED(&network_race_);
if (!header.extension.hasAbsoluteSendTime) {
- LOG(LS_WARNING) << "RemoteBitrateEstimatorAbsSendTimeImpl: Incoming packet "
- "is missing absolute send time extension!";
+ RTC_LOG(LS_WARNING)
+ << "RemoteBitrateEstimatorAbsSendTimeImpl: Incoming packet "
+ "is missing absolute send time extension!";
return;
}
IncomingPacketInfo(arrival_time_ms, header.extension.absoluteSendTime,
@@ -291,10 +292,10 @@
send_delta_ms = send_time_ms - probes_.back().send_time_ms;
recv_delta_ms = arrival_time_ms - probes_.back().recv_time_ms;
}
- LOG(LS_INFO) << "Probe packet received: send time=" << send_time_ms
- << " ms, recv time=" << arrival_time_ms
- << " ms, send delta=" << send_delta_ms
- << " ms, recv delta=" << recv_delta_ms << " ms.";
+ RTC_LOG(LS_INFO) << "Probe packet received: send time=" << send_time_ms
+ << " ms, recv time=" << arrival_time_ms
+ << " ms, send delta=" << send_delta_ms
+ << " ms, recv delta=" << recv_delta_ms << " ms.";
}
probes_.push_back(Probe(send_time_ms, arrival_time_ms, payload_size));
++total_probes_received_;
diff --git a/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc b/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc
index d258d5d..a914a84 100644
--- a/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc
+++ b/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc
@@ -53,7 +53,7 @@
last_process_time_(-1),
process_interval_ms_(kProcessIntervalMs),
uma_recorded_(false) {
- LOG(LS_INFO) << "RemoteBitrateEstimatorSingleStream: Instantiating.";
+ RTC_LOG(LS_INFO) << "RemoteBitrateEstimatorSingleStream: Instantiating.";
}
RemoteBitrateEstimatorSingleStream::~RemoteBitrateEstimatorSingleStream() {
diff --git a/modules/remote_bitrate_estimator/remote_estimator_proxy.cc b/modules/remote_bitrate_estimator/remote_estimator_proxy.cc
index 0e6caff..77354e1 100644
--- a/modules/remote_bitrate_estimator/remote_estimator_proxy.cc
+++ b/modules/remote_bitrate_estimator/remote_estimator_proxy.cc
@@ -49,8 +49,9 @@
size_t payload_size,
const RTPHeader& header) {
if (!header.extension.hasTransportSequenceNumber) {
- LOG(LS_WARNING) << "RemoteEstimatorProxy: Incoming packet "
- "is missing the transport sequence number extension!";
+ RTC_LOG(LS_WARNING)
+ << "RemoteEstimatorProxy: Incoming packet "
+ "is missing the transport sequence number extension!";
return;
}
rtc::CritScope cs(&lock_);
@@ -112,7 +113,7 @@
void RemoteEstimatorProxy::OnPacketArrival(uint16_t sequence_number,
int64_t arrival_time) {
if (arrival_time < 0 || arrival_time > kMaxTimeMs) {
- LOG(LS_WARNING) << "Arrival time out of bounds: " << arrival_time;
+ RTC_LOG(LS_WARNING) << "Arrival time out of bounds: " << arrival_time;
return;
}
@@ -122,10 +123,10 @@
// calls to IsNewerSequenceNumber instead.
int64_t seq = unwrapper_.Unwrap(sequence_number);
if (seq > window_start_seq_ + 0xFFFF / 2) {
- LOG(LS_WARNING) << "Skipping this sequence number (" << sequence_number
- << ") since it likely is reordered, but the unwrapper"
- "failed to handle it. Feedback window starts at "
- << window_start_seq_ << ".";
+ RTC_LOG(LS_WARNING) << "Skipping this sequence number (" << sequence_number
+ << ") since it likely is reordered, but the unwrapper"
+ "failed to handle it. Feedback window starts at "
+ << window_start_seq_ << ".";
return;
}
diff --git a/modules/remote_bitrate_estimator/test/bwe_test_logging.h b/modules/remote_bitrate_estimator/test/bwe_test_logging.h
index d4ec2d2..e375ad6 100644
--- a/modules/remote_bitrate_estimator/test/bwe_test_logging.h
+++ b/modules/remote_bitrate_estimator/test/bwe_test_logging.h
@@ -46,8 +46,8 @@
// Log *contexts* are names concatenated with '_' between them, with the name
// of the logged/plotted string/value last. Plot *time* is inherited down the
// tree. A branch is enabled by default but can be *disabled* to reduce output.
-// The difference between the LOG and PLOT macros is that PLOT prefixes the line
-// so it can be easily filtered, plus it outputs the current time.
+// The difference between the RTC_LOG and PLOT macros is that PLOT prefixes the
+// line so it can be easily filtered, plus it outputs the current time.
#if !(BWE_TEST_LOGGING_COMPILE_TIME_ENABLE)
diff --git a/modules/remote_bitrate_estimator/test/estimators/send_side.cc b/modules/remote_bitrate_estimator/test/estimators/send_side.cc
index d26f732..4f67f30 100644
--- a/modules/remote_bitrate_estimator/test/estimators/send_side.cc
+++ b/modules/remote_bitrate_estimator/test/estimators/send_side.cc
@@ -64,7 +64,7 @@
if (!send_time_history_.GetFeedback(&packet_feedback, true)) {
int64_t now_ms = clock_->TimeInMilliseconds();
if (now_ms - last_log_time_ms_ > 5000) {
- LOG(LS_WARNING) << "Ack arrived too late.";
+ RTC_LOG(LS_WARNING) << "Ack arrived too late.";
last_log_time_ms_ = now_ms;
}
}
diff --git a/modules/rtp_rtcp/source/flexfec_header_reader_writer.cc b/modules/rtp_rtcp/source/flexfec_header_reader_writer.cc
index 465334c..d7666e1 100644
--- a/modules/rtp_rtcp/source/flexfec_header_reader_writer.cc
+++ b/modules/rtp_rtcp/source/flexfec_header_reader_writer.cc
@@ -82,26 +82,29 @@
bool FlexfecHeaderReader::ReadFecHeader(
ForwardErrorCorrection::ReceivedFecPacket* fec_packet) const {
if (fec_packet->pkt->length <= kBaseHeaderSize + kStreamSpecificHeaderSize) {
- LOG(LS_WARNING) << "Discarding truncated FlexFEC packet.";
+ RTC_LOG(LS_WARNING) << "Discarding truncated FlexFEC packet.";
return false;
}
bool r_bit = (fec_packet->pkt->data[0] & 0x80) != 0;
if (r_bit) {
- LOG(LS_INFO) << "FlexFEC packet with retransmission bit set. We do not yet "
- "support this, thus discarding the packet.";
+ RTC_LOG(LS_INFO)
+ << "FlexFEC packet with retransmission bit set. We do not yet "
+ "support this, thus discarding the packet.";
return false;
}
bool f_bit = (fec_packet->pkt->data[0] & 0x40) != 0;
if (f_bit) {
- LOG(LS_INFO) << "FlexFEC packet with inflexible generator matrix. We do "
- "not yet support this, thus discarding packet.";
+ RTC_LOG(LS_INFO)
+ << "FlexFEC packet with inflexible generator matrix. We do "
+ "not yet support this, thus discarding packet.";
return false;
}
uint8_t ssrc_count =
ByteReader<uint8_t>::ReadBigEndian(&fec_packet->pkt->data[8]);
if (ssrc_count != 1) {
- LOG(LS_INFO) << "FlexFEC packet protecting multiple media SSRCs. We do not "
- "yet support this, thus discarding packet.";
+ RTC_LOG(LS_INFO)
+ << "FlexFEC packet protecting multiple media SSRCs. We do not "
+ "yet support this, thus discarding packet.";
return false;
}
uint32_t protected_ssrc =
@@ -120,7 +123,7 @@
// We treat the mask parts as unsigned integers with host order endianness
// in order to simplify the bit shifting between bytes.
if (fec_packet->pkt->length < kHeaderSizes[0]) {
- LOG(LS_WARNING) << "Discarding truncated FlexFEC packet.";
+ RTC_LOG(LS_WARNING) << "Discarding truncated FlexFEC packet.";
return false;
}
uint8_t* const packet_mask = fec_packet->pkt->data + kPacketMaskOffset;
@@ -157,7 +160,7 @@
packet_mask_size = kFlexfecPacketMaskSizes[1];
} else {
if (fec_packet->pkt->length < kHeaderSizes[2]) {
- LOG(LS_WARNING) << "Discarding truncated FlexFEC packet.";
+ RTC_LOG(LS_WARNING) << "Discarding truncated FlexFEC packet.";
return false;
}
bool k_bit2 = (packet_mask[6] & 0x80) != 0;
@@ -167,7 +170,8 @@
// FEC header, and the rest of the packet is payload.
packet_mask_size = kFlexfecPacketMaskSizes[2];
} else {
- LOG(LS_WARNING) << "Discarding FlexFEC packet with malformed header.";
+ RTC_LOG(LS_WARNING)
+ << "Discarding FlexFEC packet with malformed header.";
return false;
}
// At this point, K-bits 0 and 1 have been removed, and the front-most
diff --git a/modules/rtp_rtcp/source/flexfec_receiver.cc b/modules/rtp_rtcp/source/flexfec_receiver.cc
index a9a144c..e26a51b 100644
--- a/modules/rtp_rtcp/source/flexfec_receiver.cc
+++ b/modules/rtp_rtcp/source/flexfec_receiver.cc
@@ -79,7 +79,7 @@
if (received_packet->ssrc == ssrc_) {
// This is a FlexFEC packet.
if (packet.payload_size() < kMinFlexfecHeaderSize) {
- LOG(LS_WARNING) << "Truncated FlexFEC packet, discarding.";
+ RTC_LOG(LS_WARNING) << "Truncated FlexFEC packet, discarding.";
return nullptr;
}
received_packet->is_fec = true;
@@ -146,8 +146,8 @@
if (now_ms - last_recovered_packet_ms_ > kPacketLogIntervalMs) {
uint32_t media_ssrc =
ForwardErrorCorrection::ParseSsrc(recovered_packet->pkt->data);
- LOG(LS_VERBOSE) << "Recovered media packet with SSRC: " << media_ssrc
- << " from FlexFEC stream with SSRC: " << ssrc_ << ".";
+ RTC_LOG(LS_VERBOSE) << "Recovered media packet with SSRC: " << media_ssrc
+ << " from FlexFEC stream with SSRC: " << ssrc_ << ".";
last_recovered_packet_ms_ = now_ms;
}
}
diff --git a/modules/rtp_rtcp/source/flexfec_sender.cc b/modules/rtp_rtcp/source/flexfec_sender.cc
index c20c3cf..f046a34 100644
--- a/modules/rtp_rtcp/source/flexfec_sender.cc
+++ b/modules/rtp_rtcp/source/flexfec_sender.cc
@@ -49,9 +49,10 @@
} else if (extension.uri == TransmissionOffset::kUri) {
map.Register<TransmissionOffset>(extension.id);
} else {
- LOG(LS_INFO) << "FlexfecSender only supports RTP header extensions for "
- << "BWE, so the extension " << extension.ToString()
- << " will not be used.";
+ RTC_LOG(LS_INFO)
+ << "FlexfecSender only supports RTP header extensions for "
+ << "BWE, so the extension " << extension.ToString()
+ << " will not be used.";
}
}
return map;
@@ -145,9 +146,9 @@
int64_t now_ms = clock_->TimeInMilliseconds();
if (!fec_packets_to_send.empty() &&
now_ms - last_generated_packet_ms_ > kPacketLogIntervalMs) {
- LOG(LS_VERBOSE) << "Generated " << fec_packets_to_send.size()
- << " FlexFEC packets with payload type: " << payload_type_
- << " and SSRC: " << ssrc_ << ".";
+ RTC_LOG(LS_VERBOSE) << "Generated " << fec_packets_to_send.size()
+ << " FlexFEC packets with payload type: "
+ << payload_type_ << " and SSRC: " << ssrc_ << ".";
last_generated_packet_ms_ = now_ms;
}
diff --git a/modules/rtp_rtcp/source/forward_error_correction.cc b/modules/rtp_rtcp/source/forward_error_correction.cc
index 8dbe9d8..f876cff 100644
--- a/modules/rtp_rtcp/source/forward_error_correction.cc
+++ b/modules/rtp_rtcp/source/forward_error_correction.cc
@@ -118,9 +118,9 @@
RTC_DCHECK(fec_packets->empty());
const size_t max_media_packets = fec_header_writer_->MaxMediaPackets();
if (num_media_packets > max_media_packets) {
- LOG(LS_WARNING) << "Can't protect " << num_media_packets
- << " media packets per frame. Max is " << max_media_packets
- << ".";
+ RTC_LOG(LS_WARNING) << "Can't protect " << num_media_packets
+ << " media packets per frame. Max is "
+ << max_media_packets << ".";
return -1;
}
@@ -128,16 +128,18 @@
for (const auto& media_packet : media_packets) {
RTC_DCHECK(media_packet);
if (media_packet->length < kRtpHeaderSize) {
- LOG(LS_WARNING) << "Media packet " << media_packet->length << " bytes "
- << "is smaller than RTP header.";
+ RTC_LOG(LS_WARNING) << "Media packet " << media_packet->length
+ << " bytes "
+ << "is smaller than RTP header.";
return -1;
}
// Ensure the FEC packets will fit in a typical MTU.
if (media_packet->length + MaxPacketOverhead() + kTransportOverhead >
IP_PACKET_SIZE) {
- LOG(LS_WARNING) << "Media packet " << media_packet->length << " bytes "
- << "with overhead is larger than " << IP_PACKET_SIZE
- << " bytes.";
+ RTC_LOG(LS_WARNING) << "Media packet " << media_packet->length
+ << " bytes "
+ << "with overhead is larger than " << IP_PACKET_SIZE
+ << " bytes.";
}
}
@@ -413,7 +415,7 @@
// TODO(brandtr): Update here when we support multistream protection.
if (fec_packet->protected_ssrc != protected_media_ssrc_) {
- LOG(LS_INFO)
+ RTC_LOG(LS_INFO)
<< "Received FEC packet is protecting an unknown media SSRC; dropping.";
return;
}
@@ -439,7 +441,7 @@
if (fec_packet->protected_packets.empty()) {
// All-zero packet mask; we can discard this FEC packet.
- LOG(LS_WARNING) << "Received FEC packet has an all-zero packet mask.";
+ RTC_LOG(LS_WARNING) << "Received FEC packet has an all-zero packet mask.";
} else {
AssignRecoveredPackets(recovered_packets, fec_packet.get());
// TODO(holmer): Consider replacing this with a binary search for the right
@@ -525,7 +527,7 @@
RecoveredPacket* recovered_packet) {
// Sanity check packet length.
if (fec_packet.pkt->length < fec_packet.fec_header_size) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "The FEC packet is truncated: it does not contain enough room "
<< "for its own header.";
return false;
@@ -543,7 +545,7 @@
if (fec_packet.protection_length >
std::min(sizeof(recovered_packet->pkt->data) - kRtpHeaderSize,
sizeof(fec_packet.pkt->data) - fec_packet.fec_header_size)) {
- LOG(LS_WARNING) << "Incorrect protection length, dropping FEC packet.";
+ RTC_LOG(LS_WARNING) << "Incorrect protection length, dropping FEC packet.";
return false;
}
memcpy(&recovered_packet->pkt->data[kRtpHeaderSize],
@@ -564,8 +566,8 @@
kRtpHeaderSize;
if (recovered_packet->pkt->length >
sizeof(recovered_packet->pkt->data) - kRtpHeaderSize) {
- LOG(LS_WARNING) << "The recovered packet had a length larger than a "
- << "typical IP packet, and is thus dropped.";
+ RTC_LOG(LS_WARNING) << "The recovered packet had a length larger than a "
+ << "typical IP packet, and is thus dropped.";
return false;
}
// Set the SN field.
@@ -722,9 +724,9 @@
if (seq_num_diff > max_media_packets) {
// A big gap in sequence numbers. The old recovered packets
// are now useless, so it's safe to do a reset.
- LOG(LS_INFO) << "Big gap in media/ULPFEC sequence numbers. No need "
- "to keep the old packets in the FEC buffers, thus "
- "resetting them.";
+ RTC_LOG(LS_INFO) << "Big gap in media/ULPFEC sequence numbers. No need "
+ "to keep the old packets in the FEC buffers, thus "
+ "resetting them.";
ResetState(recovered_packets);
}
}
diff --git a/modules/rtp_rtcp/source/receive_statistics_impl.cc b/modules/rtp_rtcp/source/receive_statistics_impl.cc
index 538ff7b..4f956a9 100644
--- a/modules/rtp_rtcp/source/receive_statistics_impl.cc
+++ b/modules/rtp_rtcp/source/receive_statistics_impl.cc
@@ -483,7 +483,7 @@
block.SetMediaSsrc(statistician.first);
block.SetFractionLost(stats.fraction_lost);
if (!block.SetCumulativeLost(stats.packets_lost)) {
- LOG(LS_WARNING) << "Cumulative lost is oversized.";
+ RTC_LOG(LS_WARNING) << "Cumulative lost is oversized.";
result.pop_back();
continue;
}
diff --git a/modules/rtp_rtcp/source/remote_ntp_time_estimator.cc b/modules/rtp_rtcp/source/remote_ntp_time_estimator.cc
index b2102fb..06f17a1 100644
--- a/modules/rtp_rtcp/source/remote_ntp_time_estimator.cc
+++ b/modules/rtp_rtcp/source/remote_ntp_time_estimator.cc
@@ -63,10 +63,11 @@
int64_t receiver_capture_ntp_ms = receiver_capture_ms + ntp_offset;
int64_t now_ms = clock_->TimeInMilliseconds();
if (now_ms - last_timing_log_ms_ > kTimingLogIntervalMs) {
- LOG(LS_INFO) << "RTP timestamp: " << rtp_timestamp
- << " in NTP clock: " << sender_capture_ntp_ms
- << " estimated time in receiver clock: " << receiver_capture_ms
- << " converted to NTP clock: " << receiver_capture_ntp_ms;
+ RTC_LOG(LS_INFO) << "RTP timestamp: " << rtp_timestamp
+ << " in NTP clock: " << sender_capture_ntp_ms
+ << " estimated time in receiver clock: "
+ << receiver_capture_ms
+ << " converted to NTP clock: " << receiver_capture_ntp_ms;
last_timing_log_ms_ = now_ms;
}
return receiver_capture_ntp_ms;
diff --git a/modules/rtp_rtcp/source/rtcp_packet/app.cc b/modules/rtp_rtcp/source/rtcp_packet/app.cc
index a6baf28..6ef97fa 100644
--- a/modules/rtp_rtcp/source/rtcp_packet/app.cc
+++ b/modules/rtp_rtcp/source/rtcp_packet/app.cc
@@ -40,11 +40,11 @@
bool App::Parse(const CommonHeader& packet) {
RTC_DCHECK_EQ(packet.type(), kPacketType);
if (packet.payload_size_bytes() < kAppBaseLength) {
- LOG(LS_WARNING) << "Packet is too small to be a valid APP packet";
+ RTC_LOG(LS_WARNING) << "Packet is too small to be a valid APP packet";
return false;
}
if (packet.payload_size_bytes() % 4 != 0) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "Packet payload must be 32 bits aligned to make a valid APP packet";
return false;
}
diff --git a/modules/rtp_rtcp/source/rtcp_packet/bye.cc b/modules/rtp_rtcp/source/rtcp_packet/bye.cc
index 6cfda83..11d87ef 100644
--- a/modules/rtp_rtcp/source/rtcp_packet/bye.cc
+++ b/modules/rtp_rtcp/source/rtcp_packet/bye.cc
@@ -42,7 +42,7 @@
const uint8_t src_count = packet.count();
// Validate packet.
if (packet.payload_size_bytes() < 4u * src_count) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "Packet is too small to contain CSRCs it promise to have.";
return false;
}
@@ -52,7 +52,7 @@
if (has_reason) {
reason_length = payload[4u * src_count];
if (packet.payload_size_bytes() - 4u * src_count < 1u + reason_length) {
- LOG(LS_WARNING) << "Invalid reason length: " << reason_length;
+ RTC_LOG(LS_WARNING) << "Invalid reason length: " << reason_length;
return false;
}
}
@@ -115,7 +115,7 @@
bool Bye::SetCsrcs(std::vector<uint32_t> csrcs) {
if (csrcs.size() > kMaxNumberOfCsrcs) {
- LOG(LS_WARNING) << "Too many CSRCs for Bye packet.";
+ RTC_LOG(LS_WARNING) << "Too many CSRCs for Bye packet.";
return false;
}
csrcs_ = std::move(csrcs);
diff --git a/modules/rtp_rtcp/source/rtcp_packet/common_header.cc b/modules/rtp_rtcp/source/rtcp_packet/common_header.cc
index a1f38dd..5b54982 100644
--- a/modules/rtp_rtcp/source/rtcp_packet/common_header.cc
+++ b/modules/rtp_rtcp/source/rtcp_packet/common_header.cc
@@ -31,17 +31,18 @@
const uint8_t kVersion = 2;
if (size_bytes < kHeaderSizeBytes) {
- LOG(LS_WARNING) << "Too little data (" << size_bytes << " byte"
- << (size_bytes != 1 ? "s" : "")
- << ") remaining in buffer to parse RTCP header (4 bytes).";
+ RTC_LOG(LS_WARNING)
+ << "Too little data (" << size_bytes << " byte"
+ << (size_bytes != 1 ? "s" : "")
+ << ") remaining in buffer to parse RTCP header (4 bytes).";
return false;
}
uint8_t version = buffer[0] >> 6;
if (version != kVersion) {
- LOG(LS_WARNING) << "Invalid RTCP header: Version must be "
- << static_cast<int>(kVersion) << " but was "
- << static_cast<int>(version);
+ RTC_LOG(LS_WARNING) << "Invalid RTCP header: Version must be "
+ << static_cast<int>(kVersion) << " but was "
+ << static_cast<int>(version);
return false;
}
@@ -53,29 +54,31 @@
padding_size_ = 0;
if (size_bytes < kHeaderSizeBytes + payload_size_) {
- LOG(LS_WARNING) << "Buffer too small (" << size_bytes
- << " bytes) to fit an RtcpPacket with a header and "
- << payload_size_ << " bytes.";
+ RTC_LOG(LS_WARNING) << "Buffer too small (" << size_bytes
+ << " bytes) to fit an RtcpPacket with a header and "
+ << payload_size_ << " bytes.";
return false;
}
if (has_padding) {
if (payload_size_ == 0) {
- LOG(LS_WARNING) << "Invalid RTCP header: Padding bit set but 0 payload "
- "size specified.";
+ RTC_LOG(LS_WARNING)
+ << "Invalid RTCP header: Padding bit set but 0 payload "
+ "size specified.";
return false;
}
padding_size_ = payload_[payload_size_ - 1];
if (padding_size_ == 0) {
- LOG(LS_WARNING) << "Invalid RTCP header: Padding bit set but 0 padding "
- "size specified.";
+ RTC_LOG(LS_WARNING)
+ << "Invalid RTCP header: Padding bit set but 0 padding "
+ "size specified.";
return false;
}
if (padding_size_ > payload_size_) {
- LOG(LS_WARNING) << "Invalid RTCP header: Too many padding bytes ("
- << padding_size_ << ") for a packet payload size of "
- << payload_size_ << " bytes.";
+ RTC_LOG(LS_WARNING) << "Invalid RTCP header: Too many padding bytes ("
+ << padding_size_ << ") for a packet payload size of "
+ << payload_size_ << " bytes.";
return false;
}
payload_size_ -= padding_size_;
diff --git a/modules/rtp_rtcp/source/rtcp_packet/dlrr.cc b/modules/rtp_rtcp/source/rtcp_packet/dlrr.cc
index d0d7b99..40cc2e5 100644
--- a/modules/rtp_rtcp/source/rtcp_packet/dlrr.cc
+++ b/modules/rtp_rtcp/source/rtcp_packet/dlrr.cc
@@ -46,7 +46,7 @@
RTC_DCHECK_EQ(block_length_32bits,
ByteReader<uint16_t>::ReadBigEndian(&buffer[2]));
if (block_length_32bits % 3 != 0) {
- LOG(LS_WARNING) << "Invalid size for dlrr block.";
+ RTC_LOG(LS_WARNING) << "Invalid size for dlrr block.";
return false;
}
diff --git a/modules/rtp_rtcp/source/rtcp_packet/extended_jitter_report.cc b/modules/rtp_rtcp/source/rtcp_packet/extended_jitter_report.cc
index a9c955e..a511289 100644
--- a/modules/rtp_rtcp/source/rtcp_packet/extended_jitter_report.cc
+++ b/modules/rtp_rtcp/source/rtcp_packet/extended_jitter_report.cc
@@ -49,7 +49,7 @@
const uint8_t number_of_jitters = packet.count();
if (packet.payload_size_bytes() < number_of_jitters * kJitterSizeBytes) {
- LOG(LS_WARNING) << "Packet is too small to contain all the jitter.";
+ RTC_LOG(LS_WARNING) << "Packet is too small to contain all the jitter.";
return false;
}
@@ -64,7 +64,7 @@
bool ExtendedJitterReport::SetJitterValues(std::vector<uint32_t> values) {
if (values.size() > kMaxNumberOfJitterValues) {
- LOG(LS_WARNING) << "Too many inter-arrival jitter items.";
+ RTC_LOG(LS_WARNING) << "Too many inter-arrival jitter items.";
return false;
}
inter_arrival_jitters_ = std::move(values);
diff --git a/modules/rtp_rtcp/source/rtcp_packet/extended_reports.cc b/modules/rtp_rtcp/source/rtcp_packet/extended_reports.cc
index cd93592..291175e 100644
--- a/modules/rtp_rtcp/source/rtcp_packet/extended_reports.cc
+++ b/modules/rtp_rtcp/source/rtcp_packet/extended_reports.cc
@@ -47,7 +47,8 @@
RTC_DCHECK_EQ(packet.type(), kPacketType);
if (packet.payload_size_bytes() < kXrBaseLength) {
- LOG(LS_WARNING) << "Packet is too small to be an ExtendedReports packet.";
+ RTC_LOG(LS_WARNING)
+ << "Packet is too small to be an ExtendedReports packet.";
return false;
}
@@ -68,7 +69,8 @@
const uint8_t* next_block =
current_block + kBlockHeaderSizeBytes + block_length * 4;
if (next_block > packet_end) {
- LOG(LS_WARNING) << "Report block in extended report packet is too big.";
+ RTC_LOG(LS_WARNING)
+ << "Report block in extended report packet is too big.";
return false;
}
switch (block_type) {
@@ -86,7 +88,8 @@
break;
default:
// Unknown block, ignore.
- LOG(LS_WARNING) << "Unknown extended report block type " << block_type;
+ RTC_LOG(LS_WARNING)
+ << "Unknown extended report block type " << block_type;
break;
}
current_block = next_block;
@@ -97,7 +100,7 @@
void ExtendedReports::SetRrtr(const Rrtr& rrtr) {
if (rrtr_block_)
- LOG(LS_WARNING) << "Rrtr already set, overwriting.";
+ RTC_LOG(LS_WARNING) << "Rrtr already set, overwriting.";
rrtr_block_.emplace(rrtr);
}
@@ -107,13 +110,13 @@
void ExtendedReports::SetVoipMetric(const VoipMetric& voip_metric) {
if (voip_metric_block_)
- LOG(LS_WARNING) << "Voip metric already set, overwriting.";
+ RTC_LOG(LS_WARNING) << "Voip metric already set, overwriting.";
voip_metric_block_.emplace(voip_metric);
}
void ExtendedReports::SetTargetBitrate(const TargetBitrate& bitrate) {
if (target_bitrate_)
- LOG(LS_WARNING) << "TargetBitrate already set, overwriting.";
+ RTC_LOG(LS_WARNING) << "TargetBitrate already set, overwriting.";
target_bitrate_ = rtc::Optional<TargetBitrate>(bitrate);
}
@@ -165,12 +168,13 @@
void ExtendedReports::ParseRrtrBlock(const uint8_t* block,
uint16_t block_length) {
if (block_length != Rrtr::kBlockLength) {
- LOG(LS_WARNING) << "Incorrect rrtr block size " << block_length
- << " Should be " << Rrtr::kBlockLength;
+ RTC_LOG(LS_WARNING) << "Incorrect rrtr block size " << block_length
+ << " Should be " << Rrtr::kBlockLength;
return;
}
if (rrtr_block_) {
- LOG(LS_WARNING) << "Two rrtr blocks found in same Extended Report packet";
+ RTC_LOG(LS_WARNING)
+ << "Two rrtr blocks found in same Extended Report packet";
return;
}
rrtr_block_.emplace();
@@ -180,7 +184,8 @@
void ExtendedReports::ParseDlrrBlock(const uint8_t* block,
uint16_t block_length) {
if (dlrr_block_) {
- LOG(LS_WARNING) << "Two Dlrr blocks found in same Extended Report packet";
+ RTC_LOG(LS_WARNING)
+ << "Two Dlrr blocks found in same Extended Report packet";
return;
}
dlrr_block_.Parse(block, block_length);
@@ -189,12 +194,12 @@
void ExtendedReports::ParseVoipMetricBlock(const uint8_t* block,
uint16_t block_length) {
if (block_length != VoipMetric::kBlockLength) {
- LOG(LS_WARNING) << "Incorrect voip metric block size " << block_length
- << " Should be " << VoipMetric::kBlockLength;
+ RTC_LOG(LS_WARNING) << "Incorrect voip metric block size " << block_length
+ << " Should be " << VoipMetric::kBlockLength;
return;
}
if (voip_metric_block_) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "Two Voip Metric blocks found in same Extended Report packet";
return;
}
diff --git a/modules/rtp_rtcp/source/rtcp_packet/fir.cc b/modules/rtp_rtcp/source/rtcp_packet/fir.cc
index a817971..a7692fb 100644
--- a/modules/rtp_rtcp/source/rtcp_packet/fir.cc
+++ b/modules/rtp_rtcp/source/rtcp_packet/fir.cc
@@ -54,12 +54,12 @@
// The FCI field MUST contain one or more FIR entries.
if (packet.payload_size_bytes() < kCommonFeedbackLength + kFciLength) {
- LOG(LS_WARNING) << "Packet is too small to be a valid FIR packet.";
+ RTC_LOG(LS_WARNING) << "Packet is too small to be a valid FIR packet.";
return false;
}
if ((packet.payload_size_bytes() - kCommonFeedbackLength) % kFciLength != 0) {
- LOG(LS_WARNING) << "Invalid size for a valid FIR packet.";
+ RTC_LOG(LS_WARNING) << "Invalid size for a valid FIR packet.";
return false;
}
diff --git a/modules/rtp_rtcp/source/rtcp_packet/nack.cc b/modules/rtp_rtcp/source/rtcp_packet/nack.cc
index 4cf2d7d..c196e29 100644
--- a/modules/rtp_rtcp/source/rtcp_packet/nack.cc
+++ b/modules/rtp_rtcp/source/rtcp_packet/nack.cc
@@ -53,8 +53,8 @@
RTC_DCHECK_EQ(packet.fmt(), kFeedbackMessageType);
if (packet.payload_size_bytes() < kCommonFeedbackLength + kNackItemLength) {
- LOG(LS_WARNING) << "Payload length " << packet.payload_size_bytes()
- << " is too small for a Nack.";
+ RTC_LOG(LS_WARNING) << "Payload length " << packet.payload_size_bytes()
+ << " is too small for a Nack.";
return false;
}
size_t nack_items =
diff --git a/modules/rtp_rtcp/source/rtcp_packet/pli.cc b/modules/rtp_rtcp/source/rtcp_packet/pli.cc
index 112397d..07fa259 100644
--- a/modules/rtp_rtcp/source/rtcp_packet/pli.cc
+++ b/modules/rtp_rtcp/source/rtcp_packet/pli.cc
@@ -41,7 +41,7 @@
RTC_DCHECK_EQ(packet.fmt(), kFeedbackMessageType);
if (packet.payload_size_bytes() < kCommonFeedbackLength) {
- LOG(LS_WARNING) << "Packet is too small to be a valid PLI packet";
+ RTC_LOG(LS_WARNING) << "Packet is too small to be a valid PLI packet";
return false;
}
diff --git a/modules/rtp_rtcp/source/rtcp_packet/rapid_resync_request.cc b/modules/rtp_rtcp/source/rtcp_packet/rapid_resync_request.cc
index a1ef3c5..e79edbd 100644
--- a/modules/rtp_rtcp/source/rtcp_packet/rapid_resync_request.cc
+++ b/modules/rtp_rtcp/source/rtcp_packet/rapid_resync_request.cc
@@ -34,9 +34,10 @@
RTC_DCHECK_EQ(packet.fmt(), kFeedbackMessageType);
if (packet.payload_size_bytes() != kCommonFeedbackLength) {
- LOG(LS_WARNING) << "Packet payload size should be " << kCommonFeedbackLength
- << " instead of " << packet.payload_size_bytes()
- << " to be a valid Rapid Resynchronisation Request";
+ RTC_LOG(LS_WARNING) << "Packet payload size should be "
+ << kCommonFeedbackLength << " instead of "
+ << packet.payload_size_bytes()
+ << " to be a valid Rapid Resynchronisation Request";
return false;
}
diff --git a/modules/rtp_rtcp/source/rtcp_packet/receiver_report.cc b/modules/rtp_rtcp/source/rtcp_packet/receiver_report.cc
index dfe75a7..1654f48 100644
--- a/modules/rtp_rtcp/source/rtcp_packet/receiver_report.cc
+++ b/modules/rtp_rtcp/source/rtcp_packet/receiver_report.cc
@@ -44,7 +44,7 @@
if (packet.payload_size_bytes() <
kRrBaseLength + report_blocks_count * ReportBlock::kLength) {
- LOG(LS_WARNING) << "Packet is too small to contain all the data.";
+ RTC_LOG(LS_WARNING) << "Packet is too small to contain all the data.";
return false;
}
@@ -89,7 +89,7 @@
bool ReceiverReport::AddReportBlock(const ReportBlock& block) {
if (report_blocks_.size() >= kMaxNumberOfReportBlocks) {
- LOG(LS_WARNING) << "Max report blocks reached.";
+ RTC_LOG(LS_WARNING) << "Max report blocks reached.";
return false;
}
report_blocks_.push_back(block);
@@ -98,8 +98,8 @@
bool ReceiverReport::SetReportBlocks(std::vector<ReportBlock> blocks) {
if (blocks.size() > kMaxNumberOfReportBlocks) {
- LOG(LS_WARNING) << "Too many report blocks (" << blocks.size()
- << ") for receiver report.";
+ RTC_LOG(LS_WARNING) << "Too many report blocks (" << blocks.size()
+ << ") for receiver report.";
return false;
}
report_blocks_ = std::move(blocks);
diff --git a/modules/rtp_rtcp/source/rtcp_packet/remb.cc b/modules/rtp_rtcp/source/rtcp_packet/remb.cc
index e599a0b..981a296 100644
--- a/modules/rtp_rtcp/source/rtcp_packet/remb.cc
+++ b/modules/rtp_rtcp/source/rtcp_packet/remb.cc
@@ -48,20 +48,20 @@
RTC_DCHECK_EQ(packet.fmt(), kFeedbackMessageType);
if (packet.payload_size_bytes() < 16) {
- LOG(LS_WARNING) << "Payload length " << packet.payload_size_bytes()
- << " is too small for Remb packet.";
+ RTC_LOG(LS_WARNING) << "Payload length " << packet.payload_size_bytes()
+ << " is too small for Remb packet.";
return false;
}
const uint8_t* const payload = packet.payload();
if (kUniqueIdentifier != ByteReader<uint32_t>::ReadBigEndian(&payload[8])) {
- LOG(LS_WARNING) << "REMB identifier not found, not a REMB packet.";
+ RTC_LOG(LS_WARNING) << "REMB identifier not found, not a REMB packet.";
return false;
}
uint8_t number_of_ssrcs = payload[12];
if (packet.payload_size_bytes() !=
kCommonFeedbackLength + (2 + number_of_ssrcs) * 4) {
- LOG(LS_WARNING) << "Payload size " << packet.payload_size_bytes()
- << " does not match " << number_of_ssrcs << " ssrcs.";
+ RTC_LOG(LS_WARNING) << "Payload size " << packet.payload_size_bytes()
+ << " does not match " << number_of_ssrcs << " ssrcs.";
return false;
}
@@ -72,8 +72,8 @@
bitrate_bps_ = (mantissa << exponenta);
bool shift_overflow = (bitrate_bps_ >> exponenta) != mantissa;
if (shift_overflow) {
- LOG(LS_ERROR) << "Invalid remb bitrate value : " << mantissa
- << "*2^" << static_cast<int>(exponenta);
+ RTC_LOG(LS_ERROR) << "Invalid remb bitrate value : " << mantissa << "*2^"
+ << static_cast<int>(exponenta);
return false;
}
@@ -90,7 +90,7 @@
bool Remb::SetSsrcs(std::vector<uint32_t> ssrcs) {
if (ssrcs.size() > kMaxNumberOfSsrcs) {
- LOG(LS_WARNING) << "Not enough space for all given SSRCs.";
+ RTC_LOG(LS_WARNING) << "Not enough space for all given SSRCs.";
return false;
}
ssrcs_ = std::move(ssrcs);
diff --git a/modules/rtp_rtcp/source/rtcp_packet/report_block.cc b/modules/rtp_rtcp/source/rtcp_packet/report_block.cc
index 63c3222..db84b6c 100644
--- a/modules/rtp_rtcp/source/rtcp_packet/report_block.cc
+++ b/modules/rtp_rtcp/source/rtcp_packet/report_block.cc
@@ -48,7 +48,7 @@
bool ReportBlock::Parse(const uint8_t* buffer, size_t length) {
RTC_DCHECK(buffer != nullptr);
if (length < ReportBlock::kLength) {
- LOG(LS_ERROR) << "Report Block should be 24 bytes long";
+ RTC_LOG(LS_ERROR) << "Report Block should be 24 bytes long";
return false;
}
@@ -78,7 +78,8 @@
bool ReportBlock::SetCumulativeLost(uint32_t cumulative_lost) {
if (cumulative_lost >= (1u << 24)) { // Have only 3 bytes to store it.
- LOG(LS_WARNING) << "Cumulative lost is too big to fit into Report Block";
+ RTC_LOG(LS_WARNING)
+ << "Cumulative lost is too big to fit into Report Block";
return false;
}
cumulative_lost_ = cumulative_lost;
diff --git a/modules/rtp_rtcp/source/rtcp_packet/sdes.cc b/modules/rtp_rtcp/source/rtcp_packet/sdes.cc
index 50fc392..5fe9408 100644
--- a/modules/rtp_rtcp/source/rtcp_packet/sdes.cc
+++ b/modules/rtp_rtcp/source/rtcp_packet/sdes.cc
@@ -73,9 +73,10 @@
size_t block_length = kHeaderLength;
if (packet.payload_size_bytes() % 4 != 0) {
- LOG(LS_WARNING) << "Invalid payload size " << packet.payload_size_bytes()
- << " bytes for a valid Sdes packet. Size should be"
- " multiple of 4 bytes";
+ RTC_LOG(LS_WARNING) << "Invalid payload size "
+ << packet.payload_size_bytes()
+ << " bytes for a valid Sdes packet. Size should be"
+ " multiple of 4 bytes";
}
const uint8_t* const payload_end =
packet.payload() + packet.payload_size_bytes();
@@ -84,7 +85,7 @@
for (size_t i = 0; i < number_of_chunks;) {
// Each chunk consumes at least 8 bytes.
if (payload_end - looking_at < 8) {
- LOG(LS_WARNING) << "Not enough space left for chunk #" << (i + 1);
+ RTC_LOG(LS_WARNING) << "Not enough space left for chunk #" << (i + 1);
return false;
}
chunks[i].ssrc = ByteReader<uint32_t>::ReadBigEndian(looking_at);
@@ -94,22 +95,23 @@
uint8_t item_type;
while ((item_type = *(looking_at++)) != kTerminatorTag) {
if (looking_at >= payload_end) {
- LOG(LS_WARNING) << "Unexpected end of packet while reading chunk #"
- << (i + 1) << ". Expected to find size of the text.";
+ RTC_LOG(LS_WARNING)
+ << "Unexpected end of packet while reading chunk #" << (i + 1)
+ << ". Expected to find size of the text.";
return false;
}
uint8_t item_length = *(looking_at++);
const size_t kTerminatorSize = 1;
if (looking_at + item_length + kTerminatorSize > payload_end) {
- LOG(LS_WARNING) << "Unexpected end of packet while reading chunk #"
- << (i + 1) << ". Expected to find text of size "
- << item_length;
+ RTC_LOG(LS_WARNING)
+ << "Unexpected end of packet while reading chunk #" << (i + 1)
+ << ". Expected to find text of size " << item_length;
return false;
}
if (item_type == kCnameTag) {
if (cname_found) {
- LOG(LS_WARNING) << "Found extra CNAME for same ssrc in chunk #"
- << (i + 1);
+ RTC_LOG(LS_WARNING)
+ << "Found extra CNAME for same ssrc in chunk #" << (i + 1);
return false;
}
cname_found = true;
@@ -128,7 +130,7 @@
// But same time it allows chunk without items.
// So while parsing, ignore all chunks without cname,
// but do not fail the parse.
- LOG(LS_WARNING) << "CNAME not found for ssrc " << chunks[i].ssrc;
+ RTC_LOG(LS_WARNING) << "CNAME not found for ssrc " << chunks[i].ssrc;
--number_of_chunks;
chunks.resize(number_of_chunks);
}
@@ -144,7 +146,7 @@
bool Sdes::AddCName(uint32_t ssrc, std::string cname) {
RTC_DCHECK_LE(cname.length(), 0xffu);
if (chunks_.size() >= kMaxNumberOfChunks) {
- LOG(LS_WARNING) << "Max SDES chunks reached.";
+ RTC_LOG(LS_WARNING) << "Max SDES chunks reached.";
return false;
}
Chunk chunk;
diff --git a/modules/rtp_rtcp/source/rtcp_packet/sender_report.cc b/modules/rtp_rtcp/source/rtcp_packet/sender_report.cc
index 41222cf..637cbb6 100644
--- a/modules/rtp_rtcp/source/rtcp_packet/sender_report.cc
+++ b/modules/rtp_rtcp/source/rtcp_packet/sender_report.cc
@@ -54,7 +54,7 @@
const uint8_t report_block_count = packet.count();
if (packet.payload_size_bytes() <
kSenderBaseLength + report_block_count * ReportBlock::kLength) {
- LOG(LS_WARNING) << "Packet is too small to contain all the data.";
+ RTC_LOG(LS_WARNING) << "Packet is too small to contain all the data.";
return false;
}
// Read SenderReport header.
@@ -118,7 +118,7 @@
bool SenderReport::AddReportBlock(const ReportBlock& block) {
if (report_blocks_.size() >= kMaxNumberOfReportBlocks) {
- LOG(LS_WARNING) << "Max report blocks reached.";
+ RTC_LOG(LS_WARNING) << "Max report blocks reached.";
return false;
}
report_blocks_.push_back(block);
@@ -127,8 +127,8 @@
bool SenderReport::SetReportBlocks(std::vector<ReportBlock> blocks) {
if (blocks.size() > kMaxNumberOfReportBlocks) {
- LOG(LS_WARNING) << "Too many report blocks (" << blocks.size()
- << ") for sender report.";
+ RTC_LOG(LS_WARNING) << "Too many report blocks (" << blocks.size()
+ << ") for sender report.";
return false;
}
report_blocks_ = std::move(blocks);
diff --git a/modules/rtp_rtcp/source/rtcp_packet/tmmb_item.cc b/modules/rtp_rtcp/source/rtcp_packet/tmmb_item.cc
index 96bab16..810e1e2 100644
--- a/modules/rtp_rtcp/source/rtcp_packet/tmmb_item.cc
+++ b/modules/rtp_rtcp/source/rtcp_packet/tmmb_item.cc
@@ -41,8 +41,8 @@
bool shift_overflow = (bitrate_bps_ >> exponent) != mantissa;
if (shift_overflow) {
- LOG(LS_ERROR) << "Invalid tmmb bitrate value : " << mantissa
- << "*2^" << static_cast<int>(exponent);
+ RTC_LOG(LS_ERROR) << "Invalid tmmb bitrate value : " << mantissa << "*2^"
+ << static_cast<int>(exponent);
return false;
}
packet_overhead_ = overhead;
diff --git a/modules/rtp_rtcp/source/rtcp_packet/tmmbn.cc b/modules/rtp_rtcp/source/rtcp_packet/tmmbn.cc
index 271e83c..6205dad 100644
--- a/modules/rtp_rtcp/source/rtcp_packet/tmmbn.cc
+++ b/modules/rtp_rtcp/source/rtcp_packet/tmmbn.cc
@@ -52,14 +52,14 @@
RTC_DCHECK_EQ(packet.fmt(), kFeedbackMessageType);
if (packet.payload_size_bytes() < kCommonFeedbackLength) {
- LOG(LS_WARNING) << "Payload length " << packet.payload_size_bytes()
- << " is too small for TMMBN.";
+ RTC_LOG(LS_WARNING) << "Payload length " << packet.payload_size_bytes()
+ << " is too small for TMMBN.";
return false;
}
size_t items_size_bytes = packet.payload_size_bytes() - kCommonFeedbackLength;
if (items_size_bytes % TmmbItem::kLength != 0) {
- LOG(LS_WARNING) << "Payload length " << packet.payload_size_bytes()
- << " is not valid for TMMBN.";
+ RTC_LOG(LS_WARNING) << "Payload length " << packet.payload_size_bytes()
+ << " is not valid for TMMBN.";
return false;
}
ParseCommonFeedback(packet.payload());
diff --git a/modules/rtp_rtcp/source/rtcp_packet/tmmbr.cc b/modules/rtp_rtcp/source/rtcp_packet/tmmbr.cc
index 867c41a..34f3102 100644
--- a/modules/rtp_rtcp/source/rtcp_packet/tmmbr.cc
+++ b/modules/rtp_rtcp/source/rtcp_packet/tmmbr.cc
@@ -53,14 +53,14 @@
RTC_DCHECK_EQ(packet.fmt(), kFeedbackMessageType);
if (packet.payload_size_bytes() < kCommonFeedbackLength + TmmbItem::kLength) {
- LOG(LS_WARNING) << "Payload length " << packet.payload_size_bytes()
- << " is too small for a TMMBR.";
+ RTC_LOG(LS_WARNING) << "Payload length " << packet.payload_size_bytes()
+ << " is too small for a TMMBR.";
return false;
}
size_t items_size_bytes = packet.payload_size_bytes() - kCommonFeedbackLength;
if (items_size_bytes % TmmbItem::kLength != 0) {
- LOG(LS_WARNING) << "Payload length " << packet.payload_size_bytes()
- << " is not valid for a TMMBR.";
+ RTC_LOG(LS_WARNING) << "Payload length " << packet.payload_size_bytes()
+ << " is not valid for a TMMBR.";
return false;
}
ParseCommonFeedback(packet.payload());
diff --git a/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.cc b/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.cc
index 676b7df..794829c 100644
--- a/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.cc
+++ b/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.cc
@@ -343,7 +343,7 @@
int16_t delta = static_cast<int16_t>(delta_full);
// If larger than 16bit signed, we can't represent it - need new fb packet.
if (delta != delta_full) {
- LOG(LS_WARNING) << "Delta value too large ( >= 2^16 ticks )";
+ RTC_LOG(LS_WARNING) << "Delta value too large ( >= 2^16 ticks )";
return false;
}
@@ -387,10 +387,10 @@
TRACE_EVENT0("webrtc", "TransportFeedback::Parse");
if (packet.payload_size_bytes() < kMinPayloadSizeBytes) {
- LOG(LS_WARNING) << "Buffer too small (" << packet.payload_size_bytes()
- << " bytes) to fit a "
- "FeedbackPacket. Minimum size = "
- << kMinPayloadSizeBytes;
+ RTC_LOG(LS_WARNING) << "Buffer too small (" << packet.payload_size_bytes()
+ << " bytes) to fit a "
+ "FeedbackPacket. Minimum size = "
+ << kMinPayloadSizeBytes;
return false;
}
@@ -406,7 +406,7 @@
const size_t end_index = packet.payload_size_bytes();
if (status_count == 0) {
- LOG(LS_WARNING) << "Empty feedback messages not allowed.";
+ RTC_LOG(LS_WARNING) << "Empty feedback messages not allowed.";
return false;
}
@@ -414,7 +414,7 @@
delta_sizes.reserve(status_count);
while (delta_sizes.size() < status_count) {
if (index + kChunkSizeBytes > end_index) {
- LOG(LS_WARNING) << "Buffer overflow while parsing packet.";
+ RTC_LOG(LS_WARNING) << "Buffer overflow while parsing packet.";
Clear();
return false;
}
@@ -433,7 +433,7 @@
uint16_t seq_no = base_seq_no_;
for (size_t delta_size : delta_sizes) {
if (index + delta_size > end_index) {
- LOG(LS_WARNING) << "Buffer overflow while parsing packet.";
+ RTC_LOG(LS_WARNING) << "Buffer overflow while parsing packet.";
Clear();
return false;
}
@@ -456,7 +456,7 @@
}
case 3:
Clear();
- LOG(LS_WARNING) << "Invalid delta_size for seq_no " << seq_no;
+ RTC_LOG(LS_WARNING) << "Invalid delta_size for seq_no " << seq_no;
return false;
default:
RTC_NOTREACHED();
@@ -497,8 +497,8 @@
packet_size += kChunkSizeBytes;
}
if (num_seq_no_ != delta_sizes.size()) {
- LOG(LS_ERROR) << delta_sizes.size() << " packets encoded. Expected "
- << num_seq_no_;
+ RTC_LOG(LS_ERROR) << delta_sizes.size() << " packets encoded. Expected "
+ << num_seq_no_;
return false;
}
int64_t timestamp_us = base_time_ticks_ * kBaseScaleFactor;
@@ -507,18 +507,20 @@
for (DeltaSize delta_size : delta_sizes) {
if (delta_size > 0) {
if (packet_it == packets_.end()) {
- LOG(LS_ERROR) << "Failed to find delta for seq_no " << seq_no;
+ RTC_LOG(LS_ERROR) << "Failed to find delta for seq_no " << seq_no;
return false;
}
if (packet_it->sequence_number() != seq_no) {
- LOG(LS_ERROR) << "Expected to find delta for seq_no " << seq_no
- << ". Next delta is for " << packet_it->sequence_number();
+ RTC_LOG(LS_ERROR) << "Expected to find delta for seq_no " << seq_no
+ << ". Next delta is for "
+ << packet_it->sequence_number();
return false;
}
if (delta_size == 1 &&
(packet_it->delta_ticks() < 0 || packet_it->delta_ticks() > 0xff)) {
- LOG(LS_ERROR) << "Delta " << packet_it->delta_ticks() << " for seq_no "
- << seq_no << " doesn't fit into one byte";
+ RTC_LOG(LS_ERROR) << "Delta " << packet_it->delta_ticks()
+ << " for seq_no " << seq_no
+ << " doesn't fit into one byte";
return false;
}
timestamp_us += packet_it->delta_us();
@@ -528,18 +530,18 @@
++seq_no;
}
if (packet_it != packets_.end()) {
- LOG(LS_ERROR) << "Unencoded delta for seq_no "
- << packet_it->sequence_number();
+ RTC_LOG(LS_ERROR) << "Unencoded delta for seq_no "
+ << packet_it->sequence_number();
return false;
}
if (timestamp_us != last_timestamp_us_) {
- LOG(LS_ERROR) << "Last timestamp mismatch. Calculated: " << timestamp_us
- << ". Saved: " << last_timestamp_us_;
+ RTC_LOG(LS_ERROR) << "Last timestamp mismatch. Calculated: " << timestamp_us
+ << ". Saved: " << last_timestamp_us_;
return false;
}
if (size_bytes_ != packet_size) {
- LOG(LS_ERROR) << "Rtcp packet size mismatch. Calculated: " << packet_size
- << ". Saved: " << size_bytes_;
+ RTC_LOG(LS_ERROR) << "Rtcp packet size mismatch. Calculated: "
+ << packet_size << ". Saved: " << size_bytes_;
return false;
}
return true;
diff --git a/modules/rtp_rtcp/source/rtcp_receiver.cc b/modules/rtp_rtcp/source/rtcp_receiver.cc
index 5576433..4bd5928 100644
--- a/modules/rtp_rtcp/source/rtcp_receiver.cc
+++ b/modules/rtp_rtcp/source/rtcp_receiver.cc
@@ -136,7 +136,7 @@
void RTCPReceiver::IncomingPacket(const uint8_t* packet, size_t packet_size) {
if (packet_size == 0) {
- LOG(LS_WARNING) << "Incoming empty RTCP packet";
+ RTC_LOG(LS_WARNING) << "Incoming empty RTCP packet";
return;
}
@@ -291,7 +291,7 @@
if (!rtcp_block.Parse(next_block, remaining_blocks_size)) {
if (next_block == packet_begin) {
// Failed to parse 1st header, nothing was extracted from this packet.
- LOG(LS_WARNING) << "Incoming invalid RTCP packet";
+ RTC_LOG(LS_WARNING) << "Incoming invalid RTCP packet";
return false;
}
++num_skipped_packets_;
@@ -370,10 +370,11 @@
if (now_ms - last_skipped_packets_warning_ms_ >= kMaxWarningLogIntervalMs &&
num_skipped_packets_ > 0) {
last_skipped_packets_warning_ms_ = now_ms;
- LOG(LS_WARNING) << num_skipped_packets_
- << " RTCP blocks were skipped due to being malformed or of "
- "unrecognized/unsupported type, during the past "
- << (kMaxWarningLogIntervalMs / 1000) << " second period.";
+ RTC_LOG(LS_WARNING)
+ << num_skipped_packets_
+ << " RTCP blocks were skipped due to being malformed or of "
+ "unrecognized/unsupported type, during the past "
+ << (kMaxWarningLogIntervalMs / 1000) << " second period.";
}
return true;
@@ -734,7 +735,7 @@
for (const auto& item : target_bitrate.GetTargetBitrates()) {
if (item.spatial_layer >= kMaxSpatialLayers ||
item.temporal_layer >= kMaxTemporalStreams) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "Invalid layer in XR target bitrate pack: spatial index "
<< item.spatial_layer << ", temporal index " << item.temporal_layer
<< ", dropping.";
@@ -932,8 +933,8 @@
}
if (!receiver_only_ && (packet_information.packet_type_flags & kRtcpNack)) {
if (!packet_information.nack_sequence_numbers.empty()) {
- LOG(LS_VERBOSE) << "Incoming NACK length: "
- << packet_information.nack_sequence_numbers.size();
+ RTC_LOG(LS_VERBOSE) << "Incoming NACK length: "
+ << packet_information.nack_sequence_numbers.size();
rtp_rtcp_->OnReceivedNack(packet_information.nack_sequence_numbers);
}
}
@@ -947,11 +948,11 @@
if ((packet_information.packet_type_flags & kRtcpPli) ||
(packet_information.packet_type_flags & kRtcpFir)) {
if (packet_information.packet_type_flags & kRtcpPli) {
- LOG(LS_VERBOSE) << "Incoming PLI from SSRC "
- << packet_information.remote_ssrc;
+ RTC_LOG(LS_VERBOSE)
+ << "Incoming PLI from SSRC " << packet_information.remote_ssrc;
} else {
- LOG(LS_VERBOSE) << "Incoming FIR from SSRC "
- << packet_information.remote_ssrc;
+ RTC_LOG(LS_VERBOSE)
+ << "Incoming FIR from SSRC " << packet_information.remote_ssrc;
}
rtcp_intra_frame_observer_->OnReceivedIntraFrameRequest(local_ssrc);
}
@@ -959,8 +960,9 @@
if (rtcp_bandwidth_observer_) {
RTC_DCHECK(!receiver_only_);
if (packet_information.packet_type_flags & kRtcpRemb) {
- LOG(LS_VERBOSE) << "Incoming REMB: "
- << packet_information.receiver_estimated_max_bitrate_bps;
+ RTC_LOG(LS_VERBOSE)
+ << "Incoming REMB: "
+ << packet_information.receiver_estimated_max_bitrate_bps;
rtcp_bandwidth_observer_->OnReceivedEstimatedBitrate(
packet_information.receiver_estimated_max_bitrate_bps);
}
diff --git a/modules/rtp_rtcp/source/rtcp_sender.cc b/modules/rtp_rtcp/source/rtcp_sender.cc
index 9eda2a0..5db08cd 100644
--- a/modules/rtp_rtcp/source/rtcp_sender.cc
+++ b/modules/rtp_rtcp/source/rtcp_sender.cc
@@ -698,7 +698,7 @@
{
rtc::CritScope lock(&critical_section_rtcp_sender_);
if (method_ == RtcpMode::kOff) {
- LOG(LS_WARNING) << "Can't send rtcp if it is disabled.";
+ RTC_LOG(LS_WARNING) << "Can't send rtcp if it is disabled.";
return -1;
}
// Add all flags as volatile. Non volatile entries will not be overwritten.
@@ -865,7 +865,7 @@
const uint8_t* data,
uint16_t length) {
if (length % 4 != 0) {
- LOG(LS_ERROR) << "Failed to SetApplicationSpecificData.";
+ RTC_LOG(LS_ERROR) << "Failed to SetApplicationSpecificData.";
return -1;
}
rtc::CritScope lock(&critical_section_rtcp_sender_);
diff --git a/modules/rtp_rtcp/source/rtcp_transceiver_config.cc b/modules/rtp_rtcp/source/rtcp_transceiver_config.cc
index 0cd0abe..9256d24 100644
--- a/modules/rtp_rtcp/source/rtcp_transceiver_config.cc
+++ b/modules/rtp_rtcp/source/rtcp_transceiver_config.cc
@@ -24,43 +24,44 @@
bool RtcpTransceiverConfig::Validate() const {
if (feedback_ssrc == 0)
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< debug_id
<< "Ssrc 0 may be treated by some implementation as invalid.";
if (cname.empty())
- LOG(LS_WARNING) << debug_id << "missing cname for ssrc " << feedback_ssrc;
+ RTC_LOG(LS_WARNING) << debug_id << "missing cname for ssrc "
+ << feedback_ssrc;
if (cname.size() > 255) {
- LOG(LS_ERROR) << debug_id << "cname can be maximum 255 characters.";
+ RTC_LOG(LS_ERROR) << debug_id << "cname can be maximum 255 characters.";
return false;
}
if (max_packet_size < 100) {
- LOG(LS_ERROR) << debug_id << "max packet size " << max_packet_size
- << " is too small.";
+ RTC_LOG(LS_ERROR) << debug_id << "max packet size " << max_packet_size
+ << " is too small.";
return false;
}
if (max_packet_size > IP_PACKET_SIZE) {
- LOG(LS_ERROR) << debug_id << "max packet size " << max_packet_size
- << " more than " << IP_PACKET_SIZE << " is unsupported.";
+ RTC_LOG(LS_ERROR) << debug_id << "max packet size " << max_packet_size
+ << " more than " << IP_PACKET_SIZE << " is unsupported.";
return false;
}
if (!outgoing_transport) {
- LOG(LS_ERROR) << debug_id << "outgoing transport must be set";
+ RTC_LOG(LS_ERROR) << debug_id << "outgoing transport must be set";
return false;
}
if (report_period_ms <= 0) {
- LOG(LS_ERROR) << debug_id << "period " << report_period_ms
- << "ms between reports should be positive.";
+ RTC_LOG(LS_ERROR) << debug_id << "period " << report_period_ms
+ << "ms between reports should be positive.";
return false;
}
if (schedule_periodic_compound_packets && !task_queue) {
- LOG(LS_ERROR) << debug_id
- << "missing task queue for periodic compound packets";
+ RTC_LOG(LS_ERROR) << debug_id
+ << "missing task queue for periodic compound packets";
return false;
}
// TODO(danilchap): Remove or update the warning when RtcpTransceiver supports
// send-only sessions.
if (receive_statistics == nullptr)
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< debug_id
<< "receive statistic should be set to generate rtcp report blocks.";
return true;
diff --git a/modules/rtp_rtcp/source/rtp_format_h264.cc b/modules/rtp_rtcp/source/rtp_format_h264.cc
index 050f3c0..57a7955 100644
--- a/modules/rtp_rtcp/source/rtp_format_h264.cc
+++ b/modules/rtp_rtcp/source/rtp_format_h264.cc
@@ -401,7 +401,7 @@
size_t payload_data_length) {
RTC_CHECK(parsed_payload != nullptr);
if (payload_data_length == 0) {
- LOG(LS_ERROR) << "Empty payload.";
+ RTC_LOG(LS_ERROR) << "Empty payload.";
return false;
}
@@ -448,12 +448,12 @@
if (nal_type == H264::NaluType::kStapA) {
// Skip the StapA header (StapA NAL type + length).
if (length_ <= kStapAHeaderSize) {
- LOG(LS_ERROR) << "StapA header truncated.";
+ RTC_LOG(LS_ERROR) << "StapA header truncated.";
return false;
}
if (!ParseStapAStartOffsets(nalu_start, nalu_length, &nalu_start_offsets)) {
- LOG(LS_ERROR) << "StapA packet with incorrect NALU packet lengths.";
+ RTC_LOG(LS_ERROR) << "StapA packet with incorrect NALU packet lengths.";
return false;
}
@@ -473,7 +473,7 @@
// so remove that from this units length.
size_t end_offset = nalu_start_offsets[i + 1] - kLengthFieldSize;
if (end_offset - start_offset < H264::kNaluTypeSize) {
- LOG(LS_ERROR) << "STAP-A packet too short";
+ RTC_LOG(LS_ERROR) << "STAP-A packet too short";
return false;
}
@@ -502,7 +502,7 @@
switch (result) {
case SpsVuiRewriter::ParseResult::kVuiRewritten:
if (modified_buffer_) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "More than one H264 SPS NAL units needing "
"rewriting found within a single STAP-A packet. "
"Keeping the first and rewriting the last.";
@@ -553,7 +553,7 @@
parsed_payload->type.Video.height = sps->height;
nalu.sps_id = sps->id;
} else {
- LOG(LS_WARNING) << "Failed to parse SPS id from SPS slice.";
+ RTC_LOG(LS_WARNING) << "Failed to parse SPS id from SPS slice.";
}
parsed_payload->frame_type = kVideoFrameKey;
break;
@@ -567,7 +567,7 @@
nalu.pps_id = pps_id;
nalu.sps_id = sps_id;
} else {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "Failed to parse PPS id and SPS id from PPS slice.";
}
break;
@@ -581,8 +581,8 @@
if (pps_id) {
nalu.pps_id = *pps_id;
} else {
- LOG(LS_WARNING) << "Failed to parse PPS id from slice of type: "
- << static_cast<int>(nalu.type);
+ RTC_LOG(LS_WARNING) << "Failed to parse PPS id from slice of type: "
+ << static_cast<int>(nalu.type);
}
break;
}
@@ -595,12 +595,12 @@
break;
case H264::NaluType::kStapA:
case H264::NaluType::kFuA:
- LOG(LS_WARNING) << "Unexpected STAP-A or FU-A received.";
+ RTC_LOG(LS_WARNING) << "Unexpected STAP-A or FU-A received.";
return false;
}
RTPVideoHeaderH264* h264 = &parsed_payload->type.Video.codecHeader.H264;
if (h264->nalus_length == kMaxNalusPerPacket) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "Received packet containing more than " << kMaxNalusPerPacket
<< " NAL units. Will not keep track sps and pps ids for all of them.";
} else {
@@ -615,7 +615,7 @@
RtpDepacketizer::ParsedPayload* parsed_payload,
const uint8_t* payload_data) {
if (length_ < kFuAHeaderSize) {
- LOG(LS_ERROR) << "FU-A NAL units truncated.";
+ RTC_LOG(LS_ERROR) << "FU-A NAL units truncated.";
return false;
}
uint8_t fnri = payload_data[0] & (kFBit | kNriMask);
@@ -633,9 +633,10 @@
if (pps_id) {
nalu.pps_id = *pps_id;
} else {
- LOG(LS_WARNING) << "Failed to parse PPS from first fragment of FU-A NAL "
- "unit with original type: "
- << static_cast<int>(nalu.type);
+ RTC_LOG(LS_WARNING)
+ << "Failed to parse PPS from first fragment of FU-A NAL "
+ "unit with original type: "
+ << static_cast<int>(nalu.type);
}
uint8_t original_nal_header = fnri | original_nal_type;
modified_buffer_.reset(new rtc::Buffer());
diff --git a/modules/rtp_rtcp/source/rtp_format_video_generic.cc b/modules/rtp_rtcp/source/rtp_format_video_generic.cc
index 0af8fc8..0c9bb43 100644
--- a/modules/rtp_rtcp/source/rtp_format_video_generic.cc
+++ b/modules/rtp_rtcp/source/rtp_format_video_generic.cc
@@ -117,7 +117,7 @@
size_t payload_data_length) {
assert(parsed_payload != NULL);
if (payload_data_length == 0) {
- LOG(LS_ERROR) << "Empty payload.";
+ RTC_LOG(LS_ERROR) << "Empty payload.";
return false;
}
diff --git a/modules/rtp_rtcp/source/rtp_format_vp8.cc b/modules/rtp_rtcp/source/rtp_format_vp8.cc
index c47d78a..74d20c5 100644
--- a/modules/rtp_rtcp/source/rtp_format_vp8.cc
+++ b/modules/rtp_rtcp/source/rtp_format_vp8.cc
@@ -474,7 +474,7 @@
size_t payload_data_length) {
RTC_DCHECK(parsed_payload);
if (payload_data_length == 0) {
- LOG(LS_ERROR) << "Empty payload.";
+ RTC_LOG(LS_ERROR) << "Empty payload.";
return false;
}
@@ -508,7 +508,7 @@
// Advance payload_data and decrease remaining payload size.
payload_data++;
if (payload_data_length <= 1) {
- LOG(LS_ERROR) << "Error parsing VP8 payload descriptor!";
+ RTC_LOG(LS_ERROR) << "Error parsing VP8 payload descriptor!";
return false;
}
payload_data_length--;
@@ -523,7 +523,7 @@
payload_data += parsed_bytes;
payload_data_length -= parsed_bytes;
if (payload_data_length == 0) {
- LOG(LS_ERROR) << "Error parsing VP8 payload descriptor!";
+ RTC_LOG(LS_ERROR) << "Error parsing VP8 payload descriptor!";
return false;
}
}
diff --git a/modules/rtp_rtcp/source/rtp_format_vp9.cc b/modules/rtp_rtcp/source/rtp_format_vp9.cc
index 2623790..bb3edfced 100644
--- a/modules/rtp_rtcp/source/rtp_format_vp9.cc
+++ b/modules/rtp_rtcp/source/rtp_format_vp9.cc
@@ -489,22 +489,23 @@
// Splits payload in minimal number of roughly equal in size packets.
void RtpPacketizerVp9::GeneratePackets() {
if (max_payload_length_ < PayloadDescriptorLength(hdr_) + 1) {
- LOG(LS_ERROR) << "Payload header and one payload byte won't fit in the "
- "first packet.";
+ RTC_LOG(LS_ERROR) << "Payload header and one payload byte won't fit in the "
+ "first packet.";
return;
}
if (max_payload_length_ < PayloadDescriptorLengthMinusSsData(hdr_) + 1 +
last_packet_reduction_len_) {
- LOG(LS_ERROR) << "Payload header and one payload byte won't fit in the last"
- " packet.";
+ RTC_LOG(LS_ERROR)
+ << "Payload header and one payload byte won't fit in the last"
+ " packet.";
return;
}
if (payload_size_ == 1 &&
max_payload_length_ <
PayloadDescriptorLength(hdr_) + 1 + last_packet_reduction_len_) {
- LOG(LS_ERROR) << "Can't fit header and payload into single packet, but "
- "payload size is one: no way to generate packets with "
- "nonzero payload.";
+ RTC_LOG(LS_ERROR) << "Can't fit header and payload into single packet, but "
+ "payload size is one: no way to generate packets with "
+ "nonzero payload.";
return;
}
@@ -660,19 +661,19 @@
// Add fields that are present.
if (i_bit && !WritePictureId(hdr_, &writer)) {
- LOG(LS_ERROR) << "Failed writing VP9 picture id.";
+ RTC_LOG(LS_ERROR) << "Failed writing VP9 picture id.";
return false;
}
if (l_bit && !WriteLayerInfo(hdr_, &writer)) {
- LOG(LS_ERROR) << "Failed writing VP9 layer info.";
+ RTC_LOG(LS_ERROR) << "Failed writing VP9 layer info.";
return false;
}
if (p_bit && f_bit && !WriteRefIndices(hdr_, &writer)) {
- LOG(LS_ERROR) << "Failed writing VP9 ref indices.";
+ RTC_LOG(LS_ERROR) << "Failed writing VP9 ref indices.";
return false;
}
if (v_bit && !WriteSsData(hdr_, &writer)) {
- LOG(LS_ERROR) << "Failed writing VP9 SS data.";
+ RTC_LOG(LS_ERROR) << "Failed writing VP9 SS data.";
return false;
}
@@ -690,7 +691,7 @@
size_t payload_length) {
assert(parsed_payload != nullptr);
if (payload_length == 0) {
- LOG(LS_ERROR) << "Payload length is zero.";
+ RTC_LOG(LS_ERROR) << "Payload length is zero.";
return false;
}
@@ -724,20 +725,20 @@
// Parse fields that are present.
if (i_bit && !ParsePictureId(&parser, vp9)) {
- LOG(LS_ERROR) << "Failed parsing VP9 picture id.";
+ RTC_LOG(LS_ERROR) << "Failed parsing VP9 picture id.";
return false;
}
if (l_bit && !ParseLayerInfo(&parser, vp9)) {
- LOG(LS_ERROR) << "Failed parsing VP9 layer info.";
+ RTC_LOG(LS_ERROR) << "Failed parsing VP9 layer info.";
return false;
}
if (p_bit && f_bit && !ParseRefIndices(&parser, vp9)) {
- LOG(LS_ERROR) << "Failed parsing VP9 ref indices.";
+ RTC_LOG(LS_ERROR) << "Failed parsing VP9 ref indices.";
return false;
}
if (v_bit) {
if (!ParseSsData(&parser, vp9)) {
- LOG(LS_ERROR) << "Failed parsing VP9 SS data.";
+ RTC_LOG(LS_ERROR) << "Failed parsing VP9 SS data.";
return false;
}
if (vp9->spatial_layer_resolution_present) {
@@ -753,7 +754,7 @@
assert(rem_bits % 8 == 0);
parsed_payload->payload_length = rem_bits / 8;
if (parsed_payload->payload_length == 0) {
- LOG(LS_ERROR) << "Failed parsing VP9 payload data.";
+ RTC_LOG(LS_ERROR) << "Failed parsing VP9 payload data.";
return false;
}
parsed_payload->payload =
diff --git a/modules/rtp_rtcp/source/rtp_header_extension_map.cc b/modules/rtp_rtcp/source/rtp_header_extension_map.cc
index 7a3bdf4..f044e9b 100644
--- a/modules/rtp_rtcp/source/rtp_header_extension_map.cc
+++ b/modules/rtp_rtcp/source/rtp_header_extension_map.cc
@@ -81,8 +81,8 @@
for (const ExtensionInfo& extension : kExtensions)
if (uri == extension.uri)
return Register(id, extension.type, extension.uri);
- LOG(LS_WARNING) << "Unknown extension uri:'" << uri
- << "', id: " << id << '.';
+ RTC_LOG(LS_WARNING) << "Unknown extension uri:'" << uri << "', id: " << id
+ << '.';
return false;
}
@@ -121,22 +121,22 @@
RTC_DCHECK_LT(type, kRtpExtensionNumberOfExtensions);
if (id < kMinId || id > kMaxId) {
- LOG(LS_WARNING) << "Failed to register extension uri:'" << uri
- << "' with invalid id:" << id << ".";
+ RTC_LOG(LS_WARNING) << "Failed to register extension uri:'" << uri
+ << "' with invalid id:" << id << ".";
return false;
}
if (GetType(id) == type) { // Same type/id pair already registered.
- LOG(LS_VERBOSE) << "Reregistering extension uri:'" << uri
- << "', id:" << id;
+ RTC_LOG(LS_VERBOSE) << "Reregistering extension uri:'" << uri
+ << "', id:" << id;
return true;
}
if (GetType(id) != kInvalidType) { // |id| used by another extension type.
- LOG(LS_WARNING) << "Failed to register extension uri:'" << uri
- << "', id:" << id
- << ". Id already in use by extension type "
- << static_cast<int>(GetType(id));
+ RTC_LOG(LS_WARNING) << "Failed to register extension uri:'" << uri
+ << "', id:" << id
+ << ". Id already in use by extension type "
+ << static_cast<int>(GetType(id));
return false;
}
RTC_DCHECK(!IsRegistered(type));
diff --git a/modules/rtp_rtcp/source/rtp_packet.cc b/modules/rtp_rtcp/source/rtp_packet.cc
index f82c18f..468a90b 100644
--- a/modules/rtp_rtcp/source/rtp_packet.cc
+++ b/modules/rtp_rtcp/source/rtp_packet.cc
@@ -293,20 +293,21 @@
if (extension_entry->length == length)
return rtc::MakeArrayView(WriteAt(extension_entry->offset), length);
- LOG(LS_ERROR) << "Length mismatch for extension id " << id << " type "
- << static_cast<int>(extension_entry->type) << ": expected "
- << static_cast<int>(extension_entry->length) << ". received "
- << length;
+ RTC_LOG(LS_ERROR) << "Length mismatch for extension id " << id << " type "
+ << static_cast<int>(extension_entry->type)
+ << ": expected "
+ << static_cast<int>(extension_entry->length)
+ << ". received " << length;
return nullptr;
}
if (payload_size_ > 0) {
- LOG(LS_ERROR) << "Can't add new extension id " << id
- << " after payload was set.";
+ RTC_LOG(LS_ERROR) << "Can't add new extension id " << id
+ << " after payload was set.";
return nullptr;
}
if (padding_size_ > 0) {
- LOG(LS_ERROR) << "Can't add new extension id " << id
- << " after padding was set.";
+ RTC_LOG(LS_ERROR) << "Can't add new extension id " << id
+ << " after padding was set.";
return nullptr;
}
@@ -314,7 +315,7 @@
size_t extensions_offset = kFixedHeaderSize + (num_csrc * 4) + 4;
size_t new_extensions_size = extensions_size_ + kOneByteHeaderSize + length;
if (extensions_offset + new_extensions_size > capacity()) {
- LOG(LS_ERROR)
+ RTC_LOG(LS_ERROR)
<< "Extension cannot be registered: Not enough space left in buffer.";
return nullptr;
}
@@ -360,7 +361,7 @@
uint8_t* RtpPacket::SetPayloadSize(size_t size_bytes) {
RTC_DCHECK_EQ(padding_size_, 0);
if (payload_offset_ + size_bytes > capacity()) {
- LOG(LS_WARNING) << "Cannot set payload, not enough space in buffer.";
+ RTC_LOG(LS_WARNING) << "Cannot set payload, not enough space in buffer.";
return nullptr;
}
payload_size_ = size_bytes;
@@ -371,9 +372,9 @@
bool RtpPacket::SetPadding(uint8_t size_bytes, Random* random) {
RTC_DCHECK(random);
if (payload_offset_ + payload_size_ + size_bytes > capacity()) {
- LOG(LS_WARNING) << "Cannot set padding size " << size_bytes << ", only "
- << (capacity() - payload_offset_ - payload_size_)
- << " bytes left in buffer.";
+ RTC_LOG(LS_WARNING) << "Cannot set padding size " << size_bytes << ", only "
+ << (capacity() - payload_offset_ - payload_size_)
+ << " bytes left in buffer.";
return false;
}
padding_size_ = size_bytes;
@@ -437,7 +438,7 @@
if (has_padding) {
padding_size_ = buffer[size - 1];
if (padding_size_ == 0) {
- LOG(LS_WARNING) << "Padding was set, but padding size is zero";
+ RTC_LOG(LS_WARNING) << "Padding was set, but padding size is zero";
return false;
}
} else {
@@ -472,7 +473,7 @@
return false;
}
if (profile != kOneByteExtensionId) {
- LOG(LS_WARNING) << "Unsupported rtp extension " << profile;
+ RTC_LOG(LS_WARNING) << "Unsupported rtp extension " << profile;
} else {
constexpr uint8_t kPaddingId = 0;
constexpr uint8_t kReservedId = 15;
@@ -488,14 +489,14 @@
1 + (buffer[extension_offset + extensions_size_] & 0xf);
if (extensions_size_ + kOneByteHeaderSize + length >
extensions_capacity) {
- LOG(LS_WARNING) << "Oversized rtp header extension.";
+ RTC_LOG(LS_WARNING) << "Oversized rtp header extension.";
break;
}
size_t idx = id - 1;
if (extension_entries_[idx].length != 0) {
- LOG(LS_VERBOSE) << "Duplicate rtp header extension id " << id
- << ". Overwriting.";
+ RTC_LOG(LS_VERBOSE)
+ << "Duplicate rtp header extension id " << id << ". Overwriting.";
}
extensions_size_ += kOneByteHeaderSize;
diff --git a/modules/rtp_rtcp/source/rtp_packet_history.cc b/modules/rtp_rtcp/source/rtp_packet_history.cc
index e1a22f6..0272bd2 100644
--- a/modules/rtp_rtcp/source/rtp_packet_history.cc
+++ b/modules/rtp_rtcp/source/rtp_packet_history.cc
@@ -35,7 +35,8 @@
rtc::CritScope cs(&critsect_);
if (enable) {
if (store_) {
- LOG(LS_WARNING) << "Purging packet history in order to re-set status.";
+ RTC_LOG(LS_WARNING)
+ << "Purging packet history in order to re-set status.";
Free();
}
RTC_DCHECK(!store_);
@@ -130,7 +131,7 @@
int index = 0;
if (!FindSeqNum(sequence_number, &index)) {
- LOG(LS_WARNING) << "No match for getting seqNum " << sequence_number;
+ RTC_LOG(LS_WARNING) << "No match for getting seqNum " << sequence_number;
return nullptr;
}
RTC_DCHECK_EQ(sequence_number,
diff --git a/modules/rtp_rtcp/source/rtp_payload_registry.cc b/modules/rtp_rtcp/source/rtp_payload_registry.cc
index 3554876..0ea9049 100644
--- a/modules/rtp_rtcp/source/rtp_payload_registry.cc
+++ b/modules/rtp_rtcp/source/rtp_payload_registry.cc
@@ -86,8 +86,8 @@
case 77: // 205 Transport layer FB message.
case 78: // 206 Payload-specific FB message.
case 79: // 207 Extended report.
- LOG(LS_ERROR) << "Can't register invalid receiver payload type: "
- << payload_type;
+ RTC_LOG(LS_ERROR) << "Can't register invalid receiver payload type: "
+ << payload_type;
return false;
default:
return true;
@@ -152,7 +152,7 @@
it->second.typeSpecific.audio_payload().rate = 0;
return 0;
}
- LOG(LS_ERROR) << "Payload type already registered: " << payload_type;
+ RTC_LOG(LS_ERROR) << "Payload type already registered: " << payload_type;
return -1;
}
@@ -189,8 +189,8 @@
// have. If same, ignore sending an error.
if (PayloadIsCompatible(it->second, video_codec))
return 0;
- LOG(LS_ERROR) << "Payload type already registered: "
- << static_cast<int>(video_codec.plType);
+ RTC_LOG(LS_ERROR) << "Payload type already registered: "
+ << static_cast<int>(video_codec.plType);
return -1;
}
@@ -281,7 +281,7 @@
int associated_payload_type) {
rtc::CritScope cs(&crit_sect_);
if (payload_type < 0) {
- LOG(LS_ERROR) << "Invalid RTX payload type: " << payload_type;
+ RTC_LOG(LS_ERROR) << "Invalid RTX payload type: " << payload_type;
return;
}
diff --git a/modules/rtp_rtcp/source/rtp_receiver_audio.cc b/modules/rtp_rtcp/source/rtp_receiver_audio.cc
index 11035a7..270c00d 100644
--- a/modules/rtp_rtcp/source/rtp_receiver_audio.cc
+++ b/modules/rtp_rtcp/source/rtp_receiver_audio.cc
@@ -148,7 +148,7 @@
}
if (first_packet_received_()) {
- LOG(LS_INFO) << "Received first audio RTP packet";
+ RTC_LOG(LS_INFO) << "Received first audio RTP packet";
}
return ParseAudioCodecSpecific(rtp_header, payload, payload_length,
@@ -193,8 +193,8 @@
const PayloadUnion& specific_payload) const {
const auto& ap = specific_payload.audio_payload();
if (callback->OnInitializeDecoder(payload_type, ap.format, ap.rate) == -1) {
- LOG(LS_ERROR) << "Failed to create decoder for payload type: "
- << payload_name << "/" << static_cast<int>(payload_type);
+ RTC_LOG(LS_ERROR) << "Failed to create decoder for payload type: "
+ << payload_name << "/" << static_cast<int>(payload_type);
return -1;
}
return 0;
diff --git a/modules/rtp_rtcp/source/rtp_receiver_impl.cc b/modules/rtp_rtcp/source/rtp_receiver_impl.cc
index 792e08b..64acfb5 100644
--- a/modules/rtp_rtcp/source/rtp_receiver_impl.cc
+++ b/modules/rtp_rtcp/source/rtp_receiver_impl.cc
@@ -122,8 +122,8 @@
if (created_new_payload) {
if (rtp_media_receiver_->OnNewPayloadTypeCreated(payload_type,
audio_format) != 0) {
- LOG(LS_ERROR) << "Failed to register payload: " << audio_format.name
- << "/" << payload_type;
+ RTC_LOG(LS_ERROR) << "Failed to register payload: " << audio_format.name
+ << "/" << payload_type;
return -1;
}
}
@@ -179,7 +179,7 @@
// OK, keep-alive packet.
return true;
}
- LOG(LS_WARNING) << "Receiving invalid payload type.";
+ RTC_LOG(LS_WARNING) << "Receiving invalid payload type.";
return false;
}
@@ -320,8 +320,8 @@
rtp_header.payloadType, reinitialize_audio_payload->format,
reinitialize_audio_payload->rate)) {
// New stream, same codec.
- LOG(LS_ERROR) << "Failed to create decoder for payload type: "
- << static_cast<int>(rtp_header.payloadType);
+ RTC_LOG(LS_ERROR) << "Failed to create decoder for payload type: "
+ << static_cast<int>(rtp_header.payloadType);
}
}
}
diff --git a/modules/rtp_rtcp/source/rtp_receiver_video.cc b/modules/rtp_rtcp/source/rtp_receiver_video.cc
index 6786951..65d1831 100644
--- a/modules/rtp_rtcp/source/rtp_receiver_video.cc
+++ b/modules/rtp_rtcp/source/rtp_receiver_video.cc
@@ -72,14 +72,14 @@
}
if (first_packet_received_()) {
- LOG(LS_INFO) << "Received first video RTP packet";
+ RTC_LOG(LS_INFO) << "Received first video RTP packet";
}
// We are not allowed to hold a critical section when calling below functions.
std::unique_ptr<RtpDepacketizer> depacketizer(
RtpDepacketizer::Create(rtp_header->type.Video.codec));
if (depacketizer.get() == NULL) {
- LOG(LS_ERROR) << "Failed to create depacketizer.";
+ RTC_LOG(LS_ERROR) << "Failed to create depacketizer.";
return -1;
}
diff --git a/modules/rtp_rtcp/source/rtp_rtcp_impl.cc b/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
index cfd994a..64b76db 100644
--- a/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
+++ b/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
@@ -200,10 +200,10 @@
// is increasing.
int64_t rtcp_interval = RtcpReportInterval();
if (rtcp_receiver_.RtcpRrTimeout(rtcp_interval)) {
- LOG_F(LS_WARNING) << "Timeout: No RTCP RR received.";
+ RTC_LOG_F(LS_WARNING) << "Timeout: No RTCP RR received.";
} else if (rtcp_receiver_.RtcpRrSequenceNumberTimeout(rtcp_interval)) {
- LOG_F(LS_WARNING) <<
- "Timeout: No increase in RTCP RR extended highest sequence number.";
+ RTC_LOG_F(LS_WARNING) << "Timeout: No increase in RTCP RR extended "
+ "highest sequence number.";
}
if (remote_bitrate_ && rtcp_sender_.TMMBR()) {
@@ -385,7 +385,7 @@
if (rtcp_sender_.Sending() != sending) {
// Sends RTCP BYE when going from true to false
if (rtcp_sender_.SetSendingStatus(GetFeedbackState(), sending) != 0) {
- LOG(LS_WARNING) << "Failed to send RTCP BYE";
+ RTC_LOG(LS_WARNING) << "Failed to send RTCP BYE";
}
if (sending && rtp_sender_) {
// Update Rtcp receiver config, to track Rtx config changes from
diff --git a/modules/rtp_rtcp/source/rtp_sender.cc b/modules/rtp_rtcp/source/rtp_sender.cc
index 121efea..16cf8ff 100644
--- a/modules/rtp_rtcp/source/rtp_sender.cc
+++ b/modules/rtp_rtcp/source/rtp_sender.cc
@@ -328,7 +328,7 @@
RTC_DCHECK_LE(payload_type, 127);
RTC_DCHECK_LE(associated_payload_type, 127);
if (payload_type < 0) {
- LOG(LS_ERROR) << "Invalid RTX payload type: " << payload_type << ".";
+ RTC_LOG(LS_ERROR) << "Invalid RTX payload type: " << payload_type << ".";
return;
}
@@ -340,7 +340,7 @@
rtc::CritScope lock(&send_critsect_);
if (payload_type < 0) {
- LOG(LS_ERROR) << "Invalid payload_type " << payload_type << ".";
+ RTC_LOG(LS_ERROR) << "Invalid payload_type " << payload_type << ".";
return -1;
}
if (payload_type_ == payload_type) {
@@ -352,8 +352,8 @@
std::map<int8_t, RtpUtility::Payload*>::iterator it =
payload_type_map_.find(payload_type);
if (it == payload_type_map_.end()) {
- LOG(LS_WARNING) << "Payload type " << static_cast<int>(payload_type)
- << " not registered.";
+ RTC_LOG(LS_WARNING) << "Payload type " << static_cast<int>(payload_type)
+ << " not registered.";
return -1;
}
SetSendPayloadType(payload_type);
@@ -395,8 +395,8 @@
}
RtpVideoCodecTypes video_type = kRtpVideoGeneric;
if (CheckPayloadType(payload_type, &video_type) != 0) {
- LOG(LS_ERROR) << "Don't send data with unknown payload type: "
- << static_cast<int>(payload_type) << ".";
+ RTC_LOG(LS_ERROR) << "Don't send data with unknown payload type: "
+ << static_cast<int>(payload_type) << ".";
return false;
}
@@ -521,7 +521,7 @@
break;
}
if (!ssrc_) {
- LOG(LS_ERROR) << "SSRC unset.";
+ RTC_LOG(LS_ERROR) << "SSRC unset.";
return 0;
}
@@ -552,7 +552,7 @@
capture_time_ms += (now_ms - last_timestamp_time_ms_);
}
if (!ssrc_rtx_) {
- LOG(LS_ERROR) << "RTX SSRC unset.";
+ RTC_LOG(LS_ERROR) << "RTX SSRC unset.";
return 0;
}
RTC_DCHECK(ssrc_rtx_);
@@ -657,7 +657,7 @@
"sent", bytes_sent);
// TODO(pwestin): Add a separate bitrate for sent bitrate after pacer.
if (bytes_sent <= 0) {
- LOG(LS_WARNING) << "Transport failed to send packet.";
+ RTC_LOG(LS_WARNING) << "Transport failed to send packet.";
return false;
}
return true;
@@ -686,8 +686,8 @@
const int32_t bytes_sent = ReSendPacket(seq_no, 5 + avg_rtt);
if (bytes_sent < 0) {
// Failed to send one Sequence number. Give up the rest in this nack.
- LOG(LS_WARNING) << "Failed resending RTP packet " << seq_no
- << ", Discard rest of packets.";
+ RTC_LOG(LS_WARNING) << "Failed resending RTP packet " << seq_no
+ << ", Discard rest of packets.";
break;
}
}
diff --git a/modules/rtp_rtcp/source/rtp_sender_audio.cc b/modules/rtp_rtcp/source/rtp_sender_audio.cc
index 26108ac..93f2b9f 100644
--- a/modules/rtp_rtcp/source/rtp_sender_audio.cc
+++ b/modules/rtp_rtcp/source/rtp_sender_audio.cc
@@ -240,7 +240,7 @@
bool send_result = rtp_sender_->SendToNetwork(
std::move(packet), kAllowRetransmission, RtpPacketSender::kHighPriority);
if (first_packet_sent_()) {
- LOG(LS_INFO) << "First audio RTP packet sent to pacer";
+ RTC_LOG(LS_INFO) << "First audio RTP packet sent to pacer";
}
return send_result;
}
diff --git a/modules/rtp_rtcp/source/rtp_sender_video.cc b/modules/rtp_rtcp/source/rtp_sender_video.cc
index 30663c6..8d8fbf6 100644
--- a/modules/rtp_rtcp/source/rtp_sender_video.cc
+++ b/modules/rtp_rtcp/source/rtp_sender_video.cc
@@ -105,7 +105,7 @@
uint32_t rtp_timestamp = packet->Timestamp();
if (!rtp_sender_->SendToNetwork(std::move(packet), storage,
RtpPacketSender::kLowPriority)) {
- LOG(LS_WARNING) << "Failed to send video packet " << seq_num;
+ RTC_LOG(LS_WARNING) << "Failed to send video packet " << seq_num;
return;
}
rtc::CritScope cs(&stats_crit_);
@@ -161,7 +161,7 @@
"Video::PacketRed", "timestamp", rtp_timestamp,
"seqnum", media_seq_num);
} else {
- LOG(LS_WARNING) << "Failed to send RED packet " << media_seq_num;
+ RTC_LOG(LS_WARNING) << "Failed to send RED packet " << media_seq_num;
}
for (const auto& fec_packet : fec_packets) {
// TODO(danilchap): Make ulpfec_generator_ generate RtpPacketToSend to avoid
@@ -179,7 +179,8 @@
"Video::PacketUlpfec", "timestamp", rtp_timestamp,
"seqnum", fec_sequence_number);
} else {
- LOG(LS_WARNING) << "Failed to send ULPFEC packet " << fec_sequence_number;
+ RTC_LOG(LS_WARNING) << "Failed to send ULPFEC packet "
+ << fec_sequence_number;
}
}
}
@@ -210,7 +211,7 @@
"Video::PacketFlexfec", "timestamp", timestamp,
"seqnum", seq_num);
} else {
- LOG(LS_WARNING) << "Failed to send FlexFEC packet " << seq_num;
+ RTC_LOG(LS_WARNING) << "Failed to send FlexFEC packet " << seq_num;
}
}
}
@@ -419,11 +420,11 @@
if (first_frame) {
if (i == 0) {
- LOG(LS_INFO)
+ RTC_LOG(LS_INFO)
<< "Sent first RTP packet of the first video frame (pre-pacer)";
}
if (last) {
- LOG(LS_INFO)
+ RTC_LOG(LS_INFO)
<< "Sent last RTP packet of the first video frame (pre-pacer)";
}
}
diff --git a/modules/rtp_rtcp/source/rtp_utility.cc b/modules/rtp_rtcp/source/rtp_utility.cc
index 523b2b4..104265e 100644
--- a/modules/rtp_rtcp/source/rtp_utility.cc
+++ b/modules/rtp_rtcp/source/rtp_utility.cc
@@ -321,28 +321,28 @@
}
if (id == 15) {
- LOG(LS_VERBOSE)
+ RTC_LOG(LS_VERBOSE)
<< "RTP extension header 15 encountered. Terminate parsing.";
return;
}
if (ptrRTPDataExtensionEnd - ptr < (len + 1)) {
- LOG(LS_WARNING) << "Incorrect one-byte extension len: " << (len + 1)
- << ", bytes left in buffer: "
- << (ptrRTPDataExtensionEnd - ptr);
+ RTC_LOG(LS_WARNING) << "Incorrect one-byte extension len: " << (len + 1)
+ << ", bytes left in buffer: "
+ << (ptrRTPDataExtensionEnd - ptr);
return;
}
RTPExtensionType type = ptrExtensionMap->GetType(id);
if (type == RtpHeaderExtensionMap::kInvalidType) {
// If we encounter an unknown extension, just skip over it.
- LOG(LS_WARNING) << "Failed to find extension id: " << id;
+ RTC_LOG(LS_WARNING) << "Failed to find extension id: " << id;
} else {
switch (type) {
case kRtpExtensionTransmissionTimeOffset: {
if (len != 2) {
- LOG(LS_WARNING) << "Incorrect transmission time offset len: "
- << len;
+ RTC_LOG(LS_WARNING)
+ << "Incorrect transmission time offset len: " << len;
return;
}
// 0 1 2 3
@@ -358,7 +358,7 @@
}
case kRtpExtensionAudioLevel: {
if (len != 0) {
- LOG(LS_WARNING) << "Incorrect audio level len: " << len;
+ RTC_LOG(LS_WARNING) << "Incorrect audio level len: " << len;
return;
}
// 0 1
@@ -374,7 +374,7 @@
}
case kRtpExtensionAbsoluteSendTime: {
if (len != 2) {
- LOG(LS_WARNING) << "Incorrect absolute send time len: " << len;
+ RTC_LOG(LS_WARNING) << "Incorrect absolute send time len: " << len;
return;
}
// 0 1 2 3
@@ -390,7 +390,7 @@
}
case kRtpExtensionVideoRotation: {
if (len != 0) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "Incorrect coordination of video coordination len: " << len;
return;
}
@@ -406,8 +406,8 @@
}
case kRtpExtensionTransportSequenceNumber: {
if (len != 1) {
- LOG(LS_WARNING) << "Incorrect transport sequence number len: "
- << len;
+ RTC_LOG(LS_WARNING)
+ << "Incorrect transport sequence number len: " << len;
return;
}
// 0 1 2
@@ -424,7 +424,7 @@
}
case kRtpExtensionPlayoutDelay: {
if (len != 2) {
- LOG(LS_WARNING) << "Incorrect playout delay len: " << len;
+ RTC_LOG(LS_WARNING) << "Incorrect playout delay len: " << len;
return;
}
// 0 1 2 3
@@ -443,7 +443,7 @@
}
case kRtpExtensionVideoContentType: {
if (len != 0) {
- LOG(LS_WARNING) << "Incorrect video content type len: " << len;
+ RTC_LOG(LS_WARNING) << "Incorrect video content type len: " << len;
return;
}
// 0 1
@@ -461,7 +461,7 @@
}
case kRtpExtensionVideoTiming: {
if (len != VideoTimingExtension::kValueSizeBytes - 1) {
- LOG(LS_WARNING) << "Incorrect video timing len: " << len;
+ RTC_LOG(LS_WARNING) << "Incorrect video timing len: " << len;
return;
}
header->extension.has_video_timing = true;
diff --git a/modules/rtp_rtcp/source/ulpfec_receiver_impl.cc b/modules/rtp_rtcp/source/ulpfec_receiver_impl.cc
index 4292f3c..a5512e1 100644
--- a/modules/rtp_rtcp/source/ulpfec_receiver_impl.cc
+++ b/modules/rtp_rtcp/source/ulpfec_receiver_impl.cc
@@ -76,7 +76,7 @@
size_t packet_length,
uint8_t ulpfec_payload_type) {
if (header.ssrc != ssrc_) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "Received RED packet with different SSRC than expected; dropping.";
return -1;
}
@@ -87,7 +87,7 @@
size_t payload_data_length = packet_length - header.headerLength;
if (payload_data_length == 0) {
- LOG(LS_WARNING) << "Corrupt/truncated FEC packet.";
+ RTC_LOG(LS_WARNING) << "Corrupt/truncated FEC packet.";
return -1;
}
@@ -107,7 +107,7 @@
// f bit set in RED header, i.e. there are more than one RED header blocks.
red_header_length = 4;
if (payload_data_length < red_header_length + 1u) {
- LOG(LS_WARNING) << "Corrupt/truncated FEC packet.";
+ RTC_LOG(LS_WARNING) << "Corrupt/truncated FEC packet.";
return -1;
}
@@ -116,7 +116,7 @@
timestamp_offset += incoming_rtp_packet[header.headerLength + 2];
timestamp_offset = timestamp_offset >> 2;
if (timestamp_offset != 0) {
- LOG(LS_WARNING) << "Corrupt payload found.";
+ RTC_LOG(LS_WARNING) << "Corrupt payload found.";
return -1;
}
@@ -125,13 +125,13 @@
// Check next RED header block.
if (incoming_rtp_packet[header.headerLength + 4] & 0x80) {
- LOG(LS_WARNING) << "More than 2 blocks in packet not supported.";
+ RTC_LOG(LS_WARNING) << "More than 2 blocks in packet not supported.";
return -1;
}
// Check that the packet is long enough to contain data in the following
// block.
if (block_length > payload_data_length - (red_header_length + 1)) {
- LOG(LS_WARNING) << "Block length longer than packet.";
+ RTC_LOG(LS_WARNING) << "Block length longer than packet.";
return -1;
}
}
diff --git a/modules/video_capture/device_info_impl.cc b/modules/video_capture/device_info_impl.cc
index 355e6a2..0f8198c 100644
--- a/modules/video_capture/device_info_impl.cc
+++ b/modules/video_capture/device_info_impl.cc
@@ -92,9 +92,9 @@
// Make sure the number is valid
if (deviceCapabilityNumber >= (unsigned int)_captureCapabilities.size()) {
- LOG(LS_ERROR) << "Invalid deviceCapabilityNumber " << deviceCapabilityNumber
- << ">= number of capabilities ("
- << _captureCapabilities.size() << ").";
+ RTC_LOG(LS_ERROR) << "Invalid deviceCapabilityNumber "
+ << deviceCapabilityNumber << ">= number of capabilities ("
+ << _captureCapabilities.size() << ").";
return -1;
}
@@ -225,9 +225,10 @@
} // else height not good
} // end for
- LOG(LS_VERBOSE) << "Best camera format: " << bestWidth << "x" << bestHeight
- << "@" << bestFrameRate
- << "fps, color format: " << static_cast<int>(bestVideoType);
+ RTC_LOG(LS_VERBOSE) << "Best camera format: " << bestWidth << "x"
+ << bestHeight << "@" << bestFrameRate
+ << "fps, color format: "
+ << static_cast<int>(bestVideoType);
// Copy the capability
if (bestformatIndex < 0)
diff --git a/modules/video_capture/linux/device_info_linux.cc b/modules/video_capture/linux/device_info_linux.cc
index b5ad58c..9ced0ae 100644
--- a/modules/video_capture/linux/device_info_linux.cc
+++ b/modules/video_capture/linux/device_info_linux.cc
@@ -37,7 +37,7 @@
DeviceInfoLinux::~DeviceInfoLinux() {}
uint32_t DeviceInfoLinux::NumberOfDevices() {
- LOG(LS_INFO) << __FUNCTION__;
+ RTC_LOG(LS_INFO) << __FUNCTION__;
uint32_t count = 0;
char device[20];
@@ -62,7 +62,7 @@
uint32_t deviceUniqueIdUTF8Length,
char* /*productUniqueIdUTF8*/,
uint32_t /*productUniqueIdUTF8Length*/) {
- LOG(LS_INFO) << __FUNCTION__;
+ RTC_LOG(LS_INFO) << __FUNCTION__;
// Travel through /dev/video [0-63]
uint32_t count = 0;
@@ -89,8 +89,8 @@
// query device capabilities
struct v4l2_capability cap;
if (ioctl(fd, VIDIOC_QUERYCAP, &cap) < 0) {
- LOG(LS_INFO) << "error in querying the device capability for device "
- << device << ". errno = " << errno;
+ RTC_LOG(LS_INFO) << "error in querying the device capability for device "
+ << device << ". errno = " << errno;
close(fd);
return -1;
}
@@ -104,7 +104,7 @@
if (deviceNameLength >= strlen(cameraName)) {
memcpy(deviceNameUTF8, cameraName, strlen(cameraName));
} else {
- LOG(LS_INFO) << "buffer passed is too small";
+ RTC_LOG(LS_INFO) << "buffer passed is too small";
return -1;
}
@@ -116,7 +116,7 @@
memcpy(deviceUniqueIdUTF8, cap.bus_info,
strlen((const char*)cap.bus_info));
} else {
- LOG(LS_INFO) << "buffer passed is too small";
+ RTC_LOG(LS_INFO) << "buffer passed is too small";
return -1;
}
}
@@ -132,11 +132,11 @@
const int32_t deviceUniqueIdUTF8Length =
(int32_t)strlen((char*)deviceUniqueIdUTF8);
if (deviceUniqueIdUTF8Length > kVideoCaptureUniqueNameLength) {
- LOG(LS_INFO) << "Device name too long";
+ RTC_LOG(LS_INFO) << "Device name too long";
return -1;
}
- LOG(LS_INFO) << "CreateCapabilityMap called for device "
- << deviceUniqueIdUTF8;
+ RTC_LOG(LS_INFO) << "CreateCapabilityMap called for device "
+ << deviceUniqueIdUTF8;
/* detect /dev/video [0-63] entries */
for (int n = 0; n < 64; ++n) {
@@ -169,7 +169,7 @@
}
if (!found) {
- LOG(LS_INFO) << "no matching device found";
+ RTC_LOG(LS_INFO) << "no matching device found";
return -1;
}
@@ -187,7 +187,7 @@
memcpy(_lastUsedDeviceName, deviceUniqueIdUTF8,
_lastUsedDeviceNameLength + 1);
- LOG(LS_INFO) << "CreateCapabilityMap " << _captureCapabilities.size();
+ RTC_LOG(LS_INFO) << "CreateCapabilityMap " << _captureCapabilities.size();
return size;
}
@@ -250,16 +250,16 @@
_captureCapabilities.push_back(cap);
index++;
- LOG(LS_VERBOSE) << "Camera capability, width:" << cap.width
- << " height:" << cap.height
- << " type:" << static_cast<int32_t>(cap.videoType)
- << " fps:" << cap.maxFPS;
+ RTC_LOG(LS_VERBOSE) << "Camera capability, width:" << cap.width
+ << " height:" << cap.height
+ << " type:" << static_cast<int32_t>(cap.videoType)
+ << " fps:" << cap.maxFPS;
}
}
}
}
- LOG(LS_INFO) << "CreateCapabilityMap " << _captureCapabilities.size();
+ RTC_LOG(LS_INFO) << "CreateCapabilityMap " << _captureCapabilities.size();
return _captureCapabilities.size();
}
diff --git a/modules/video_capture/linux/video_capture_linux.cc b/modules/video_capture/linux/video_capture_linux.cc
index f034f80..5be4272 100644
--- a/modules/video_capture/linux/video_capture_linux.cc
+++ b/modules/video_capture/linux/video_capture_linux.cc
@@ -89,7 +89,7 @@
}
}
if (!found) {
- LOG(LS_INFO) << "no matching device found";
+ RTC_LOG(LS_INFO) << "no matching device found";
return -1;
}
_deviceId = n; // store the device id
@@ -120,7 +120,7 @@
sprintf(device, "/dev/video%d", (int)_deviceId);
if ((_deviceFd = open(device, O_RDWR | O_NONBLOCK, 0)) < 0) {
- LOG(LS_INFO) << "error in opening " << device << " errono = " << errno;
+ RTC_LOG(LS_INFO) << "error in opening " << device << " errono = " << errno;
return -1;
}
@@ -149,11 +149,11 @@
memset(&fmt, 0, sizeof(fmt));
fmt.index = 0;
fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- LOG(LS_INFO) << "Video Capture enumerats supported image formats:";
+ RTC_LOG(LS_INFO) << "Video Capture enumerats supported image formats:";
while (ioctl(_deviceFd, VIDIOC_ENUM_FMT, &fmt) == 0) {
- LOG(LS_INFO) << " { pixelformat = "
- << cricket::GetFourccName(fmt.pixelformat)
- << ", description = '" << fmt.description << "' }";
+ RTC_LOG(LS_INFO) << " { pixelformat = "
+ << cricket::GetFourccName(fmt.pixelformat)
+ << ", description = '" << fmt.description << "' }";
// Match the preferred order.
for (int i = 0; i < nFormats; i++) {
if (fmt.pixelformat == fmts[i] && i < fmtsIdx)
@@ -164,11 +164,11 @@
}
if (fmtsIdx == nFormats) {
- LOG(LS_INFO) << "no supporting video formats found";
+ RTC_LOG(LS_INFO) << "no supporting video formats found";
return -1;
} else {
- LOG(LS_INFO) << "We prefer format "
- << cricket::GetFourccName(fmts[fmtsIdx]);
+ RTC_LOG(LS_INFO) << "We prefer format "
+ << cricket::GetFourccName(fmts[fmtsIdx]);
}
struct v4l2_format video_fmt;
@@ -191,7 +191,7 @@
// set format and frame size now
if (ioctl(_deviceFd, VIDIOC_S_FMT, &video_fmt) < 0) {
- LOG(LS_INFO) << "error in VIDIOC_S_FMT, errno = " << errno;
+ RTC_LOG(LS_INFO) << "error in VIDIOC_S_FMT, errno = " << errno;
return -1;
}
@@ -205,7 +205,7 @@
memset(&streamparms, 0, sizeof(streamparms));
streamparms.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
if (ioctl(_deviceFd, VIDIOC_G_PARM, &streamparms) < 0) {
- LOG(LS_INFO) << "error in VIDIOC_G_PARM errno = " << errno;
+ RTC_LOG(LS_INFO) << "error in VIDIOC_G_PARM errno = " << errno;
driver_framerate_support = false;
// continue
} else {
@@ -217,7 +217,7 @@
streamparms.parm.capture.timeperframe.numerator = 1;
streamparms.parm.capture.timeperframe.denominator = capability.maxFPS;
if (ioctl(_deviceFd, VIDIOC_S_PARM, &streamparms) < 0) {
- LOG(LS_INFO) << "Failed to set the framerate. errno=" << errno;
+ RTC_LOG(LS_INFO) << "Failed to set the framerate. errno=" << errno;
driver_framerate_support = false;
} else {
_currentFrameRate = capability.maxFPS;
@@ -235,7 +235,7 @@
}
if (!AllocateVideoBuffers()) {
- LOG(LS_INFO) << "failed to allocate video capture buffers";
+ RTC_LOG(LS_INFO) << "failed to allocate video capture buffers";
return -1;
}
@@ -251,7 +251,7 @@
enum v4l2_buf_type type;
type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
if (ioctl(_deviceFd, VIDIOC_STREAMON, &type) == -1) {
- LOG(LS_INFO) << "Failed to turn on stream";
+ RTC_LOG(LS_INFO) << "Failed to turn on stream";
return -1;
}
@@ -289,7 +289,7 @@
rbuffer.count = kNoOfV4L2Bufffers;
if (ioctl(_deviceFd, VIDIOC_REQBUFS, &rbuffer) < 0) {
- LOG(LS_INFO) << "Could not get buffers from device. errno = " << errno;
+ RTC_LOG(LS_INFO) << "Could not get buffers from device. errno = " << errno;
return false;
}
@@ -341,7 +341,7 @@
enum v4l2_buf_type type;
type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
if (ioctl(_deviceFd, VIDIOC_STREAMOFF, &type) < 0) {
- LOG(LS_INFO) << "VIDIOC_STREAMOFF error. errno: " << errno;
+ RTC_LOG(LS_INFO) << "VIDIOC_STREAMOFF error. errno: " << errno;
}
return true;
@@ -387,8 +387,8 @@
// dequeue a buffer - repeat until dequeued properly!
while (ioctl(_deviceFd, VIDIOC_DQBUF, &buf) < 0) {
if (errno != EINTR) {
- LOG(LS_INFO) << "could not sync on a buffer on device "
- << strerror(errno);
+ RTC_LOG(LS_INFO) << "could not sync on a buffer on device "
+ << strerror(errno);
return true;
}
}
@@ -402,7 +402,7 @@
frameInfo);
// enqueue the buffer again
if (ioctl(_deviceFd, VIDIOC_QBUF, &buf) == -1) {
- LOG(LS_INFO) << "Failed to enqueue capture buffer";
+ RTC_LOG(LS_INFO) << "Failed to enqueue capture buffer";
}
}
usleep(0);
diff --git a/modules/video_capture/objc/device_info.mm b/modules/video_capture/objc/device_info.mm
index aecc01b..42c1cd4 100644
--- a/modules/video_capture/objc/device_info.mm
+++ b/modules/video_capture/objc/device_info.mm
@@ -30,8 +30,8 @@
AVCaptureSessionPreset1280x720
];
-#define IOS_UNSUPPORTED() \
- LOG(LS_ERROR) << __FUNCTION__ << " is not supported on the iOS platform."; \
+#define IOS_UNSUPPORTED() \
+ RTC_LOG(LS_ERROR) << __FUNCTION__ << " is not supported on the iOS platform."; \
return -1;
VideoCaptureModule::DeviceInfo* VideoCaptureImpl::CreateDeviceInfo() {
diff --git a/modules/video_capture/objc/rtc_video_capture_objc.mm b/modules/video_capture/objc/rtc_video_capture_objc.mm
index 8b65dc0..bea9bb7 100644
--- a/modules/video_capture/objc/rtc_video_capture_objc.mm
+++ b/modules/video_capture/objc/rtc_video_capture_objc.mm
@@ -67,7 +67,7 @@
if ([_captureSession canAddOutput:captureOutput]) {
[_captureSession addOutput:captureOutput];
} else {
- LOG(LS_ERROR) << __FUNCTION__ << ": Could not add output to AVCaptureSession";
+ RTC_LOG(LS_ERROR) << __FUNCTION__ << ": Could not add output to AVCaptureSession";
}
#ifdef WEBRTC_IOS
@@ -230,7 +230,7 @@
- (void)onVideoError:(NSNotification*)notification {
NSLog(@"onVideoError: %@", notification);
// TODO(sjlee): make the specific error handling with this notification.
- LOG(LS_ERROR) << __FUNCTION__ << ": [AVCaptureSession startRunning] error.";
+ RTC_LOG(LS_ERROR) << __FUNCTION__ << ": [AVCaptureSession startRunning] error.";
}
- (BOOL)stopCapture {
@@ -288,7 +288,7 @@
if (!newCaptureInput) {
const char* errorMessage = [[deviceError localizedDescription] UTF8String];
- LOG(LS_ERROR) << __FUNCTION__ << ": deviceInputWithDevice error:" << errorMessage;
+ RTC_LOG(LS_ERROR) << __FUNCTION__ << ": deviceInputWithDevice error:" << errorMessage;
return NO;
}
diff --git a/modules/video_capture/video_capture_impl.cc b/modules/video_capture/video_capture_impl.cc
index 88890a6..6a24f80 100644
--- a/modules/video_capture/video_capture_impl.cc
+++ b/modules/video_capture/video_capture_impl.cc
@@ -136,7 +136,7 @@
if (frameInfo.videoType != VideoType::kMJPEG &&
CalcBufferSize(frameInfo.videoType, width, abs(height)) !=
videoFrameLength) {
- LOG(LS_ERROR) << "Wrong incoming frame length.";
+ RTC_LOG(LS_ERROR) << "Wrong incoming frame length.";
return -1;
}
@@ -169,8 +169,8 @@
width, height, videoFrameLength,
apply_rotation ? _rotateFrame : kVideoRotation_0, buffer.get());
if (conversionResult < 0) {
- LOG(LS_ERROR) << "Failed to convert capture frame from type "
- << static_cast<int>(frameInfo.videoType) << "to I420.";
+ RTC_LOG(LS_ERROR) << "Failed to convert capture frame from type "
+ << static_cast<int>(frameInfo.videoType) << "to I420.";
return -1;
}
diff --git a/modules/video_capture/windows/device_info_ds.cc b/modules/video_capture/windows/device_info_ds.cc
index d0946c4..d788ae1 100644
--- a/modules/video_capture/windows/device_info_ds.cc
+++ b/modules/video_capture/windows/device_info_ds.cc
@@ -73,9 +73,9 @@
// Details: hr = 0x80010106 <=> "Cannot change thread mode after it is
// set".
//
- LOG(LS_INFO) << __FUNCTION__
- << ": CoInitializeEx(NULL, COINIT_APARTMENTTHREADED)"
- << " => RPC_E_CHANGED_MODE, error 0x" << std::hex << hr;
+ RTC_LOG(LS_INFO) << __FUNCTION__
+ << ": CoInitializeEx(NULL, COINIT_APARTMENTTHREADED)"
+ << " => RPC_E_CHANGED_MODE, error 0x" << std::hex << hr;
}
}
}
@@ -92,8 +92,8 @@
HRESULT hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC,
IID_ICreateDevEnum, (void**)&_dsDevEnum);
if (hr != NOERROR) {
- LOG(LS_INFO) << "Failed to create CLSID_SystemDeviceEnum, error 0x"
- << std::hex << hr;
+ RTC_LOG(LS_INFO) << "Failed to create CLSID_SystemDeviceEnum, error 0x"
+ << std::hex << hr;
return -1;
}
return 0;
@@ -131,8 +131,8 @@
HRESULT hr = _dsDevEnum->CreateClassEnumerator(CLSID_VideoInputDeviceCategory,
&_dsMonikerDevEnum, 0);
if (hr != NOERROR) {
- LOG(LS_INFO) << "Failed to enumerate CLSID_SystemDeviceEnum, error 0x"
- << std::hex << hr << ". No webcam exist?";
+ RTC_LOG(LS_INFO) << "Failed to enumerate CLSID_SystemDeviceEnum, error 0x"
+ << std::hex << hr << ". No webcam exist?";
return 0;
}
@@ -163,8 +163,8 @@
(char*)deviceNameUTF8,
deviceNameLength, NULL, NULL);
if (convResult == 0) {
- LOG(LS_INFO) << "Failed to convert device name to UTF8, "
- << "error = " << GetLastError();
+ RTC_LOG(LS_INFO) << "Failed to convert device name to UTF8, "
+ << "error = " << GetLastError();
return -1;
}
}
@@ -173,16 +173,17 @@
if (FAILED(hr)) {
strncpy_s((char*)deviceUniqueIdUTF8, deviceUniqueIdUTF8Length,
(char*)deviceNameUTF8, convResult);
- LOG(LS_INFO) << "Failed to get "
- << "deviceUniqueIdUTF8 using "
- << "deviceNameUTF8";
+ RTC_LOG(LS_INFO) << "Failed to get "
+ << "deviceUniqueIdUTF8 using "
+ << "deviceNameUTF8";
} else {
convResult = WideCharToMultiByte(
CP_UTF8, 0, varName.bstrVal, -1, (char*)deviceUniqueIdUTF8,
deviceUniqueIdUTF8Length, NULL, NULL);
if (convResult == 0) {
- LOG(LS_INFO) << "Failed to convert device "
- << "name to UTF8, error = " << GetLastError();
+ RTC_LOG(LS_INFO)
+ << "Failed to convert device "
+ << "name to UTF8, error = " << GetLastError();
return -1;
}
if (productUniqueIdUTF8 && productUniqueIdUTF8Length > 0) {
@@ -201,7 +202,7 @@
}
}
if (deviceNameLength) {
- LOG(LS_INFO) << __FUNCTION__ << " " << deviceNameUTF8;
+ RTC_LOG(LS_INFO) << __FUNCTION__ << " " << deviceNameUTF8;
}
return index;
}
@@ -212,7 +213,7 @@
const int32_t deviceUniqueIdUTF8Length = (int32_t)strlen(
(char*)deviceUniqueIdUTF8); // UTF8 is also NULL terminated
if (deviceUniqueIdUTF8Length > kVideoCaptureUniqueNameLength) {
- LOG(LS_INFO) << "Device name too long";
+ RTC_LOG(LS_INFO) << "Device name too long";
return NULL;
}
@@ -221,8 +222,8 @@
HRESULT hr = _dsDevEnum->CreateClassEnumerator(CLSID_VideoInputDeviceCategory,
&_dsMonikerDevEnum, 0);
if (hr != NOERROR) {
- LOG(LS_INFO) << "Failed to enumerate CLSID_SystemDeviceEnum, error 0x"
- << std::hex << hr << ". No webcam exist?";
+ RTC_LOG(LS_INFO) << "Failed to enumerate CLSID_SystemDeviceEnum, error 0x"
+ << std::hex << hr << ". No webcam exist?";
return 0;
}
_dsMonikerDevEnum->Reset();
@@ -260,8 +261,8 @@
pM->BindToObject(0, 0, IID_IBaseFilter, (void**)&captureFilter);
if
FAILED(hr) {
- LOG(LS_ERROR) << "Failed to bind to the selected "
- << "capture device " << hr;
+ RTC_LOG(LS_ERROR) << "Failed to bind to the selected "
+ << "capture device " << hr;
}
if (productUniqueIdUTF8 &&
@@ -304,11 +305,11 @@
const int32_t deviceUniqueIdUTF8Length =
(int32_t)strlen((char*)deviceUniqueIdUTF8);
if (deviceUniqueIdUTF8Length > kVideoCaptureUniqueNameLength) {
- LOG(LS_INFO) << "Device name too long";
+ RTC_LOG(LS_INFO) << "Device name too long";
return -1;
}
- LOG(LS_INFO) << "CreateCapabilityMap called for device "
- << deviceUniqueIdUTF8;
+ RTC_LOG(LS_INFO) << "CreateCapabilityMap called for device "
+ << deviceUniqueIdUTF8;
char productId[kVideoCaptureProductIdLength];
IBaseFilter* captureDevice = DeviceInfoDS::GetDeviceFilter(
@@ -317,7 +318,7 @@
return -1;
IPin* outputCapturePin = GetOutputPin(captureDevice, GUID_NULL);
if (!outputCapturePin) {
- LOG(LS_INFO) << "Failed to get capture device output pin";
+ RTC_LOG(LS_INFO) << "Failed to get capture device output pin";
RELEASE_AND_CLEAR(captureDevice);
return -1;
}
@@ -325,7 +326,7 @@
HRESULT hr =
captureDevice->QueryInterface(IID_IAMExtDevice, (void**)&extDevice);
if (SUCCEEDED(hr) && extDevice) {
- LOG(LS_INFO) << "This is an external device";
+ RTC_LOG(LS_INFO) << "This is an external device";
extDevice->Release();
}
@@ -333,8 +334,8 @@
hr = outputCapturePin->QueryInterface(IID_IAMStreamConfig,
(void**)&streamConfig);
if (FAILED(hr)) {
- LOG(LS_INFO) << "Failed to get IID_IAMStreamConfig interface "
- << "from capture device";
+ RTC_LOG(LS_INFO) << "Failed to get IID_IAMStreamConfig interface "
+ << "from capture device";
return -1;
}
@@ -343,7 +344,7 @@
HRESULT hrVC = captureDevice->QueryInterface(IID_IAMVideoControl,
(void**)&videoControlConfig);
if (FAILED(hrVC)) {
- LOG(LS_INFO) << "IID_IAMVideoControl Interface NOT SUPPORTED";
+ RTC_LOG(LS_INFO) << "IID_IAMVideoControl Interface NOT SUPPORTED";
}
AM_MEDIA_TYPE* pmt = NULL;
@@ -352,7 +353,7 @@
hr = streamConfig->GetNumberOfCapabilities(&count, &size);
if (FAILED(hr)) {
- LOG(LS_INFO) << "Failed to GetNumberOfCapabilities";
+ RTC_LOG(LS_INFO) << "Failed to GetNumberOfCapabilities";
RELEASE_AND_CLEAR(videoControlConfig);
RELEASE_AND_CLEAR(streamConfig);
RELEASE_AND_CLEAR(outputCapturePin);
@@ -373,7 +374,7 @@
if (!FAILED(hr)) {
if (pmt->majortype == MEDIATYPE_Video &&
pmt->formattype == FORMAT_VideoInfo2) {
- LOG(LS_INFO) << "Device support FORMAT_VideoInfo2";
+ RTC_LOG(LS_INFO) << "Device support FORMAT_VideoInfo2";
supportFORMAT_VideoInfo2 = true;
VIDEOINFOHEADER2* h =
reinterpret_cast<VIDEOINFOHEADER2*>(pmt->pbFormat);
@@ -384,7 +385,7 @@
}
if (pmt->majortype == MEDIATYPE_Video &&
pmt->formattype == FORMAT_VideoInfo) {
- LOG(LS_INFO) << "Device support FORMAT_VideoInfo2";
+ RTC_LOG(LS_INFO) << "Device support FORMAT_VideoInfo2";
supportFORMAT_VideoInfo = true;
}
}
@@ -400,7 +401,7 @@
for (int32_t tmp = 0; tmp < count; ++tmp) {
hr = streamConfig->GetStreamCaps(tmp, &pmt, reinterpret_cast<BYTE*>(&caps));
if (FAILED(hr)) {
- LOG(LS_INFO) << "Failed to GetStreamCaps";
+ RTC_LOG(LS_INFO) << "Failed to GetStreamCaps";
RELEASE_AND_CLEAR(videoControlConfig);
RELEASE_AND_CLEAR(streamConfig);
RELEASE_AND_CLEAR(outputCapturePin);
@@ -458,7 +459,7 @@
capability.supportFrameRateControl = true;
} else // use existing method
{
- LOG(LS_INFO) << "GetMaxAvailableFrameRate NOT SUPPORTED";
+ RTC_LOG(LS_INFO) << "GetMaxAvailableFrameRate NOT SUPPORTED";
if (avgTimePerFrame > 0)
capability.maxFPS = static_cast<int>(10000000 / avgTimePerFrame);
else
@@ -501,23 +502,23 @@
// BT. 709 color. Not entiry correct to use
// UYVY. http://en.wikipedia.org/wiki/YCbCr
{
- LOG(LS_INFO) << "Device support HDYC.";
+ RTC_LOG(LS_INFO) << "Device support HDYC.";
capability.videoType = VideoType::kUYVY;
} else {
WCHAR strGuid[39];
StringFromGUID2(pmt->subtype, strGuid, 39);
- LOG(LS_WARNING) << "Device support unknown media type " << strGuid
- << ", width " << capability.width << ", height "
- << capability.height;
+ RTC_LOG(LS_WARNING)
+ << "Device support unknown media type " << strGuid << ", width "
+ << capability.width << ", height " << capability.height;
continue;
}
_captureCapabilities.push_back(capability);
_captureCapabilitiesWindows.push_back(capability);
- LOG(LS_INFO) << "Camera capability, width:" << capability.width
- << " height:" << capability.height
- << " type:" << static_cast<int>(capability.videoType)
- << " fps:" << capability.maxFPS;
+ RTC_LOG(LS_INFO) << "Camera capability, width:" << capability.width
+ << " height:" << capability.height
+ << " type:" << static_cast<int>(capability.videoType)
+ << " fps:" << capability.maxFPS;
}
DeleteMediaType(pmt);
pmt = NULL;
@@ -533,7 +534,7 @@
(char*)realloc(_lastUsedDeviceName, _lastUsedDeviceNameLength + 1);
memcpy(_lastUsedDeviceName, deviceUniqueIdUTF8,
_lastUsedDeviceNameLength + 1);
- LOG(LS_INFO) << "CreateCapabilityMap " << _captureCapabilities.size();
+ RTC_LOG(LS_INFO) << "CreateCapabilityMap " << _captureCapabilities.size();
return static_cast<int32_t>(_captureCapabilities.size());
}
@@ -552,7 +553,7 @@
char* startPos = strstr((char*)devicePath, "\\\\?\\");
if (!startPos) {
strncpy_s((char*)productUniqueIdUTF8, productUniqueIdUTF8Length, "", 1);
- LOG(LS_INFO) << "Failed to get the product Id";
+ RTC_LOG(LS_INFO) << "Failed to get the product Id";
return;
}
startPos += 4;
@@ -560,7 +561,7 @@
char* pos = strchr(startPos, '&');
if (!pos || pos >= (char*)devicePath + strlen((char*)devicePath)) {
strncpy_s((char*)productUniqueIdUTF8, productUniqueIdUTF8Length, "", 1);
- LOG(LS_INFO) << "Failed to get the product Id";
+ RTC_LOG(LS_INFO) << "Failed to get the product Id";
return;
}
// Find the second occurrence.
@@ -572,7 +573,7 @@
(char*)startPos, bytesToCopy);
} else {
strncpy_s((char*)productUniqueIdUTF8, productUniqueIdUTF8Length, "", 1);
- LOG(LS_INFO) << "Failed to get the product Id";
+ RTC_LOG(LS_INFO) << "Failed to get the product Id";
}
}
diff --git a/modules/video_capture/windows/sink_filter_ds.cc b/modules/video_capture/windows/sink_filter_ds.cc
index f982fce..6efd023 100644
--- a/modules/video_capture/windows/sink_filter_ds.cc
+++ b/modules/video_capture/windows/sink_filter_ds.cc
@@ -73,7 +73,7 @@
VIDEOINFOHEADER* pvi =
(VIDEOINFOHEADER*)pmt->AllocFormatBuffer(sizeof(VIDEOINFOHEADER));
if (NULL == pvi) {
- LOG(LS_INFO) << "CheckMediaType VIDEOINFOHEADER is NULL. Returning.";
+ RTC_LOG(LS_INFO) << "CheckMediaType VIDEOINFOHEADER is NULL. Returning.";
return (E_OUTOFMEMORY);
}
@@ -145,10 +145,10 @@
return VFW_S_NO_MORE_ITEMS;
}
pmt->SetSampleSize(pvi->bmiHeader.biSizeImage);
- LOG(LS_INFO) << "GetMediaType position " << iPosition << ", width "
- << _requestedCapability.width << ", height "
- << _requestedCapability.height << ", biCompression 0x"
- << std::hex << pvi->bmiHeader.biCompression;
+ RTC_LOG(LS_INFO) << "GetMediaType position " << iPosition << ", width "
+ << _requestedCapability.width << ", height "
+ << _requestedCapability.height << ", biCompression 0x"
+ << std::hex << pvi->bmiHeader.biCompression;
return NOERROR;
}
@@ -186,9 +186,10 @@
_resultingCapability.height = abs(pvi->bmiHeader.biHeight);
}
- LOG(LS_INFO) << "CheckMediaType width:" << pvi->bmiHeader.biWidth
- << " height:" << pvi->bmiHeader.biHeight << " Compression:0x"
- << std::hex << pvi->bmiHeader.biCompression;
+ RTC_LOG(LS_INFO) << "CheckMediaType width:" << pvi->bmiHeader.biWidth
+ << " height:" << pvi->bmiHeader.biHeight
+ << " Compression:0x" << std::hex
+ << pvi->bmiHeader.biCompression;
if (*SubType == MEDIASUBTYPE_MJPG &&
pvi->bmiHeader.biCompression == MAKEFOURCC('M', 'J', 'P', 'G')) {
@@ -230,9 +231,10 @@
return E_INVALIDARG;
}
- LOG(LS_INFO) << "CheckMediaType width:" << pvi->bmiHeader.biWidth
- << " height:" << pvi->bmiHeader.biHeight << " Compression:0x"
- << std::hex << pvi->bmiHeader.biCompression;
+ RTC_LOG(LS_INFO) << "CheckMediaType width:" << pvi->bmiHeader.biWidth
+ << " height:" << pvi->bmiHeader.biHeight
+ << " Compression:0x" << std::hex
+ << pvi->bmiHeader.biCompression;
_resultingCapability.width = pvi->bmiHeader.biWidth;
diff --git a/modules/video_capture/windows/video_capture_ds.cc b/modules/video_capture/windows/video_capture_ds.cc
index aece107..4f4ae90 100644
--- a/modules/video_capture/windows/video_capture_ds.cc
+++ b/modules/video_capture/windows/video_capture_ds.cc
@@ -71,7 +71,7 @@
_captureFilter = _dsInfo.GetDeviceFilter(deviceUniqueIdUTF8);
if (!_captureFilter) {
- LOG(LS_INFO) << "Failed to create capture filter.";
+ RTC_LOG(LS_INFO) << "Failed to create capture filter.";
return -1;
}
@@ -79,18 +79,18 @@
HRESULT hr = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER,
IID_IGraphBuilder, (void**)&_graphBuilder);
if (FAILED(hr)) {
- LOG(LS_INFO) << "Failed to create graph builder.";
+ RTC_LOG(LS_INFO) << "Failed to create graph builder.";
return -1;
}
hr = _graphBuilder->QueryInterface(IID_IMediaControl, (void**)&_mediaControl);
if (FAILED(hr)) {
- LOG(LS_INFO) << "Failed to create media control builder.";
+ RTC_LOG(LS_INFO) << "Failed to create media control builder.";
return -1;
}
hr = _graphBuilder->AddFilter(_captureFilter, CAPTURE_FILTER_NAME);
if (FAILED(hr)) {
- LOG(LS_INFO) << "Failed to add the capture device to the graph.";
+ RTC_LOG(LS_INFO) << "Failed to add the capture device to the graph.";
return -1;
}
@@ -99,14 +99,14 @@
// Create the sink filte used for receiving Captured frames.
_sinkFilter = new CaptureSinkFilter(SINK_FILTER_NAME, NULL, &hr, *this);
if (hr != S_OK) {
- LOG(LS_INFO) << "Failed to create send filter";
+ RTC_LOG(LS_INFO) << "Failed to create send filter";
return -1;
}
_sinkFilter->AddRef();
hr = _graphBuilder->AddFilter(_sinkFilter, SINK_FILTER_NAME);
if (FAILED(hr)) {
- LOG(LS_INFO) << "Failed to add the send filter to the graph.";
+ RTC_LOG(LS_INFO) << "Failed to add the send filter to the graph.";
return -1;
}
_inputSendPin = GetInputPin(_sinkFilter);
@@ -118,11 +118,12 @@
}
hr = _mediaControl->Pause();
if (FAILED(hr)) {
- LOG(LS_INFO)
+ RTC_LOG(LS_INFO)
<< "Failed to Pause the Capture device. Is it already occupied? " << hr;
return -1;
}
- LOG(LS_INFO) << "Capture device '" << deviceUniqueIdUTF8 << "' initialized.";
+ RTC_LOG(LS_INFO) << "Capture device '" << deviceUniqueIdUTF8
+ << "' initialized.";
return 0;
}
@@ -138,7 +139,7 @@
}
HRESULT hr = _mediaControl->Run();
if (FAILED(hr)) {
- LOG(LS_INFO) << "Failed to start the Capture device.";
+ RTC_LOG(LS_INFO) << "Failed to start the Capture device.";
return -1;
}
return 0;
@@ -149,7 +150,7 @@
HRESULT hr = _mediaControl->Pause();
if (FAILED(hr)) {
- LOG(LS_INFO) << "Failed to stop the capture graph. " << hr;
+ RTC_LOG(LS_INFO) << "Failed to stop the capture graph. " << hr;
return -1;
}
return 0;
@@ -158,9 +159,9 @@
OAFilterState state = 0;
HRESULT hr = _mediaControl->GetState(1000, &state);
if (hr != S_OK && hr != VFW_S_CANT_CUE) {
- LOG(LS_INFO) << "Failed to get the CaptureStarted status";
+ RTC_LOG(LS_INFO) << "Failed to get the CaptureStarted status";
}
- LOG(LS_INFO) << "CaptureStarted " << state;
+ RTC_LOG(LS_INFO) << "CaptureStarted " << state;
return state == State_Running;
}
int32_t VideoCaptureDS::CaptureSettings(VideoCaptureCapability& settings) {
@@ -202,7 +203,7 @@
HRESULT hr = _outputCapturePin->QueryInterface(IID_IAMStreamConfig,
(void**)&streamConfig);
if (hr) {
- LOG(LS_INFO) << "Can't get the Capture format settings.";
+ RTC_LOG(LS_INFO) << "Can't get the Capture format settings.";
return -1;
}
@@ -236,7 +237,7 @@
RELEASE_AND_CLEAR(streamConfig);
if (FAILED(hr)) {
- LOG(LS_INFO) << "Failed to set capture device output format";
+ RTC_LOG(LS_INFO) << "Failed to set capture device output format";
return -1;
}
@@ -246,7 +247,7 @@
hr = _graphBuilder->ConnectDirect(_outputCapturePin, _inputSendPin, NULL);
}
if (hr != S_OK) {
- LOG(LS_INFO) << "Failed to connect the Capture graph " << hr;
+ RTC_LOG(LS_INFO) << "Failed to connect the Capture graph " << hr;
return -1;
}
return 0;
@@ -263,8 +264,8 @@
_graphBuilder->Disconnect(_outputDvPin);
}
if (hr != S_OK) {
- LOG(LS_ERROR) << "Failed to Stop the Capture device for reconfiguration "
- << hr;
+ RTC_LOG(LS_ERROR)
+ << "Failed to Stop the Capture device for reconfiguration " << hr;
return -1;
}
return 0;
@@ -276,39 +277,39 @@
hr = CoCreateInstance(CLSID_DVVideoCodec, NULL, CLSCTX_INPROC,
IID_IBaseFilter, (void**)&_dvFilter);
if (hr != S_OK) {
- LOG(LS_INFO) << "Failed to create the dv decoder: " << hr;
+ RTC_LOG(LS_INFO) << "Failed to create the dv decoder: " << hr;
return hr;
}
hr = _graphBuilder->AddFilter(_dvFilter, L"VideoDecoderDV");
if (hr != S_OK) {
- LOG(LS_INFO) << "Failed to add the dv decoder to the graph: " << hr;
+ RTC_LOG(LS_INFO) << "Failed to add the dv decoder to the graph: " << hr;
return hr;
}
_inputDvPin = GetInputPin(_dvFilter);
if (_inputDvPin == NULL) {
- LOG(LS_INFO) << "Failed to get input pin from DV decoder";
+ RTC_LOG(LS_INFO) << "Failed to get input pin from DV decoder";
return -1;
}
_outputDvPin = GetOutputPin(_dvFilter, GUID_NULL);
if (_outputDvPin == NULL) {
- LOG(LS_INFO) << "Failed to get output pin from DV decoder";
+ RTC_LOG(LS_INFO) << "Failed to get output pin from DV decoder";
return -1;
}
}
hr = _graphBuilder->ConnectDirect(_outputCapturePin, _inputDvPin, NULL);
if (hr != S_OK) {
- LOG(LS_INFO) << "Failed to connect capture device to the dv devoder: "
- << hr;
+ RTC_LOG(LS_INFO) << "Failed to connect capture device to the dv devoder: "
+ << hr;
return hr;
}
hr = _graphBuilder->ConnectDirect(_outputDvPin, _inputSendPin, NULL);
if (hr != S_OK) {
if (hr == HRESULT_FROM_WIN32(ERROR_TOO_MANY_OPEN_FILES)) {
- LOG(LS_INFO) << "Failed to connect the capture device, busy";
+ RTC_LOG(LS_INFO) << "Failed to connect the capture device, busy";
} else {
- LOG(LS_INFO) << "Failed to connect capture device to the send graph: "
- << hr;
+ RTC_LOG(LS_INFO) << "Failed to connect capture device to the send graph: "
+ << hr;
}
return hr;
}
diff --git a/modules/video_coding/codec_database.cc b/modules/video_coding/codec_database.cc
index 18e6cc1..2bc3077 100644
--- a/modules/video_coding/codec_database.cc
+++ b/modules/video_coding/codec_database.cc
@@ -45,7 +45,7 @@
default:
break;
}
- LOG(LS_WARNING) << "No internal decoder of this type exists.";
+ RTC_LOG(LS_WARNING) << "No internal decoder of this type exists.";
return std::unique_ptr<VCMGenericDecoder>();
}
@@ -149,7 +149,7 @@
encoded_frame_callback_->SetInternalSource(internal_source_);
if (ptr_encoder_->InitEncode(&send_codec_, number_of_cores_,
max_payload_size_) < 0) {
- LOG(LS_ERROR) << "Failed to initialize video encoder.";
+ RTC_LOG(LS_ERROR) << "Failed to initialize video encoder.";
DeleteEncoder();
return false;
}
@@ -395,13 +395,13 @@
const VCMEncodedFrame& frame,
VideoCodec* new_codec) const {
uint8_t payload_type = frame.PayloadType();
- LOG(LS_INFO) << "Initializing decoder with payload type '"
- << static_cast<int>(payload_type) << "'.";
+ RTC_LOG(LS_INFO) << "Initializing decoder with payload type '"
+ << static_cast<int>(payload_type) << "'.";
RTC_DCHECK(new_codec);
const VCMDecoderMapItem* decoder_item = FindDecoderItem(payload_type);
if (!decoder_item) {
- LOG(LS_ERROR) << "Can't find a decoder associated with payload type: "
- << static_cast<int>(payload_type);
+ RTC_LOG(LS_ERROR) << "Can't find a decoder associated with payload type: "
+ << static_cast<int>(payload_type);
return nullptr;
}
std::unique_ptr<VCMGenericDecoder> ptr_decoder;
diff --git a/modules/video_coding/codecs/h264/h264.cc b/modules/video_coding/codecs/h264/h264.cc
index b39b21b..e694940 100644
--- a/modules/video_coding/codecs/h264/h264.cc
+++ b/modules/video_coding/codecs/h264/h264.cc
@@ -74,7 +74,7 @@
RTC_DCHECK(H264Encoder::IsSupported());
#if defined(WEBRTC_USE_H264)
RTC_CHECK(g_rtc_use_h264);
- LOG(LS_INFO) << "Creating H264EncoderImpl.";
+ RTC_LOG(LS_INFO) << "Creating H264EncoderImpl.";
return new H264EncoderImpl(codec);
#else
RTC_NOTREACHED();
@@ -90,7 +90,7 @@
RTC_DCHECK(H264Decoder::IsSupported());
#if defined(WEBRTC_USE_H264)
RTC_CHECK(g_rtc_use_h264);
- LOG(LS_INFO) << "Creating H264DecoderImpl.";
+ RTC_LOG(LS_INFO) << "Creating H264DecoderImpl.";
return new H264DecoderImpl();
#else
RTC_NOTREACHED();
diff --git a/modules/video_coding/codecs/h264/h264_decoder_impl.cc b/modules/video_coding/codecs/h264/h264_decoder_impl.cc
index f6355c5..5f6b0c9 100644
--- a/modules/video_coding/codecs/h264/h264_decoder_impl.cc
+++ b/modules/video_coding/codecs/h264/h264_decoder_impl.cc
@@ -119,7 +119,7 @@
int ret = av_image_check_size(static_cast<unsigned int>(width),
static_cast<unsigned int>(height), 0, nullptr);
if (ret < 0) {
- LOG(LS_ERROR) << "Invalid picture size " << width << "x" << height;
+ RTC_LOG(LS_ERROR) << "Invalid picture size " << width << "x" << height;
decoder->ReportError();
return ret;
}
@@ -244,14 +244,14 @@
if (!codec) {
// This is an indication that FFmpeg has not been initialized or it has not
// been compiled/initialized with the correct set of codecs.
- LOG(LS_ERROR) << "FFmpeg H.264 decoder not found.";
+ RTC_LOG(LS_ERROR) << "FFmpeg H.264 decoder not found.";
Release();
ReportError();
return WEBRTC_VIDEO_CODEC_ERROR;
}
int res = avcodec_open2(av_context_.get(), codec, nullptr);
if (res < 0) {
- LOG(LS_ERROR) << "avcodec_open2 error: " << res;
+ RTC_LOG(LS_ERROR) << "avcodec_open2 error: " << res;
Release();
ReportError();
return WEBRTC_VIDEO_CODEC_ERROR;
@@ -283,8 +283,9 @@
return WEBRTC_VIDEO_CODEC_UNINITIALIZED;
}
if (!decoded_image_callback_) {
- LOG(LS_WARNING) << "InitDecode() has been called, but a callback function "
- "has not been set with RegisterDecodeCompleteCallback()";
+ RTC_LOG(LS_WARNING)
+ << "InitDecode() has been called, but a callback function "
+ "has not been set with RegisterDecodeCompleteCallback()";
ReportError();
return WEBRTC_VIDEO_CODEC_UNINITIALIZED;
}
@@ -323,14 +324,14 @@
int result = avcodec_send_packet(av_context_.get(), &packet);
if (result < 0) {
- LOG(LS_ERROR) << "avcodec_send_packet error: " << result;
+ RTC_LOG(LS_ERROR) << "avcodec_send_packet error: " << result;
ReportError();
return WEBRTC_VIDEO_CODEC_ERROR;
}
result = avcodec_receive_frame(av_context_.get(), av_frame_.get());
if (result < 0) {
- LOG(LS_ERROR) << "avcodec_receive_frame error: " << result;
+ RTC_LOG(LS_ERROR) << "avcodec_receive_frame error: " << result;
ReportError();
return WEBRTC_VIDEO_CODEC_ERROR;
}
diff --git a/modules/video_coding/codecs/h264/h264_encoder_impl.cc b/modules/video_coding/codecs/h264/h264_encoder_impl.cc
index 0b964e0..15ad1f6 100644
--- a/modules/video_coding/codecs/h264/h264_encoder_impl.cc
+++ b/modules/video_coding/codecs/h264/h264_encoder_impl.cc
@@ -111,9 +111,10 @@
VideoType::kI420, frame_buffer.width(), frame_buffer.height());
if (encoded_image->_size < required_size) {
// Encoded data > unencoded data. Allocate required bytes.
- LOG(LS_WARNING) << "Encoding produced more bytes than the original image "
- << "data! Original bytes: " << encoded_image->_size
- << ", encoded bytes: " << required_size << ".";
+ RTC_LOG(LS_WARNING)
+ << "Encoding produced more bytes than the original image "
+ << "data! Original bytes: " << encoded_image->_size
+ << ", encoded bytes: " << required_size << ".";
encoded_image->_size = required_size;
}
encoded_image->_buffer = new uint8_t[encoded_image->_size];
@@ -209,7 +210,7 @@
// Create encoder.
if (WelsCreateSVCEncoder(&openh264_encoder_) != 0) {
// Failed to create encoder.
- LOG(LS_ERROR) << "Failed to create OpenH264 encoder";
+ RTC_LOG(LS_ERROR) << "Failed to create OpenH264 encoder";
RTC_DCHECK(!openh264_encoder_);
ReportError();
return WEBRTC_VIDEO_CODEC_ERROR;
@@ -243,7 +244,7 @@
// Initialize.
if (openh264_encoder_->InitializeExt(&encoder_params) != 0) {
- LOG(LS_ERROR) << "Failed to initialize OpenH264 encoder";
+ RTC_LOG(LS_ERROR) << "Failed to initialize OpenH264 encoder";
Release();
ReportError();
return WEBRTC_VIDEO_CODEC_ERROR;
@@ -309,8 +310,9 @@
return WEBRTC_VIDEO_CODEC_UNINITIALIZED;
}
if (!encoded_image_callback_) {
- LOG(LS_WARNING) << "InitEncode() has been called, but a callback function "
- << "has not been set with RegisterEncodeCompleteCallback()";
+ RTC_LOG(LS_WARNING)
+ << "InitEncode() has been called, but a callback function "
+ << "has not been set with RegisterEncodeCompleteCallback()";
ReportError();
return WEBRTC_VIDEO_CODEC_UNINITIALIZED;
}
@@ -355,8 +357,8 @@
// Encode!
int enc_ret = openh264_encoder_->EncodeFrame(&picture, &info);
if (enc_ret != 0) {
- LOG(LS_ERROR) << "OpenH264 frame encoding failed, EncodeFrame returned "
- << enc_ret << ".";
+ RTC_LOG(LS_ERROR) << "OpenH264 frame encoding failed, EncodeFrame returned "
+ << enc_ret << ".";
ReportError();
return WEBRTC_VIDEO_CODEC_ERROR;
}
@@ -449,8 +451,8 @@
encoder_params.iTargetBitrate;
encoder_params.sSpatialLayers[0].iMaxSpatialBitrate =
encoder_params.iMaxBitrate;
- LOG(INFO) << "OpenH264 version is " << OPENH264_MAJOR << "."
- << OPENH264_MINOR;
+ RTC_LOG(INFO) << "OpenH264 version is " << OPENH264_MAJOR << "."
+ << OPENH264_MINOR;
switch (packetization_mode_) {
case H264PacketizationMode::SingleNalUnit:
// Limit the size of the packets produced.
diff --git a/modules/video_coding/codecs/stereo/stereo_encoder_adapter.cc b/modules/video_coding/codecs/stereo/stereo_encoder_adapter.cc
index 2ef0641..283273d 100644
--- a/modules/video_coding/codecs/stereo/stereo_encoder_adapter.cc
+++ b/modules/video_coding/codecs/stereo/stereo_encoder_adapter.cc
@@ -66,7 +66,7 @@
factory_->CreateVideoEncoder(format);
const int rv = encoder->InitEncode(inst, number_of_cores, max_payload_size);
if (rv) {
- LOG(LS_ERROR) << "Failed to create stere codec index " << i;
+ RTC_LOG(LS_ERROR) << "Failed to create stere codec index " << i;
return rv;
}
adapter_callbacks_.emplace_back(new AdapterEncodedImageCallback(
diff --git a/modules/video_coding/codecs/vp8/default_temporal_layers.cc b/modules/video_coding/codecs/vp8/default_temporal_layers.cc
index e2e5488..5b1ccb9 100644
--- a/modules/video_coding/codecs/vp8/default_temporal_layers.cc
+++ b/modules/video_coding/codecs/vp8/default_temporal_layers.cc
@@ -494,15 +494,16 @@
if (pattern_idx_ == temporal_ids_.size()) {
// All non key-frame buffers should be updated each pattern cycle.
if (!last_.is_keyframe && !last_.is_updated_this_cycle) {
- LOG(LS_ERROR) << "Last buffer was not updated during pattern cycle.";
+ RTC_LOG(LS_ERROR) << "Last buffer was not updated during pattern cycle.";
return false;
}
if (!arf_.is_keyframe && !arf_.is_updated_this_cycle) {
- LOG(LS_ERROR) << "Arf buffer was not updated during pattern cycle.";
+ RTC_LOG(LS_ERROR) << "Arf buffer was not updated during pattern cycle.";
return false;
}
if (!golden_.is_keyframe && !golden_.is_updated_this_cycle) {
- LOG(LS_ERROR) << "Golden buffer was not updated during pattern cycle.";
+ RTC_LOG(LS_ERROR)
+ << "Golden buffer was not updated during pattern cycle.";
return false;
}
last_.is_updated_this_cycle = false;
@@ -512,9 +513,9 @@
}
uint8_t expected_tl_idx = temporal_ids_[pattern_idx_];
if (frame_config.packetizer_temporal_idx != expected_tl_idx) {
- LOG(LS_ERROR) << "Frame has an incorrect temporal index. Expected: "
- << static_cast<int>(expected_tl_idx) << " Actual: "
- << static_cast<int>(frame_config.packetizer_temporal_idx);
+ RTC_LOG(LS_ERROR) << "Frame has an incorrect temporal index. Expected: "
+ << static_cast<int>(expected_tl_idx) << " Actual: "
+ << static_cast<int>(frame_config.packetizer_temporal_idx);
return false;
}
@@ -555,8 +556,8 @@
}
if (need_sync != frame_config.layer_sync) {
- LOG(LS_ERROR) << "Sync bit is set incorrectly on a frame. Expected: "
- << need_sync << " Actual: " << frame_config.layer_sync;
+ RTC_LOG(LS_ERROR) << "Sync bit is set incorrectly on a frame. Expected: "
+ << need_sync << " Actual: " << frame_config.layer_sync;
return false;
}
@@ -565,10 +566,11 @@
for (i = 0; i < dependencies.size(); ++i) {
if (temporal_dependencies_[pattern_idx_].find(dependencies[i]) ==
temporal_dependencies_[pattern_idx_].end()) {
- LOG(LS_ERROR) << "Illegal temporal dependency out of defined pattern "
- "from position "
- << static_cast<int>(pattern_idx_) << " to position "
- << static_cast<int>(dependencies[i]);
+ RTC_LOG(LS_ERROR)
+ << "Illegal temporal dependency out of defined pattern "
+ "from position "
+ << static_cast<int>(pattern_idx_) << " to position "
+ << static_cast<int>(dependencies[i]);
return false;
}
}
diff --git a/modules/video_coding/codecs/vp8/temporal_layers.cc b/modules/video_coding/codecs/vp8/temporal_layers.cc
index cf6c5fc..0a9b993 100644
--- a/modules/video_coding/codecs/vp8/temporal_layers.cc
+++ b/modules/video_coding/codecs/vp8/temporal_layers.cc
@@ -48,7 +48,7 @@
}
if (!frame_is_keyframe && !state->is_keyframe &&
state->temporal_layer > temporal_layer) {
- LOG(LS_ERROR) << "Frame is referencing higher temporal layer.";
+ RTC_LOG(LS_ERROR) << "Frame is referencing higher temporal layer.";
return false;
}
}
@@ -72,9 +72,9 @@
if (frame_config.packetizer_temporal_idx >= num_temporal_layers_ ||
(frame_config.packetizer_temporal_idx == kNoTemporalIdx &&
num_temporal_layers_ > 1)) {
- LOG(LS_ERROR) << "Incorrect temporal layer set for frame: "
- << frame_config.packetizer_temporal_idx
- << " num_temporal_layers: " << num_temporal_layers_;
+ RTC_LOG(LS_ERROR) << "Incorrect temporal layer set for frame: "
+ << frame_config.packetizer_temporal_idx
+ << " num_temporal_layers: " << num_temporal_layers_;
return false;
}
@@ -86,7 +86,7 @@
&last_, &need_sync, frame_is_keyframe,
frame_config.packetizer_temporal_idx, frame_config.last_buffer_flags,
sequence_number_, &lowest_sequence_referenced)) {
- LOG(LS_ERROR) << "Error in the Last buffer";
+ RTC_LOG(LS_ERROR) << "Error in the Last buffer";
return false;
}
if (!CheckAndUpdateBufferState(&golden_, &need_sync, frame_is_keyframe,
@@ -94,22 +94,22 @@
frame_config.golden_buffer_flags,
sequence_number_,
&lowest_sequence_referenced)) {
- LOG(LS_ERROR) << "Error in the Golden buffer";
+ RTC_LOG(LS_ERROR) << "Error in the Golden buffer";
return false;
}
if (!CheckAndUpdateBufferState(
&arf_, &need_sync, frame_is_keyframe,
frame_config.packetizer_temporal_idx, frame_config.arf_buffer_flags,
sequence_number_, &lowest_sequence_referenced)) {
- LOG(LS_ERROR) << "Error in the Arf buffer";
+ RTC_LOG(LS_ERROR) << "Error in the Arf buffer";
return false;
}
if (lowest_sequence_referenced < last_sync_sequence_number_ &&
!frame_is_keyframe) {
- LOG(LS_ERROR) << "Reference past the last sync frame. Referenced "
- << lowest_sequence_referenced << ", but sync was at "
- << last_sync_sequence_number_;
+ RTC_LOG(LS_ERROR) << "Reference past the last sync frame. Referenced "
+ << lowest_sequence_referenced << ", but sync was at "
+ << last_sync_sequence_number_;
return false;
}
@@ -126,8 +126,8 @@
}
if (need_sync != frame_config.layer_sync) {
- LOG(LS_ERROR) << "Sync bit is set incorrectly on a frame. Expected: "
- << need_sync << " Actual: " << frame_config.layer_sync;
+ RTC_LOG(LS_ERROR) << "Sync bit is set incorrectly on a frame. Expected: "
+ << need_sync << " Actual: " << frame_config.layer_sync;
return false;
}
return true;
diff --git a/modules/video_coding/codecs/vp9/vp9_frame_buffer_pool.cc b/modules/video_coding/codecs/vp9/vp9_frame_buffer_pool.cc
index a7a03e5..69101cb 100644
--- a/modules/video_coding/codecs/vp9/vp9_frame_buffer_pool.cc
+++ b/modules/video_coding/codecs/vp9/vp9_frame_buffer_pool.cc
@@ -70,7 +70,7 @@
available_buffer = new rtc::RefCountedObject<Vp9FrameBuffer>();
allocated_buffers_.push_back(available_buffer);
if (allocated_buffers_.size() > max_num_buffers_) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< allocated_buffers_.size() << " Vp9FrameBuffers have been "
<< "allocated by a Vp9FrameBufferPool (exceeding what is "
<< "considered reasonable, " << max_num_buffers_ << ").";
diff --git a/modules/video_coding/codecs/vp9/vp9_impl.cc b/modules/video_coding/codecs/vp9/vp9_impl.cc
index b33ea8e..c68fea7 100644
--- a/modules/video_coding/codecs/vp9/vp9_impl.cc
+++ b/modules/video_coding/codecs/vp9/vp9_impl.cc
@@ -128,8 +128,8 @@
if (ExplicitlyConfiguredSpatialLayers()) {
if (num_temporal_layers_ > 1) {
- LOG(LS_ERROR) << "Multiple temporal layers when manually specifying "
- "spatial layers not implemented yet!";
+ RTC_LOG(LS_ERROR) << "Multiple temporal layers when manually specifying "
+ "spatial layers not implemented yet!";
return false;
}
int total_bitrate_bps = 0;
@@ -150,7 +150,7 @@
for (i = 0; i < num_spatial_layers_; ++i) {
if (svc_params_.scaling_factor_num[i] <= 0 ||
svc_params_.scaling_factor_den[i] <= 0) {
- LOG(LS_ERROR) << "Scaling factors not specified!";
+ RTC_LOG(LS_ERROR) << "Scaling factors not specified!";
return false;
}
rate_ratio[i] =
@@ -178,8 +178,8 @@
config_->layer_target_bitrate[i * num_temporal_layers_ + 2] =
config_->ss_target_bitrate[i];
} else {
- LOG(LS_ERROR) << "Unsupported number of temporal layers: "
- << num_temporal_layers_;
+ RTC_LOG(LS_ERROR) << "Unsupported number of temporal layers: "
+ << num_temporal_layers_;
return false;
}
}
@@ -861,8 +861,8 @@
// The frame buffers are reference counted and frames are exposed after
// decoding. There may be valid usage cases where previous frames are still
// referenced after ~VP9DecoderImpl that is not a leak.
- LOG(LS_INFO) << num_buffers_in_use << " Vp9FrameBuffers are still "
- << "referenced during ~VP9DecoderImpl.";
+ RTC_LOG(LS_INFO) << num_buffers_in_use << " Vp9FrameBuffers are still "
+ << "referenced during ~VP9DecoderImpl.";
}
}
diff --git a/modules/video_coding/decoding_state.cc b/modules/video_coding/decoding_state.cc
index 01ba860..23bf668 100644
--- a/modules/video_coding/decoding_state.cc
+++ b/modules/video_coding/decoding_state.cc
@@ -81,15 +81,15 @@
for (const NaluInfo& nalu : frame->GetNaluInfos()) {
if (nalu.type == H264::NaluType::kPps) {
if (nalu.pps_id < 0) {
- LOG(LS_WARNING) << "Received pps without pps id.";
+ RTC_LOG(LS_WARNING) << "Received pps without pps id.";
} else if (nalu.sps_id < 0) {
- LOG(LS_WARNING) << "Received pps without sps id.";
+ RTC_LOG(LS_WARNING) << "Received pps without sps id.";
} else {
received_pps_[nalu.pps_id] = nalu.sps_id;
}
} else if (nalu.type == H264::NaluType::kSps) {
if (nalu.sps_id < 0) {
- LOG(LS_WARNING) << "Received sps without sps id.";
+ RTC_LOG(LS_WARNING) << "Received sps without sps id.";
} else {
received_sps_.insert(nalu.sps_id);
}
@@ -295,8 +295,8 @@
frame->CodecSpecific()->codecType == kVideoCodecVP9 &&
frame->CodecSpecific()->codecSpecific.VP9.flexible_mode;
if (is_flexible_mode && frame->PictureId() == kNoPictureId) {
- LOG(LS_WARNING) << "Frame is marked as using flexible mode but no"
- << "picture id is set.";
+ RTC_LOG(LS_WARNING) << "Frame is marked as using flexible mode but no"
+ << "picture id is set.";
return false;
}
return is_flexible_mode;
@@ -326,16 +326,16 @@
switch (nalu.type) {
case H264::NaluType::kPps:
if (nalu.pps_id < 0) {
- LOG(LS_WARNING) << "Received pps without pps id.";
+ RTC_LOG(LS_WARNING) << "Received pps without pps id.";
} else if (nalu.sps_id < 0) {
- LOG(LS_WARNING) << "Received pps without sps id.";
+ RTC_LOG(LS_WARNING) << "Received pps without sps id.";
} else {
new_pps[nalu.pps_id] = nalu.sps_id;
}
break;
case H264::NaluType::kSps:
if (nalu.sps_id < 0) {
- LOG(LS_WARNING) << "Received sps without sps id.";
+ RTC_LOG(LS_WARNING) << "Received sps without sps id.";
} else {
new_sps.insert(nalu.sps_id);
}
diff --git a/modules/video_coding/frame_buffer.cc b/modules/video_coding/frame_buffer.cc
index 51fb20a..f06e40f 100644
--- a/modules/video_coding/frame_buffer.cc
+++ b/modules/video_coding/frame_buffer.cc
@@ -122,8 +122,8 @@
(requiredSizeBytes % kBufferIncStepSizeBytes > 0);
const uint32_t newSize = _size + increments * kBufferIncStepSizeBytes;
if (newSize > kMaxJBFrameSizeBytes) {
- LOG(LS_ERROR) << "Failed to insert packet due to frame being too "
- "big.";
+ RTC_LOG(LS_ERROR) << "Failed to insert packet due to frame being too "
+ "big.";
return kSizeError;
}
VerifyAndAllocate(newSize);
diff --git a/modules/video_coding/frame_buffer2.cc b/modules/video_coding/frame_buffer2.cc
index e289a03..12bfd35 100644
--- a/modules/video_coding/frame_buffer2.cc
+++ b/modules/video_coding/frame_buffer2.cc
@@ -178,16 +178,15 @@
!frame_is_higher_spatial_layer_of_last_decoded_frame) {
// TODO(brandtr): Consider clearing the entire buffer when we hit
// these conditions.
- LOG(LS_WARNING) << "Frame with (timestamp:picture_id:spatial_id) ("
- << frame->timestamp << ":" << frame->picture_id << ":"
- << static_cast<int>(frame->spatial_layer) << ")"
- << " sent to decoder after frame with"
- << " (timestamp:picture_id:spatial_id) ("
- << last_decoded_frame_timestamp_ << ":"
- << last_decoded_frame_key.picture_id << ":"
- << static_cast<int>(
- last_decoded_frame_key.spatial_layer)
- << ").";
+ RTC_LOG(LS_WARNING)
+ << "Frame with (timestamp:picture_id:spatial_id) ("
+ << frame->timestamp << ":" << frame->picture_id << ":"
+ << static_cast<int>(frame->spatial_layer) << ")"
+ << " sent to decoder after frame with"
+ << " (timestamp:picture_id:spatial_id) ("
+ << last_decoded_frame_timestamp_ << ":"
+ << last_decoded_frame_key.picture_id << ":"
+ << static_cast<int>(last_decoded_frame_key.spatial_layer) << ").";
}
}
@@ -218,15 +217,15 @@
}
if (std::abs(render_time_ms - now_ms) > kMaxVideoDelayMs) {
int frame_delay = static_cast<int>(std::abs(render_time_ms - now_ms));
- LOG(LS_WARNING) << "A frame about to be decoded is out of the configured "
- << "delay bounds (" << frame_delay << " > "
- << kMaxVideoDelayMs
- << "). Resetting the video jitter buffer.";
+ RTC_LOG(LS_WARNING)
+ << "A frame about to be decoded is out of the configured "
+ << "delay bounds (" << frame_delay << " > " << kMaxVideoDelayMs
+ << "). Resetting the video jitter buffer.";
return true;
}
if (static_cast<int>(timing_->TargetVideoDelay()) > kMaxVideoDelayMs) {
- LOG(LS_WARNING) << "The video target delay has grown larger than "
- << kMaxVideoDelayMs << " ms.";
+ RTC_LOG(LS_WARNING) << "The video target delay has grown larger than "
+ << kMaxVideoDelayMs << " ms.";
return true;
}
return false;
@@ -302,17 +301,19 @@
: last_continuous_frame_it_->first.picture_id;
if (!ValidReferences(*frame)) {
- LOG(LS_WARNING) << "Frame with (picture_id:spatial_id) (" << key.picture_id
- << ":" << static_cast<int>(key.spatial_layer)
- << ") has invalid frame references, dropping frame.";
+ RTC_LOG(LS_WARNING) << "Frame with (picture_id:spatial_id) ("
+ << key.picture_id << ":"
+ << static_cast<int>(key.spatial_layer)
+ << ") has invalid frame references, dropping frame.";
return last_continuous_picture_id;
}
if (num_frames_buffered_ >= kMaxFramesBuffered) {
- LOG(LS_WARNING) << "Frame with (picture_id:spatial_id) (" << key.picture_id
- << ":" << static_cast<int>(key.spatial_layer)
- << ") could not be inserted due to the frame "
- << "buffer being full, dropping frame.";
+ RTC_LOG(LS_WARNING) << "Frame with (picture_id:spatial_id) ("
+ << key.picture_id << ":"
+ << static_cast<int>(key.spatial_layer)
+ << ") could not be inserted due to the frame "
+ << "buffer being full, dropping frame.";
return last_continuous_picture_id;
}
@@ -325,18 +326,19 @@
// reconfiguration or some other reason. Even though this is not according
// to spec we can still continue to decode from this frame if it is a
// keyframe.
- LOG(LS_WARNING) << "A jump in picture id was detected, clearing buffer.";
+ RTC_LOG(LS_WARNING)
+ << "A jump in picture id was detected, clearing buffer.";
ClearFramesAndHistory();
last_continuous_picture_id = -1;
} else {
- LOG(LS_WARNING) << "Frame with (picture_id:spatial_id) ("
- << key.picture_id << ":"
- << static_cast<int>(key.spatial_layer)
- << ") inserted after frame ("
- << last_decoded_frame_it_->first.picture_id << ":"
- << static_cast<int>(
- last_decoded_frame_it_->first.spatial_layer)
- << ") was handed off for decoding, dropping frame.";
+ RTC_LOG(LS_WARNING) << "Frame with (picture_id:spatial_id) ("
+ << key.picture_id << ":"
+ << static_cast<int>(key.spatial_layer)
+ << ") inserted after frame ("
+ << last_decoded_frame_it_->first.picture_id << ":"
+ << static_cast<int>(
+ last_decoded_frame_it_->first.spatial_layer)
+ << ") was handed off for decoding, dropping frame.";
return last_continuous_picture_id;
}
}
@@ -347,7 +349,8 @@
if (!frames_.empty() &&
key < frames_.begin()->first &&
frames_.rbegin()->first < key) {
- LOG(LS_WARNING) << "A jump in picture id was detected, clearing buffer.";
+ RTC_LOG(LS_WARNING)
+ << "A jump in picture id was detected, clearing buffer.";
ClearFramesAndHistory();
last_continuous_picture_id = -1;
}
@@ -355,9 +358,10 @@
auto info = frames_.insert(std::make_pair(key, FrameInfo())).first;
if (info->second.frame) {
- LOG(LS_WARNING) << "Frame with (picture_id:spatial_id) (" << key.picture_id
- << ":" << static_cast<int>(key.spatial_layer)
- << ") already inserted, dropping frame.";
+ RTC_LOG(LS_WARNING) << "Frame with (picture_id:spatial_id) ("
+ << key.picture_id << ":"
+ << static_cast<int>(key.spatial_layer)
+ << ") already inserted, dropping frame.";
return last_continuous_picture_id;
}
@@ -476,7 +480,7 @@
if (ref_info == frames_.end()) {
int64_t now_ms = clock_->TimeInMilliseconds();
if (last_log_non_decoded_ms_ + kLogNonDecodedIntervalMs < now_ms) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "Frame with (picture_id:spatial_id) (" << key.picture_id << ":"
<< static_cast<int>(key.spatial_layer)
<< ") depends on a non-decoded frame more previous than"
diff --git a/modules/video_coding/generic_decoder.cc b/modules/video_coding/generic_decoder.cc
index f67c017..cfe5acf 100644
--- a/modules/video_coding/generic_decoder.cc
+++ b/modules/video_coding/generic_decoder.cc
@@ -78,8 +78,8 @@
}
if (frameInfo == NULL) {
- LOG(LS_WARNING) << "Too many frames backed up in the decoder, dropping "
- "this one.";
+ RTC_LOG(LS_WARNING) << "Too many frames backed up in the decoder, dropping "
+ "this one.";
return;
}
@@ -234,10 +234,10 @@
_callback->OnDecoderImplementationName(decoder_->ImplementationName());
if (ret < WEBRTC_VIDEO_CODEC_OK) {
- LOG(LS_WARNING) << "Failed to decode frame with timestamp "
- << frame.TimeStamp() << ", error code: " << ret;
- _callback->Pop(frame.TimeStamp());
- return ret;
+ RTC_LOG(LS_WARNING) << "Failed to decode frame with timestamp "
+ << frame.TimeStamp() << ", error code: " << ret;
+ _callback->Pop(frame.TimeStamp());
+ return ret;
} else if (ret == WEBRTC_VIDEO_CODEC_NO_OUTPUT ||
ret == WEBRTC_VIDEO_CODEC_REQUEST_SLI) {
// No output
diff --git a/modules/video_coding/generic_encoder.cc b/modules/video_coding/generic_encoder.cc
index b616523..731c4f8 100644
--- a/modules/video_coding/generic_encoder.cc
+++ b/modules/video_coding/generic_encoder.cc
@@ -60,9 +60,9 @@
vcm_encoded_frame_callback_->OnFrameRateChanged(settings->maxFramerate);
if (encoder_->InitEncode(settings, number_of_cores, max_payload_size) != 0) {
- LOG(LS_ERROR) << "Failed to initialize the encoder associated with "
- "payload name: "
- << settings->plName;
+ RTC_LOG(LS_ERROR) << "Failed to initialize the encoder associated with "
+ "payload name: "
+ << settings->plName;
return -1;
}
vcm_encoded_frame_callback_->Reset();
@@ -103,19 +103,19 @@
if (channel_parameters_have_changed) {
int res = encoder_->SetChannelParameters(params.loss_rate, params.rtt);
if (res != 0) {
- LOG(LS_WARNING) << "Error set encoder parameters (loss = "
- << params.loss_rate << ", rtt = " << params.rtt
- << "): " << res;
+ RTC_LOG(LS_WARNING) << "Error set encoder parameters (loss = "
+ << params.loss_rate << ", rtt = " << params.rtt
+ << "): " << res;
}
}
if (rates_have_changed) {
int res = encoder_->SetRateAllocation(params.target_bitrate,
params.input_frame_rate);
if (res != 0) {
- LOG(LS_WARNING) << "Error set encoder rate (total bitrate bps = "
- << params.target_bitrate.get_sum_bps()
- << ", framerate = " << params.input_frame_rate
- << "): " << res;
+ RTC_LOG(LS_WARNING) << "Error set encoder rate (total bitrate bps = "
+ << params.target_bitrate.get_sum_bps()
+ << ", framerate = " << params.input_frame_rate
+ << "): " << res;
}
vcm_encoded_frame_callback_->OnFrameRateChanged(params.input_frame_rate);
for (size_t i = 0; i < streams_or_svc_num_; ++i) {
@@ -225,8 +225,8 @@
.capture_time_ms) >= 0);
if (timing_frames_info_[simulcast_svc_idx].encode_start_list.size() ==
kMaxEncodeStartTimeListSize) {
- LOG(LS_WARNING) << "Too many frames in the encode_start_list."
- " Did encoder stall?";
+ RTC_LOG(LS_WARNING) << "Too many frames in the encode_start_list."
+ " Did encoder stall?";
post_encode_callback_->OnDroppedFrame(DropReason::kDroppedByEncoder);
timing_frames_info_[simulcast_svc_idx].encode_start_list.pop_front();
}
diff --git a/modules/video_coding/h264_sprop_parameter_sets.cc b/modules/video_coding/h264_sprop_parameter_sets.cc
index 3229f0f..be0d17c 100644
--- a/modules/video_coding/h264_sprop_parameter_sets.cc
+++ b/modules/video_coding/h264_sprop_parameter_sets.cc
@@ -29,20 +29,20 @@
bool H264SpropParameterSets::DecodeSprop(const std::string& sprop) {
size_t separator_pos = sprop.find(',');
- LOG(LS_INFO) << "Parsing sprop \"" << sprop << "\"";
+ RTC_LOG(LS_INFO) << "Parsing sprop \"" << sprop << "\"";
if ((separator_pos <= 0) || (separator_pos >= sprop.length() - 1)) {
- LOG(LS_WARNING) << "Invalid seperator position " << separator_pos << " *"
- << sprop << "*";
+ RTC_LOG(LS_WARNING) << "Invalid seperator position " << separator_pos
+ << " *" << sprop << "*";
return false;
}
std::string sps_str = sprop.substr(0, separator_pos);
std::string pps_str = sprop.substr(separator_pos + 1, std::string::npos);
if (!DecodeAndConvert(sps_str, &sps_)) {
- LOG(LS_WARNING) << "Failed to decode sprop/sps *" << sprop << "*";
+ RTC_LOG(LS_WARNING) << "Failed to decode sprop/sps *" << sprop << "*";
return false;
}
if (!DecodeAndConvert(pps_str, &pps_)) {
- LOG(LS_WARNING) << "Failed to decode sprop/pps *" << sprop << "*";
+ RTC_LOG(LS_WARNING) << "Failed to decode sprop/pps *" << sprop << "*";
return false;
}
return true;
diff --git a/modules/video_coding/h264_sps_pps_tracker.cc b/modules/video_coding/h264_sps_pps_tracker.cc
index 443946d..e8864e2 100644
--- a/modules/video_coding/h264_sps_pps_tracker.cc
+++ b/modules/video_coding/h264_sps_pps_tracker.cc
@@ -60,20 +60,20 @@
// to prepend the SPS/PPS to the bitstream with start codes.
if (video_header.is_first_packet_in_frame) {
if (nalu.pps_id == -1) {
- LOG(LS_WARNING) << "No PPS id in IDR nalu.";
+ RTC_LOG(LS_WARNING) << "No PPS id in IDR nalu.";
return kRequestKeyframe;
}
pps = pps_data_.find(nalu.pps_id);
if (pps == pps_data_.end()) {
- LOG(LS_WARNING) << "No PPS with id << " << nalu.pps_id
- << " received";
+ RTC_LOG(LS_WARNING)
+ << "No PPS with id << " << nalu.pps_id << " received";
return kRequestKeyframe;
}
sps = sps_data_.find(pps->second.sps_id);
if (sps == sps_data_.end()) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "No SPS with id << " << pps->second.sps_id << " received";
return kRequestKeyframe;
}
@@ -159,8 +159,8 @@
codec_header->nalus[codec_header->nalus_length++] = sps_info;
codec_header->nalus[codec_header->nalus_length++] = pps_info;
} else {
- LOG(LS_WARNING) << "Not enough space in H.264 codec header to insert "
- "SPS/PPS provided out-of-band.";
+ RTC_LOG(LS_WARNING) << "Not enough space in H.264 codec header to insert "
+ "SPS/PPS provided out-of-band.";
}
}
@@ -202,21 +202,21 @@
const std::vector<uint8_t>& pps) {
constexpr size_t kNaluHeaderOffset = 1;
if (sps.size() < kNaluHeaderOffset) {
- LOG(LS_WARNING) << "SPS size " << sps.size() << " is smaller than "
- << kNaluHeaderOffset;
+ RTC_LOG(LS_WARNING) << "SPS size " << sps.size() << " is smaller than "
+ << kNaluHeaderOffset;
return;
}
if ((sps[0] & 0x1f) != H264::NaluType::kSps) {
- LOG(LS_WARNING) << "SPS Nalu header missing";
+ RTC_LOG(LS_WARNING) << "SPS Nalu header missing";
return;
}
if (pps.size() < kNaluHeaderOffset) {
- LOG(LS_WARNING) << "PPS size " << pps.size() << " is smaller than "
- << kNaluHeaderOffset;
+ RTC_LOG(LS_WARNING) << "PPS size " << pps.size() << " is smaller than "
+ << kNaluHeaderOffset;
return;
}
if ((pps[0] & 0x1f) != H264::NaluType::kPps) {
- LOG(LS_WARNING) << "SPS Nalu header missing";
+ RTC_LOG(LS_WARNING) << "SPS Nalu header missing";
return;
}
rtc::Optional<SpsParser::SpsState> parsed_sps = SpsParser::ParseSps(
@@ -225,11 +225,11 @@
pps.data() + kNaluHeaderOffset, pps.size() - kNaluHeaderOffset);
if (!parsed_sps) {
- LOG(LS_WARNING) << "Failed to parse SPS.";
+ RTC_LOG(LS_WARNING) << "Failed to parse SPS.";
}
if (!parsed_pps) {
- LOG(LS_WARNING) << "Failed to parse PPS.";
+ RTC_LOG(LS_WARNING) << "Failed to parse PPS.";
}
if (!parsed_pps || !parsed_sps) {
@@ -253,9 +253,9 @@
pps_info.data.reset(pps_data);
pps_data_[parsed_pps->id] = std::move(pps_info);
- LOG(LS_INFO) << "Inserted SPS id " << parsed_sps->id << " and PPS id "
- << parsed_pps->id << " (referencing SPS " << parsed_pps->sps_id
- << ")";
+ RTC_LOG(LS_INFO) << "Inserted SPS id " << parsed_sps->id << " and PPS id "
+ << parsed_pps->id << " (referencing SPS "
+ << parsed_pps->sps_id << ")";
}
} // namespace video_coding
diff --git a/modules/video_coding/jitter_buffer.cc b/modules/video_coding/jitter_buffer.cc
index 0b65333..aefe6ae 100644
--- a/modules/video_coding/jitter_buffer.cc
+++ b/modules/video_coding/jitter_buffer.cc
@@ -605,7 +605,7 @@
*frame = GetEmptyFrame();
if (*frame == NULL) {
// No free frame! Try to reclaim some...
- LOG(LS_WARNING) << "Unable to get empty frame; Recycling.";
+ RTC_LOG(LS_WARNING) << "Unable to get empty frame; Recycling.";
bool found_key_frame = RecycleFramesUntilKeyFrame();
*frame = GetEmptyFrame();
RTC_CHECK(*frame);
@@ -655,7 +655,7 @@
FindAndInsertContinuousFramesWithState(last_decoded_state_);
if (num_consecutive_old_packets_ > kMaxConsecutiveOldPackets) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< num_consecutive_old_packets_
<< " consecutive old packets received. Flushing the jitter buffer.";
Flush();
@@ -996,9 +996,9 @@
int non_continuous_incomplete_duration =
NonContinuousOrIncompleteDuration();
if (non_continuous_incomplete_duration > 90 * max_incomplete_time_ms_) {
- LOG_F(LS_WARNING) << "Too long non-decodable duration: "
- << non_continuous_incomplete_duration << " > "
- << 90 * max_incomplete_time_ms_;
+ RTC_LOG_F(LS_WARNING) << "Too long non-decodable duration: "
+ << non_continuous_incomplete_duration << " > "
+ << 90 * max_incomplete_time_ms_;
FrameList::reverse_iterator rit = find_if(
incomplete_frames_.rbegin(), incomplete_frames_.rend(), IsKeyFrame);
if (rit == incomplete_frames_.rend()) {
@@ -1052,12 +1052,13 @@
"seqnum", i);
}
if (TooLargeNackList() && !HandleTooLargeNackList()) {
- LOG(LS_WARNING) << "Requesting key frame due to too large NACK list.";
+ RTC_LOG(LS_WARNING) << "Requesting key frame due to too large NACK list.";
return false;
}
if (MissingTooOldPacket(sequence_number) &&
!HandleTooOldPackets(sequence_number)) {
- LOG(LS_WARNING) << "Requesting key frame due to missing too old packets";
+ RTC_LOG(LS_WARNING)
+ << "Requesting key frame due to missing too old packets";
return false;
}
} else {
@@ -1075,9 +1076,9 @@
bool VCMJitterBuffer::HandleTooLargeNackList() {
// Recycle frames until the NACK list is small enough. It is likely cheaper to
// request a key frame than to retransmit this many missing packets.
- LOG_F(LS_WARNING) << "NACK list has grown too large: "
- << missing_sequence_numbers_.size() << " > "
- << max_nack_list_size_;
+ RTC_LOG_F(LS_WARNING) << "NACK list has grown too large: "
+ << missing_sequence_numbers_.size() << " > "
+ << max_nack_list_size_;
bool key_frame_found = false;
while (TooLargeNackList()) {
key_frame_found = RecycleFramesUntilKeyFrame();
@@ -1101,9 +1102,9 @@
bool key_frame_found = false;
const uint16_t age_of_oldest_missing_packet =
latest_sequence_number - *missing_sequence_numbers_.begin();
- LOG_F(LS_WARNING) << "NACK list contains too old sequence numbers: "
- << age_of_oldest_missing_packet << " > "
- << max_packet_age_to_nack_;
+ RTC_LOG_F(LS_WARNING) << "NACK list contains too old sequence numbers: "
+ << age_of_oldest_missing_packet << " > "
+ << max_packet_age_to_nack_;
while (MissingTooOldPacket(latest_sequence_number)) {
key_frame_found = RecycleFramesUntilKeyFrame();
}
@@ -1163,7 +1164,7 @@
}
TRACE_EVENT_INSTANT0("webrtc", "JB::RecycleFramesUntilKeyFrame");
if (key_frame_found) {
- LOG(LS_INFO) << "Found key frame while dropping frames.";
+ RTC_LOG(LS_INFO) << "Found key frame while dropping frames.";
// Reset last decoded state to make sure the next frame decoded is a key
// frame, and start NACKing from here.
last_decoded_state_.Reset();
@@ -1195,7 +1196,7 @@
if (frame.FrameType() == kVideoFrameKey) {
++receive_statistics_.key_frames;
if (receive_statistics_.key_frames == 1) {
- LOG(LS_INFO) << "Received first complete key frame";
+ RTC_LOG(LS_INFO) << "Received first complete key frame";
}
} else {
++receive_statistics_.delta_frames;
diff --git a/modules/video_coding/nack_module.cc b/modules/video_coding/nack_module.cc
index dad4e22..ed2e82a 100644
--- a/modules/video_coding/nack_module.cc
+++ b/modules/video_coding/nack_module.cc
@@ -196,8 +196,8 @@
if (nack_list_.size() + num_new_nacks > kMaxNackPackets) {
nack_list_.clear();
- LOG(LS_WARNING) << "NACK list full, clearing NACK"
- " list and requesting keyframe.";
+ RTC_LOG(LS_WARNING) << "NACK list full, clearing NACK"
+ " list and requesting keyframe.";
keyframe_request_sender_->RequestKeyFrame();
return;
}
@@ -223,8 +223,8 @@
++it->second.retries;
it->second.sent_at_time = now_ms;
if (it->second.retries >= kMaxNackRetries) {
- LOG(LS_WARNING) << "Sequence number " << it->second.seq_num
- << " removed from NACK list due to max retries.";
+ RTC_LOG(LS_WARNING) << "Sequence number " << it->second.seq_num
+ << " removed from NACK list due to max retries.";
it = nack_list_.erase(it);
} else {
++it;
@@ -237,8 +237,8 @@
++it->second.retries;
it->second.sent_at_time = now_ms;
if (it->second.retries >= kMaxNackRetries) {
- LOG(LS_WARNING) << "Sequence number " << it->second.seq_num
- << " removed from NACK list due to max retries.";
+ RTC_LOG(LS_WARNING) << "Sequence number " << it->second.seq_num
+ << " removed from NACK list due to max retries.";
it = nack_list_.erase(it);
} else {
++it;
diff --git a/modules/video_coding/packet_buffer.cc b/modules/video_coding/packet_buffer.cc
index 0e4ef6a..bf83083 100644
--- a/modules/video_coding/packet_buffer.cc
+++ b/modules/video_coding/packet_buffer.cc
@@ -206,8 +206,8 @@
bool PacketBuffer::ExpandBufferSize() {
if (size_ == max_size_) {
- LOG(LS_WARNING) << "PacketBuffer is already at max size (" << max_size_
- << "), failed to increase size. Clearing PacketBuffer.";
+ RTC_LOG(LS_WARNING) << "PacketBuffer is already at max size (" << max_size_
+ << "), failed to increase size. Clearing PacketBuffer.";
Clear();
return false;
}
@@ -225,7 +225,7 @@
size_ = new_size;
sequence_buffer_ = std::move(new_sequence_buffer);
data_buffer_ = std::move(new_data_buffer);
- LOG(LS_INFO) << "PacketBuffer size expanded to " << new_size;
+ RTC_LOG(LS_INFO) << "PacketBuffer size expanded to " << new_size;
return true;
}
@@ -344,7 +344,7 @@
ss << "Treating as key frame since "
"WebRTC-SpsPpsIdrIsH264Keyframe is disabled.";
}
- LOG(LS_WARNING) << ss.str();
+ RTC_LOG(LS_WARNING) << ss.str();
}
// Now that we have decided whether to treat this frame as a key frame
@@ -419,9 +419,9 @@
RTC_DCHECK_EQ(data_buffer_[index].seqNum, sequence_buffer_[index].seq_num);
size_t length = data_buffer_[index].sizeBytes;
if (destination + length > destination_end) {
- LOG(LS_WARNING) << "Frame (" << frame.picture_id << ":"
- << static_cast<int>(frame.spatial_layer) << ")"
- << " bitstream buffer is not large enough.";
+ RTC_LOG(LS_WARNING) << "Frame (" << frame.picture_id << ":"
+ << static_cast<int>(frame.spatial_layer) << ")"
+ << " bitstream buffer is not large enough.";
return false;
}
diff --git a/modules/video_coding/receiver.cc b/modules/video_coding/receiver.cc
index 1bf90f3..157cb88 100644
--- a/modules/video_coding/receiver.cc
+++ b/modules/video_coding/receiver.cc
@@ -165,15 +165,16 @@
timing_error = true;
} else if (std::abs(render_time_ms - now_ms) > max_video_delay_ms_) {
int frame_delay = static_cast<int>(std::abs(render_time_ms - now_ms));
- LOG(LS_WARNING) << "A frame about to be decoded is out of the configured "
- << "delay bounds (" << frame_delay << " > "
- << max_video_delay_ms_
- << "). Resetting the video jitter buffer.";
+ RTC_LOG(LS_WARNING)
+ << "A frame about to be decoded is out of the configured "
+ << "delay bounds (" << frame_delay << " > " << max_video_delay_ms_
+ << "). Resetting the video jitter buffer.";
timing_error = true;
} else if (static_cast<int>(timing_->TargetVideoDelay()) >
max_video_delay_ms_) {
- LOG(LS_WARNING) << "The video target delay has grown larger than "
- << max_video_delay_ms_ << " ms. Resetting jitter buffer.";
+ RTC_LOG(LS_WARNING) << "The video target delay has grown larger than "
+ << max_video_delay_ms_
+ << " ms. Resetting jitter buffer.";
timing_error = true;
}
diff --git a/modules/video_coding/rtp_frame_reference_finder.cc b/modules/video_coding/rtp_frame_reference_finder.cc
index 23e8c81..a2f32c2 100644
--- a/modules/video_coding/rtp_frame_reference_finder.cc
+++ b/modules/video_coding/rtp_frame_reference_finder.cc
@@ -204,9 +204,10 @@
// that this frame indirectly references.
auto seq_num_it = last_seq_num_gop_.upper_bound(frame->last_seq_num());
if (seq_num_it == last_seq_num_gop_.begin()) {
- LOG(LS_WARNING) << "Generic frame with packet range ["
- << frame->first_seq_num() << ", " << frame->last_seq_num()
- << "] has no GoP, dropping frame.";
+ RTC_LOG(LS_WARNING) << "Generic frame with packet range ["
+ << frame->first_seq_num() << ", "
+ << frame->last_seq_num()
+ << "] has no GoP, dropping frame.";
return kDrop;
}
seq_num_it--;
@@ -244,7 +245,8 @@
RtpFrameObject* frame) {
rtc::Optional<RTPVideoTypeHeader> rtp_codec_header = frame->GetCodecHeader();
if (!rtp_codec_header) {
- LOG(LS_WARNING) << "Failed to get codec header from frame, dropping frame.";
+ RTC_LOG(LS_WARNING)
+ << "Failed to get codec header from frame, dropping frame.";
return kDrop;
}
@@ -351,10 +353,11 @@
if (!(AheadOf<uint16_t, kPicIdLength>(frame->picture_id,
layer_info_it->second[layer]))) {
- LOG(LS_WARNING) << "Frame with picture id " << frame->picture_id
- << " and packet range [" << frame->first_seq_num() << ", "
- << frame->last_seq_num() << "] already received, "
- << " dropping frame.";
+ RTC_LOG(LS_WARNING) << "Frame with picture id " << frame->picture_id
+ << " and packet range [" << frame->first_seq_num()
+ << ", " << frame->last_seq_num()
+ << "] already received, "
+ << " dropping frame.";
return kDrop;
}
@@ -397,7 +400,8 @@
RtpFrameObject* frame) {
rtc::Optional<RTPVideoTypeHeader> rtp_codec_header = frame->GetCodecHeader();
if (!rtp_codec_header) {
- LOG(LS_WARNING) << "Failed to get codec header from frame, dropping frame.";
+ RTC_LOG(LS_WARNING)
+ << "Failed to get codec header from frame, dropping frame.";
return kDrop;
}
@@ -432,8 +436,9 @@
if (codec_header.ss_data_available) {
// Scalability structures can only be sent with tl0 frames.
if (codec_header.temporal_idx != 0) {
- LOG(LS_WARNING) << "Received scalability structure on a non base layer"
- " frame. Scalability structure ignored.";
+ RTC_LOG(LS_WARNING)
+ << "Received scalability structure on a non base layer"
+ " frame. Scalability structure ignored.";
} else {
current_ss_idx_ = Add<kMaxGofSaved>(current_ss_idx_, 1);
scalability_structures_[current_ss_idx_] = codec_header.gof;
@@ -453,7 +458,7 @@
if (frame->frame_type() == kVideoFrameKey) {
// When using GOF all keyframes must include the scalability structure.
if (!codec_header.ss_data_available)
- LOG(LS_WARNING) << "Received keyframe without scalability structure";
+ RTC_LOG(LS_WARNING) << "Received keyframe without scalability structure";
frame->num_references = 0;
GofInfo info = gof_info_.find(codec_header.tl0_pic_idx)->second;
diff --git a/modules/video_coding/session_info.cc b/modules/video_coding/session_info.cc
index c0a294d..74d7bfa 100644
--- a/modules/video_coding/session_info.cc
+++ b/modules/video_coding/session_info.cc
@@ -437,7 +437,7 @@
}
if (packets_.size() == kMaxPacketsInSession) {
- LOG(LS_ERROR) << "Max number of packets per frame has been reached.";
+ RTC_LOG(LS_ERROR) << "Max number of packets per frame has been reached.";
return -1;
}
@@ -478,8 +478,9 @@
first_packet_seq_num_ = static_cast<int>(packet.seqNum);
} else if (first_packet_seq_num_ != -1 &&
IsNewerSequenceNumber(first_packet_seq_num_, packet.seqNum)) {
- LOG(LS_WARNING) << "Received packet with a sequence number which is out "
- "of frame boundaries";
+ RTC_LOG(LS_WARNING)
+ << "Received packet with a sequence number which is out "
+ "of frame boundaries";
return -3;
} else if (frame_type_ == kEmptyFrame && packet.frameType != kEmptyFrame) {
// Update the frame type with the type of the first media packet.
@@ -492,8 +493,9 @@
last_packet_seq_num_ = static_cast<int>(packet.seqNum);
} else if (last_packet_seq_num_ != -1 &&
IsNewerSequenceNumber(packet.seqNum, last_packet_seq_num_)) {
- LOG(LS_WARNING) << "Received packet with a sequence number which is out "
- "of frame boundaries";
+ RTC_LOG(LS_WARNING)
+ << "Received packet with a sequence number which is out "
+ "of frame boundaries";
return -3;
}
}
diff --git a/modules/video_coding/utility/ivf_file_writer.cc b/modules/video_coding/utility/ivf_file_writer.cc
index 8e40635..4b2cf3d 100644
--- a/modules/video_coding/utility/ivf_file_writer.cc
+++ b/modules/video_coding/utility/ivf_file_writer.cc
@@ -50,7 +50,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
? 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 @@
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;
}
diff --git a/modules/video_coding/utility/quality_scaler.cc b/modules/video_coding/utility/quality_scaler.cc
index aed2b0c..447506e 100644
--- a/modules/video_coding/utility/quality_scaler.cc
+++ b/modules/video_coding/utility/quality_scaler.cc
@@ -73,13 +73,13 @@
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 @@
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 @@
// 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;
diff --git a/modules/video_coding/utility/vp8_header_parser.cc b/modules/video_coding/utility/vp8_header_parser.cc
index a8bfc55..d1cfb08 100644
--- a/modules/video_coding/utility/vp8_header_parser.cc
+++ b/modules/video_coding/utility/vp8_header_parser.cc
@@ -162,7 +162,7 @@
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 @@
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 @@
// 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;
diff --git a/modules/video_coding/utility/vp9_uncompressed_header_parser.cc b/modules/video_coding/utility/vp9_uncompressed_header_parser.cc
index c35c0af..808fdd3 100644
--- a/modules/video_coding/utility/vp9_uncompressed_header_parser.cc
+++ b/modules/video_coding/utility/vp9_uncompressed_header_parser.cc
@@ -35,7 +35,7 @@
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 @@
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 @@
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 @@
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 @@
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;
}
diff --git a/modules/video_coding/video_codec_initializer.cc b/modules/video_coding/video_codec_initializer.cc
index 51131ed..3e1b0e1 100644
--- a/modules/video_coding/video_codec_initializer.cc
+++ b/modules/video_coding/video_codec_initializer.cc
@@ -131,7 +131,8 @@
streams.back().temporal_layer_thresholds_bps.size() + 1);
if (nack_enabled && !TemporalLayersConfigured(streams)) {
- LOG(LS_INFO) << "No temporal layers and nack enabled -> resilience off";
+ RTC_LOG(LS_INFO)
+ << "No temporal layers and nack enabled -> resilience off";
video_codec.VP8()->resilience = kResilienceOff;
}
break;
@@ -151,8 +152,8 @@
if (nack_enabled && !TemporalLayersConfigured(streams) &&
video_codec.VP9()->numberOfSpatialLayers == 1) {
- LOG(LS_INFO) << "No temporal or spatial layers and nack enabled -> "
- << "resilience off";
+ RTC_LOG(LS_INFO) << "No temporal or spatial layers and nack enabled -> "
+ << "resilience off";
video_codec.VP9()->resilienceOn = false;
}
break;
diff --git a/modules/video_coding/video_receiver.cc b/modules/video_coding/video_receiver.cc
index 532bb59..112edda 100644
--- a/modules/video_coding/video_receiver.cc
+++ b/modules/video_coding/video_receiver.cc
@@ -264,9 +264,9 @@
clock_->TimeInMilliseconds());
if (first_frame_received_()) {
- LOG(LS_INFO) << "Received first "
- << (frame->Complete() ? "complete" : "incomplete")
- << " decodable video frame";
+ RTC_LOG(LS_INFO) << "Received first "
+ << (frame->Complete() ? "complete" : "incomplete")
+ << " decodable video frame";
}
const int32_t ret = Decode(*frame);
diff --git a/modules/video_coding/video_sender.cc b/modules/video_coding/video_sender.cc
index fbf6ff8..4d211655 100644
--- a/modules/video_coding/video_sender.cc
+++ b/modules/video_coding/video_sender.cc
@@ -69,8 +69,8 @@
current_codec_ = *sendCodec;
if (!ret) {
- LOG(LS_ERROR) << "Failed to initialize set encoder with payload name '"
- << sendCodec->plName << "'.";
+ RTC_LOG(LS_ERROR) << "Failed to initialize set encoder with payload name '"
+ << sendCodec->plName << "'.";
return VCM_CODEC_ERROR;
}
@@ -110,10 +110,10 @@
encoder_has_internal_source_ = _encoder->InternalSource();
}
- LOG(LS_VERBOSE) << " max bitrate " << sendCodec->maxBitrate
- << " start bitrate " << sendCodec->startBitrate
- << " max frame rate " << sendCodec->maxFramerate
- << " max payload size " << maxPayloadSize;
+ RTC_LOG(LS_VERBOSE) << " max bitrate " << sendCodec->maxBitrate
+ << " start bitrate " << sendCodec->startBitrate
+ << " max frame rate " << sendCodec->maxFramerate
+ << " max payload size " << maxPayloadSize;
_mediaOpt.SetEncodingData(sendCodec->maxBitrate * 1000,
sendCodec->startBitrate * 1000,
sendCodec->maxFramerate);
@@ -296,12 +296,12 @@
return VCM_UNINITIALIZED;
SetEncoderParameters(encoder_params, encoder_has_internal_source);
if (_mediaOpt.DropFrame()) {
- LOG(LS_VERBOSE) << "Drop Frame "
- << "target bitrate "
- << encoder_params.target_bitrate.get_sum_bps()
- << " loss rate " << encoder_params.loss_rate << " rtt "
- << encoder_params.rtt << " input frame rate "
- << encoder_params.input_frame_rate;
+ RTC_LOG(LS_VERBOSE) << "Drop Frame "
+ << "target bitrate "
+ << encoder_params.target_bitrate.get_sum_bps()
+ << " loss rate " << encoder_params.loss_rate << " rtt "
+ << encoder_params.rtt << " input frame rate "
+ << encoder_params.input_frame_rate;
post_encode_callback_->OnDroppedFrame(
EncodedImageCallback::DropReason::kDroppedByMediaOptimizations);
return VCM_OK;
@@ -310,7 +310,8 @@
// processing so frame size always matches.
if (!_codecDataBase.MatchesCurrentResolution(videoFrame.width(),
videoFrame.height())) {
- LOG(LS_ERROR) << "Incoming frame doesn't match set resolution. Dropping.";
+ RTC_LOG(LS_ERROR)
+ << "Incoming frame doesn't match set resolution. Dropping.";
return VCM_PARAMETER_ERROR;
}
VideoFrame converted_frame = videoFrame;
@@ -327,7 +328,7 @@
converted_frame.video_frame_buffer()->ToI420());
if (!converted_buffer) {
- LOG(LS_ERROR) << "Frame conversion failed, dropping frame.";
+ RTC_LOG(LS_ERROR) << "Frame conversion failed, dropping frame.";
return VCM_PARAMETER_ERROR;
}
converted_frame = VideoFrame(converted_buffer,
@@ -338,7 +339,7 @@
int32_t ret =
_encoder->Encode(converted_frame, codecSpecificInfo, next_frame_types);
if (ret < 0) {
- LOG(LS_ERROR) << "Failed to encode frame. Error code: " << ret;
+ RTC_LOG(LS_ERROR) << "Failed to encode frame. Error code: " << ret;
return ret;
}