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/api/rtcerror.h b/api/rtcerror.h
index b412b29..962f46d 100644
--- a/api/rtcerror.h
+++ b/api/rtcerror.h
@@ -151,8 +151,8 @@
#define LOG_AND_RETURN_ERROR_EX(type, message, severity) \
{ \
RTC_DCHECK(type != RTCErrorType::NONE); \
- LOG(severity) << message << " (" << type << ")"; \
- return webrtc::RTCError(type, message); \
+ RTC_LOG(severity) << message << " (" << type << ")"; \
+ return webrtc::RTCError(type, message); \
}
#define LOG_AND_RETURN_ERROR(type, message) \
@@ -176,7 +176,7 @@
// std::unique_ptr<Foo> foo = result.ConsumeValue();
// foo->DoSomethingCool();
// } else {
-// LOG(LS_ERROR) << result.error();
+// RTC_LOG(LS_ERROR) << result.error();
// }
//
// Example factory implementation returning RTCErrorOr<std::unique_ptr<T>>:
diff --git a/audio/audio_receive_stream.cc b/audio/audio_receive_stream.cc
index 730248e..b1e3f98 100644
--- a/audio/audio_receive_stream.cc
+++ b/audio/audio_receive_stream.cc
@@ -69,7 +69,7 @@
const rtc::scoped_refptr<webrtc::AudioState>& audio_state,
webrtc::RtcEventLog* event_log)
: config_(config), audio_state_(audio_state) {
- LOG(LS_INFO) << "AudioReceiveStream: " << config_.ToString();
+ RTC_LOG(LS_INFO) << "AudioReceiveStream: " << config_.ToString();
RTC_DCHECK_NE(config_.voe_channel_id, -1);
RTC_DCHECK(audio_state_.get());
RTC_DCHECK(packet_router);
@@ -117,7 +117,7 @@
AudioReceiveStream::~AudioReceiveStream() {
RTC_DCHECK_RUN_ON(&worker_thread_checker_);
- LOG(LS_INFO) << "~AudioReceiveStream: " << config_.ToString();
+ RTC_LOG(LS_INFO) << "~AudioReceiveStream: " << config_.ToString();
if (playing_) {
Stop();
}
@@ -135,12 +135,13 @@
int error = SetVoiceEnginePlayout(true);
if (error != 0) {
- LOG(LS_ERROR) << "AudioReceiveStream::Start failed with error: " << error;
+ RTC_LOG(LS_ERROR) << "AudioReceiveStream::Start failed with error: "
+ << error;
return;
}
if (!audio_state()->mixer()->AddSource(this)) {
- LOG(LS_ERROR) << "Failed to add source to mixer.";
+ RTC_LOG(LS_ERROR) << "Failed to add source to mixer.";
SetVoiceEnginePlayout(false);
return;
}
diff --git a/audio/audio_send_stream.cc b/audio/audio_send_stream.cc
index 7895af3..d0ec6dc 100644
--- a/audio/audio_send_stream.cc
+++ b/audio/audio_send_stream.cc
@@ -95,7 +95,7 @@
kRecoverablePacketLossRateMinNumAckedPairs),
rtp_rtcp_module_(nullptr),
suspended_rtp_state_(suspended_rtp_state) {
- LOG(LS_INFO) << "AudioSendStream: " << config.ToString();
+ RTC_LOG(LS_INFO) << "AudioSendStream: " << config.ToString();
RTC_DCHECK_NE(config.voe_channel_id, -1);
RTC_DCHECK(audio_state_.get());
RTC_DCHECK(transport);
@@ -119,7 +119,7 @@
AudioSendStream::~AudioSendStream() {
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
- LOG(LS_INFO) << "~AudioSendStream: " << config_.ToString();
+ RTC_LOG(LS_INFO) << "~AudioSendStream: " << config_.ToString();
transport_->send_side_cc()->DeRegisterPacketFeedbackObserver(this);
channel_proxy_->RegisterTransport(nullptr);
channel_proxy_->ResetSenderCongestionControlObjects();
@@ -141,7 +141,7 @@
webrtc::internal::AudioSendStream* stream,
const webrtc::AudioSendStream::Config& new_config,
bool first_time) {
- LOG(LS_INFO) << "AudioSendStream::Configuring: " << new_config.ToString();
+ RTC_LOG(LS_INFO) << "AudioSendStream::Configuring: " << new_config.ToString();
const auto& channel_proxy = stream->channel_proxy_;
const auto& old_config = stream->config_;
@@ -226,7 +226,7 @@
}
if (!ReconfigureSendCodec(stream, new_config)) {
- LOG(LS_ERROR) << "Failed to set up send codec state.";
+ RTC_LOG(LS_ERROR) << "Failed to set up send codec state.";
}
ReconfigureBitrateObserver(stream, new_config);
@@ -244,7 +244,7 @@
ScopedVoEInterface<VoEBase> base(voice_engine());
int error = base->StartSend(config_.voe_channel_id);
if (error != 0) {
- LOG(LS_ERROR) << "AudioSendStream::Start failed with error: " << error;
+ RTC_LOG(LS_ERROR) << "AudioSendStream::Start failed with error: " << error;
}
}
@@ -255,7 +255,7 @@
ScopedVoEInterface<VoEBase> base(voice_engine());
int error = base->StopSend(config_.voe_channel_id);
if (error != 0) {
- LOG(LS_ERROR) << "AudioSendStream::Stop failed with error: " << error;
+ RTC_LOG(LS_ERROR) << "AudioSendStream::Stop failed with error: " << error;
}
}
@@ -447,7 +447,7 @@
spec.format);
if (!encoder) {
- LOG(LS_ERROR) << "Unable to create encoder for " << spec.format;
+ RTC_LOG(LS_ERROR) << "Unable to create encoder for " << spec.format;
return false;
}
// If a bitrate has been specified for the codec, use it over the
@@ -460,8 +460,8 @@
if (new_config.audio_network_adaptor_config) {
if (encoder->EnableAudioNetworkAdaptor(
*new_config.audio_network_adaptor_config, stream->event_log_)) {
- LOG(LS_INFO) << "Audio network adaptor enabled on SSRC "
- << new_config.rtp.ssrc;
+ RTC_LOG(LS_INFO) << "Audio network adaptor enabled on SSRC "
+ << new_config.rtp.ssrc;
} else {
RTC_NOTREACHED();
}
@@ -541,8 +541,8 @@
CallEncoder(stream->channel_proxy_, [&](AudioEncoder* encoder) {
if (encoder->EnableAudioNetworkAdaptor(
*new_config.audio_network_adaptor_config, stream->event_log_)) {
- LOG(LS_INFO) << "Audio network adaptor enabled on SSRC "
- << new_config.rtp.ssrc;
+ RTC_LOG(LS_INFO) << "Audio network adaptor enabled on SSRC "
+ << new_config.rtp.ssrc;
} else {
RTC_NOTREACHED();
}
@@ -551,8 +551,8 @@
CallEncoder(stream->channel_proxy_, [&](AudioEncoder* encoder) {
encoder->DisableAudioNetworkAdaptor();
});
- LOG(LS_INFO) << "Audio network adaptor disabled on SSRC "
- << new_config.rtp.ssrc;
+ RTC_LOG(LS_INFO) << "Audio network adaptor disabled on SSRC "
+ << new_config.rtp.ssrc;
}
}
@@ -651,8 +651,8 @@
if (rtp_rtcp_module_->RegisterSendPayload(codec) != 0) {
rtp_rtcp_module_->DeRegisterSendPayload(codec.pltype);
if (rtp_rtcp_module_->RegisterSendPayload(codec) != 0) {
- LOG(LS_ERROR) << "RegisterCngPayloadType() failed to register CN to "
- "RTP/RTCP module";
+ RTC_LOG(LS_ERROR) << "RegisterCngPayloadType() failed to register CN to "
+ "RTP/RTCP module";
}
}
}
diff --git a/audio/audio_send_stream_tests.cc b/audio/audio_send_stream_tests.cc
index 4283b73..3f96c33 100644
--- a/audio/audio_send_stream_tests.cc
+++ b/audio/audio_send_stream_tests.cc
@@ -120,8 +120,8 @@
// Wait for at least one packet with a non-zero level.
observation_complete_.Set();
} else {
- LOG(LS_WARNING) << "Got a packet with zero audioLevel - waiting"
- " for another packet...";
+ RTC_LOG(LS_WARNING) << "Got a packet with zero audioLevel - waiting"
+ " for another packet...";
}
return SEND_PACKET;
diff --git a/audio/audio_state.cc b/audio/audio_state.cc
index 9b5f74f..14a86e5 100644
--- a/audio/audio_state.cc
+++ b/audio/audio_state.cc
@@ -63,7 +63,7 @@
}
void AudioState::SetPlayout(bool enabled) {
- LOG(INFO) << "SetPlayout(" << enabled << ")";
+ RTC_LOG(INFO) << "SetPlayout(" << enabled << ")";
RTC_DCHECK(thread_checker_.CalledOnValidThread());
const bool currently_enabled = (null_audio_poller_ == nullptr);
if (enabled == currently_enabled) {
@@ -85,7 +85,7 @@
}
void AudioState::SetRecording(bool enabled) {
- LOG(INFO) << "SetRecording(" << enabled << ")";
+ RTC_LOG(INFO) << "SetRecording(" << enabled << ")";
RTC_DCHECK(thread_checker_.CalledOnValidThread());
// TODO(henrika): keep track of state as in SetPlayout().
VoEBase* const voe = VoEBase::GetInterface(voice_engine());
diff --git a/call/bitrate_allocator.cc b/call/bitrate_allocator.cc
index e186380..2692c00 100644
--- a/call/bitrate_allocator.cc
+++ b/call/bitrate_allocator.cc
@@ -82,7 +82,7 @@
// Periodically log the incoming BWE.
int64_t now = clock_->TimeInMilliseconds();
if (now > last_bwe_log_time_ + kBweLogIntervalMs) {
- LOG(LS_INFO) << "Current BWE " << target_bitrate_bps;
+ RTC_LOG(LS_INFO) << "Current BWE " << target_bitrate_bps;
last_bwe_log_time_ = now;
}
@@ -101,17 +101,18 @@
// and protection used before this observer was muted.
uint32_t predicted_protection_bps =
(1.0 - config.media_ratio) * config.min_bitrate_bps;
- LOG(LS_INFO) << "Pausing observer " << config.observer
- << " with configured min bitrate " << config.min_bitrate_bps
- << " and current estimate of " << target_bitrate_bps
- << " and protection bitrate " << predicted_protection_bps;
+ RTC_LOG(LS_INFO) << "Pausing observer " << config.observer
+ << " with configured min bitrate "
+ << config.min_bitrate_bps << " and current estimate of "
+ << target_bitrate_bps << " and protection bitrate "
+ << predicted_protection_bps;
} else if (allocated_bitrate > 0 && config.allocated_bitrate_bps == 0) {
if (target_bitrate_bps > 0)
++num_pause_events_;
- LOG(LS_INFO) << "Resuming observer " << config.observer
- << ", configured min bitrate " << config.min_bitrate_bps
- << ", current allocation " << allocated_bitrate
- << " and protection bitrate " << protection_bitrate;
+ RTC_LOG(LS_INFO) << "Resuming observer " << config.observer
+ << ", configured min bitrate " << config.min_bitrate_bps
+ << ", current allocation " << allocated_bitrate
+ << " and protection bitrate " << protection_bitrate;
}
// Only update the media ratio if the observer got an allocation.
@@ -191,10 +192,10 @@
total_requested_min_bitrate_ = total_requested_min_bitrate;
total_requested_padding_bitrate_ = total_requested_padding_bitrate;
- LOG(LS_INFO) << "UpdateAllocationLimits : total_requested_min_bitrate: "
- << total_requested_min_bitrate
- << "bps, total_requested_padding_bitrate: "
- << total_requested_padding_bitrate << "bps";
+ RTC_LOG(LS_INFO) << "UpdateAllocationLimits : total_requested_min_bitrate: "
+ << total_requested_min_bitrate
+ << "bps, total_requested_padding_bitrate: "
+ << total_requested_padding_bitrate << "bps";
limit_observer_->OnAllocationLimitsChanged(total_requested_min_bitrate,
total_requested_padding_bitrate);
}
diff --git a/call/call.cc b/call/call.cc
index 90aaba3..440cd3b 100644
--- a/call/call.cc
+++ b/call/call.cc
@@ -527,16 +527,16 @@
if (send_bitrate_stats.num_samples > kMinRequiredPeriodicSamples) {
RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.EstimatedSendBitrateInKbps",
send_bitrate_stats.average);
- LOG(LS_INFO) << "WebRTC.Call.EstimatedSendBitrateInKbps, "
- << send_bitrate_stats.ToString();
+ RTC_LOG(LS_INFO) << "WebRTC.Call.EstimatedSendBitrateInKbps, "
+ << send_bitrate_stats.ToString();
}
AggregatedStats pacer_bitrate_stats =
pacer_bitrate_kbps_counter_.ProcessAndGetStats();
if (pacer_bitrate_stats.num_samples > kMinRequiredPeriodicSamples) {
RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.PacerBitrateInKbps",
pacer_bitrate_stats.average);
- LOG(LS_INFO) << "WebRTC.Call.PacerBitrateInKbps, "
- << pacer_bitrate_stats.ToString();
+ RTC_LOG(LS_INFO) << "WebRTC.Call.PacerBitrateInKbps, "
+ << pacer_bitrate_stats.ToString();
}
}
@@ -557,32 +557,32 @@
if (video_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) {
RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.VideoBitrateReceivedInKbps",
video_bytes_per_sec.average * 8 / 1000);
- LOG(LS_INFO) << "WebRTC.Call.VideoBitrateReceivedInBps, "
- << video_bytes_per_sec.ToStringWithMultiplier(8);
+ RTC_LOG(LS_INFO) << "WebRTC.Call.VideoBitrateReceivedInBps, "
+ << video_bytes_per_sec.ToStringWithMultiplier(8);
}
AggregatedStats audio_bytes_per_sec =
received_audio_bytes_per_second_counter_.GetStats();
if (audio_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) {
RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.AudioBitrateReceivedInKbps",
audio_bytes_per_sec.average * 8 / 1000);
- LOG(LS_INFO) << "WebRTC.Call.AudioBitrateReceivedInBps, "
- << audio_bytes_per_sec.ToStringWithMultiplier(8);
+ RTC_LOG(LS_INFO) << "WebRTC.Call.AudioBitrateReceivedInBps, "
+ << audio_bytes_per_sec.ToStringWithMultiplier(8);
}
AggregatedStats rtcp_bytes_per_sec =
received_rtcp_bytes_per_second_counter_.GetStats();
if (rtcp_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) {
RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.RtcpBitrateReceivedInBps",
rtcp_bytes_per_sec.average * 8);
- LOG(LS_INFO) << "WebRTC.Call.RtcpBitrateReceivedInBps, "
- << rtcp_bytes_per_sec.ToStringWithMultiplier(8);
+ RTC_LOG(LS_INFO) << "WebRTC.Call.RtcpBitrateReceivedInBps, "
+ << rtcp_bytes_per_sec.ToStringWithMultiplier(8);
}
AggregatedStats recv_bytes_per_sec =
received_bytes_per_second_counter_.GetStats();
if (recv_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) {
RTC_HISTOGRAM_COUNTS_100000("WebRTC.Call.BitrateReceivedInKbps",
recv_bytes_per_sec.average * 8 / 1000);
- LOG(LS_INFO) << "WebRTC.Call.BitrateReceivedInBps, "
- << recv_bytes_per_sec.ToStringWithMultiplier(8);
+ RTC_LOG(LS_INFO) << "WebRTC.Call.BitrateReceivedInBps, "
+ << recv_bytes_per_sec.ToStringWithMultiplier(8);
}
}
@@ -985,8 +985,8 @@
if (updated.min_bitrate_bps == config_.bitrate_config.min_bitrate_bps &&
updated.max_bitrate_bps == config_.bitrate_config.max_bitrate_bps &&
!new_start) {
- LOG(LS_VERBOSE) << "WebRTC.Call.UpdateCurrentBitrateConfig: "
- << "nothing to update";
+ RTC_LOG(LS_VERBOSE) << "WebRTC.Call.UpdateCurrentBitrateConfig: "
+ << "nothing to update";
return;
}
@@ -998,10 +998,10 @@
updated.start_bitrate_bps = -1;
}
- LOG(INFO) << "WebRTC.Call.UpdateCurrentBitrateConfig: "
- << "calling SetBweBitrates with args (" << updated.min_bitrate_bps
- << ", " << updated.start_bitrate_bps << ", "
- << updated.max_bitrate_bps << ")";
+ RTC_LOG(INFO) << "WebRTC.Call.UpdateCurrentBitrateConfig: "
+ << "calling SetBweBitrates with args ("
+ << updated.min_bitrate_bps << ", " << updated.start_bitrate_bps
+ << ", " << updated.max_bitrate_bps << ")";
transport_send_->send_side_cc()->SetBweBitrates(updated.min_bitrate_bps,
updated.start_bitrate_bps,
updated.max_bitrate_bps);
@@ -1095,7 +1095,7 @@
RTC_DCHECK_CALLED_SEQUENTIALLY(&configuration_sequence_checker_);
// Check if the network route is connected.
if (!network_route.connected) {
- LOG(LS_INFO) << "Transport " << transport_name << " is disconnected";
+ RTC_LOG(LS_INFO) << "Transport " << transport_name << " is disconnected";
// TODO(honghaiz): Perhaps handle this in SignalChannelNetworkState and
// consider merging these two methods.
return;
@@ -1112,14 +1112,14 @@
}
if (kv->second != network_route) {
kv->second = network_route;
- LOG(LS_INFO) << "Network route changed on transport " << transport_name
- << ": new local network id " << network_route.local_network_id
- << " new remote network id " << network_route.remote_network_id
- << " Reset bitrates to min: "
- << config_.bitrate_config.min_bitrate_bps
- << " bps, start: " << config_.bitrate_config.start_bitrate_bps
- << " bps, max: " << config_.bitrate_config.start_bitrate_bps
- << " bps.";
+ RTC_LOG(LS_INFO)
+ << "Network route changed on transport " << transport_name
+ << ": new local network id " << network_route.local_network_id
+ << " new remote network id " << network_route.remote_network_id
+ << " Reset bitrates to min: " << config_.bitrate_config.min_bitrate_bps
+ << " bps, start: " << config_.bitrate_config.start_bitrate_bps
+ << " bps, max: " << config_.bitrate_config.start_bitrate_bps
+ << " bps.";
RTC_DCHECK_GT(config_.bitrate_config.start_bitrate_bps, 0);
transport_send_->send_side_cc()->OnNetworkRouteChanged(
network_route, config_.bitrate_config.start_bitrate_bps,
@@ -1154,8 +1154,8 @@
aggregate_state = kNetworkUp;
}
- LOG(LS_INFO) << "UpdateAggregateNetworkState: aggregate_state="
- << (aggregate_state == kNetworkUp ? "up" : "down");
+ RTC_LOG(LS_INFO) << "UpdateAggregateNetworkState: aggregate_state="
+ << (aggregate_state == kNetworkUp ? "up" : "down");
transport_send_->send_side_cc()->SignalNetworkState(aggregate_state);
}
@@ -1238,9 +1238,10 @@
for (AudioReceiveStream* stream : audio_receive_streams_) {
if (stream->config().sync_group == sync_group) {
if (sync_audio_stream != nullptr) {
- LOG(LS_WARNING) << "Attempting to sync more than one audio stream "
- "within the same sync group. This is not "
- "supported in the current implementation.";
+ RTC_LOG(LS_WARNING)
+ << "Attempting to sync more than one audio stream "
+ "within the same sync group. This is not "
+ "supported in the current implementation.";
break;
}
sync_audio_stream = stream;
@@ -1257,9 +1258,10 @@
if (num_synced_streams > 1) {
// TODO(pbos): Support synchronizing more than one A/V pair.
// https://code.google.com/p/webrtc/issues/detail?id=4762
- LOG(LS_WARNING) << "Attempting to sync more than one audio/video pair "
- "within the same sync group. This is not supported in "
- "the current implementation.";
+ RTC_LOG(LS_WARNING)
+ << "Attempting to sync more than one audio/video pair "
+ "within the same sync group. This is not supported in "
+ "the current implementation.";
}
// Only sync the first A/V pair within this sync group.
if (num_synced_streams == 1) {
@@ -1348,8 +1350,8 @@
ReadLockScoped read_lock(*receive_crit_);
auto it = receive_rtp_config_.find(parsed_packet.Ssrc());
if (it == receive_rtp_config_.end()) {
- LOG(LS_ERROR) << "receive_rtp_config_ lookup failed for ssrc "
- << parsed_packet.Ssrc();
+ RTC_LOG(LS_ERROR) << "receive_rtp_config_ lookup failed for ssrc "
+ << parsed_packet.Ssrc();
// Destruction of the receive stream, including deregistering from the
// RtpDemuxer, is not protected by the |receive_crit_| lock. But
// deregistering in the |receive_rtp_config_| map is protected by that lock.
@@ -1414,8 +1416,8 @@
ReadLockScoped read_lock(*receive_crit_);
auto it = receive_rtp_config_.find(parsed_packet.Ssrc());
if (it == receive_rtp_config_.end()) {
- LOG(LS_ERROR) << "receive_rtp_config_ lookup failed for ssrc "
- << parsed_packet.Ssrc();
+ RTC_LOG(LS_ERROR) << "receive_rtp_config_ lookup failed for ssrc "
+ << parsed_packet.Ssrc();
// Destruction of the receive stream, including deregistering from the
// RtpDemuxer, is not protected by the |receive_crit_| lock. But
// deregistering in the |receive_rtp_config_| map is protected by that lock.
diff --git a/call/flexfec_receive_stream_impl.cc b/call/flexfec_receive_stream_impl.cc
index bb68f6e..038c1f6 100644
--- a/call/flexfec_receive_stream_impl.cc
+++ b/call/flexfec_receive_stream_impl.cc
@@ -74,25 +74,28 @@
const FlexfecReceiveStream::Config& config,
RecoveredPacketReceiver* recovered_packet_receiver) {
if (config.payload_type < 0) {
- LOG(LS_WARNING) << "Invalid FlexFEC payload type given. "
- << "This FlexfecReceiveStream will therefore be useless.";
+ RTC_LOG(LS_WARNING)
+ << "Invalid FlexFEC payload type given. "
+ << "This FlexfecReceiveStream will therefore be useless.";
return nullptr;
}
RTC_DCHECK_GE(config.payload_type, 0);
RTC_DCHECK_LE(config.payload_type, 127);
if (config.remote_ssrc == 0) {
- LOG(LS_WARNING) << "Invalid FlexFEC SSRC given. "
- << "This FlexfecReceiveStream will therefore be useless.";
+ RTC_LOG(LS_WARNING)
+ << "Invalid FlexFEC SSRC given. "
+ << "This FlexfecReceiveStream will therefore be useless.";
return nullptr;
}
if (config.protected_media_ssrcs.empty()) {
- LOG(LS_WARNING) << "No protected media SSRC supplied. "
- << "This FlexfecReceiveStream will therefore be useless.";
+ RTC_LOG(LS_WARNING)
+ << "No protected media SSRC supplied. "
+ << "This FlexfecReceiveStream will therefore be useless.";
return nullptr;
}
if (config.protected_media_ssrcs.size() > 1) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "The supplied FlexfecConfig contained multiple protected "
"media streams, but our implementation currently only "
"supports protecting a single media stream. "
@@ -136,7 +139,7 @@
config_.rtcp_send_transport,
rtt_stats)),
process_thread_(process_thread) {
- LOG(LS_INFO) << "FlexfecReceiveStreamImpl: " << config_.ToString();
+ RTC_LOG(LS_INFO) << "FlexfecReceiveStreamImpl: " << config_.ToString();
// RTCP reporting.
rtp_rtcp_->SetRTCPStatus(config_.rtcp_mode);
@@ -159,7 +162,7 @@
}
FlexfecReceiveStreamImpl::~FlexfecReceiveStreamImpl() {
- LOG(LS_INFO) << "~FlexfecReceiveStreamImpl: " << config_.ToString();
+ RTC_LOG(LS_INFO) << "~FlexfecReceiveStreamImpl: " << config_.ToString();
process_thread_->DeRegisterModule(rtp_rtcp_.get());
}
diff --git a/call/rtp_demuxer.cc b/call/rtp_demuxer.cc
index 0f9173e..6a9cae8 100644
--- a/call/rtp_demuxer.cc
+++ b/call/rtp_demuxer.cc
@@ -340,8 +340,9 @@
bool RtpDemuxer::AddSsrcSinkBinding(uint32_t ssrc,
RtpPacketSinkInterface* sink) {
if (sink_by_ssrc_.size() >= kMaxSsrcBindings) {
- LOG(LS_WARNING) << "New SSRC=" << ssrc << " sink binding ignored; limit of"
- << kMaxSsrcBindings << " bindings has been reached.";
+ RTC_LOG(LS_WARNING) << "New SSRC=" << ssrc
+ << " sink binding ignored; limit of" << kMaxSsrcBindings
+ << " bindings has been reached.";
return false;
}
diff --git a/call/rtp_stream_receiver_controller.cc b/call/rtp_stream_receiver_controller.cc
index 44a1622..a5d73f5 100644
--- a/call/rtp_stream_receiver_controller.cc
+++ b/call/rtp_stream_receiver_controller.cc
@@ -22,8 +22,9 @@
: controller_(controller), sink_(sink) {
const bool sink_added = controller_->AddSink(ssrc, sink_);
if (!sink_added) {
- LOG(LS_ERROR) << "RtpStreamReceiverController::Receiver::Receiver: Sink "
- << "could not be added for SSRC=" << ssrc << ".";
+ RTC_LOG(LS_ERROR)
+ << "RtpStreamReceiverController::Receiver::Receiver: Sink "
+ << "could not be added for SSRC=" << ssrc << ".";
}
}
diff --git a/call/rtx_receive_stream.cc b/call/rtx_receive_stream.cc
index 3013b62..0920079 100644
--- a/call/rtx_receive_stream.cc
+++ b/call/rtx_receive_stream.cc
@@ -27,7 +27,7 @@
media_ssrc_(media_ssrc),
rtp_receive_statistics_(rtp_receive_statistics) {
if (associated_payload_types_.empty()) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "RtxReceiveStream created with empty payload type mapping.";
}
}
@@ -49,9 +49,9 @@
auto it = associated_payload_types_.find(rtx_packet.PayloadType());
if (it == associated_payload_types_.end()) {
- LOG(LS_VERBOSE) << "Unknown payload type "
- << static_cast<int>(rtx_packet.PayloadType())
- << " on rtx ssrc " << rtx_packet.Ssrc();
+ RTC_LOG(LS_VERBOSE) << "Unknown payload type "
+ << static_cast<int>(rtx_packet.PayloadType())
+ << " on rtx ssrc " << rtx_packet.Ssrc();
return;
}
RtpPacketReceived media_packet;
diff --git a/common_audio/resampler/resampler.cc b/common_audio/resampler/resampler.cc
index 1c210df..ea85d82 100644
--- a/common_audio/resampler/resampler.cc
+++ b/common_audio/resampler/resampler.cc
@@ -84,15 +84,16 @@
int Resampler::Reset(int inFreq, int outFreq, size_t num_channels) {
if (num_channels != 1 && num_channels != 2) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "Reset() called with unsupported channel count, num_channels = "
<< num_channels;
return -1;
}
ResamplerMode mode;
if (ComputeResamplerMode(inFreq, outFreq, &mode) != 0) {
- LOG(LS_WARNING) << "Reset() called with unsupported sample rates, inFreq = "
- << inFreq << ", outFreq = " << outFreq;
+ RTC_LOG(LS_WARNING)
+ << "Reset() called with unsupported sample rates, inFreq = " << inFreq
+ << ", outFreq = " << outFreq;
return -1;
}
// Reinitialize internal state for the frequencies and sample rates.
diff --git a/common_video/bitrate_adjuster.cc b/common_video/bitrate_adjuster.cc
index 56f0a3c..0d3458c 100644
--- a/common_video/bitrate_adjuster.cc
+++ b/common_video/bitrate_adjuster.cc
@@ -142,15 +142,15 @@
// Set the adjustment if it's not already set.
float last_adjusted_bitrate_bps = adjusted_bitrate_bps_;
if (adjusted_bitrate_bps != last_adjusted_bitrate_bps) {
- LOG(LS_VERBOSE) << "Adjusting encoder bitrate:"
- << "\n target_bitrate:"
- << static_cast<uint32_t>(target_bitrate_bps)
- << "\n estimated_bitrate:"
- << static_cast<uint32_t>(estimated_bitrate_bps)
- << "\n last_adjusted_bitrate:"
- << static_cast<uint32_t>(last_adjusted_bitrate_bps)
- << "\n adjusted_bitrate:"
- << static_cast<uint32_t>(adjusted_bitrate_bps);
+ RTC_LOG(LS_VERBOSE) << "Adjusting encoder bitrate:"
+ << "\n target_bitrate:"
+ << static_cast<uint32_t>(target_bitrate_bps)
+ << "\n estimated_bitrate:"
+ << static_cast<uint32_t>(estimated_bitrate_bps)
+ << "\n last_adjusted_bitrate:"
+ << static_cast<uint32_t>(last_adjusted_bitrate_bps)
+ << "\n adjusted_bitrate:"
+ << static_cast<uint32_t>(adjusted_bitrate_bps);
adjusted_bitrate_bps_ = adjusted_bitrate_bps;
}
}
diff --git a/common_video/h264/h264_bitstream_parser.cc b/common_video/h264/h264_bitstream_parser.cc
index 3bf81a0..1f9032c 100644
--- a/common_video/h264/h264_bitstream_parser.cc
+++ b/common_video/h264/h264_bitstream_parser.cc
@@ -26,10 +26,10 @@
namespace webrtc {
-#define RETURN_ON_FAIL(x, res) \
- if (!(x)) { \
- LOG_F(LS_ERROR) << "FAILED: " #x; \
- return res; \
+#define RETURN_ON_FAIL(x, res) \
+ if (!(x)) { \
+ RTC_LOG_F(LS_ERROR) << "FAILED: " #x; \
+ return res; \
}
#define RETURN_INV_ON_FAIL(x) RETURN_ON_FAIL(x, kInvalidStream)
@@ -141,7 +141,7 @@
}
// assume nal_unit_type != 20 && nal_unit_type != 21:
if (nalu_type == 20 || nalu_type == 21) {
- LOG(LS_ERROR) << "Unsupported nal unit type.";
+ RTC_LOG(LS_ERROR) << "Unsupported nal unit type.";
return kUnsupportedStream;
}
// if (nal_unit_type == 20 || nal_unit_type == 21)
@@ -201,7 +201,7 @@
if ((pps_->weighted_pred_flag && (slice_type == H264::SliceType::kP ||
slice_type == H264::SliceType::kSp)) ||
(pps_->weighted_bipred_idc == 1 && slice_type == H264::SliceType::kB)) {
- LOG(LS_ERROR) << "Streams with pred_weight_table unsupported.";
+ RTC_LOG(LS_ERROR) << "Streams with pred_weight_table unsupported.";
return kUnsupportedStream;
}
// if ((weighted_pred_flag && (slice_type == P || slice_type == SP)) ||
@@ -258,7 +258,7 @@
slice_reader.ReadSignedExponentialGolomb(&last_slice_qp_delta));
if (abs(last_slice_qp_delta) > kMaxAbsQpDeltaValue) {
// Something has gone wrong, and the parsed value is invalid.
- LOG(LS_WARNING) << "Parsed QP value out of range.";
+ RTC_LOG(LS_WARNING) << "Parsed QP value out of range.";
return kInvalidStream;
}
@@ -273,14 +273,14 @@
sps_ = SpsParser::ParseSps(slice + H264::kNaluTypeSize,
length - H264::kNaluTypeSize);
if (!sps_)
- LOG(LS_WARNING) << "Unable to parse SPS from H264 bitstream.";
+ RTC_LOG(LS_WARNING) << "Unable to parse SPS from H264 bitstream.";
break;
}
case H264::NaluType::kPps: {
pps_ = PpsParser::ParsePps(slice + H264::kNaluTypeSize,
length - H264::kNaluTypeSize);
if (!pps_)
- LOG(LS_WARNING) << "Unable to parse PPS from H264 bitstream.";
+ RTC_LOG(LS_WARNING) << "Unable to parse PPS from H264 bitstream.";
break;
}
case H264::NaluType::kAud:
@@ -289,7 +289,7 @@
default:
Result res = ParseNonParameterSetNalu(slice, length, nalu_type);
if (res != kOk)
- LOG(LS_INFO) << "Failed to parse bitstream. Error: " << res;
+ RTC_LOG(LS_INFO) << "Failed to parse bitstream. Error: " << res;
break;
}
}
@@ -307,7 +307,7 @@
return false;
const int parsed_qp = 26 + pps_->pic_init_qp_minus26 + *last_slice_qp_delta_;
if (parsed_qp < kMinQpValue || parsed_qp > kMaxQpValue) {
- LOG(LS_ERROR) << "Parsed invalid QP from bitstream.";
+ RTC_LOG(LS_ERROR) << "Parsed invalid QP from bitstream.";
return false;
}
*qp = parsed_qp;
diff --git a/common_video/h264/sps_parser.cc b/common_video/h264/sps_parser.cc
index e2a759c..946c685 100644
--- a/common_video/h264/sps_parser.cc
+++ b/common_video/h264/sps_parser.cc
@@ -108,7 +108,8 @@
// see/use them in practice, so we'll just reject the full sps if we see
// any provided.
if (seq_scaling_list_present_flags > 0) {
- LOG(LS_WARNING) << "SPS contains scaling lists, which are unsupported.";
+ RTC_LOG(LS_WARNING)
+ << "SPS contains scaling lists, which are unsupported.";
return OptionalSps();
}
}
diff --git a/common_video/h264/sps_vui_rewriter.cc b/common_video/h264/sps_vui_rewriter.cc
index 0c31428..9f4fb9e 100644
--- a/common_video/h264/sps_vui_rewriter.cc
+++ b/common_video/h264/sps_vui_rewriter.cc
@@ -29,10 +29,10 @@
// closer to 24 or so, but better safe than sorry.
const size_t kMaxVuiSpsIncrease = 64;
-#define RETURN_FALSE_ON_FAIL(x) \
- if (!(x)) { \
- LOG_F(LS_ERROR) << " (line:" << __LINE__ << ") FAILED: " #x; \
- return false; \
+#define RETURN_FALSE_ON_FAIL(x) \
+ if (!(x)) { \
+ RTC_LOG_F(LS_ERROR) << " (line:" << __LINE__ << ") FAILED: " #x; \
+ return false; \
}
#define COPY_UINT8(src, dest, tmp) \
@@ -115,7 +115,7 @@
ParseResult vui_updated;
if (!CopyAndRewriteVui(*sps_state, &source_buffer, &sps_writer,
&vui_updated)) {
- LOG(LS_ERROR) << "Failed to parse/copy SPS VUI.";
+ RTC_LOG(LS_ERROR) << "Failed to parse/copy SPS VUI.";
return ParseResult::kFailure;
}
@@ -125,7 +125,7 @@
}
if (!CopyRemainingBits(&source_buffer, &sps_writer)) {
- LOG(LS_ERROR) << "Failed to parse/copy SPS VUI.";
+ RTC_LOG(LS_ERROR) << "Failed to parse/copy SPS VUI.";
return ParseResult::kFailure;
}
@@ -271,7 +271,7 @@
source->ReadExponentialGolomb(&max_dec_frame_buffering));
if (max_num_reorder_frames == 0 &&
max_dec_frame_buffering <= sps.max_num_ref_frames) {
- LOG(LS_INFO) << "VUI bitstream already contains an optimal VUI.";
+ RTC_LOG(LS_INFO) << "VUI bitstream already contains an optimal VUI.";
*out_vui_rewritten = SpsVuiRewriter::ParseResult::kVuiOk;
return true;
}
diff --git a/common_video/video_render_frames.cc b/common_video/video_render_frames.cc
index b6af1b3..deaa409 100644
--- a/common_video/video_render_frames.cc
+++ b/common_video/video_render_frames.cc
@@ -45,20 +45,20 @@
// really slow system never renders any frames.
if (!incoming_frames_.empty() &&
new_frame.render_time_ms() + kOldRenderTimestampMS < time_now) {
- LOG(LS_WARNING) << "Too old frame, timestamp=" << new_frame.timestamp();
+ RTC_LOG(LS_WARNING) << "Too old frame, timestamp=" << new_frame.timestamp();
return -1;
}
if (new_frame.render_time_ms() > time_now + kFutureRenderTimestampMS) {
- LOG(LS_WARNING) << "Frame too long into the future, timestamp="
- << new_frame.timestamp();
+ RTC_LOG(LS_WARNING) << "Frame too long into the future, timestamp="
+ << new_frame.timestamp();
return -1;
}
if (new_frame.render_time_ms() < last_render_time_ms_) {
- LOG(LS_WARNING) << "Frame scheduled out of order, render_time="
- << new_frame.render_time_ms()
- << ", latest=" << last_render_time_ms_;
+ RTC_LOG(LS_WARNING) << "Frame scheduled out of order, render_time="
+ << new_frame.render_time_ms()
+ << ", latest=" << last_render_time_ms_;
// For more details, see bug:
// https://bugs.chromium.org/p/webrtc/issues/detail?id=7253
return -1;
@@ -68,7 +68,8 @@
incoming_frames_.emplace_back(std::move(new_frame));
if (incoming_frames_.size() > kMaxIncomingFramesBeforeLogged)
- LOG(LS_WARNING) << "Stored incoming frames: " << incoming_frames_.size();
+ RTC_LOG(LS_WARNING) << "Stored incoming frames: "
+ << incoming_frames_.size();
return static_cast<int32_t>(incoming_frames_.size());
}
diff --git a/examples/peerconnection/client/conductor.cc b/examples/peerconnection/client/conductor.cc
index 3e3bfda..7394137 100644
--- a/examples/peerconnection/client/conductor.cc
+++ b/examples/peerconnection/client/conductor.cc
@@ -43,11 +43,9 @@
return
new rtc::RefCountedObject<DummySetSessionDescriptionObserver>();
}
- virtual void OnSuccess() {
- LOG(INFO) << __FUNCTION__;
- }
+ virtual void OnSuccess() { RTC_LOG(INFO) << __FUNCTION__; }
virtual void OnFailure(const std::string& error) {
- LOG(INFO) << __FUNCTION__ << " " << error;
+ RTC_LOG(INFO) << __FUNCTION__ << " " << error;
}
protected:
@@ -162,22 +160,22 @@
// Called when a remote stream is added
void Conductor::OnAddStream(
rtc::scoped_refptr<webrtc::MediaStreamInterface> stream) {
- LOG(INFO) << __FUNCTION__ << " " << stream->label();
+ RTC_LOG(INFO) << __FUNCTION__ << " " << stream->label();
main_wnd_->QueueUIThreadCallback(NEW_STREAM_ADDED, stream.release());
}
void Conductor::OnRemoveStream(
rtc::scoped_refptr<webrtc::MediaStreamInterface> stream) {
- LOG(INFO) << __FUNCTION__ << " " << stream->label();
+ RTC_LOG(INFO) << __FUNCTION__ << " " << stream->label();
main_wnd_->QueueUIThreadCallback(STREAM_REMOVED, stream.release());
}
void Conductor::OnIceCandidate(const webrtc::IceCandidateInterface* candidate) {
- LOG(INFO) << __FUNCTION__ << " " << candidate->sdp_mline_index();
+ RTC_LOG(INFO) << __FUNCTION__ << " " << candidate->sdp_mline_index();
// For loopback test. To save some connecting delay.
if (loopback_) {
if (!peer_connection_->AddIceCandidate(candidate)) {
- LOG(WARNING) << "Failed to apply the received candidate";
+ RTC_LOG(WARNING) << "Failed to apply the received candidate";
}
return;
}
@@ -189,7 +187,7 @@
jmessage[kCandidateSdpMlineIndexName] = candidate->sdp_mline_index();
std::string sdp;
if (!candidate->ToString(&sdp)) {
- LOG(LS_ERROR) << "Failed to serialize candidate";
+ RTC_LOG(LS_ERROR) << "Failed to serialize candidate";
return;
}
jmessage[kCandidateSdpName] = sdp;
@@ -201,12 +199,12 @@
//
void Conductor::OnSignedIn() {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
main_wnd_->SwitchToPeerList(client_->peers());
}
void Conductor::OnDisconnected() {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
DeletePeerConnection();
@@ -215,16 +213,16 @@
}
void Conductor::OnPeerConnected(int id, const std::string& name) {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
// Refresh the list if we're showing it.
if (main_wnd_->current_ui() == MainWindow::LIST_PEERS)
main_wnd_->SwitchToPeerList(client_->peers());
}
void Conductor::OnPeerDisconnected(int id) {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
if (id == peer_id_) {
- LOG(INFO) << "Our peer disconnected";
+ RTC_LOG(INFO) << "Our peer disconnected";
main_wnd_->QueueUIThreadCallback(PEER_CONNECTION_CLOSED, NULL);
} else {
// Refresh the list if we're showing it.
@@ -242,21 +240,22 @@
peer_id_ = peer_id;
if (!InitializePeerConnection()) {
- LOG(LS_ERROR) << "Failed to initialize our PeerConnection instance";
+ RTC_LOG(LS_ERROR) << "Failed to initialize our PeerConnection instance";
client_->SignOut();
return;
}
} else if (peer_id != peer_id_) {
RTC_DCHECK(peer_id_ != -1);
- LOG(WARNING) << "Received a message from unknown peer while already in a "
- "conversation with a different peer.";
+ RTC_LOG(WARNING)
+ << "Received a message from unknown peer while already in a "
+ "conversation with a different peer.";
return;
}
Json::Reader reader;
Json::Value jmessage;
if (!reader.parse(message, jmessage)) {
- LOG(WARNING) << "Received unknown message. " << message;
+ RTC_LOG(WARNING) << "Received unknown message. " << message;
return;
}
std::string type;
@@ -268,7 +267,7 @@
// This is a loopback call.
// Recreate the peerconnection with DTLS disabled.
if (!ReinitializePeerConnectionForLoopback()) {
- LOG(LS_ERROR) << "Failed to initialize our PeerConnection instance";
+ RTC_LOG(LS_ERROR) << "Failed to initialize our PeerConnection instance";
DeletePeerConnection();
client_->SignOut();
}
@@ -278,18 +277,18 @@
std::string sdp;
if (!rtc::GetStringFromJsonObject(jmessage, kSessionDescriptionSdpName,
&sdp)) {
- LOG(WARNING) << "Can't parse received session description message.";
+ RTC_LOG(WARNING) << "Can't parse received session description message.";
return;
}
webrtc::SdpParseError error;
webrtc::SessionDescriptionInterface* session_description(
webrtc::CreateSessionDescription(type, sdp, &error));
if (!session_description) {
- LOG(WARNING) << "Can't parse received session description message. "
- << "SdpParseError was: " << error.description;
+ RTC_LOG(WARNING) << "Can't parse received session description message. "
+ << "SdpParseError was: " << error.description;
return;
}
- LOG(INFO) << " Received session description :" << message;
+ RTC_LOG(INFO) << " Received session description :" << message;
peer_connection_->SetRemoteDescription(
DummySetSessionDescriptionObserver::Create(), session_description);
if (session_description->type() ==
@@ -306,22 +305,22 @@
!rtc::GetIntFromJsonObject(jmessage, kCandidateSdpMlineIndexName,
&sdp_mlineindex) ||
!rtc::GetStringFromJsonObject(jmessage, kCandidateSdpName, &sdp)) {
- LOG(WARNING) << "Can't parse received message.";
+ RTC_LOG(WARNING) << "Can't parse received message.";
return;
}
webrtc::SdpParseError error;
std::unique_ptr<webrtc::IceCandidateInterface> candidate(
webrtc::CreateIceCandidate(sdp_mid, sdp_mlineindex, sdp, &error));
if (!candidate.get()) {
- LOG(WARNING) << "Can't parse received candidate message. "
- << "SdpParseError was: " << error.description;
+ RTC_LOG(WARNING) << "Can't parse received candidate message. "
+ << "SdpParseError was: " << error.description;
return;
}
if (!peer_connection_->AddIceCandidate(candidate.get())) {
- LOG(WARNING) << "Failed to apply the received candidate";
+ RTC_LOG(WARNING) << "Failed to apply the received candidate";
return;
}
- LOG(INFO) << " Received candidate :" << message;
+ RTC_LOG(INFO) << " Received candidate :" << message;
return;
}
}
@@ -421,7 +420,7 @@
stream->AddTrack(audio_track);
stream->AddTrack(video_track);
if (!peer_connection_->AddStream(stream)) {
- LOG(LS_ERROR) << "Adding stream to PeerConnection failed";
+ RTC_LOG(LS_ERROR) << "Adding stream to PeerConnection failed";
}
typedef std::pair<std::string,
rtc::scoped_refptr<webrtc::MediaStreamInterface> >
@@ -431,7 +430,7 @@
}
void Conductor::DisconnectFromCurrentPeer() {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
if (peer_connection_.get()) {
client_->SendHangUp(peer_id_);
DeletePeerConnection();
@@ -444,7 +443,7 @@
void Conductor::UIThreadCallback(int msg_id, void* data) {
switch (msg_id) {
case PEER_CONNECTION_CLOSED:
- LOG(INFO) << "PEER_CONNECTION_CLOSED";
+ RTC_LOG(INFO) << "PEER_CONNECTION_CLOSED";
DeletePeerConnection();
RTC_DCHECK(active_streams_.empty());
@@ -461,7 +460,7 @@
break;
case SEND_MESSAGE_TO_PEER: {
- LOG(INFO) << "SEND_MESSAGE_TO_PEER";
+ RTC_LOG(INFO) << "SEND_MESSAGE_TO_PEER";
std::string* msg = reinterpret_cast<std::string*>(data);
if (msg) {
// For convenience, we always run the message through the queue.
@@ -475,7 +474,7 @@
pending_messages_.pop_front();
if (!client_->SendToPeer(peer_id_, *msg) && peer_id_ != -1) {
- LOG(LS_ERROR) << "SendToPeer failed";
+ RTC_LOG(LS_ERROR) << "SendToPeer failed";
DisconnectFromServer();
}
delete msg;
@@ -541,7 +540,7 @@
}
void Conductor::OnFailure(const std::string& error) {
- LOG(LERROR) << error;
+ RTC_LOG(LERROR) << error;
}
void Conductor::SendMessage(const std::string& json_object) {
diff --git a/examples/peerconnection/client/linux/main_wnd.cc b/examples/peerconnection/client/linux/main_wnd.cc
index d092ba1..f7863d9 100644
--- a/examples/peerconnection/client/linux/main_wnd.cc
+++ b/examples/peerconnection/client/linux/main_wnd.cc
@@ -227,7 +227,7 @@
}
void GtkMainWnd::SwitchToConnectUI() {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
RTC_DCHECK(IsWindow());
RTC_DCHECK(vbox_ == NULL);
@@ -283,7 +283,7 @@
}
void GtkMainWnd::SwitchToPeerList(const Peers& peers) {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
if (!peer_list_) {
gtk_container_set_border_width(GTK_CONTAINER(window_), 0);
@@ -320,7 +320,7 @@
}
void GtkMainWnd::SwitchToStreamingUI() {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
RTC_DCHECK(draw_area_ == NULL);
diff --git a/examples/peerconnection/client/peer_connection_client.cc b/examples/peerconnection/client/peer_connection_client.cc
index 30e156d..40dfec5 100644
--- a/examples/peerconnection/client/peer_connection_client.cc
+++ b/examples/peerconnection/client/peer_connection_client.cc
@@ -96,7 +96,7 @@
RTC_DCHECK(!client_name.empty());
if (state_ != NOT_CONNECTED) {
- LOG(WARNING)
+ RTC_LOG(WARNING)
<< "The client must not be connected before you can call Connect()";
callback_->OnServerConnectionFailure();
return;
@@ -303,7 +303,7 @@
bool ret = false;
size_t i = data->find("\r\n\r\n");
if (i != std::string::npos) {
- LOG(INFO) << "Headers received";
+ RTC_LOG(INFO) << "Headers received";
if (GetHeaderValue(*data, i, "\r\nContent-Length: ", content_length)) {
size_t total_response_size = (i + 4) + *content_length;
if (data->length() >= total_response_size) {
@@ -321,7 +321,7 @@
// We haven't received everything. Just continue to accept data.
}
} else {
- LOG(LS_ERROR) << "No content length field specified by the server.";
+ RTC_LOG(LS_ERROR) << "No content length field specified by the server.";
}
}
return ret;
@@ -379,7 +379,7 @@
}
void PeerConnectionClient::OnHangingGetRead(rtc::AsyncSocket* socket) {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
size_t content_length = 0;
if (ReadIntoBuffer(socket, ¬ification_data_, &content_length)) {
size_t peer_id = 0, eoh = 0;
@@ -457,7 +457,7 @@
size_t* eoh) {
int status = GetResponseStatus(response.c_str());
if (status != 200) {
- LOG(LS_ERROR) << "Received error from server";
+ RTC_LOG(LS_ERROR) << "Received error from server";
Close();
callback_->OnDisconnected();
return false;
@@ -478,7 +478,7 @@
}
void PeerConnectionClient::OnClose(rtc::AsyncSocket* socket, int err) {
- LOG(INFO) << __FUNCTION__;
+ RTC_LOG(INFO) << __FUNCTION__;
socket->Close();
@@ -497,7 +497,7 @@
}
} else {
if (socket == control_socket_.get()) {
- LOG(WARNING) << "Connection refused; retrying in 2 seconds";
+ RTC_LOG(WARNING) << "Connection refused; retrying in 2 seconds";
rtc::Thread::Current()->PostDelayed(RTC_FROM_HERE, kReconnectDelay, this,
0);
} else {
diff --git a/examples/stunprober/main.cc b/examples/stunprober/main.cc
index 51937d8..e0f9877 100644
--- a/examples/stunprober/main.cc
+++ b/examples/stunprober/main.cc
@@ -66,30 +66,32 @@
void PrintStats(StunProber* prober) {
StunProber::Stats stats;
if (!prober->GetStats(&stats)) {
- LOG(LS_WARNING) << "Results are inconclusive.";
+ RTC_LOG(LS_WARNING) << "Results are inconclusive.";
return;
}
- LOG(LS_INFO) << "Shared Socket Mode: " << stats.shared_socket_mode;
- LOG(LS_INFO) << "Requests sent: " << stats.num_request_sent;
- LOG(LS_INFO) << "Responses received: " << stats.num_response_received;
- LOG(LS_INFO) << "Target interval (ns): " << stats.target_request_interval_ns;
- LOG(LS_INFO) << "Actual interval (ns): " << stats.actual_request_interval_ns;
- LOG(LS_INFO) << "NAT Type: " << PrintNatType(stats.nat_type);
- LOG(LS_INFO) << "Host IP: " << stats.host_ip;
- LOG(LS_INFO) << "Server-reflexive ips: ";
+ RTC_LOG(LS_INFO) << "Shared Socket Mode: " << stats.shared_socket_mode;
+ RTC_LOG(LS_INFO) << "Requests sent: " << stats.num_request_sent;
+ RTC_LOG(LS_INFO) << "Responses received: " << stats.num_response_received;
+ RTC_LOG(LS_INFO) << "Target interval (ns): "
+ << stats.target_request_interval_ns;
+ RTC_LOG(LS_INFO) << "Actual interval (ns): "
+ << stats.actual_request_interval_ns;
+ RTC_LOG(LS_INFO) << "NAT Type: " << PrintNatType(stats.nat_type);
+ RTC_LOG(LS_INFO) << "Host IP: " << stats.host_ip;
+ RTC_LOG(LS_INFO) << "Server-reflexive ips: ";
for (auto& ip : stats.srflx_addrs) {
- LOG(LS_INFO) << "\t" << ip;
+ RTC_LOG(LS_INFO) << "\t" << ip;
}
- LOG(LS_INFO) << "Success Precent: " << stats.success_percent;
- LOG(LS_INFO) << "Response Latency:" << stats.average_rtt_ms;
+ RTC_LOG(LS_INFO) << "Success Precent: " << stats.success_percent;
+ RTC_LOG(LS_INFO) << "Response Latency:" << stats.average_rtt_ms;
}
void StopTrial(rtc::Thread* thread, StunProber* prober, int result) {
thread->Quit();
if (prober) {
- LOG(LS_INFO) << "Result: " << result;
+ RTC_LOG(LS_INFO) << "Result: " << result;
if (result == StunProber::SUCCESS) {
PrintStats(prober);
}
@@ -111,7 +113,7 @@
while (getline(servers, server, ',')) {
rtc::SocketAddress addr;
if (!addr.FromString(server)) {
- LOG(LS_ERROR) << "Parsing " << server << " failed.";
+ RTC_LOG(LS_ERROR) << "Parsing " << server << " failed.";
return -1;
}
server_addresses.push_back(addr);
diff --git a/examples/unityplugin/simple_peer_connection.cc b/examples/unityplugin/simple_peer_connection.cc
index fe59d53..9332a83 100644
--- a/examples/unityplugin/simple_peer_connection.cc
+++ b/examples/unityplugin/simple_peer_connection.cc
@@ -64,9 +64,9 @@
static DummySetSessionDescriptionObserver* Create() {
return new rtc::RefCountedObject<DummySetSessionDescriptionObserver>();
}
- virtual void OnSuccess() { LOG(INFO) << __FUNCTION__; }
+ virtual void OnSuccess() { RTC_LOG(INFO) << __FUNCTION__; }
virtual void OnFailure(const std::string& error) {
- LOG(INFO) << __FUNCTION__ << " " << error;
+ RTC_LOG(INFO) << __FUNCTION__ << " " << error;
}
protected:
@@ -217,7 +217,7 @@
}
void SimplePeerConnection::OnFailure(const std::string& error) {
- LOG(LERROR) << error;
+ RTC_LOG(LERROR) << error;
if (OnFailureMessage)
OnFailureMessage(error.c_str());
@@ -225,11 +225,11 @@
void SimplePeerConnection::OnIceCandidate(
const webrtc::IceCandidateInterface* candidate) {
- LOG(INFO) << __FUNCTION__ << " " << candidate->sdp_mline_index();
+ RTC_LOG(INFO) << __FUNCTION__ << " " << candidate->sdp_mline_index();
std::string sdp;
if (!candidate->ToString(&sdp)) {
- LOG(LS_ERROR) << "Failed to serialize candidate";
+ RTC_LOG(LS_ERROR) << "Failed to serialize candidate";
return;
}
@@ -290,11 +290,11 @@
webrtc::SessionDescriptionInterface* session_description(
webrtc::CreateSessionDescription(sdp_type, remote_desc, &error));
if (!session_description) {
- LOG(WARNING) << "Can't parse received session description message. "
- << "SdpParseError was: " << error.description;
+ RTC_LOG(WARNING) << "Can't parse received session description message. "
+ << "SdpParseError was: " << error.description;
return false;
}
- LOG(INFO) << " Received session description :" << remote_desc;
+ RTC_LOG(INFO) << " Received session description :" << remote_desc;
peer_connection_->SetRemoteDescription(
DummySetSessionDescriptionObserver::Create(), session_description);
@@ -311,15 +311,15 @@
std::unique_ptr<webrtc::IceCandidateInterface> ice_candidate(
webrtc::CreateIceCandidate(sdp_mid, sdp_mlineindex, candidate, &error));
if (!ice_candidate.get()) {
- LOG(WARNING) << "Can't parse received candidate message. "
- << "SdpParseError was: " << error.description;
+ RTC_LOG(WARNING) << "Can't parse received candidate message. "
+ << "SdpParseError was: " << error.description;
return false;
}
if (!peer_connection_->AddIceCandidate(ice_candidate.get())) {
- LOG(WARNING) << "Failed to apply the received candidate";
+ RTC_LOG(WARNING) << "Failed to apply the received candidate";
return false;
}
- LOG(INFO) << " Received candidate :" << candidate;
+ RTC_LOG(INFO) << " Received candidate :" << candidate;
return true;
}
@@ -354,7 +354,7 @@
void SimplePeerConnection::OnAddStream(
rtc::scoped_refptr<webrtc::MediaStreamInterface> stream) {
- LOG(INFO) << __FUNCTION__ << " " << stream->label();
+ RTC_LOG(INFO) << __FUNCTION__ << " " << stream->label();
remote_stream_ = stream;
if (remote_video_observer_ && !remote_stream_->GetVideoTracks().empty()) {
remote_stream_->GetVideoTracks()[0]->AddOrUpdateSink(
@@ -460,7 +460,7 @@
}
if (!peer_connection_->AddStream(stream)) {
- LOG(LS_ERROR) << "Adding stream to PeerConnection failed";
+ RTC_LOG(LS_ERROR) << "Adding stream to PeerConnection failed";
}
typedef std::pair<std::string,
@@ -476,10 +476,10 @@
data_channel_ = peer_connection_->CreateDataChannel("Hello", &init);
if (data_channel_.get()) {
data_channel_->RegisterObserver(this);
- LOG(LS_INFO) << "Succeeds to create data channel";
+ RTC_LOG(LS_INFO) << "Succeeds to create data channel";
return true;
} else {
- LOG(LS_INFO) << "Fails to create data channel";
+ RTC_LOG(LS_INFO) << "Fails to create data channel";
return false;
}
}
@@ -494,7 +494,7 @@
bool SimplePeerConnection::SendDataViaDataChannel(const std::string& data) {
if (!data_channel_.get()) {
- LOG(LS_INFO) << "Data channel is not established";
+ RTC_LOG(LS_INFO) << "Data channel is not established";
return false;
}
webrtc::DataBuffer buffer(data);
@@ -514,7 +514,7 @@
if (state == webrtc::DataChannelInterface::kOpen) {
if (OnLocalDataChannelReady)
OnLocalDataChannelReady();
- LOG(LS_INFO) << "Data channel is open";
+ RTC_LOG(LS_INFO) << "Data channel is open";
}
}
}
diff --git a/logging/rtc_event_log/encoder/rtc_event_log_encoder_legacy.cc b/logging/rtc_event_log/encoder/rtc_event_log_encoder_legacy.cc
index 47b4c1e..36cca88 100644
--- a/logging/rtc_event_log/encoder/rtc_event_log_encoder_legacy.cc
+++ b/logging/rtc_event_log/encoder/rtc_event_log_encoder_legacy.cc
@@ -461,8 +461,9 @@
encoder->set_payload_type(codec.payload_type);
if (event.config_->codecs.size() > 1) {
- LOG(WARNING) << "LogVideoSendStreamConfig currently only supports one "
- << "codec. Logging codec :" << codec.payload_name;
+ RTC_LOG(WARNING)
+ << "LogVideoSendStreamConfig currently only supports one "
+ << "codec. Logging codec :" << codec.payload_name;
break;
}
}
diff --git a/logging/rtc_event_log/output/rtc_event_log_output_file.cc b/logging/rtc_event_log/output/rtc_event_log_output_file.cc
index 2e06a36..fba7d5b 100644
--- a/logging/rtc_event_log/output/rtc_event_log_output_file.cc
+++ b/logging/rtc_event_log/output/rtc_event_log_output_file.cc
@@ -34,7 +34,7 @@
RTC_CHECK_LE(max_size_bytes_, kMaxReasonableFileSize);
if (!file_->OpenFile(file_name.c_str(), false)) {
- LOG(LS_ERROR) << "Can't open file. WebRTC event log not started.";
+ RTC_LOG(LS_ERROR) << "Can't open file. WebRTC event log not started.";
file_.reset();
return;
}
@@ -50,18 +50,18 @@
FILE* file_handle = rtc::FdopenPlatformFileForWriting(file);
if (!file_handle) {
- LOG(LS_ERROR) << "Can't open file. WebRTC event log not started.";
+ RTC_LOG(LS_ERROR) << "Can't open file. WebRTC event log not started.";
// Even though we failed to open a FILE*, the file is still open
// and needs to be closed.
if (!rtc::ClosePlatformFile(file)) {
- LOG(LS_ERROR) << "Can't close file.";
+ RTC_LOG(LS_ERROR) << "Can't close file.";
}
file_.reset();
return;
}
if (!file_->OpenFromFileHandle(file_handle)) {
- LOG(LS_ERROR) << "Can't open file. WebRTC event log not started.";
+ RTC_LOG(LS_ERROR) << "Can't open file. WebRTC event log not started.";
file_.reset();
return;
}
@@ -90,10 +90,10 @@
written_bytes_ + output.length() <= max_size_bytes_) {
written = file_->Write(output.c_str(), output.size());
if (!written) {
- LOG(LS_ERROR) << "FileWrapper failed to write WebRtcEventLog file.";
+ RTC_LOG(LS_ERROR) << "FileWrapper failed to write WebRtcEventLog file.";
}
} else {
- LOG(LS_VERBOSE) << "Max file size reached.";
+ RTC_LOG(LS_VERBOSE) << "Max file size reached.";
}
if (written) {
diff --git a/logging/rtc_event_log/rtc_event_log.cc b/logging/rtc_event_log/rtc_event_log.cc
index 7d9115f..3e4084d 100644
--- a/logging/rtc_event_log/rtc_event_log.cc
+++ b/logging/rtc_event_log/rtc_event_log.cc
@@ -73,7 +73,8 @@
case RtcEventLog::EncodingType::Legacy:
return rtc::MakeUnique<RtcEventLogEncoderLegacy>();
default:
- LOG(LS_ERROR) << "Unknown RtcEventLog encoder type (" << int(type) << ")";
+ RTC_LOG(LS_ERROR) << "Unknown RtcEventLog encoder type (" << int(type)
+ << ")";
RTC_NOTREACHED();
return std::unique_ptr<RtcEventLogEncoder>(nullptr);
}
@@ -160,7 +161,7 @@
return false;
}
- LOG(LS_INFO) << "Starting WebRTC event log.";
+ RTC_LOG(LS_INFO) << "Starting WebRTC event log.";
// |start_event| captured by value. This is done here because we want the
// timestamp to reflect when StartLogging() was called; not the queueing
@@ -186,7 +187,7 @@
void RtcEventLogImpl::StopLogging() {
RTC_DCHECK_CALLED_SEQUENTIALLY(&owner_sequence_checker_);
- LOG(LS_INFO) << "Stopping WebRTC event log.";
+ RTC_LOG(LS_INFO) << "Stopping WebRTC event log.";
rtc::Event output_stopped(true, false);
@@ -198,7 +199,7 @@
output_stopped.Wait(rtc::Event::kForever);
- LOG(LS_INFO) << "WebRTC event log successfully stopped.";
+ RTC_LOG(LS_INFO) << "WebRTC event log successfully stopped.";
}
void RtcEventLogImpl::Log(std::unique_ptr<RtcEvent> event) {
@@ -330,7 +331,7 @@
void RtcEventLogImpl::WriteToOutput(const std::string& output_string) {
RTC_DCHECK(event_output_ && event_output_->IsActive());
if (!event_output_->Write(output_string)) {
- LOG(LS_ERROR) << "Failed to write RTC event to output.";
+ RTC_LOG(LS_ERROR) << "Failed to write RTC event to output.";
// The first failure closes the output.
RTC_DCHECK(!event_output_->IsActive());
StopOutput(); // Clean-up.
@@ -350,8 +351,8 @@
constexpr int kMaxLogCount = 5;
int count = 1 + std::atomic_fetch_add(&rtc_event_log_count, 1);
if (count > kMaxLogCount) {
- LOG(LS_WARNING) << "Denied creation of additional WebRTC event logs. "
- << count - 1 << " logs open already.";
+ RTC_LOG(LS_WARNING) << "Denied creation of additional WebRTC event logs. "
+ << count - 1 << " logs open already.";
std::atomic_fetch_sub(&rtc_event_log_count, 1);
return CreateNull();
}
diff --git a/logging/rtc_event_log/rtc_event_log2stats.cc b/logging/rtc_event_log/rtc_event_log2stats.cc
index 4a4ee3f..10fb53c 100644
--- a/logging/rtc_event_log/rtc_event_log2stats.cc
+++ b/logging/rtc_event_log/rtc_event_log2stats.cc
@@ -70,7 +70,7 @@
std::vector<webrtc::rtclog::Event>* events) {
std::ifstream stream(filename, std::ios_base::in | std::ios_base::binary);
if (!stream.good() || !stream.is_open()) {
- LOG(LS_WARNING) << "Could not open file for reading.";
+ RTC_LOG(LS_WARNING) << "Could not open file for reading.";
return false;
}
@@ -95,34 +95,36 @@
const uint64_t kExpectedTag = (1 << 3) | 2;
std::tie(tag, success) = ParseVarInt(stream);
if (!success) {
- LOG(LS_WARNING) << "Missing field tag from beginning of protobuf event.";
+ RTC_LOG(LS_WARNING)
+ << "Missing field tag from beginning of protobuf event.";
return false;
} else if (tag != kExpectedTag) {
- LOG(LS_WARNING) << "Unexpected field tag at beginning of protobuf event.";
+ RTC_LOG(LS_WARNING)
+ << "Unexpected field tag at beginning of protobuf event.";
return false;
}
// Read the length field.
std::tie(message_length, success) = ParseVarInt(stream);
if (!success) {
- LOG(LS_WARNING) << "Missing message length after protobuf field tag.";
+ RTC_LOG(LS_WARNING) << "Missing message length after protobuf field tag.";
return false;
} else if (message_length > kMaxEventSize) {
- LOG(LS_WARNING) << "Protobuf message length is too large.";
+ RTC_LOG(LS_WARNING) << "Protobuf message length is too large.";
return false;
}
// Read the next protobuf event to a temporary char buffer.
stream.read(tmp_buffer.data(), message_length);
if (stream.gcount() != static_cast<int>(message_length)) {
- LOG(LS_WARNING) << "Failed to read protobuf message from file.";
+ RTC_LOG(LS_WARNING) << "Failed to read protobuf message from file.";
return false;
}
// Parse the protobuf event from the buffer.
webrtc::rtclog::Event event;
if (!event.ParseFromArray(tmp_buffer.data(), message_length)) {
- LOG(LS_WARNING) << "Failed to parse protobuf message.";
+ RTC_LOG(LS_WARNING) << "Failed to parse protobuf message.";
return false;
}
events->push_back(event);
@@ -194,7 +196,7 @@
std::vector<webrtc::rtclog::Event> events;
if (!ParseEvents(file_name, &events)) {
- LOG(LS_ERROR) << "Failed to parse event log.";
+ RTC_LOG(LS_ERROR) << "Failed to parse event log.";
return -1;
}
diff --git a/logging/rtc_event_log/rtc_event_log2text.cc b/logging/rtc_event_log/rtc_event_log2text.cc
index 9292fd3..dca0823 100644
--- a/logging/rtc_event_log/rtc_event_log2text.cc
+++ b/logging/rtc_event_log/rtc_event_log2text.cc
@@ -449,7 +449,7 @@
if (extension_map == nullptr) {
extension_map = &default_map;
if (!default_map_used)
- LOG(LS_WARNING) << "Using default header extension map";
+ RTC_LOG(LS_WARNING) << "Using default header extension map";
default_map_used = true;
}
diff --git a/logging/rtc_event_log/rtc_event_log_parser.cc b/logging/rtc_event_log/rtc_event_log_parser.cc
index ca9ae39..060c553 100644
--- a/logging/rtc_event_log/rtc_event_log_parser.cc
+++ b/logging/rtc_event_log/rtc_event_log_parser.cc
@@ -132,7 +132,7 @@
bool ParsedRtcEventLog::ParseFile(const std::string& filename) {
std::ifstream file(filename, std::ios_base::in | std::ios_base::binary);
if (!file.good() || !file.is_open()) {
- LOG(LS_WARNING) << "Could not open file for reading.";
+ RTC_LOG(LS_WARNING) << "Could not open file for reading.";
return false;
}
@@ -174,34 +174,36 @@
const uint64_t kExpectedTag = (1 << 3) | 2;
std::tie(tag, success) = ParseVarInt(stream);
if (!success) {
- LOG(LS_WARNING) << "Missing field tag from beginning of protobuf event.";
+ RTC_LOG(LS_WARNING)
+ << "Missing field tag from beginning of protobuf event.";
return false;
} else if (tag != kExpectedTag) {
- LOG(LS_WARNING) << "Unexpected field tag at beginning of protobuf event.";
+ RTC_LOG(LS_WARNING)
+ << "Unexpected field tag at beginning of protobuf event.";
return false;
}
// Read the length field.
std::tie(message_length, success) = ParseVarInt(stream);
if (!success) {
- LOG(LS_WARNING) << "Missing message length after protobuf field tag.";
+ RTC_LOG(LS_WARNING) << "Missing message length after protobuf field tag.";
return false;
} else if (message_length > kMaxEventSize) {
- LOG(LS_WARNING) << "Protobuf message length is too large.";
+ RTC_LOG(LS_WARNING) << "Protobuf message length is too large.";
return false;
}
// Read the next protobuf event to a temporary char buffer.
stream.read(tmp_buffer.data(), message_length);
if (stream.gcount() != static_cast<int>(message_length)) {
- LOG(LS_WARNING) << "Failed to read protobuf message from file.";
+ RTC_LOG(LS_WARNING) << "Failed to read protobuf message from file.";
return false;
}
// Parse the protobuf event from the buffer.
rtclog::Event event;
if (!event.ParseFromArray(tmp_buffer.data(), message_length)) {
- LOG(LS_WARNING) << "Failed to parse protobuf message.";
+ RTC_LOG(LS_WARNING) << "Failed to parse protobuf message.";
return false;
}
@@ -410,7 +412,7 @@
rtx_payload_type = rtx_it->second.rtx_payload_type();
if (config.rtx_ssrc != 0 &&
config.rtx_ssrc != rtx_it->second.rtx_ssrc()) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "RtcEventLog protobuf contained different SSRCs for "
"different received RTX payload types. Will only use "
"rtx_ssrc = "
@@ -441,8 +443,9 @@
const rtclog::VideoSendConfig& sender_config = event.video_sender_config();
if (sender_config.rtx_ssrcs_size() > 0 &&
sender_config.ssrcs_size() != sender_config.rtx_ssrcs_size()) {
- LOG(WARNING) << "VideoSendConfig is configured for RTX but the number of "
- "SSRCs doesn't match the number of RTX SSRCs.";
+ RTC_LOG(WARNING)
+ << "VideoSendConfig is configured for RTX but the number of "
+ "SSRCs doesn't match the number of RTX SSRCs.";
}
configs.resize(sender_config.ssrcs_size());
for (int i = 0; i < sender_config.ssrcs_size(); i++) {
diff --git a/media/base/codec.cc b/media/base/codec.cc
index 625875b..5c486ee 100644
--- a/media/base/codec.cc
+++ b/media/base/codec.cc
@@ -290,7 +290,7 @@
bool VideoCodec::ValidateCodecFormat() const {
if (id < 0 || id > 127) {
- LOG(LS_ERROR) << "Codec with invalid payload type: " << ToString();
+ RTC_LOG(LS_ERROR) << "Codec with invalid payload type: " << ToString();
return false;
}
if (GetCodecType() != CODEC_VIDEO) {
@@ -303,7 +303,7 @@
if (GetParam(kCodecParamMinBitrate, &min_bitrate) &&
GetParam(kCodecParamMaxBitrate, &max_bitrate)) {
if (max_bitrate < min_bitrate) {
- LOG(LS_ERROR) << "Codec with max < min bitrate: " << ToString();
+ RTC_LOG(LS_ERROR) << "Codec with max < min bitrate: " << ToString();
return false;
}
}
diff --git a/media/base/rtpdataengine.cc b/media/base/rtpdataengine.cc
index cacf973..7cb5fa8 100644
--- a/media/base/rtpdataengine.cc
+++ b/media/base/rtpdataengine.cc
@@ -110,8 +110,8 @@
bool RtpDataMediaChannel::SetRecvCodecs(const std::vector<DataCodec>& codecs) {
const DataCodec* unknown_codec = FindUnknownCodec(codecs);
if (unknown_codec) {
- LOG(LS_WARNING) << "Failed to SetRecvCodecs because of unknown codec: "
- << unknown_codec->ToString();
+ RTC_LOG(LS_WARNING) << "Failed to SetRecvCodecs because of unknown codec: "
+ << unknown_codec->ToString();
return false;
}
@@ -122,8 +122,8 @@
bool RtpDataMediaChannel::SetSendCodecs(const std::vector<DataCodec>& codecs) {
const DataCodec* known_codec = FindKnownCodec(codecs);
if (!known_codec) {
- LOG(LS_WARNING) <<
- "Failed to SetSendCodecs because there is no known codec.";
+ RTC_LOG(LS_WARNING)
+ << "Failed to SetSendCodecs because there is no known codec.";
return false;
}
@@ -146,9 +146,9 @@
}
if (GetStreamBySsrc(send_streams_, stream.first_ssrc())) {
- LOG(LS_WARNING) << "Not adding data send stream '" << stream.id
- << "' with ssrc=" << stream.first_ssrc()
- << " because stream already exists.";
+ RTC_LOG(LS_WARNING) << "Not adding data send stream '" << stream.id
+ << "' with ssrc=" << stream.first_ssrc()
+ << " because stream already exists.";
return false;
}
@@ -159,8 +159,8 @@
kDataCodecClockrate,
rtc::CreateRandomNonZeroId(), rtc::CreateRandomNonZeroId());
- LOG(LS_INFO) << "Added data send stream '" << stream.id
- << "' with ssrc=" << stream.first_ssrc();
+ RTC_LOG(LS_INFO) << "Added data send stream '" << stream.id
+ << "' with ssrc=" << stream.first_ssrc();
return true;
}
@@ -181,15 +181,15 @@
}
if (GetStreamBySsrc(recv_streams_, stream.first_ssrc())) {
- LOG(LS_WARNING) << "Not adding data recv stream '" << stream.id
- << "' with ssrc=" << stream.first_ssrc()
- << " because stream already exists.";
+ RTC_LOG(LS_WARNING) << "Not adding data recv stream '" << stream.id
+ << "' with ssrc=" << stream.first_ssrc()
+ << " because stream already exists.";
return false;
}
recv_streams_.push_back(stream);
- LOG(LS_INFO) << "Added data recv stream '" << stream.id
- << "' with ssrc=" << stream.first_ssrc();
+ RTC_LOG(LS_INFO) << "Added data recv stream '" << stream.id
+ << "' with ssrc=" << stream.first_ssrc();
return true;
}
@@ -203,7 +203,7 @@
RtpHeader header;
if (!GetRtpHeader(packet->cdata(), packet->size(), &header)) {
// Don't want to log for every corrupt packet.
- // LOG(LS_WARNING) << "Could not read rtp header from packet of length "
+ // RTC_LOG(LS_WARNING) << "Could not read rtp header from packet of length "
// << packet->length() << ".";
return;
}
@@ -211,7 +211,7 @@
size_t header_length;
if (!GetRtpHeaderLen(packet->cdata(), packet->size(), &header_length)) {
// Don't want to log for every corrupt packet.
- // LOG(LS_WARNING) << "Could not read rtp header"
+ // RTC_LOG(LS_WARNING) << "Could not read rtp header"
// << length from packet of length "
// << packet->length() << ".";
return;
@@ -221,16 +221,15 @@
size_t data_len = packet->size() - header_length - sizeof(kReservedSpace);
if (!receiving_) {
- LOG(LS_WARNING) << "Not receiving packet "
- << header.ssrc << ":" << header.seq_num
- << " before SetReceive(true) called.";
+ RTC_LOG(LS_WARNING) << "Not receiving packet " << header.ssrc << ":"
+ << header.seq_num << " before SetReceive(true) called.";
return;
}
if (!FindCodecById(recv_codecs_, header.payload_type)) {
// For bundling, this will be logged for every message.
// So disable this logging.
- // LOG(LS_WARNING) << "Not receiving packet "
+ // RTC_LOG(LS_WARNING) << "Not receiving packet "
// << header.ssrc << ":" << header.seq_num
// << " (" << data_len << ")"
// << " because unknown payload id: " << header.payload_type;
@@ -238,13 +237,13 @@
}
if (!GetStreamBySsrc(recv_streams_, header.ssrc)) {
- LOG(LS_WARNING) << "Received packet for unknown ssrc: " << header.ssrc;
+ RTC_LOG(LS_WARNING) << "Received packet for unknown ssrc: " << header.ssrc;
return;
}
// Uncomment this for easy debugging.
// const auto* found_stream = GetStreamBySsrc(recv_streams_, header.ssrc);
- // LOG(LS_INFO) << "Received packet"
+ // RTC_LOG(LS_INFO) << "Received packet"
// << " groupid=" << found_stream.groupid
// << ", ssrc=" << header.ssrc
// << ", seqnum=" << header.seq_num
@@ -263,7 +262,8 @@
bps = kDataMaxBandwidth;
}
send_limiter_.reset(new rtc::RateLimiter(bps / 8, 1.0));
- LOG(LS_INFO) << "RtpDataMediaChannel::SetSendBandwidth to " << bps << "bps.";
+ RTC_LOG(LS_INFO) << "RtpDataMediaChannel::SetSendBandwidth to " << bps
+ << "bps.";
return true;
}
@@ -276,29 +276,31 @@
*result = SDR_ERROR;
}
if (!sending_) {
- LOG(LS_WARNING) << "Not sending packet with ssrc=" << params.ssrc
- << " len=" << payload.size() << " before SetSend(true).";
+ RTC_LOG(LS_WARNING) << "Not sending packet with ssrc=" << params.ssrc
+ << " len=" << payload.size()
+ << " before SetSend(true).";
return false;
}
if (params.type != cricket::DMT_TEXT) {
- LOG(LS_WARNING) << "Not sending data because binary type is unsupported.";
+ RTC_LOG(LS_WARNING)
+ << "Not sending data because binary type is unsupported.";
return false;
}
const StreamParams* found_stream =
GetStreamBySsrc(send_streams_, params.ssrc);
if (!found_stream) {
- LOG(LS_WARNING) << "Not sending data because ssrc is unknown: "
- << params.ssrc;
+ RTC_LOG(LS_WARNING) << "Not sending data because ssrc is unknown: "
+ << params.ssrc;
return false;
}
const DataCodec* found_codec =
FindCodecByName(send_codecs_, kGoogleRtpDataCodecName);
if (!found_codec) {
- LOG(LS_WARNING) << "Not sending data because codec is unknown: "
- << kGoogleRtpDataCodecName;
+ RTC_LOG(LS_WARNING) << "Not sending data because codec is unknown: "
+ << kGoogleRtpDataCodecName;
return false;
}
@@ -312,9 +314,9 @@
rtc::TimeMicros() / static_cast<double>(rtc::kNumMicrosecsPerSec);
if (!send_limiter_->CanUse(packet_len, now)) {
- LOG(LS_VERBOSE) << "Dropped data packet of len=" << packet_len
- << "; already sent " << send_limiter_->used_in_period()
- << "/" << send_limiter_->max_per_period();
+ RTC_LOG(LS_VERBOSE) << "Dropped data packet of len=" << packet_len
+ << "; already sent " << send_limiter_->used_in_period()
+ << "/" << send_limiter_->max_per_period();
return false;
}
@@ -331,11 +333,12 @@
packet.AppendData(kReservedSpace);
packet.AppendData(payload);
- LOG(LS_VERBOSE) << "Sent RTP data packet: "
- << " stream=" << found_stream->id << " ssrc=" << header.ssrc
- << ", seqnum=" << header.seq_num
- << ", timestamp=" << header.timestamp
- << ", len=" << payload.size();
+ RTC_LOG(LS_VERBOSE) << "Sent RTP data packet: "
+ << " stream=" << found_stream->id
+ << " ssrc=" << header.ssrc
+ << ", seqnum=" << header.seq_num
+ << ", timestamp=" << header.timestamp
+ << ", len=" << payload.size();
MediaChannel::SendPacket(&packet, rtc::PacketOptions());
send_limiter_->Use(packet_len, now);
diff --git a/media/base/videoadapter.cc b/media/base/videoadapter.cc
index 7fb02e1..c678444 100644
--- a/media/base/videoadapter.cc
+++ b/media/base/videoadapter.cc
@@ -182,15 +182,12 @@
if ((frames_in_ - frames_out_) % 90 == 0) {
// TODO(fbarchard): Reduce to LS_VERBOSE when adapter info is not needed
// in default calls.
- LOG(LS_INFO) << "VAdapt Drop Frame: scaled " << frames_scaled_
- << " / out " << frames_out_
- << " / in " << frames_in_
- << " Changes: " << adaption_changes_
- << " Input: " << in_width
- << "x" << in_height
- << " timestamp: " << in_timestamp_ns
- << " Output: i"
- << (requested_format_ ? requested_format_->interval : 0);
+ RTC_LOG(LS_INFO) << "VAdapt Drop Frame: scaled " << frames_scaled_
+ << " / out " << frames_out_ << " / in " << frames_in_
+ << " Changes: " << adaption_changes_
+ << " Input: " << in_width << "x" << in_height
+ << " timestamp: " << in_timestamp_ns << " Output: i"
+ << (requested_format_ ? requested_format_->interval : 0);
}
// Drop frame.
@@ -243,13 +240,14 @@
if (previous_width_ && (previous_width_ != *out_width ||
previous_height_ != *out_height)) {
++adaption_changes_;
- LOG(LS_INFO) << "Frame size changed: scaled " << frames_scaled_ << " / out "
- << frames_out_ << " / in " << frames_in_
- << " Changes: " << adaption_changes_ << " Input: " << in_width
- << "x" << in_height
- << " Scale: " << scale.numerator << "/" << scale.denominator
- << " Output: " << *out_width << "x" << *out_height << " i"
- << (requested_format_ ? requested_format_->interval : 0);
+ RTC_LOG(LS_INFO) << "Frame size changed: scaled " << frames_scaled_
+ << " / out " << frames_out_ << " / in " << frames_in_
+ << " Changes: " << adaption_changes_
+ << " Input: " << in_width << "x" << in_height
+ << " Scale: " << scale.numerator << "/"
+ << scale.denominator << " Output: " << *out_width << "x"
+ << *out_height << " i"
+ << (requested_format_ ? requested_format_->interval : 0);
}
previous_width_ = *out_width;
diff --git a/media/base/videobroadcaster.cc b/media/base/videobroadcaster.cc
index 344c3cc..d2a9c54 100644
--- a/media/base/videobroadcaster.cc
+++ b/media/base/videobroadcaster.cc
@@ -60,7 +60,7 @@
// When rotation_applied is set to true, one or a few frames may get here
// with rotation still pending. Protect sinks that don't expect any
// pending rotation.
- LOG(LS_VERBOSE) << "Discarding frame with unexpected rotation.";
+ RTC_LOG(LS_VERBOSE) << "Discarding frame with unexpected rotation.";
continue;
}
if (sink_pair.wants.black_frames) {
diff --git a/media/base/videocapturer.cc b/media/base/videocapturer.cc
index 3fc56b5..f6e05ba 100644
--- a/media/base/videocapturer.cc
+++ b/media/base/videocapturer.cc
@@ -84,7 +84,7 @@
if (supported_formats->empty()) {
return false;
}
- LOG(LS_INFO) << " Capture Requested " << format.ToString();
+ RTC_LOG(LS_INFO) << " Capture Requested " << format.ToString();
int64_t best_distance = kMaxDistance;
std::vector<VideoFormat>::const_iterator best = supported_formats->end();
std::vector<VideoFormat>::const_iterator i;
@@ -92,14 +92,15 @@
int64_t distance = GetFormatDistance(format, *i);
// TODO(fbarchard): Reduce to LS_VERBOSE if/when camera capture is
// relatively bug free.
- LOG(LS_INFO) << " Supported " << i->ToString() << " distance " << distance;
+ RTC_LOG(LS_INFO) << " Supported " << i->ToString() << " distance "
+ << distance;
if (distance < best_distance) {
best_distance = distance;
best = i;
}
}
if (supported_formats->end() == best) {
- LOG(LS_ERROR) << " No acceptable camera format found";
+ RTC_LOG(LS_ERROR) << " No acceptable camera format found";
return false;
}
@@ -108,8 +109,8 @@
best_format->height = best->height;
best_format->fourcc = best->fourcc;
best_format->interval = best->interval;
- LOG(LS_INFO) << " Best " << best_format->ToString() << " Interval "
- << best_format->interval << " distance " << best_distance;
+ RTC_LOG(LS_INFO) << " Best " << best_format->ToString() << " Interval "
+ << best_format->interval << " distance " << best_distance;
}
return true;
}
@@ -117,7 +118,7 @@
void VideoCapturer::ConstrainSupportedFormats(const VideoFormat& max_format) {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
max_format_.reset(new VideoFormat(max_format));
- LOG(LS_VERBOSE) << " ConstrainSupportedFormats " << max_format.ToString();
+ RTC_LOG(LS_VERBOSE) << " ConstrainSupportedFormats " << max_format.ToString();
UpdateFilteredSupportedFormats();
}
@@ -218,7 +219,7 @@
// in this case, for frames in flight at the time
// applied_rotation is set to true. In that case, we just drop
// the frame.
- LOG(LS_WARNING) << "Non-I420 frame requiring rotation. Discarding.";
+ RTC_LOG(LS_WARNING) << "Non-I420 frame requiring rotation. Discarding.";
return;
}
broadcaster_.OnFrame(webrtc::VideoFrame(
diff --git a/media/engine/adm_helpers.cc b/media/engine/adm_helpers.cc
index bb2ecc3..3a1776e 100644
--- a/media/engine/adm_helpers.cc
+++ b/media/engine/adm_helpers.cc
@@ -38,46 +38,46 @@
// Save recording status and stop recording.
const bool was_recording = adm->Recording();
if (was_recording && adm->StopRecording() != 0) {
- LOG(LS_ERROR) << "Unable to stop recording.";
+ RTC_LOG(LS_ERROR) << "Unable to stop recording.";
return;
}
// Set device and stereo mode.
if (adm->SetRecordingChannel(AudioDeviceModule::kChannelBoth) != 0) {
- LOG(LS_ERROR) << "Unable to set recording channel to kChannelBoth.";
+ RTC_LOG(LS_ERROR) << "Unable to set recording channel to kChannelBoth.";
}
if (adm->SetRecordingDevice(AUDIO_DEVICE_ID) != 0) {
- LOG(LS_ERROR) << "Unable to set recording device.";
+ RTC_LOG(LS_ERROR) << "Unable to set recording device.";
return;
}
// Init microphone, so user can do volume settings etc.
if (adm->InitMicrophone() != 0) {
- LOG(LS_ERROR) << "Unable to access microphone.";
+ RTC_LOG(LS_ERROR) << "Unable to access microphone.";
}
// Set number of channels
bool available = false;
if (adm->StereoRecordingIsAvailable(&available) != 0) {
- LOG(LS_ERROR) << "Failed to query stereo recording.";
+ RTC_LOG(LS_ERROR) << "Failed to query stereo recording.";
}
if (adm->SetStereoRecording(available) != 0) {
- LOG(LS_ERROR) << "Failed to set stereo recording mode.";
+ RTC_LOG(LS_ERROR) << "Failed to set stereo recording mode.";
}
// Restore recording if it was enabled already when calling this function.
if (was_recording) {
if (adm->InitRecording() != 0) {
- LOG(LS_ERROR) << "Failed to initialize recording.";
+ RTC_LOG(LS_ERROR) << "Failed to initialize recording.";
return;
}
if (adm->StartRecording() != 0) {
- LOG(LS_ERROR) << "Failed to start recording.";
+ RTC_LOG(LS_ERROR) << "Failed to start recording.";
return;
}
}
- LOG(LS_INFO) << "Set recording device.";
+ RTC_LOG(LS_INFO) << "Set recording device.";
}
void SetPlayoutDevice(AudioDeviceModule* adm) {
@@ -86,42 +86,42 @@
// Save playing status and stop playout.
const bool was_playing = adm->Playing();
if (was_playing && adm->StopPlayout() != 0) {
- LOG(LS_ERROR) << "Unable to stop playout.";
+ RTC_LOG(LS_ERROR) << "Unable to stop playout.";
}
// Set device.
if (adm->SetPlayoutDevice(AUDIO_DEVICE_ID) != 0) {
- LOG(LS_ERROR) << "Unable to set playout device.";
+ RTC_LOG(LS_ERROR) << "Unable to set playout device.";
return;
}
// Init speaker, so user can do volume settings etc.
if (adm->InitSpeaker() != 0) {
- LOG(LS_ERROR) << "Unable to access speaker.";
+ RTC_LOG(LS_ERROR) << "Unable to access speaker.";
}
// Set number of channels
bool available = false;
if (adm->StereoPlayoutIsAvailable(&available) != 0) {
- LOG(LS_ERROR) << "Failed to query stereo playout.";
+ RTC_LOG(LS_ERROR) << "Failed to query stereo playout.";
}
if (adm->SetStereoPlayout(available) != 0) {
- LOG(LS_ERROR) << "Failed to set stereo playout mode.";
+ RTC_LOG(LS_ERROR) << "Failed to set stereo playout mode.";
}
// Restore recording if it was enabled already when calling this function.
if (was_playing) {
if (adm->InitPlayout() != 0) {
- LOG(LS_ERROR) << "Failed to initialize playout.";
+ RTC_LOG(LS_ERROR) << "Failed to initialize playout.";
return;
}
if (adm->StartPlayout() != 0) {
- LOG(LS_ERROR) << "Failed to start playout.";
+ RTC_LOG(LS_ERROR) << "Failed to start playout.";
return;
}
}
- LOG(LS_INFO) << "Set playout device.";
+ RTC_LOG(LS_INFO) << "Set playout device.";
}
} // namespace adm_helpers
diff --git a/media/engine/apm_helpers.cc b/media/engine/apm_helpers.cc
index d6c45a6..0f67be1 100644
--- a/media/engine/apm_helpers.cc
+++ b/media/engine/apm_helpers.cc
@@ -32,14 +32,16 @@
RTC_DCHECK(apm);
GainControl* gc = apm->gain_control();
if (gc->set_target_level_dbfs(config.targetLeveldBOv) != 0) {
- LOG(LS_ERROR) << "Failed to set target level: " << config.targetLeveldBOv;
+ RTC_LOG(LS_ERROR) << "Failed to set target level: "
+ << config.targetLeveldBOv;
}
if (gc->set_compression_gain_db(config.digitalCompressionGaindB) != 0) {
- LOG(LS_ERROR) << "Failed to set compression gain: "
- << config.digitalCompressionGaindB;
+ RTC_LOG(LS_ERROR) << "Failed to set compression gain: "
+ << config.digitalCompressionGaindB;
}
if (gc->enable_limiter(config.limiterEnable) != 0) {
- LOG(LS_ERROR) << "Failed to set limiter on/off: " << config.limiterEnable;
+ RTC_LOG(LS_ERROR) << "Failed to set limiter on/off: "
+ << config.limiterEnable;
}
}
@@ -55,19 +57,19 @@
#endif
GainControl* gc = apm->gain_control();
if (gc->set_mode(agc_mode) != 0) {
- LOG(LS_ERROR) << "Failed to set AGC mode: " << agc_mode;
+ RTC_LOG(LS_ERROR) << "Failed to set AGC mode: " << agc_mode;
return;
}
if (gc->Enable(enable) != 0) {
- LOG(LS_ERROR) << "Failed to enable/disable AGC: " << enable;
+ RTC_LOG(LS_ERROR) << "Failed to enable/disable AGC: " << enable;
return;
}
// Set AGC state in the ADM when adaptive AGC mode has been selected.
if (adm->SetAGC(enable && agc_mode == GainControl::kAdaptiveAnalog) != 0) {
- LOG(LS_ERROR) << "Failed to set AGC mode in ADM: " << enable;
+ RTC_LOG(LS_ERROR) << "Failed to set AGC mode in ADM: " << enable;
return;
}
- LOG(LS_INFO) << "AGC set to " << enable << " with mode " << agc_mode;
+ RTC_LOG(LS_INFO) << "AGC set to " << enable << " with mode " << agc_mode;
}
void SetEcStatus(AudioProcessing* apm,
@@ -80,40 +82,40 @@
if (mode == kEcConference) {
// Disable the AECM before enabling the AEC.
if (enable && ecm->is_enabled() && ecm->Enable(false) != 0) {
- LOG(LS_ERROR) << "Failed to disable AECM.";
+ RTC_LOG(LS_ERROR) << "Failed to disable AECM.";
return;
}
if (ec->Enable(enable) != 0) {
- LOG(LS_ERROR) << "Failed to enable/disable AEC: " << enable;
+ RTC_LOG(LS_ERROR) << "Failed to enable/disable AEC: " << enable;
return;
}
if (ec->set_suppression_level(EchoCancellation::kHighSuppression)
!= 0) {
- LOG(LS_ERROR) << "Failed to set high AEC aggressiveness.";
+ RTC_LOG(LS_ERROR) << "Failed to set high AEC aggressiveness.";
return;
}
} else {
// Disable the AEC before enabling the AECM.
if (enable && ec->is_enabled() && ec->Enable(false) != 0) {
- LOG(LS_ERROR) << "Failed to disable AEC.";
+ RTC_LOG(LS_ERROR) << "Failed to disable AEC.";
return;
}
if (ecm->Enable(enable) != 0) {
- LOG(LS_ERROR) << "Failed to enable/disable AECM: " << enable;
+ RTC_LOG(LS_ERROR) << "Failed to enable/disable AECM: " << enable;
return;
}
}
- LOG(LS_INFO) << "Echo control set to " << enable << " with mode " << mode;
+ RTC_LOG(LS_INFO) << "Echo control set to " << enable << " with mode " << mode;
}
void SetEcMetricsStatus(AudioProcessing* apm, bool enable) {
RTC_DCHECK(apm);
if ((apm->echo_cancellation()->enable_metrics(enable) != 0) ||
(apm->echo_cancellation()->enable_delay_logging(enable) != 0)) {
- LOG(LS_ERROR) << "Failed to enable/disable EC metrics: " << enable;
+ RTC_LOG(LS_ERROR) << "Failed to enable/disable EC metrics: " << enable;
return;
}
- LOG(LS_INFO) << "EC metrics set to " << enable;
+ RTC_LOG(LS_INFO) << "EC metrics set to " << enable;
}
void SetAecmMode(AudioProcessing* apm, bool enable) {
@@ -121,24 +123,24 @@
EchoControlMobile* ecm = apm->echo_control_mobile();
RTC_DCHECK_EQ(EchoControlMobile::kSpeakerphone, ecm->routing_mode());
if (ecm->enable_comfort_noise(enable) != 0) {
- LOG(LS_ERROR) << "Failed to enable/disable CNG: " << enable;
+ RTC_LOG(LS_ERROR) << "Failed to enable/disable CNG: " << enable;
return;
}
- LOG(LS_INFO) << "CNG set to " << enable;
+ RTC_LOG(LS_INFO) << "CNG set to " << enable;
}
void SetNsStatus(AudioProcessing* apm, bool enable) {
RTC_DCHECK(apm);
NoiseSuppression* ns = apm->noise_suppression();
if (ns->set_level(NoiseSuppression::kHigh) != 0) {
- LOG(LS_ERROR) << "Failed to set high NS level.";
+ RTC_LOG(LS_ERROR) << "Failed to set high NS level.";
return;
}
if (ns->Enable(enable) != 0) {
- LOG(LS_ERROR) << "Failed to enable/disable NS: " << enable;
+ RTC_LOG(LS_ERROR) << "Failed to enable/disable NS: " << enable;
return;
}
- LOG(LS_INFO) << "NS set to " << enable;
+ RTC_LOG(LS_INFO) << "NS set to " << enable;
}
void SetTypingDetectionStatus(AudioProcessing* apm, bool enable) {
@@ -156,14 +158,14 @@
// feature on/off in TransmitMixer.
VoiceDetection* vd = apm->voice_detection();
if (vd->Enable(enable)) {
- LOG(LS_ERROR) << "Failed to enable/disable VAD: " << enable;
+ RTC_LOG(LS_ERROR) << "Failed to enable/disable VAD: " << enable;
return;
}
if (vd->set_likelihood(VoiceDetection::kVeryLowLikelihood)) {
- LOG(LS_ERROR) << "Failed to set low VAD likelihood.";
+ RTC_LOG(LS_ERROR) << "Failed to set low VAD likelihood.";
return;
}
- LOG(LS_INFO) << "VAD set to " << enable << " for typing detection.";
+ RTC_LOG(LS_INFO) << "VAD set to " << enable << " for typing detection.";
#endif
}
} // namespace apm_helpers
diff --git a/media/engine/internaldecoderfactory.cc b/media/engine/internaldecoderfactory.cc
index 5e69602..33119b1 100644
--- a/media/engine/internaldecoderfactory.cc
+++ b/media/engine/internaldecoderfactory.cc
@@ -27,7 +27,7 @@
public:
int32_t InitDecode(const webrtc::VideoCodec* codec_settings,
int32_t number_of_cores) override {
- LOG(LS_ERROR) << "Can't initialize NullVideoDecoder.";
+ RTC_LOG(LS_ERROR) << "Can't initialize NullVideoDecoder.";
return WEBRTC_VIDEO_CODEC_OK;
}
@@ -36,13 +36,13 @@
const webrtc::RTPFragmentationHeader* fragmentation,
const webrtc::CodecSpecificInfo* codec_specific_info,
int64_t render_time_ms) override {
- LOG(LS_ERROR) << "The NullVideoDecoder doesn't support decoding.";
+ RTC_LOG(LS_ERROR) << "The NullVideoDecoder doesn't support decoding.";
return WEBRTC_VIDEO_CODEC_OK;
}
int32_t RegisterDecodeCompleteCallback(
webrtc::DecodedImageCallback* callback) override {
- LOG(LS_ERROR)
+ RTC_LOG(LS_ERROR)
<< "Can't register decode complete callback on NullVideoDecoder.";
return WEBRTC_VIDEO_CODEC_OK;
}
@@ -68,8 +68,8 @@
// This could happen in a software-fallback for a codec type only
// supported externally (e.g. H.264 on iOS or Android) or in current usage
// in WebRtcVideoEngine if the external decoder fails to be created.
- LOG(LS_ERROR) << "Unable to create an H.264 decoder fallback. "
- << "Decoding of this stream will be broken.";
+ RTC_LOG(LS_ERROR) << "Unable to create an H.264 decoder fallback. "
+ << "Decoding of this stream will be broken.";
return new NullVideoDecoder();
case webrtc::kVideoCodecVP8:
return webrtc::VP8Decoder::Create();
@@ -77,7 +77,7 @@
RTC_DCHECK(webrtc::VP9Decoder::IsSupported());
return webrtc::VP9Decoder::Create();
default:
- LOG(LS_ERROR) << "Creating NullVideoDecoder for unsupported codec.";
+ RTC_LOG(LS_ERROR) << "Creating NullVideoDecoder for unsupported codec.";
return new NullVideoDecoder();
}
}
diff --git a/media/engine/simulcast.cc b/media/engine/simulcast.cc
index f2b3c3a..c2ac2d5 100644
--- a/media/engine/simulcast.cc
+++ b/media/engine/simulcast.cc
@@ -149,14 +149,14 @@
bool SlotSimulcastMaxResolution(size_t max_layers, int* width, int* height) {
int index = FindSimulcastFormatIndex(*width, *height, max_layers);
if (index == -1) {
- LOG(LS_ERROR) << "SlotSimulcastMaxResolution";
+ RTC_LOG(LS_ERROR) << "SlotSimulcastMaxResolution";
return false;
}
*width = kSimulcastFormats[index].width;
*height = kSimulcastFormats[index].height;
- LOG(LS_INFO) << "SlotSimulcastMaxResolution to width:" << *width
- << " height:" << *height;
+ RTC_LOG(LS_INFO) << "SlotSimulcastMaxResolution to width:" << *width
+ << " height:" << *height;
return true;
}
@@ -300,8 +300,9 @@
ScreenshareLayerConfig config(kScreenshareDefaultTl0BitrateKbps,
kScreenshareDefaultTl1BitrateKbps);
if (!group.empty() && !FromFieldTrialGroup(group, &config)) {
- LOG(LS_WARNING) << "Unable to parse WebRTC-ScreenshareLayerRates"
- " field trial group: '" << group << "'.";
+ RTC_LOG(LS_WARNING) << "Unable to parse WebRTC-ScreenshareLayerRates"
+ " field trial group: '"
+ << group << "'.";
}
return config;
}
diff --git a/media/engine/videodecodersoftwarefallbackwrapper.cc b/media/engine/videodecodersoftwarefallbackwrapper.cc
index 9d6274d..101b444 100644
--- a/media/engine/videodecodersoftwarefallbackwrapper.cc
+++ b/media/engine/videodecodersoftwarefallbackwrapper.cc
@@ -53,13 +53,13 @@
bool VideoDecoderSoftwareFallbackWrapper::InitFallbackDecoder() {
RTC_CHECK(codec_type_ != kVideoCodecUnknown)
<< "Decoder requesting fallback to codec not supported in software.";
- LOG(LS_WARNING) << "Decoder falling back to software decoding.";
+ RTC_LOG(LS_WARNING) << "Decoder falling back to software decoding.";
cricket::InternalDecoderFactory internal_decoder_factory;
fallback_decoder_.reset(
internal_decoder_factory.CreateVideoDecoder(codec_type_));
if (fallback_decoder_->InitDecode(&codec_settings_, number_of_cores_) !=
WEBRTC_VIDEO_CODEC_OK) {
- LOG(LS_ERROR) << "Failed to initialize software-decoder fallback.";
+ RTC_LOG(LS_ERROR) << "Failed to initialize software-decoder fallback.";
fallback_decoder_.reset();
return false;
}
@@ -95,7 +95,7 @@
if (ret == WEBRTC_VIDEO_CODEC_OK) {
if (fallback_decoder_) {
// Decode OK -> stop using fallback decoder.
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "Decode OK, no longer using the software fallback decoder.";
fallback_decoder_->Release();
fallback_decoder_.reset();
@@ -125,7 +125,7 @@
int32_t VideoDecoderSoftwareFallbackWrapper::Release() {
if (fallback_decoder_) {
- LOG(LS_INFO) << "Releasing software fallback decoder.";
+ RTC_LOG(LS_INFO) << "Releasing software fallback decoder.";
fallback_decoder_->Release();
fallback_decoder_.reset();
}
diff --git a/media/engine/videoencodersoftwarefallbackwrapper.cc b/media/engine/videoencodersoftwarefallbackwrapper.cc
index daee90e..1a07cd8 100644
--- a/media/engine/videoencodersoftwarefallbackwrapper.cc
+++ b/media/engine/videoencodersoftwarefallbackwrapper.cc
@@ -55,12 +55,13 @@
int min_pixels;
if (sscanf(group.c_str(), "Enabled-%d,%d,%d,%d", &low_kbps, &high_kbps,
&min_low_ms, &min_pixels) != 4) {
- LOG(LS_WARNING) << "Invalid number of forced fallback parameters provided.";
+ RTC_LOG(LS_WARNING)
+ << "Invalid number of forced fallback parameters provided.";
return;
}
if (min_low_ms <= 0 || min_pixels <= 0 || low_kbps <= 0 ||
high_kbps <= low_kbps) {
- LOG(LS_WARNING) << "Invalid forced fallback parameter value provided.";
+ RTC_LOG(LS_WARNING) << "Invalid forced fallback parameter value provided.";
return;
}
*param_low_kbps = low_kbps;
@@ -91,11 +92,11 @@
}
bool VideoEncoderSoftwareFallbackWrapper::InitFallbackEncoder() {
- LOG(LS_WARNING) << "Encoder falling back to software encoding.";
+ RTC_LOG(LS_WARNING) << "Encoder falling back to software encoding.";
MaybeModifyCodecForFallback();
cricket::InternalEncoderFactory internal_factory;
if (!FindMatchingCodec(internal_factory.supported_codecs(), codec_)) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "Encoder requesting fallback to codec not supported in software.";
return false;
}
@@ -103,7 +104,7 @@
if (fallback_encoder_->InitEncode(&codec_settings_, number_of_cores_,
max_payload_size_) !=
WEBRTC_VIDEO_CODEC_OK) {
- LOG(LS_ERROR) << "Failed to initialize software-encoder fallback.";
+ RTC_LOG(LS_ERROR) << "Failed to initialize software-encoder fallback.";
fallback_encoder_->Release();
fallback_encoder_.reset();
return false;
@@ -150,7 +151,7 @@
encoder_->InitEncode(codec_settings, number_of_cores, max_payload_size);
if (ret == WEBRTC_VIDEO_CODEC_OK || codec_.name.empty()) {
if (fallback_encoder_) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "InitEncode OK, no longer using the software fallback encoder.";
fallback_encoder_->Release();
}
@@ -193,8 +194,9 @@
// Frame may have been converted from kNative to kI420 during fallback.
if (encoder_->SupportsNativeHandle() &&
frame.video_frame_buffer()->type() != VideoFrameBuffer::Type::kNative) {
- LOG(LS_WARNING) << "Encoder supports native frames, dropping one frame "
- << "to avoid possible reconfig due to format change.";
+ RTC_LOG(LS_WARNING)
+ << "Encoder supports native frames, dropping one frame "
+ << "to avoid possible reconfig due to format change.";
return WEBRTC_VIDEO_CODEC_ERROR;
}
}
@@ -211,8 +213,8 @@
forced_fallback_.Reset(); // Not a forced fallback.
if (frame.video_frame_buffer()->type() == VideoFrameBuffer::Type::kNative &&
!fallback_encoder_->SupportsNativeHandle()) {
- LOG(LS_WARNING) << "Fallback encoder doesn't support native frames, "
- << "dropping one frame.";
+ RTC_LOG(LS_WARNING) << "Fallback encoder doesn't support native frames, "
+ << "dropping one frame.";
return WEBRTC_VIDEO_CODEC_ERROR;
}
@@ -291,7 +293,8 @@
// Release the forced fallback encoder.
if (encoder_->InitEncode(&codec_settings_, number_of_cores_,
max_payload_size_) == WEBRTC_VIDEO_CODEC_OK) {
- LOG(LS_INFO) << "Stop forced SW encoder fallback, max bitrate exceeded.";
+ RTC_LOG(LS_INFO)
+ << "Stop forced SW encoder fallback, max bitrate exceeded.";
fallback_encoder_->Release();
fallback_encoder_.reset();
forced_fallback_.Reset();
@@ -306,14 +309,14 @@
// Encoder reconfigured.
if (!forced_fallback_.IsValid(codec_settings_)) {
- LOG(LS_INFO) << "Stop forced SW encoder fallback, max pixels exceeded.";
+ RTC_LOG(LS_INFO) << "Stop forced SW encoder fallback, max pixels exceeded.";
return false;
}
// Settings valid, reinitialize the forced fallback encoder.
if (fallback_encoder_->InitEncode(&codec_settings_, number_of_cores_,
max_payload_size_) !=
WEBRTC_VIDEO_CODEC_OK) {
- LOG(LS_ERROR) << "Failed to init forced SW encoder fallback.";
+ RTC_LOG(LS_ERROR) << "Failed to init forced SW encoder fallback.";
return false;
}
return true;
@@ -328,7 +331,7 @@
fallback_encoder_->Release();
fallback_encoder_.reset();
}
- LOG(LS_INFO) << "Disable forced_fallback_possible_ due to settings.";
+ RTC_LOG(LS_INFO) << "Disable forced_fallback_possible_ due to settings.";
forced_fallback_possible_ = false;
}
}
@@ -347,7 +350,7 @@
start_ms.emplace(now_ms);
if ((now_ms - *start_ms) >= min_low_ms) {
- LOG(LS_INFO) << "Request forced SW encoder fallback.";
+ RTC_LOG(LS_INFO) << "Request forced SW encoder fallback.";
// In case the request fails, update time to avoid too frequent requests.
start_ms.emplace(now_ms);
return true;
diff --git a/media/engine/webrtcmediaengine.cc b/media/engine/webrtcmediaengine.cc
index b82b279..869ef21 100644
--- a/media/engine/webrtcmediaengine.cc
+++ b/media/engine/webrtcmediaengine.cc
@@ -181,11 +181,12 @@
bool id_used[14] = {false};
for (const auto& extension : extensions) {
if (extension.id <= 0 || extension.id >= 15) {
- LOG(LS_ERROR) << "Bad RTP extension ID: " << extension.ToString();
+ RTC_LOG(LS_ERROR) << "Bad RTP extension ID: " << extension.ToString();
return false;
}
if (id_used[extension.id - 1]) {
- LOG(LS_ERROR) << "Duplicate RTP extension ID: " << extension.ToString();
+ RTC_LOG(LS_ERROR) << "Duplicate RTP extension ID: "
+ << extension.ToString();
return false;
}
id_used[extension.id - 1] = true;
@@ -206,7 +207,8 @@
if (supported(extension.uri)) {
result.push_back(extension);
} else {
- LOG(LS_WARNING) << "Unsupported RTP extension: " << extension.ToString();
+ RTC_LOG(LS_WARNING) << "Unsupported RTP extension: "
+ << extension.ToString();
}
}
diff --git a/media/engine/webrtcvideocapturer.cc b/media/engine/webrtcvideocapturer.cc
index 47bbbe8..4d8db6e 100644
--- a/media/engine/webrtcvideocapturer.cc
+++ b/media/engine/webrtcvideocapturer.cc
@@ -123,7 +123,7 @@
bool WebRtcVideoCapturer::Init(const Device& device) {
RTC_DCHECK(!start_thread_);
if (module_) {
- LOG(LS_ERROR) << "The capturer is already initialized";
+ RTC_LOG(LS_ERROR) << "The capturer is already initialized";
return false;
}
@@ -149,7 +149,7 @@
}
}
if (!found) {
- LOG(LS_WARNING) << "Failed to find capturer for id: " << device.id;
+ RTC_LOG(LS_WARNING) << "Failed to find capturer for id: " << device.id;
factory_->DestroyDeviceInfo(info);
return false;
}
@@ -165,21 +165,21 @@
if (CapabilityToFormat(cap, &format)) {
supported.push_back(format);
} else {
- LOG(LS_WARNING) << "Ignoring unsupported WebRTC capture format "
- << static_cast<int>(cap.videoType);
+ RTC_LOG(LS_WARNING) << "Ignoring unsupported WebRTC capture format "
+ << static_cast<int>(cap.videoType);
}
}
}
factory_->DestroyDeviceInfo(info);
if (supported.empty()) {
- LOG(LS_ERROR) << "Failed to find usable formats for id: " << device.id;
+ RTC_LOG(LS_ERROR) << "Failed to find usable formats for id: " << device.id;
return false;
}
module_ = factory_->Create(vcm_id);
if (!module_) {
- LOG(LS_ERROR) << "Failed to create capturer for id: " << device.id;
+ RTC_LOG(LS_ERROR) << "Failed to create capturer for id: " << device.id;
return false;
}
@@ -194,11 +194,11 @@
const rtc::scoped_refptr<webrtc::VideoCaptureModule>& module) {
RTC_DCHECK(!start_thread_);
if (module_) {
- LOG(LS_ERROR) << "The capturer is already initialized";
+ RTC_LOG(LS_ERROR) << "The capturer is already initialized";
return false;
}
if (!module) {
- LOG(LS_ERROR) << "Invalid VCM supplied";
+ RTC_LOG(LS_ERROR) << "Invalid VCM supplied";
return false;
}
// TODO(juberti): Set id and formats.
@@ -219,9 +219,9 @@
best_format->height = desired.height;
best_format->fourcc = FOURCC_I420;
best_format->interval = desired.interval;
- LOG(LS_INFO) << "Failed to find best capture format,"
- << " fall back to the requested format "
- << best_format->ToString();
+ RTC_LOG(LS_INFO) << "Failed to find best capture format,"
+ << " fall back to the requested format "
+ << best_format->ToString();
}
return true;
}
@@ -243,11 +243,11 @@
CaptureState WebRtcVideoCapturer::Start(const VideoFormat& capture_format) {
if (!module_) {
- LOG(LS_ERROR) << "The capturer has not been initialized";
+ RTC_LOG(LS_ERROR) << "The capturer has not been initialized";
return CS_FAILED;
}
if (start_thread_) {
- LOG(LS_ERROR) << "The capturer is already running";
+ RTC_LOG(LS_ERROR) << "The capturer is already running";
RTC_DCHECK(start_thread_->IsCurrent())
<< "Trying to start capturer on different threads";
return CS_FAILED;
@@ -260,23 +260,23 @@
webrtc::VideoCaptureCapability cap;
if (!FormatToCapability(capture_format, &cap)) {
- LOG(LS_ERROR) << "Invalid capture format specified";
+ RTC_LOG(LS_ERROR) << "Invalid capture format specified";
return CS_FAILED;
}
int64_t start = rtc::TimeMillis();
module_->RegisterCaptureDataCallback(this);
if (module_->StartCapture(cap) != 0) {
- LOG(LS_ERROR) << "Camera '" << GetId() << "' failed to start";
+ RTC_LOG(LS_ERROR) << "Camera '" << GetId() << "' failed to start";
module_->DeRegisterCaptureDataCallback();
SetCaptureFormat(nullptr);
start_thread_ = nullptr;
return CS_FAILED;
}
- LOG(LS_INFO) << "Camera '" << GetId() << "' started with format "
- << capture_format.ToString() << ", elapsed time "
- << rtc::TimeSince(start) << " ms";
+ RTC_LOG(LS_INFO) << "Camera '" << GetId() << "' started with format "
+ << capture_format.ToString() << ", elapsed time "
+ << rtc::TimeSince(start) << " ms";
SetCaptureState(CS_RUNNING);
return CS_STARTING;
@@ -284,7 +284,7 @@
void WebRtcVideoCapturer::Stop() {
if (!start_thread_) {
- LOG(LS_ERROR) << "The capturer is already stopped";
+ RTC_LOG(LS_ERROR) << "The capturer is already stopped";
return;
}
RTC_DCHECK(start_thread_);
@@ -298,9 +298,9 @@
// TODO(juberti): Determine if the VCM exposes any drop stats we can use.
double drop_ratio = 0.0;
- LOG(LS_INFO) << "Camera '" << GetId() << "' stopped after capturing "
- << captured_frames_ << " frames and dropping "
- << drop_ratio << "%";
+ RTC_LOG(LS_INFO) << "Camera '" << GetId() << "' stopped after capturing "
+ << captured_frames_ << " frames and dropping " << drop_ratio
+ << "%";
SetCaptureFormat(NULL);
start_thread_ = nullptr;
@@ -331,9 +331,9 @@
++captured_frames_;
// Log the size and pixel aspect ratio of the first captured frame.
if (1 == captured_frames_) {
- LOG(LS_INFO) << "Captured frame size "
- << sample.width() << "x" << sample.height()
- << ". Expected format " << GetCaptureFormat()->ToString();
+ RTC_LOG(LS_INFO) << "Captured frame size " << sample.width() << "x"
+ << sample.height() << ". Expected format "
+ << GetCaptureFormat()->ToString();
}
VideoCapturer::OnFrame(sample, sample.width(), sample.height());
diff --git a/media/engine/webrtcvideoengine.cc b/media/engine/webrtcvideoengine.cc
index 3a99fc3..8c4ffe8 100644
--- a/media/engine/webrtcvideoengine.cc
+++ b/media/engine/webrtcvideoengine.cc
@@ -185,8 +185,8 @@
}
}
if (!has_video) {
- LOG(LS_ERROR) << "Setting codecs without a video codec is invalid: "
- << CodecVectorToString(codecs);
+ RTC_LOG(LS_ERROR) << "Setting codecs without a video codec is invalid: "
+ << CodecVectorToString(codecs);
return false;
}
return true;
@@ -194,7 +194,7 @@
static bool ValidateStreamParams(const StreamParams& sp) {
if (sp.ssrcs.empty()) {
- LOG(LS_ERROR) << "No SSRCs in stream parameters: " << sp.ToString();
+ RTC_LOG(LS_ERROR) << "No SSRCs in stream parameters: " << sp.ToString();
return false;
}
@@ -211,13 +211,14 @@
}
}
if (!rtx_ssrc_present) {
- LOG(LS_ERROR) << "RTX SSRC '" << rtx_ssrc
- << "' missing from StreamParams ssrcs: " << sp.ToString();
+ RTC_LOG(LS_ERROR) << "RTX SSRC '" << rtx_ssrc
+ << "' missing from StreamParams ssrcs: "
+ << sp.ToString();
return false;
}
}
if (!rtx_ssrcs.empty() && primary_ssrcs.size() != rtx_ssrcs.size()) {
- LOG(LS_ERROR)
+ RTC_LOG(LS_ERROR)
<< "RTX SSRCs exist, but don't cover all SSRCs (unsupported): "
<< sp.ToString();
return false;
@@ -368,16 +369,17 @@
channel->GetDefaultReceiveStreamSsrc();
if (default_recv_ssrc) {
- LOG(LS_INFO) << "Destroying old default receive stream for SSRC=" << ssrc
- << ".";
+ RTC_LOG(LS_INFO) << "Destroying old default receive stream for SSRC="
+ << ssrc << ".";
channel->RemoveRecvStream(*default_recv_ssrc);
}
StreamParams sp;
sp.ssrcs.push_back(ssrc);
- LOG(LS_INFO) << "Creating default receive stream for SSRC=" << ssrc << ".";
+ RTC_LOG(LS_INFO) << "Creating default receive stream for SSRC=" << ssrc
+ << ".";
if (!channel->AddRecvStream(sp, true)) {
- LOG(LS_WARNING) << "Could not create default receive stream.";
+ RTC_LOG(LS_WARNING) << "Could not create default receive stream.";
}
channel->SetSink(ssrc, default_sink_);
@@ -407,7 +409,7 @@
new DecoderFactoryAdapter(std::move(external_video_decoder_factory))),
encoder_factory_(ConvertVideoEncoderFactory(
std::move(external_video_encoder_factory))) {
- LOG(LS_INFO) << "WebRtcVideoEngine::WebRtcVideoEngine()";
+ RTC_LOG(LS_INFO) << "WebRtcVideoEngine::WebRtcVideoEngine()";
}
WebRtcVideoEngine::WebRtcVideoEngine(
@@ -416,18 +418,18 @@
: decoder_factory_(
new DecoderFactoryAdapter(std::move(video_decoder_factory))),
encoder_factory_(std::move(video_encoder_factory)) {
- LOG(LS_INFO) << "WebRtcVideoEngine::WebRtcVideoEngine()";
+ RTC_LOG(LS_INFO) << "WebRtcVideoEngine::WebRtcVideoEngine()";
}
WebRtcVideoEngine::~WebRtcVideoEngine() {
- LOG(LS_INFO) << "WebRtcVideoEngine::~WebRtcVideoEngine";
+ RTC_LOG(LS_INFO) << "WebRtcVideoEngine::~WebRtcVideoEngine";
}
WebRtcVideoChannel* WebRtcVideoEngine::CreateChannel(
webrtc::Call* call,
const MediaConfig& config,
const VideoOptions& options) {
- LOG(LS_INFO) << "CreateChannel. Options: " << options.ToString();
+ RTC_LOG(LS_INFO) << "CreateChannel. Options: " << options.ToString();
return new WebRtcVideoChannel(call, config, options, encoder_factory_.get(),
decoder_factory_.get());
}
@@ -595,15 +597,16 @@
SelectSendVideoCodec(MapCodecs(params.codecs));
if (!selected_send_codec) {
- LOG(LS_ERROR) << "No video codecs supported.";
+ RTC_LOG(LS_ERROR) << "No video codecs supported.";
return false;
}
// Never enable sending FlexFEC, unless we are in the experiment.
if (!IsFlexfecFieldTrialEnabled()) {
if (selected_send_codec->flexfec_payload_type != -1) {
- LOG(LS_INFO) << "Remote supports flexfec-03, but we will not send since "
- << "WebRTC-FlexFEC-03 field trial is not enabled.";
+ RTC_LOG(LS_INFO)
+ << "Remote supports flexfec-03, but we will not send since "
+ << "WebRTC-FlexFEC-03 field trial is not enabled.";
}
selected_send_codec->flexfec_payload_type = -1;
}
@@ -651,7 +654,7 @@
bool WebRtcVideoChannel::SetSendParameters(const VideoSendParameters& params) {
TRACE_EVENT0("webrtc", "WebRtcVideoChannel::SetSendParameters");
- LOG(LS_INFO) << "SetSendParameters: " << params.ToString();
+ RTC_LOG(LS_INFO) << "SetSendParameters: " << params.ToString();
ChangedSendParameters changed_params;
if (!GetChangedSendParameters(params, &changed_params)) {
return false;
@@ -660,7 +663,7 @@
if (changed_params.codec) {
const VideoCodecSettings& codec_settings = *changed_params.codec;
send_codec_ = rtc::Optional<VideoCodecSettings>(codec_settings);
- LOG(LS_INFO) << "Using codec: " << codec_settings.codec.ToString();
+ RTC_LOG(LS_INFO) << "Using codec: " << codec_settings.codec.ToString();
}
if (changed_params.rtp_header_extensions) {
@@ -708,7 +711,7 @@
}
if (changed_params.codec || changed_params.rtcp_mode) {
// Update receive feedback parameters from new codec or RTCP mode.
- LOG(LS_INFO)
+ RTC_LOG(LS_INFO)
<< "SetFeedbackOptions on all the receive streams because the send "
"codec or RTCP mode has changed.";
for (auto& kv : receive_streams_) {
@@ -730,8 +733,8 @@
rtc::CritScope stream_lock(&stream_crit_);
auto it = send_streams_.find(ssrc);
if (it == send_streams_.end()) {
- LOG(LS_WARNING) << "Attempting to get RTP send parameters for stream "
- << "with ssrc " << ssrc << " which doesn't exist.";
+ RTC_LOG(LS_WARNING) << "Attempting to get RTP send parameters for stream "
+ << "with ssrc " << ssrc << " which doesn't exist.";
return webrtc::RtpParameters();
}
@@ -751,8 +754,8 @@
rtc::CritScope stream_lock(&stream_crit_);
auto it = send_streams_.find(ssrc);
if (it == send_streams_.end()) {
- LOG(LS_ERROR) << "Attempting to set RTP send parameters for stream "
- << "with ssrc " << ssrc << " which doesn't exist.";
+ RTC_LOG(LS_ERROR) << "Attempting to set RTP send parameters for stream "
+ << "with ssrc " << ssrc << " which doesn't exist.";
return false;
}
@@ -760,8 +763,8 @@
// different order (which should change the send codec).
webrtc::RtpParameters current_parameters = GetRtpSendParameters(ssrc);
if (current_parameters.codecs != parameters.codecs) {
- LOG(LS_ERROR) << "Using SetParameters to change the set of codecs "
- << "is not currently supported.";
+ RTC_LOG(LS_ERROR) << "Using SetParameters to change the set of codecs "
+ << "is not currently supported.";
return false;
}
@@ -775,17 +778,19 @@
// SSRC of 0 represents an unsignaled receive stream.
if (ssrc == 0) {
if (!default_unsignalled_ssrc_handler_.GetDefaultSink()) {
- LOG(LS_WARNING) << "Attempting to get RTP parameters for the default, "
- "unsignaled video receive stream, but not yet "
- "configured to receive such a stream.";
+ RTC_LOG(LS_WARNING)
+ << "Attempting to get RTP parameters for the default, "
+ "unsignaled video receive stream, but not yet "
+ "configured to receive such a stream.";
return rtp_params;
}
rtp_params.encodings.emplace_back();
} else {
auto it = receive_streams_.find(ssrc);
if (it == receive_streams_.end()) {
- LOG(LS_WARNING) << "Attempting to get RTP receive parameters for stream "
- << "with SSRC " << ssrc << " which doesn't exist.";
+ RTC_LOG(LS_WARNING)
+ << "Attempting to get RTP receive parameters for stream "
+ << "with SSRC " << ssrc << " which doesn't exist.";
return webrtc::RtpParameters();
}
// TODO(deadbeef): Return stream-specific parameters, beyond just SSRC.
@@ -809,24 +814,26 @@
// SSRC of 0 represents an unsignaled receive stream.
if (ssrc == 0) {
if (!default_unsignalled_ssrc_handler_.GetDefaultSink()) {
- LOG(LS_WARNING) << "Attempting to set RTP parameters for the default, "
- "unsignaled video receive stream, but not yet "
- "configured to receive such a stream.";
+ RTC_LOG(LS_WARNING)
+ << "Attempting to set RTP parameters for the default, "
+ "unsignaled video receive stream, but not yet "
+ "configured to receive such a stream.";
return false;
}
} else {
auto it = receive_streams_.find(ssrc);
if (it == receive_streams_.end()) {
- LOG(LS_WARNING) << "Attempting to set RTP receive parameters for stream "
- << "with SSRC " << ssrc << " which doesn't exist.";
+ RTC_LOG(LS_WARNING)
+ << "Attempting to set RTP receive parameters for stream "
+ << "with SSRC " << ssrc << " which doesn't exist.";
return false;
}
}
webrtc::RtpParameters current_parameters = GetRtpReceiveParameters(ssrc);
if (current_parameters != parameters) {
- LOG(LS_ERROR) << "Changing the RTP receive parameters is currently "
- << "unsupported.";
+ RTC_LOG(LS_ERROR) << "Changing the RTP receive parameters is currently "
+ << "unsupported.";
return false;
}
return true;
@@ -844,7 +851,7 @@
const std::vector<VideoCodecSettings> mapped_codecs =
MapCodecs(params.codecs);
if (mapped_codecs.empty()) {
- LOG(LS_ERROR) << "SetRecvParameters called without any video codecs.";
+ RTC_LOG(LS_ERROR) << "SetRecvParameters called without any video codecs.";
return false;
}
@@ -853,8 +860,9 @@
AssignPayloadTypesAndAddAssociatedRtxCodecs(encoder_factory_);
for (const VideoCodecSettings& mapped_codec : mapped_codecs) {
if (!FindMatchingCodec(local_supported_codecs, mapped_codec.codec)) {
- LOG(LS_ERROR) << "SetRecvParameters called with unsupported video codec: "
- << mapped_codec.codec.ToString();
+ RTC_LOG(LS_ERROR)
+ << "SetRecvParameters called with unsupported video codec: "
+ << mapped_codec.codec.ToString();
return false;
}
}
@@ -883,24 +891,25 @@
bool WebRtcVideoChannel::SetRecvParameters(const VideoRecvParameters& params) {
TRACE_EVENT0("webrtc", "WebRtcVideoChannel::SetRecvParameters");
- LOG(LS_INFO) << "SetRecvParameters: " << params.ToString();
+ RTC_LOG(LS_INFO) << "SetRecvParameters: " << params.ToString();
ChangedRecvParameters changed_params;
if (!GetChangedRecvParameters(params, &changed_params)) {
return false;
}
if (changed_params.flexfec_payload_type) {
- LOG(LS_INFO) << "Changing FlexFEC payload type (recv) from "
- << recv_flexfec_payload_type_ << " to "
- << *changed_params.flexfec_payload_type;
+ RTC_LOG(LS_INFO) << "Changing FlexFEC payload type (recv) from "
+ << recv_flexfec_payload_type_ << " to "
+ << *changed_params.flexfec_payload_type;
recv_flexfec_payload_type_ = *changed_params.flexfec_payload_type;
}
if (changed_params.rtp_header_extensions) {
recv_rtp_extensions_ = *changed_params.rtp_header_extensions;
}
if (changed_params.codec_settings) {
- LOG(LS_INFO) << "Changing recv codecs from "
- << CodecSettingsVectorToString(recv_codecs_) << " to "
- << CodecSettingsVectorToString(*changed_params.codec_settings);
+ RTC_LOG(LS_INFO) << "Changing recv codecs from "
+ << CodecSettingsVectorToString(recv_codecs_) << " to "
+ << CodecSettingsVectorToString(
+ *changed_params.codec_settings);
recv_codecs_ = *changed_params.codec_settings;
}
@@ -930,7 +939,7 @@
bool WebRtcVideoChannel::GetSendCodec(VideoCodec* codec) {
if (!send_codec_) {
- LOG(LS_VERBOSE) << "GetSendCodec: No send codec set.";
+ RTC_LOG(LS_VERBOSE) << "GetSendCodec: No send codec set.";
return false;
}
*codec = send_codec_->codec;
@@ -939,9 +948,9 @@
bool WebRtcVideoChannel::SetSend(bool send) {
TRACE_EVENT0("webrtc", "WebRtcVideoChannel::SetSend");
- LOG(LS_VERBOSE) << "SetSend: " << (send ? "true" : "false");
+ RTC_LOG(LS_VERBOSE) << "SetSend: " << (send ? "true" : "false");
if (send && !send_codec_) {
- LOG(LS_ERROR) << "SetSend(true) called before setting codec.";
+ RTC_LOG(LS_ERROR) << "SetSend(true) called before setting codec.";
return false;
}
{
@@ -964,16 +973,17 @@
rtc::VideoSourceInterface<webrtc::VideoFrame>* source) {
TRACE_EVENT0("webrtc", "SetVideoSend");
RTC_DCHECK(ssrc != 0);
- LOG(LS_INFO) << "SetVideoSend (ssrc= " << ssrc << ", enable = " << enable
- << ", options: " << (options ? options->ToString() : "nullptr")
- << ", source = " << (source ? "(source)" : "nullptr") << ")";
+ RTC_LOG(LS_INFO) << "SetVideoSend (ssrc= " << ssrc << ", enable = " << enable
+ << ", options: "
+ << (options ? options->ToString() : "nullptr")
+ << ", source = " << (source ? "(source)" : "nullptr") << ")";
rtc::CritScope stream_lock(&stream_crit_);
const auto& kv = send_streams_.find(ssrc);
if (kv == send_streams_.end()) {
// Allow unknown ssrc only if source is null.
RTC_CHECK(source == nullptr);
- LOG(LS_ERROR) << "No sending stream on ssrc " << ssrc;
+ RTC_LOG(LS_ERROR) << "No sending stream on ssrc " << ssrc;
return false;
}
@@ -984,7 +994,8 @@
const StreamParams& sp) const {
for (uint32_t ssrc : sp.ssrcs) {
if (send_ssrcs_.find(ssrc) != send_ssrcs_.end()) {
- LOG(LS_ERROR) << "Send stream with SSRC '" << ssrc << "' already exists.";
+ RTC_LOG(LS_ERROR) << "Send stream with SSRC '" << ssrc
+ << "' already exists.";
return false;
}
}
@@ -995,8 +1006,8 @@
const StreamParams& sp) const {
for (uint32_t ssrc : sp.ssrcs) {
if (receive_ssrcs_.find(ssrc) != receive_ssrcs_.end()) {
- LOG(LS_ERROR) << "Receive stream with SSRC '" << ssrc
- << "' already exists.";
+ RTC_LOG(LS_ERROR) << "Receive stream with SSRC '" << ssrc
+ << "' already exists.";
return false;
}
}
@@ -1004,7 +1015,7 @@
}
bool WebRtcVideoChannel::AddSendStream(const StreamParams& sp) {
- LOG(LS_INFO) << "AddSendStream: " << sp.ToString();
+ RTC_LOG(LS_INFO) << "AddSendStream: " << sp.ToString();
if (!ValidateStreamParams(sp))
return false;
@@ -1032,8 +1043,9 @@
if (rtcp_receiver_report_ssrc_ == kDefaultRtcpReceiverReportSsrc) {
rtcp_receiver_report_ssrc_ = ssrc;
- LOG(LS_INFO) << "SetLocalSsrc on all the receive streams because we added "
- "a send stream.";
+ RTC_LOG(LS_INFO)
+ << "SetLocalSsrc on all the receive streams because we added "
+ "a send stream.";
for (auto& kv : receive_streams_)
kv.second->SetLocalSsrc(ssrc);
}
@@ -1045,7 +1057,7 @@
}
bool WebRtcVideoChannel::RemoveSendStream(uint32_t ssrc) {
- LOG(LS_INFO) << "RemoveSendStream: " << ssrc;
+ RTC_LOG(LS_INFO) << "RemoveSendStream: " << ssrc;
WebRtcVideoSendStream* removed_stream;
{
@@ -1067,8 +1079,8 @@
rtcp_receiver_report_ssrc_ = send_streams_.empty()
? kDefaultRtcpReceiverReportSsrc
: send_streams_.begin()->first;
- LOG(LS_INFO) << "SetLocalSsrc on all the receive streams because the "
- "previous local SSRC was removed.";
+ RTC_LOG(LS_INFO) << "SetLocalSsrc on all the receive streams because the "
+ "previous local SSRC was removed.";
for (auto& kv : receive_streams_) {
kv.second->SetLocalSsrc(rtcp_receiver_report_ssrc_);
@@ -1096,8 +1108,9 @@
bool default_stream) {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
- LOG(LS_INFO) << "AddRecvStream" << (default_stream ? " (default stream)" : "")
- << ": " << sp.ToString();
+ RTC_LOG(LS_INFO) << "AddRecvStream"
+ << (default_stream ? " (default stream)" : "") << ": "
+ << sp.ToString();
if (!ValidateStreamParams(sp))
return false;
@@ -1109,8 +1122,8 @@
const auto& prev_stream = receive_streams_.find(ssrc);
if (prev_stream != receive_streams_.end()) {
if (default_stream || !prev_stream->second->IsDefaultStream()) {
- LOG(LS_ERROR) << "Receive stream for SSRC '" << ssrc
- << "' already exists.";
+ RTC_LOG(LS_ERROR) << "Receive stream for SSRC '" << ssrc
+ << "' already exists.";
return false;
}
DeleteReceiveStream(prev_stream->second);
@@ -1191,9 +1204,9 @@
}
bool WebRtcVideoChannel::RemoveRecvStream(uint32_t ssrc) {
- LOG(LS_INFO) << "RemoveRecvStream: " << ssrc;
+ RTC_LOG(LS_INFO) << "RemoveRecvStream: " << ssrc;
if (ssrc == 0) {
- LOG(LS_ERROR) << "RemoveRecvStream with 0 ssrc is not supported.";
+ RTC_LOG(LS_ERROR) << "RemoveRecvStream with 0 ssrc is not supported.";
return false;
}
@@ -1201,7 +1214,7 @@
std::map<uint32_t, WebRtcVideoReceiveStream*>::iterator stream =
receive_streams_.find(ssrc);
if (stream == receive_streams_.end()) {
- LOG(LS_ERROR) << "Stream not found for ssrc: " << ssrc;
+ RTC_LOG(LS_ERROR) << "Stream not found for ssrc: " << ssrc;
return false;
}
DeleteReceiveStream(stream->second);
@@ -1213,8 +1226,8 @@
bool WebRtcVideoChannel::SetSink(
uint32_t ssrc,
rtc::VideoSinkInterface<webrtc::VideoFrame>* sink) {
- LOG(LS_INFO) << "SetSink: ssrc:" << ssrc << " "
- << (sink ? "(ptr)" : "nullptr");
+ RTC_LOG(LS_INFO) << "SetSink: ssrc:" << ssrc << " "
+ << (sink ? "(ptr)" : "nullptr");
if (ssrc == 0) {
// Do not hold |stream_crit_| here, since SetDefaultSink will call
// WebRtcVideoChannel::GetDefaultReceiveStreamSsrc().
@@ -1259,7 +1272,7 @@
}
if (log_stats)
- LOG(LS_INFO) << stats.ToString(now_ms);
+ RTC_LOG(LS_INFO) << stats.ToString(now_ms);
return true;
}
@@ -1365,7 +1378,7 @@
webrtc::MediaType::VIDEO,
packet->cdata(), packet->size(),
webrtc_packet_time) != webrtc::PacketReceiver::DELIVERY_OK) {
- LOG(LS_WARNING) << "Failed to deliver RTP packet on re-delivery.";
+ RTC_LOG(LS_WARNING) << "Failed to deliver RTP packet on re-delivery.";
return;
}
}
@@ -1386,7 +1399,7 @@
}
void WebRtcVideoChannel::OnReadyToSend(bool ready) {
- LOG(LS_VERBOSE) << "OnReadyToSend: " << (ready ? "Ready." : "Not ready.");
+ RTC_LOG(LS_VERBOSE) << "OnReadyToSend: " << (ready ? "Ready." : "Not ready.");
call_->SignalChannelNetworkState(
webrtc::MediaType::VIDEO,
ready ? webrtc::kNetworkUp : webrtc::kNetworkDown);
@@ -1506,11 +1519,12 @@
for (uint32_t primary_ssrc : parameters_.config.rtp.ssrcs) {
if (sp.GetFecFrSsrc(primary_ssrc, &flexfec_ssrc)) {
if (flexfec_enabled) {
- LOG(LS_INFO) << "Multiple FlexFEC streams in local SDP, but "
- "our implementation only supports a single FlexFEC "
- "stream. Will not enable FlexFEC for proposed "
- "stream with SSRC: "
- << flexfec_ssrc << ".";
+ RTC_LOG(LS_INFO)
+ << "Multiple FlexFEC streams in local SDP, but "
+ "our implementation only supports a single FlexFEC "
+ "stream. Will not enable FlexFEC for proposed "
+ "stream with SSRC: "
+ << flexfec_ssrc << ".";
continue;
}
@@ -1648,8 +1662,9 @@
// Set RTX payload type if RTX is enabled.
if (!parameters_.config.rtp.rtx.ssrcs.empty()) {
if (codec_settings.rtx_payload_type == -1) {
- LOG(LS_WARNING) << "RTX SSRCs configured but there's no configured RTX "
- "payload type. Ignoring.";
+ RTC_LOG(LS_WARNING)
+ << "RTX SSRCs configured but there's no configured RTX "
+ "payload type. Ignoring.";
parameters_.config.rtp.rtx.ssrcs.clear();
} else {
parameters_.config.rtp.rtx.payload_type = codec_settings.rtx_payload_type;
@@ -1662,7 +1677,7 @@
parameters_.codec_settings =
rtc::Optional<WebRtcVideoChannel::VideoCodecSettings>(codec_settings);
- LOG(LS_INFO) << "RecreateWebRtcStream (send) because of SetCodec.";
+ RTC_LOG(LS_INFO) << "RecreateWebRtcStream (send) because of SetCodec.";
RecreateWebRtcStream();
allocated_encoder_ = std::move(new_encoder);
allocated_codec_ = codec_settings.codec;
@@ -1701,7 +1716,8 @@
recreate_stream = false; // SetCodec has already recreated the stream.
}
if (recreate_stream) {
- LOG(LS_INFO) << "RecreateWebRtcStream (send) because of SetSendParameters";
+ RTC_LOG(LS_INFO)
+ << "RecreateWebRtcStream (send) because of SetSendParameters";
RecreateWebRtcStream();
}
}
@@ -1736,12 +1752,12 @@
const webrtc::RtpParameters& rtp_parameters) {
RTC_DCHECK_RUN_ON(&thread_checker_);
if (rtp_parameters.encodings.size() != 1) {
- LOG(LS_ERROR)
+ RTC_LOG(LS_ERROR)
<< "Attempted to set RtpParameters without exactly one encoding";
return false;
}
if (rtp_parameters.encodings[0].ssrc != rtp_parameters_.encodings[0].ssrc) {
- LOG(LS_ERROR) << "Attempted to set RtpParameters with modified SSRC";
+ RTC_LOG(LS_ERROR) << "Attempted to set RtpParameters with modified SSRC";
return false;
}
return true;
@@ -1895,7 +1911,7 @@
webrtc::VideoSendStream::Stats stats = stream_->GetStats();
if (log_stats)
- LOG(LS_INFO) << stats.ToString(rtc::TimeMillis());
+ RTC_LOG(LS_INFO) << stats.ToString(rtc::TimeMillis());
info.adapt_changes = stats.number_of_cpu_adapt_changes;
info.adapt_reason =
@@ -1988,8 +2004,8 @@
webrtc::VideoSendStream::Config config = parameters_.config.Copy();
if (!config.rtp.rtx.ssrcs.empty() && config.rtp.rtx.payload_type == -1) {
- LOG(LS_WARNING) << "RTX SSRCs configured but there's no configured RTX "
- "payload type the set codec. Ignoring RTX.";
+ RTC_LOG(LS_WARNING) << "RTX SSRCs configured but there's no configured RTX "
+ "payload type the set codec. Ignoring RTX.";
config.rtp.rtx.ssrcs.clear();
}
stream_ = call_->CreateVideoSendStream(std::move(config),
@@ -2053,7 +2069,8 @@
stream_params_.GetPrimarySsrcs(&primary_ssrcs);
if (primary_ssrcs.empty()) {
- LOG(LS_WARNING) << "Empty primary ssrcs vector, returning empty optional";
+ RTC_LOG(LS_WARNING)
+ << "Empty primary ssrcs vector, returning empty optional";
return rtc::Optional<uint32_t>();
} else {
return rtc::Optional<uint32_t>(primary_ssrcs[0]);
@@ -2124,14 +2141,15 @@
// right now this can't be done due to unittests depending on receiving what
// they are sending from the same MediaChannel.
if (local_ssrc == config_.rtp.remote_ssrc) {
- LOG(LS_INFO) << "Ignoring call to SetLocalSsrc because parameters are "
- "unchanged; local_ssrc=" << local_ssrc;
+ RTC_LOG(LS_INFO) << "Ignoring call to SetLocalSsrc because parameters are "
+ "unchanged; local_ssrc="
+ << local_ssrc;
return;
}
config_.rtp.local_ssrc = local_ssrc;
flexfec_config_.local_ssrc = local_ssrc;
- LOG(LS_INFO)
+ RTC_LOG(LS_INFO)
<< "RecreateWebRtcStream (recv) because of SetLocalSsrc; local_ssrc="
<< local_ssrc;
MaybeRecreateWebRtcFlexfecStream();
@@ -2148,7 +2166,7 @@
config_.rtp.remb == remb_enabled &&
config_.rtp.transport_cc == transport_cc_enabled &&
config_.rtp.rtcp_mode == rtcp_mode) {
- LOG(LS_INFO)
+ RTC_LOG(LS_INFO)
<< "Ignoring call to SetFeedbackParameters because parameters are "
"unchanged; nack="
<< nack_enabled << ", remb=" << remb_enabled
@@ -2163,7 +2181,7 @@
// based on the rtcp-fb for the FlexFEC codec, not the media codec.
flexfec_config_.transport_cc = config_.rtp.transport_cc;
flexfec_config_.rtcp_mode = config_.rtp.rtcp_mode;
- LOG(LS_INFO)
+ RTC_LOG(LS_INFO)
<< "RecreateWebRtcStream (recv) because of SetFeedbackParameters; nack="
<< nack_enabled << ", remb=" << remb_enabled
<< ", transport_cc=" << transport_cc_enabled;
@@ -2191,12 +2209,12 @@
flexfec_needs_recreation = true;
}
if (flexfec_needs_recreation) {
- LOG(LS_INFO) << "MaybeRecreateWebRtcFlexfecStream (recv) because of "
- "SetRecvParameters";
+ RTC_LOG(LS_INFO) << "MaybeRecreateWebRtcFlexfecStream (recv) because of "
+ "SetRecvParameters";
MaybeRecreateWebRtcFlexfecStream();
}
if (video_needs_recreation) {
- LOG(LS_INFO)
+ RTC_LOG(LS_INFO)
<< "RecreateWebRtcVideoStream (recv) because of SetRecvParameters";
RecreateWebRtcVideoStream();
}
@@ -2258,7 +2276,7 @@
estimated_remote_start_ntp_time_ms_ = frame.ntp_time_ms() - elapsed_time_ms;
if (sink_ == NULL) {
- LOG(LS_WARNING) << "VideoReceiveStream not connected to a VideoSink.";
+ RTC_LOG(LS_WARNING) << "VideoReceiveStream not connected to a VideoSink.";
return;
}
@@ -2343,7 +2361,7 @@
info.timing_frame_info = stats.timing_frame_info;
if (log_stats)
- LOG(LS_INFO) << stats.ToString(rtc::TimeMillis());
+ RTC_LOG(LS_INFO) << stats.ToString(rtc::TimeMillis());
return info;
}
@@ -2388,8 +2406,8 @@
int payload_type = in_codec.id;
if (payload_used[payload_type]) {
- LOG(LS_ERROR) << "Payload type already registered: "
- << in_codec.ToString();
+ RTC_LOG(LS_ERROR) << "Payload type already registered: "
+ << in_codec.ToString();
return std::vector<VideoCodecSettings>();
}
payload_used[payload_type] = true;
@@ -2422,7 +2440,7 @@
if (!in_codec.GetParam(kCodecParamAssociatedPayloadType,
&associated_payload_type) ||
!IsValidRtpPayloadType(associated_payload_type)) {
- LOG(LS_ERROR)
+ RTC_LOG(LS_ERROR)
<< "RTX codec with invalid or no associated payload type: "
<< in_codec.ToString();
return std::vector<VideoCodecSettings>();
@@ -2447,12 +2465,13 @@
it != rtx_mapping.end();
++it) {
if (!payload_used[it->first]) {
- LOG(LS_ERROR) << "RTX mapped to payload not in codec list.";
+ RTC_LOG(LS_ERROR) << "RTX mapped to payload not in codec list.";
return std::vector<VideoCodecSettings>();
}
if (payload_codec_type[it->first] != VideoCodec::CODEC_VIDEO &&
payload_codec_type[it->first] != VideoCodec::CODEC_RED) {
- LOG(LS_ERROR) << "RTX not mapped to regular video codec or RED codec.";
+ RTC_LOG(LS_ERROR)
+ << "RTX not mapped to regular video codec or RED codec.";
return std::vector<VideoCodecSettings>();
}
diff --git a/media/engine/webrtcvoiceengine.cc b/media/engine/webrtcvoiceengine.cc
index e2428cf..1b3cde6 100644
--- a/media/engine/webrtcvoiceengine.cc
+++ b/media/engine/webrtcvoiceengine.cc
@@ -90,11 +90,12 @@
bool ValidateStreamParams(const StreamParams& sp) {
if (sp.ssrcs.empty()) {
- LOG(LS_ERROR) << "No SSRCs in stream parameters: " << sp.ToString();
+ RTC_LOG(LS_ERROR) << "No SSRCs in stream parameters: " << sp.ToString();
return false;
}
if (sp.ssrcs.size() > 1) {
- LOG(LS_ERROR) << "Multiple SSRCs in stream parameters: " << sp.ToString();
+ RTC_LOG(LS_ERROR) << "Multiple SSRCs in stream parameters: "
+ << sp.ToString();
return false;
}
return true;
@@ -191,10 +192,10 @@
// If codec is not multi-rate and |bps| is less than the fixed bitrate then
// fail. If codec is not multi-rate and |bps| exceeds or equal the fixed
// bitrate then ignore.
- LOG(LS_ERROR) << "Failed to set codec " << spec.format.name
- << " to bitrate " << bps << " bps"
- << ", requires at least " << spec.info.min_bitrate_bps
- << " bps.";
+ RTC_LOG(LS_ERROR) << "Failed to set codec " << spec.format.name
+ << " to bitrate " << bps << " bps"
+ << ", requires at least " << spec.info.min_bitrate_bps
+ << " bps.";
return rtc::Optional<int>();
}
@@ -237,7 +238,7 @@
// This may be called from any thread, so detach thread checkers.
worker_thread_checker_.DetachFromThread();
signal_thread_checker_.DetachFromThread();
- LOG(LS_INFO) << "WebRtcVoiceEngine::WebRtcVoiceEngine";
+ RTC_LOG(LS_INFO) << "WebRtcVoiceEngine::WebRtcVoiceEngine";
RTC_DCHECK(decoder_factory);
RTC_DCHECK(encoder_factory);
RTC_DCHECK(audio_processing);
@@ -246,7 +247,7 @@
WebRtcVoiceEngine::~WebRtcVoiceEngine() {
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
- LOG(LS_INFO) << "WebRtcVoiceEngine::~WebRtcVoiceEngine";
+ RTC_LOG(LS_INFO) << "WebRtcVoiceEngine::~WebRtcVoiceEngine";
if (initialized_) {
StopAecDump();
voe_wrapper_->base()->Terminate();
@@ -255,7 +256,7 @@
void WebRtcVoiceEngine::Init() {
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
- LOG(LS_INFO) << "WebRtcVoiceEngine::Init";
+ RTC_LOG(LS_INFO) << "WebRtcVoiceEngine::Init";
// TaskQueue expects to be created/destroyed on the same thread.
low_priority_worker_queue_.reset(
@@ -268,16 +269,16 @@
}
// Load our audio codec lists.
- LOG(LS_INFO) << "Supported send codecs in order of preference:";
+ RTC_LOG(LS_INFO) << "Supported send codecs in order of preference:";
send_codecs_ = CollectCodecs(encoder_factory_->GetSupportedEncoders());
for (const AudioCodec& codec : send_codecs_) {
- LOG(LS_INFO) << ToString(codec);
+ RTC_LOG(LS_INFO) << ToString(codec);
}
- LOG(LS_INFO) << "Supported recv codecs in order of preference:";
+ RTC_LOG(LS_INFO) << "Supported recv codecs in order of preference:";
recv_codecs_ = CollectCodecs(decoder_factory_->GetSupportedDecoders());
for (const AudioCodec& codec : recv_codecs_) {
- LOG(LS_INFO) << ToString(codec);
+ RTC_LOG(LS_INFO) << ToString(codec);
}
channel_config_.enable_voice_pacing = true;
@@ -353,23 +354,24 @@
bool WebRtcVoiceEngine::ApplyOptions(const AudioOptions& options_in) {
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
- LOG(LS_INFO) << "WebRtcVoiceEngine::ApplyOptions: " << options_in.ToString();
+ RTC_LOG(LS_INFO) << "WebRtcVoiceEngine::ApplyOptions: "
+ << options_in.ToString();
AudioOptions options = options_in; // The options are modified below.
// Set and adjust echo canceller options.
// kEcConference is AEC with high suppression.
webrtc::EcModes ec_mode = webrtc::kEcConference;
if (options.aecm_generate_comfort_noise) {
- LOG(LS_VERBOSE) << "Comfort noise explicitly set to "
- << *options.aecm_generate_comfort_noise
- << " (default is false).";
+ RTC_LOG(LS_VERBOSE) << "Comfort noise explicitly set to "
+ << *options.aecm_generate_comfort_noise
+ << " (default is false).";
}
#if defined(WEBRTC_IOS)
// On iOS, VPIO provides built-in EC.
options.echo_cancellation = rtc::Optional<bool>(false);
options.extended_filter_aec = rtc::Optional<bool>(false);
- LOG(LS_INFO) << "Always disable AEC on iOS. Use built-in instead.";
+ RTC_LOG(LS_INFO) << "Always disable AEC on iOS. Use built-in instead.";
#elif defined(WEBRTC_ANDROID)
ec_mode = webrtc::kEcAecm;
options.extended_filter_aec = rtc::Optional<bool>(false);
@@ -395,7 +397,7 @@
options.noise_suppression = rtc::Optional<bool>(false);
options.typing_detection = rtc::Optional<bool>(false);
options.experimental_ns = rtc::Optional<bool>(false);
- LOG(LS_INFO) << "Always disable NS on iOS. Use built-in instead.";
+ RTC_LOG(LS_INFO) << "Always disable NS on iOS. Use built-in instead.";
#elif defined(WEBRTC_ANDROID)
options.typing_detection = rtc::Optional<bool>(false);
options.experimental_ns = rtc::Optional<bool>(false);
@@ -406,7 +408,7 @@
// On iOS, VPIO provides built-in AGC.
options.auto_gain_control = rtc::Optional<bool>(false);
options.experimental_agc = rtc::Optional<bool>(false);
- LOG(LS_INFO) << "Always disable AGC on iOS. Use built-in instead.";
+ RTC_LOG(LS_INFO) << "Always disable AGC on iOS. Use built-in instead.";
#elif defined(WEBRTC_ANDROID)
options.experimental_agc = rtc::Optional<bool>(false);
#endif
@@ -420,11 +422,12 @@
if (webrtc::field_trial::IsEnabled(
"WebRTC-Audio-MinimizeResamplingOnMobile")) {
options.auto_gain_control = rtc::Optional<bool>(false);
- LOG(LS_INFO) << "Disable AGC according to field trial.";
+ RTC_LOG(LS_INFO) << "Disable AGC according to field trial.";
if (!(options.noise_suppression.value_or(false) ||
options.echo_cancellation.value_or(false))) {
// If possible, turn off the high-pass filter.
- LOG(LS_INFO) << "Disable high-pass filter in response to field trial.";
+ RTC_LOG(LS_INFO)
+ << "Disable high-pass filter in response to field trial.";
options.highpass_filter = rtc::Optional<bool>(false);
}
}
@@ -452,7 +455,8 @@
// Disable internal software EC if built-in EC is enabled,
// i.e., replace the software EC with the built-in EC.
options.echo_cancellation = rtc::Optional<bool>(false);
- LOG(LS_INFO) << "Disabling EC since built-in EC will be used instead";
+ RTC_LOG(LS_INFO)
+ << "Disabling EC since built-in EC will be used instead";
}
}
webrtc::apm_helpers::SetEcStatus(
@@ -474,7 +478,8 @@
// Disable internal software AGC if built-in AGC is enabled,
// i.e., replace the software AGC with the built-in AGC.
options.auto_gain_control = rtc::Optional<bool>(false);
- LOG(LS_INFO) << "Disabling AGC since built-in AGC will be used instead";
+ RTC_LOG(LS_INFO)
+ << "Disabling AGC since built-in AGC will be used instead";
}
}
webrtc::apm_helpers::SetAgcStatus(apm(), adm(), *options.auto_gain_control);
@@ -501,9 +506,9 @@
webrtc::AgcConfig config = default_agc_config_;
if (options.adjust_agc_delta) {
config.targetLeveldBOv -= *options.adjust_agc_delta;
- LOG(LS_INFO) << "Adjusting AGC level from default -"
- << default_agc_config_.targetLeveldBOv << "dB to -"
- << config.targetLeveldBOv << "dB";
+ RTC_LOG(LS_INFO) << "Adjusting AGC level from default -"
+ << default_agc_config_.targetLeveldBOv << "dB to -"
+ << config.targetLeveldBOv << "dB";
}
webrtc::apm_helpers::SetAgcConfig(apm(), config);
}
@@ -512,7 +517,7 @@
intelligibility_enhancer_ = options.intelligibility_enhancer;
}
if (intelligibility_enhancer_ && *intelligibility_enhancer_) {
- LOG(LS_INFO) << "Enabling NS when Intelligibility Enhancer is active.";
+ RTC_LOG(LS_INFO) << "Enabling NS when Intelligibility Enhancer is active.";
options.noise_suppression = intelligibility_enhancer_;
}
@@ -525,33 +530,34 @@
// Disable internal software NS if built-in NS is enabled,
// i.e., replace the software NS with the built-in NS.
options.noise_suppression = rtc::Optional<bool>(false);
- LOG(LS_INFO) << "Disabling NS since built-in NS will be used instead";
+ RTC_LOG(LS_INFO)
+ << "Disabling NS since built-in NS will be used instead";
}
}
webrtc::apm_helpers::SetNsStatus(apm(), *options.noise_suppression);
}
if (options.stereo_swapping) {
- LOG(LS_INFO) << "Stereo swapping enabled? " << *options.stereo_swapping;
+ RTC_LOG(LS_INFO) << "Stereo swapping enabled? " << *options.stereo_swapping;
transmit_mixer()->EnableStereoChannelSwapping(*options.stereo_swapping);
}
if (options.audio_jitter_buffer_max_packets) {
- LOG(LS_INFO) << "NetEq capacity is "
- << *options.audio_jitter_buffer_max_packets;
+ RTC_LOG(LS_INFO) << "NetEq capacity is "
+ << *options.audio_jitter_buffer_max_packets;
channel_config_.acm_config.neteq_config.max_packets_in_buffer =
std::max(20, *options.audio_jitter_buffer_max_packets);
}
if (options.audio_jitter_buffer_fast_accelerate) {
- LOG(LS_INFO) << "NetEq fast mode? "
- << *options.audio_jitter_buffer_fast_accelerate;
+ RTC_LOG(LS_INFO) << "NetEq fast mode? "
+ << *options.audio_jitter_buffer_fast_accelerate;
channel_config_.acm_config.neteq_config.enable_fast_accelerate =
*options.audio_jitter_buffer_fast_accelerate;
}
if (options.typing_detection) {
- LOG(LS_INFO) << "Typing detection is enabled? "
- << *options.typing_detection;
+ RTC_LOG(LS_INFO) << "Typing detection is enabled? "
+ << *options.typing_detection;
webrtc::apm_helpers::SetTypingDetectionStatus(
apm(), *options.typing_detection);
}
@@ -561,7 +567,8 @@
if (options.delay_agnostic_aec)
delay_agnostic_aec_ = options.delay_agnostic_aec;
if (delay_agnostic_aec_) {
- LOG(LS_INFO) << "Delay agnostic aec is enabled? " << *delay_agnostic_aec_;
+ RTC_LOG(LS_INFO) << "Delay agnostic aec is enabled? "
+ << *delay_agnostic_aec_;
config.Set<webrtc::DelayAgnostic>(
new webrtc::DelayAgnostic(*delay_agnostic_aec_));
}
@@ -570,7 +577,8 @@
extended_filter_aec_ = options.extended_filter_aec;
}
if (extended_filter_aec_) {
- LOG(LS_INFO) << "Extended filter aec is enabled? " << *extended_filter_aec_;
+ RTC_LOG(LS_INFO) << "Extended filter aec is enabled? "
+ << *extended_filter_aec_;
config.Set<webrtc::ExtendedFilter>(
new webrtc::ExtendedFilter(*extended_filter_aec_));
}
@@ -579,14 +587,14 @@
experimental_ns_ = options.experimental_ns;
}
if (experimental_ns_) {
- LOG(LS_INFO) << "Experimental ns is enabled? " << *experimental_ns_;
+ RTC_LOG(LS_INFO) << "Experimental ns is enabled? " << *experimental_ns_;
config.Set<webrtc::ExperimentalNs>(
new webrtc::ExperimentalNs(*experimental_ns_));
}
if (intelligibility_enhancer_) {
- LOG(LS_INFO) << "Intelligibility Enhancer is enabled? "
- << *intelligibility_enhancer_;
+ RTC_LOG(LS_INFO) << "Intelligibility Enhancer is enabled? "
+ << *intelligibility_enhancer_;
config.Set<webrtc::Intelligibility>(
new webrtc::Intelligibility(*intelligibility_enhancer_));
}
@@ -597,8 +605,8 @@
webrtc::AudioProcessing::Config apm_config = apm()->GetConfig();
- LOG(LS_INFO) << "Level control: "
- << (!!level_control_ ? *level_control_ : -1);
+ RTC_LOG(LS_INFO) << "Level control: "
+ << (!!level_control_ ? *level_control_ : -1);
if (level_control_) {
apm_config.level_controller.enabled = *level_control_;
if (options.level_control_initial_peak_level_dbfs) {
@@ -619,19 +627,20 @@
apm()->ApplyConfig(apm_config);
if (options.recording_sample_rate) {
- LOG(LS_INFO) << "Recording sample rate is "
- << *options.recording_sample_rate;
+ RTC_LOG(LS_INFO) << "Recording sample rate is "
+ << *options.recording_sample_rate;
if (adm()->SetRecordingSampleRate(*options.recording_sample_rate)) {
- LOG(LS_WARNING) << "SetRecordingSampleRate("
- << *options.recording_sample_rate << ") failed.";
+ RTC_LOG(LS_WARNING) << "SetRecordingSampleRate("
+ << *options.recording_sample_rate << ") failed.";
}
}
if (options.playout_sample_rate) {
- LOG(LS_INFO) << "Playout sample rate is " << *options.playout_sample_rate;
+ RTC_LOG(LS_INFO) << "Playout sample rate is "
+ << *options.playout_sample_rate;
if (adm()->SetPlayoutSampleRate(*options.playout_sample_rate)) {
- LOG(LS_WARNING) << "SetPlayoutSampleRate("
- << *options.playout_sample_rate << ") failed.";
+ RTC_LOG(LS_WARNING) << "SetPlayoutSampleRate("
+ << *options.playout_sample_rate << ") failed.";
}
}
return true;
@@ -754,7 +763,8 @@
out->push_back(*opt_codec);
}
} else {
- LOG(LS_ERROR) << "Unable to assign payload type to format: " << format;
+ RTC_LOG(LS_ERROR) << "Unable to assign payload type to format: "
+ << format;
}
return opt_codec;
@@ -996,12 +1006,12 @@
bool ValidateRtpParameters(const webrtc::RtpParameters& rtp_parameters) {
if (rtp_parameters.encodings.size() != 1) {
- LOG(LS_ERROR)
+ RTC_LOG(LS_ERROR)
<< "Attempted to set RtpParameters without exactly one encoding";
return false;
}
if (rtp_parameters.encodings[0].ssrc != rtp_parameters_.encodings[0].ssrc) {
- LOG(LS_ERROR) << "Attempted to set RtpParameters with modified SSRC";
+ RTC_LOG(LS_ERROR) << "Attempted to set RtpParameters with modified SSRC";
return false;
}
return true;
@@ -1259,10 +1269,10 @@
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
RTC_DCHECK(stream_);
if (playout) {
- LOG(LS_INFO) << "Starting playout for channel #" << channel();
+ RTC_LOG(LS_INFO) << "Starting playout for channel #" << channel();
stream_->Start();
} else {
- LOG(LS_INFO) << "Stopping playout for channel #" << channel();
+ RTC_LOG(LS_INFO) << "Stopping playout for channel #" << channel();
stream_->Stop();
}
playout_ = playout;
@@ -1301,7 +1311,7 @@
const AudioOptions& options,
webrtc::Call* call)
: VoiceMediaChannel(config), engine_(engine), call_(call) {
- LOG(LS_VERBOSE) << "WebRtcVoiceMediaChannel::WebRtcVoiceMediaChannel";
+ RTC_LOG(LS_VERBOSE) << "WebRtcVoiceMediaChannel::WebRtcVoiceMediaChannel";
RTC_DCHECK(call);
engine->RegisterChannel(this);
SetOptions(options);
@@ -1309,7 +1319,7 @@
WebRtcVoiceMediaChannel::~WebRtcVoiceMediaChannel() {
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
- LOG(LS_VERBOSE) << "WebRtcVoiceMediaChannel::~WebRtcVoiceMediaChannel";
+ RTC_LOG(LS_VERBOSE) << "WebRtcVoiceMediaChannel::~WebRtcVoiceMediaChannel";
// TODO(solenberg): Should be able to delete the streams directly, without
// going through RemoveNnStream(), once stream objects handle
// all (de)configuration.
@@ -1330,8 +1340,8 @@
const AudioSendParameters& params) {
TRACE_EVENT0("webrtc", "WebRtcVoiceMediaChannel::SetSendParameters");
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
- LOG(LS_INFO) << "WebRtcVoiceMediaChannel::SetSendParameters: "
- << params.ToString();
+ RTC_LOG(LS_INFO) << "WebRtcVoiceMediaChannel::SetSendParameters: "
+ << params.ToString();
// TODO(pthatcher): Refactor this to be more clean now that we have
// all the information at once.
@@ -1362,8 +1372,8 @@
const AudioRecvParameters& params) {
TRACE_EVENT0("webrtc", "WebRtcVoiceMediaChannel::SetRecvParameters");
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
- LOG(LS_INFO) << "WebRtcVoiceMediaChannel::SetRecvParameters: "
- << params.ToString();
+ RTC_LOG(LS_INFO) << "WebRtcVoiceMediaChannel::SetRecvParameters: "
+ << params.ToString();
// TODO(pthatcher): Refactor this to be more clean now that we have
// all the information at once.
@@ -1391,8 +1401,8 @@
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
auto it = send_streams_.find(ssrc);
if (it == send_streams_.end()) {
- LOG(LS_WARNING) << "Attempting to get RTP send parameters for stream "
- << "with ssrc " << ssrc << " which doesn't exist.";
+ RTC_LOG(LS_WARNING) << "Attempting to get RTP send parameters for stream "
+ << "with ssrc " << ssrc << " which doesn't exist.";
return webrtc::RtpParameters();
}
@@ -1411,8 +1421,8 @@
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
auto it = send_streams_.find(ssrc);
if (it == send_streams_.end()) {
- LOG(LS_WARNING) << "Attempting to set RTP send parameters for stream "
- << "with ssrc " << ssrc << " which doesn't exist.";
+ RTC_LOG(LS_WARNING) << "Attempting to set RTP send parameters for stream "
+ << "with ssrc " << ssrc << " which doesn't exist.";
return false;
}
@@ -1420,8 +1430,8 @@
// different order (which should change the send codec).
webrtc::RtpParameters current_parameters = GetRtpSendParameters(ssrc);
if (current_parameters.codecs != parameters.codecs) {
- LOG(LS_ERROR) << "Using SetParameters to change the set of codecs "
- << "is not currently supported.";
+ RTC_LOG(LS_ERROR) << "Using SetParameters to change the set of codecs "
+ << "is not currently supported.";
return false;
}
@@ -1446,17 +1456,19 @@
// SSRC of 0 represents the default receive stream.
if (ssrc == 0) {
if (!default_sink_) {
- LOG(LS_WARNING) << "Attempting to get RTP parameters for the default, "
- "unsignaled audio receive stream, but not yet "
- "configured to receive such a stream.";
+ RTC_LOG(LS_WARNING)
+ << "Attempting to get RTP parameters for the default, "
+ "unsignaled audio receive stream, but not yet "
+ "configured to receive such a stream.";
return rtp_params;
}
rtp_params.encodings.emplace_back();
} else {
auto it = recv_streams_.find(ssrc);
if (it == recv_streams_.end()) {
- LOG(LS_WARNING) << "Attempting to get RTP receive parameters for stream "
- << "with ssrc " << ssrc << " which doesn't exist.";
+ RTC_LOG(LS_WARNING)
+ << "Attempting to get RTP receive parameters for stream "
+ << "with ssrc " << ssrc << " which doesn't exist.";
return webrtc::RtpParameters();
}
rtp_params.encodings.emplace_back();
@@ -1477,24 +1489,26 @@
// SSRC of 0 represents the default receive stream.
if (ssrc == 0) {
if (!default_sink_) {
- LOG(LS_WARNING) << "Attempting to set RTP parameters for the default, "
- "unsignaled audio receive stream, but not yet "
- "configured to receive such a stream.";
+ RTC_LOG(LS_WARNING)
+ << "Attempting to set RTP parameters for the default, "
+ "unsignaled audio receive stream, but not yet "
+ "configured to receive such a stream.";
return false;
}
} else {
auto it = recv_streams_.find(ssrc);
if (it == recv_streams_.end()) {
- LOG(LS_WARNING) << "Attempting to set RTP receive parameters for stream "
- << "with ssrc " << ssrc << " which doesn't exist.";
+ RTC_LOG(LS_WARNING)
+ << "Attempting to set RTP receive parameters for stream "
+ << "with ssrc " << ssrc << " which doesn't exist.";
return false;
}
}
webrtc::RtpParameters current_parameters = GetRtpReceiveParameters(ssrc);
if (current_parameters != parameters) {
- LOG(LS_ERROR) << "Changing the RTP receive parameters is currently "
- << "unsupported.";
+ RTC_LOG(LS_ERROR) << "Changing the RTP receive parameters is currently "
+ << "unsupported.";
return false;
}
return true;
@@ -1502,16 +1516,15 @@
bool WebRtcVoiceMediaChannel::SetOptions(const AudioOptions& options) {
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
- LOG(LS_INFO) << "Setting voice channel options: "
- << options.ToString();
+ RTC_LOG(LS_INFO) << "Setting voice channel options: " << options.ToString();
// We retain all of the existing options, and apply the given ones
// on top. This means there is no way to "clear" options such that
// they go back to the engine default.
options_.SetAll(options);
if (!engine()->ApplyOptions(options_)) {
- LOG(LS_WARNING) <<
- "Failed to apply engine options during channel SetOptions.";
+ RTC_LOG(LS_WARNING)
+ << "Failed to apply engine options during channel SetOptions.";
return false;
}
@@ -1521,8 +1534,8 @@
it.second->SetAudioNetworkAdaptorConfig(audio_network_adaptor_config);
}
- LOG(LS_INFO) << "Set voice channel options. Current options: "
- << options_.ToString();
+ RTC_LOG(LS_INFO) << "Set voice channel options. Current options: "
+ << options_.ToString();
return true;
}
@@ -1531,10 +1544,10 @@
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
// Set the payload types to be used for incoming media.
- LOG(LS_INFO) << "Setting receive voice codecs.";
+ RTC_LOG(LS_INFO) << "Setting receive voice codecs.";
if (!VerifyUniquePayloadTypes(codecs)) {
- LOG(LS_ERROR) << "Codec payload types overlap.";
+ RTC_LOG(LS_ERROR) << "Codec payload types overlap.";
return false;
}
@@ -1547,14 +1560,14 @@
AudioCodec old_codec;
if (FindCodec(recv_codecs_, codec, &old_codec) &&
old_codec.id != codec.id) {
- LOG(LS_WARNING) << codec.name << " mapped to a second payload type ("
- << codec.id << ", was already mapped to " << old_codec.id
- << ")";
+ RTC_LOG(LS_WARNING) << codec.name << " mapped to a second payload type ("
+ << codec.id << ", was already mapped to "
+ << old_codec.id << ")";
}
auto format = AudioCodecToSdpAudioFormat(codec);
if (!IsCodec(codec, "cn") && !IsCodec(codec, "telephone-event") &&
!engine()->decoder_factory_->IsSupportedDecoder(format)) {
- LOG(LS_ERROR) << "Unsupported codec: " << format;
+ RTC_LOG(LS_ERROR) << "Unsupported codec: " << format;
return false;
}
// We allow adding new codecs but don't allow changing the payload type of
@@ -1570,9 +1583,10 @@
// conflict could happen between audio and video codecs.
auto existing = decoder_map_.find(codec.id);
if (existing != decoder_map_.end() && !existing->second.Matches(format)) {
- LOG(LS_ERROR) << "Attempting to use payload type " << codec.id << " for "
- << codec.name << ", but it is already used for "
- << existing->second.name;
+ RTC_LOG(LS_ERROR) << "Attempting to use payload type " << codec.id
+ << " for " << codec.name
+ << ", but it is already used for "
+ << existing->second.name;
return false;
}
decoder_map.insert({codec.id, std::move(format)});
@@ -1616,7 +1630,8 @@
// don't overlap, remove redundant/unsupported codecs etc -
// the same way it is done for RtpHeaderExtensions.
if (codec.id < kMinPayloadType || codec.id > kMaxPayloadType) {
- LOG(LS_WARNING) << "Codec payload type out of range: " << ToString(codec);
+ RTC_LOG(LS_WARNING) << "Codec payload type out of range: "
+ << ToString(codec);
return false;
}
}
@@ -1648,7 +1663,7 @@
voice_codec_info = engine()->encoder_factory_->QueryAudioEncoder(format);
if (!voice_codec_info) {
- LOG(LS_WARNING) << "Unknown codec " << ToString(voice_codec);
+ RTC_LOG(LS_WARNING) << "Unknown codec " << ToString(voice_codec);
continue;
}
@@ -1684,8 +1699,8 @@
send_codec_spec->cng_payload_type = rtc::Optional<int>(cn_codec.id);
break;
default:
- LOG(LS_WARNING) << "CN frequency " << cn_codec.clockrate
- << " not supported.";
+ RTC_LOG(LS_WARNING)
+ << "CN frequency " << cn_codec.clockrate << " not supported.";
break;
}
break;
@@ -1719,8 +1734,8 @@
// preferred send codec, and in that case reconfigure all receive streams.
if (recv_transport_cc_enabled_ != send_codec_spec_->transport_cc_enabled ||
recv_nack_enabled_ != send_codec_spec_->nack_enabled) {
- LOG(LS_INFO) << "Recreate all the receive streams because the send "
- "codec has changed.";
+ RTC_LOG(LS_INFO) << "Recreate all the receive streams because the send "
+ "codec has changed.";
recv_transport_cc_enabled_ = send_codec_spec_->transport_cc_enabled;
recv_nack_enabled_ = send_codec_spec_->nack_enabled;
for (auto& kv : recv_streams_) {
@@ -1766,7 +1781,7 @@
if (!engine()->adm()->RecordingIsInitialized() &&
!engine()->adm()->Recording()) {
if (engine()->adm()->InitRecording() != 0) {
- LOG(LS_WARNING) << "Failed to initialize recording";
+ RTC_LOG(LS_WARNING) << "Failed to initialize recording";
}
}
}
@@ -1801,7 +1816,7 @@
int WebRtcVoiceMediaChannel::CreateVoEChannel() {
int id = engine()->CreateVoEChannel();
if (id == -1) {
- LOG(LS_WARNING) << "CreateVoEChannel() failed.";
+ RTC_LOG(LS_WARNING) << "CreateVoEChannel() failed.";
return -1;
}
@@ -1810,7 +1825,7 @@
bool WebRtcVoiceMediaChannel::DeleteVoEChannel(int channel) {
if (engine()->voe()->base()->DeleteChannel(channel) == -1) {
- LOG(LS_WARNING) << "DeleteChannel(" << channel << ") failed.";
+ RTC_LOG(LS_WARNING) << "DeleteChannel(" << channel << ") failed.";
return false;
}
return true;
@@ -1819,13 +1834,13 @@
bool WebRtcVoiceMediaChannel::AddSendStream(const StreamParams& sp) {
TRACE_EVENT0("webrtc", "WebRtcVoiceMediaChannel::AddSendStream");
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
- LOG(LS_INFO) << "AddSendStream: " << sp.ToString();
+ RTC_LOG(LS_INFO) << "AddSendStream: " << sp.ToString();
uint32_t ssrc = sp.first_ssrc();
RTC_DCHECK(0 != ssrc);
if (GetSendChannelId(ssrc) != -1) {
- LOG(LS_ERROR) << "Stream already exists with ssrc " << ssrc;
+ RTC_LOG(LS_ERROR) << "Stream already exists with ssrc " << ssrc;
return false;
}
@@ -1867,12 +1882,12 @@
bool WebRtcVoiceMediaChannel::RemoveSendStream(uint32_t ssrc) {
TRACE_EVENT0("webrtc", "WebRtcVoiceMediaChannel::RemoveSendStream");
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
- LOG(LS_INFO) << "RemoveSendStream: " << ssrc;
+ RTC_LOG(LS_INFO) << "RemoveSendStream: " << ssrc;
auto it = send_streams_.find(ssrc);
if (it == send_streams_.end()) {
- LOG(LS_WARNING) << "Try to remove stream with ssrc " << ssrc
- << " which doesn't exist.";
+ RTC_LOG(LS_WARNING) << "Try to remove stream with ssrc " << ssrc
+ << " which doesn't exist.";
return false;
}
@@ -1884,8 +1899,8 @@
// Clean up and delete the send stream+channel.
int channel = it->second->channel();
- LOG(LS_INFO) << "Removing audio send stream " << ssrc
- << " with VoiceEngine channel #" << channel << ".";
+ RTC_LOG(LS_INFO) << "Removing audio send stream " << ssrc
+ << " with VoiceEngine channel #" << channel << ".";
delete it->second;
send_streams_.erase(it);
if (!DeleteVoEChannel(channel)) {
@@ -1900,7 +1915,7 @@
bool WebRtcVoiceMediaChannel::AddRecvStream(const StreamParams& sp) {
TRACE_EVENT0("webrtc", "WebRtcVoiceMediaChannel::AddRecvStream");
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
- LOG(LS_INFO) << "AddRecvStream: " << sp.ToString();
+ RTC_LOG(LS_INFO) << "AddRecvStream: " << sp.ToString();
if (!ValidateStreamParams(sp)) {
return false;
@@ -1908,7 +1923,7 @@
const uint32_t ssrc = sp.first_ssrc();
if (ssrc == 0) {
- LOG(LS_WARNING) << "AddRecvStream with ssrc==0 is not supported.";
+ RTC_LOG(LS_WARNING) << "AddRecvStream with ssrc==0 is not supported.";
return false;
}
@@ -1920,7 +1935,7 @@
}
if (GetReceiveChannelId(ssrc) != -1) {
- LOG(LS_ERROR) << "Stream already exists with ssrc " << ssrc;
+ RTC_LOG(LS_ERROR) << "Stream already exists with ssrc " << ssrc;
return false;
}
@@ -1944,12 +1959,12 @@
bool WebRtcVoiceMediaChannel::RemoveRecvStream(uint32_t ssrc) {
TRACE_EVENT0("webrtc", "WebRtcVoiceMediaChannel::RemoveRecvStream");
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
- LOG(LS_INFO) << "RemoveRecvStream: " << ssrc;
+ RTC_LOG(LS_INFO) << "RemoveRecvStream: " << ssrc;
const auto it = recv_streams_.find(ssrc);
if (it == recv_streams_.end()) {
- LOG(LS_WARNING) << "Try to remove stream with ssrc " << ssrc
- << " which doesn't exist.";
+ RTC_LOG(LS_WARNING) << "Try to remove stream with ssrc " << ssrc
+ << " which doesn't exist.";
return false;
}
@@ -1958,8 +1973,8 @@
const int channel = it->second->channel();
// Clean up and delete the receive stream+channel.
- LOG(LS_INFO) << "Removing audio receive stream " << ssrc
- << " with VoiceEngine channel #" << channel << ".";
+ RTC_LOG(LS_INFO) << "Removing audio receive stream " << ssrc
+ << " with VoiceEngine channel #" << channel << ".";
it->second->SetRawAudioSink(nullptr);
delete it->second;
recv_streams_.erase(it);
@@ -1972,7 +1987,7 @@
if (it == send_streams_.end()) {
if (source) {
// Return an error if trying to set a valid source with an invalid ssrc.
- LOG(LS_ERROR) << "SetLocalSource failed with ssrc " << ssrc;
+ RTC_LOG(LS_ERROR) << "SetLocalSource failed with ssrc " << ssrc;
return false;
}
@@ -2024,12 +2039,12 @@
for (uint32_t ssrc : ssrcs) {
const auto it = recv_streams_.find(ssrc);
if (it == recv_streams_.end()) {
- LOG(LS_WARNING) << "SetOutputVolume: no recv stream " << ssrc;
+ RTC_LOG(LS_WARNING) << "SetOutputVolume: no recv stream " << ssrc;
return false;
}
it->second->SetOutputVolume(volume);
- LOG(LS_INFO) << "SetOutputVolume() to " << volume
- << " for recv stream with ssrc " << ssrc;
+ RTC_LOG(LS_INFO) << "SetOutputVolume() to " << volume
+ << " for recv stream with ssrc " << ssrc;
}
return true;
}
@@ -2041,7 +2056,7 @@
bool WebRtcVoiceMediaChannel::InsertDtmf(uint32_t ssrc, int event,
int duration) {
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
- LOG(LS_INFO) << "WebRtcVoiceMediaChannel::InsertDtmf";
+ RTC_LOG(LS_INFO) << "WebRtcVoiceMediaChannel::InsertDtmf";
if (!dtmf_payload_type_) {
return false;
}
@@ -2049,12 +2064,12 @@
// Figure out which WebRtcAudioSendStream to send the event on.
auto it = ssrc != 0 ? send_streams_.find(ssrc) : send_streams_.begin();
if (it == send_streams_.end()) {
- LOG(LS_WARNING) << "The specified ssrc " << ssrc << " is not in use.";
+ RTC_LOG(LS_WARNING) << "The specified ssrc " << ssrc << " is not in use.";
return false;
}
if (event < kMinTelephoneEventCode ||
event > kMaxTelephoneEventCode) {
- LOG(LS_WARNING) << "DTMF event code " << event << " out of range.";
+ RTC_LOG(LS_WARNING) << "DTMF event code " << event << " out of range.";
return false;
}
RTC_DCHECK_NE(-1, dtmf_payload_freq_);
@@ -2089,9 +2104,9 @@
// Add new stream.
StreamParams sp;
sp.ssrcs.push_back(ssrc);
- LOG(LS_INFO) << "Creating unsignaled receive stream for SSRC=" << ssrc;
+ RTC_LOG(LS_INFO) << "Creating unsignaled receive stream for SSRC=" << ssrc;
if (!AddRecvStream(sp)) {
- LOG(LS_WARNING) << "Could not create unsignaled receive stream.";
+ RTC_LOG(LS_WARNING) << "Could not create unsignaled receive stream.";
return;
}
unsignaled_recv_ssrcs_.push_back(ssrc);
@@ -2102,8 +2117,8 @@
// Remove oldest unsignaled stream, if we have too many.
if (unsignaled_recv_ssrcs_.size() > kMaxUnsignaledRecvStreams) {
uint32_t remove_ssrc = unsignaled_recv_ssrcs_.front();
- LOG(LS_INFO) << "Removing unsignaled receive stream with SSRC="
- << remove_ssrc;
+ RTC_LOG(LS_INFO) << "Removing unsignaled receive stream with SSRC="
+ << remove_ssrc;
RemoveRecvStream(remove_ssrc);
}
RTC_DCHECK_GE(kMaxUnsignaledRecvStreams, unsignaled_recv_ssrcs_.size());
@@ -2151,7 +2166,7 @@
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
const auto it = send_streams_.find(ssrc);
if (it == send_streams_.end()) {
- LOG(LS_WARNING) << "The specified ssrc " << ssrc << " is not in use.";
+ RTC_LOG(LS_WARNING) << "The specified ssrc " << ssrc << " is not in use.";
return false;
}
it->second->SetMuted(muted);
@@ -2171,7 +2186,7 @@
}
bool WebRtcVoiceMediaChannel::SetMaxSendBitrate(int bps) {
- LOG(LS_INFO) << "WebRtcVoiceMediaChannel::SetMaxSendBitrate.";
+ RTC_LOG(LS_INFO) << "WebRtcVoiceMediaChannel::SetMaxSendBitrate.";
max_send_bitrate_bps_ = bps;
bool success = true;
for (const auto& kv : send_streams_) {
@@ -2184,7 +2199,7 @@
void WebRtcVoiceMediaChannel::OnReadyToSend(bool ready) {
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
- LOG(LS_VERBOSE) << "OnReadyToSend: " << (ready ? "Ready." : "Not ready.");
+ RTC_LOG(LS_VERBOSE) << "OnReadyToSend: " << (ready ? "Ready." : "Not ready.");
call_->SignalChannelNetworkState(
webrtc::MediaType::AUDIO,
ready ? webrtc::kNetworkUp : webrtc::kNetworkDown);
@@ -2311,8 +2326,8 @@
uint32_t ssrc,
std::unique_ptr<webrtc::AudioSinkInterface> sink) {
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
- LOG(LS_VERBOSE) << "WebRtcVoiceMediaChannel::SetRawAudioSink: ssrc:" << ssrc
- << " " << (sink ? "(ptr)" : "NULL");
+ RTC_LOG(LS_VERBOSE) << "WebRtcVoiceMediaChannel::SetRawAudioSink: ssrc:"
+ << ssrc << " " << (sink ? "(ptr)" : "NULL");
if (ssrc == 0) {
if (!unsignaled_recv_ssrcs_.empty()) {
std::unique_ptr<webrtc::AudioSinkInterface> proxy_sink(
@@ -2324,7 +2339,7 @@
}
const auto it = recv_streams_.find(ssrc);
if (it == recv_streams_.end()) {
- LOG(LS_WARNING) << "SetRawAudioSink: no recv stream " << ssrc;
+ RTC_LOG(LS_WARNING) << "SetRawAudioSink: no recv stream " << ssrc;
return;
}
it->second->SetRawAudioSink(std::move(sink));
diff --git a/media/sctp/sctptransport.cc b/media/sctp/sctptransport.cc
index 112aac6..545d18a 100644
--- a/media/sctp/sctptransport.cc
+++ b/media/sctp/sctptransport.cc
@@ -138,7 +138,7 @@
va_list ap;
va_start(ap, format);
vsnprintf(s, sizeof(s), format, ap);
- LOG(LS_INFO) << "SCTP: " << s;
+ RTC_LOG(LS_INFO) << "SCTP: " << s;
va_end(ap);
#endif
}
@@ -204,14 +204,14 @@
// getting a normal packet capture won't help you, unless you have the DTLS
// keying material.
void VerboseLogPacket(const void* data, size_t length, int direction) {
- if (LOG_CHECK_LEVEL(LS_VERBOSE) && length > 0) {
+ if (RTC_LOG_CHECK_LEVEL(LS_VERBOSE) && length > 0) {
char* dump_buf;
// Some downstream project uses an older version of usrsctp that expects
// a non-const "void*" as first parameter when dumping the packet, so we
// need to cast the const away here to avoid a compiler error.
if ((dump_buf = usrsctp_dumppacket(const_cast<void*>(data), length,
direction)) != NULL) {
- LOG(LS_VERBOSE) << dump_buf;
+ RTC_LOG(LS_VERBOSE) << dump_buf;
usrsctp_freedumpbuffer(dump_buf);
}
}
@@ -226,7 +226,7 @@
class SctpTransport::UsrSctpWrapper {
public:
static void InitializeUsrSctp() {
- LOG(LS_INFO) << __FUNCTION__;
+ RTC_LOG(LS_INFO) << __FUNCTION__;
// First argument is udp_encapsulation_port, which is not releveant for our
// AF_CONN use of sctp.
usrsctp_init(0, &UsrSctpWrapper::OnSctpOutboundPacket, &DebugSctpPrintf);
@@ -242,7 +242,8 @@
// changes.
int send_size = usrsctp_sysctl_get_sctp_sendspace();
if (send_size != kSendBufferSize) {
- LOG(LS_ERROR) << "Got different send size than expected: " << send_size;
+ RTC_LOG(LS_ERROR) << "Got different send size than expected: "
+ << send_size;
}
// TODO(ldixon): Consider turning this on/off.
@@ -268,7 +269,7 @@
}
static void UninitializeUsrSctp() {
- LOG(LS_INFO) << __FUNCTION__;
+ RTC_LOG(LS_INFO) << __FUNCTION__;
// usrsctp_finish() may fail if it's called too soon after the transports
// are
// closed. Wait and try again until it succeeds for up to 3 seconds.
@@ -279,7 +280,7 @@
rtc::Thread::SleepMs(10);
}
- LOG(LS_ERROR) << "Failed to shutdown usrsctp.";
+ RTC_LOG(LS_ERROR) << "Failed to shutdown usrsctp.";
}
static void IncrementUsrSctpUsageCount() {
@@ -306,10 +307,10 @@
uint8_t tos,
uint8_t set_df) {
SctpTransport* transport = static_cast<SctpTransport*>(addr);
- LOG(LS_VERBOSE) << "global OnSctpOutboundPacket():"
- << "addr: " << addr << "; length: " << length
- << "; tos: " << std::hex << static_cast<int>(tos)
- << "; set_df: " << std::hex << static_cast<int>(set_df);
+ RTC_LOG(LS_VERBOSE) << "global OnSctpOutboundPacket():"
+ << "addr: " << addr << "; length: " << length
+ << "; tos: " << std::hex << static_cast<int>(tos)
+ << "; set_df: " << std::hex << static_cast<int>(set_df);
VerboseLogPacket(data, length, SCTP_DUMP_OUTBOUND);
// Note: We have to copy the data; the caller will delete it.
@@ -343,8 +344,8 @@
DataMessageType type = DMT_NONE;
if (!GetDataMediaType(ppid, &type) && !(flags & MSG_NOTIFICATION)) {
// It's neither a notification nor a recognized data packet. Drop it.
- LOG(LS_ERROR) << "Received an unknown PPID " << ppid
- << " on an SCTP packet. Dropping.";
+ RTC_LOG(LS_ERROR) << "Received an unknown PPID " << ppid
+ << " on an SCTP packet. Dropping.";
} else {
rtc::CopyOnWriteBuffer buffer;
ReceiveDataParams params;
@@ -390,7 +391,7 @@
// and then back here.
SctpTransport* transport = GetTransportFromSocket(sock);
if (!transport) {
- LOG(LS_ERROR)
+ RTC_LOG(LS_ERROR)
<< "SendThresholdCallback: Failed to get transport for socket "
<< sock;
return 0;
@@ -443,7 +444,8 @@
}
if (started_) {
if (local_sctp_port != local_port_ || remote_sctp_port != remote_port_) {
- LOG(LS_ERROR) << "Can't change SCTP port after SCTP association formed.";
+ RTC_LOG(LS_ERROR)
+ << "Can't change SCTP port after SCTP association formed.";
return false;
}
return true;
@@ -463,21 +465,22 @@
bool SctpTransport::OpenStream(int sid) {
RTC_DCHECK_RUN_ON(network_thread_);
if (sid > kMaxSctpSid) {
- LOG(LS_WARNING) << debug_name_ << "->OpenStream(...): "
- << "Not adding data stream "
- << "with sid=" << sid << " because sid is too high.";
+ RTC_LOG(LS_WARNING) << debug_name_ << "->OpenStream(...): "
+ << "Not adding data stream "
+ << "with sid=" << sid << " because sid is too high.";
return false;
} else if (open_streams_.find(sid) != open_streams_.end()) {
- LOG(LS_WARNING) << debug_name_ << "->OpenStream(...): "
- << "Not adding data stream "
- << "with sid=" << sid << " because stream is already open.";
+ RTC_LOG(LS_WARNING) << debug_name_ << "->OpenStream(...): "
+ << "Not adding data stream "
+ << "with sid=" << sid
+ << " because stream is already open.";
return false;
} else if (queued_reset_streams_.find(sid) != queued_reset_streams_.end() ||
sent_reset_streams_.find(sid) != sent_reset_streams_.end()) {
- LOG(LS_WARNING) << debug_name_ << "->OpenStream(...): "
- << "Not adding data stream "
- << " with sid=" << sid
- << " because stream is still closing.";
+ RTC_LOG(LS_WARNING) << debug_name_ << "->OpenStream(...): "
+ << "Not adding data stream "
+ << " with sid=" << sid
+ << " because stream is still closing.";
return false;
}
@@ -489,12 +492,12 @@
RTC_DCHECK_RUN_ON(network_thread_);
StreamSet::iterator found = open_streams_.find(sid);
if (found == open_streams_.end()) {
- LOG(LS_WARNING) << debug_name_ << "->ResetStream(" << sid << "): "
- << "stream not found.";
+ RTC_LOG(LS_WARNING) << debug_name_ << "->ResetStream(" << sid << "): "
+ << "stream not found.";
return false;
} else {
- LOG(LS_VERBOSE) << debug_name_ << "->ResetStream(" << sid << "): "
- << "Removing and queuing RE-CONFIG chunk.";
+ RTC_LOG(LS_VERBOSE) << debug_name_ << "->ResetStream(" << sid << "): "
+ << "Removing and queuing RE-CONFIG chunk.";
open_streams_.erase(found);
}
@@ -522,17 +525,17 @@
}
if (!sock_) {
- LOG(LS_WARNING) << debug_name_ << "->SendData(...): "
- << "Not sending packet with sid=" << params.sid
- << " len=" << payload.size() << " before Start().";
+ RTC_LOG(LS_WARNING) << debug_name_ << "->SendData(...): "
+ << "Not sending packet with sid=" << params.sid
+ << " len=" << payload.size() << " before Start().";
return false;
}
if (params.type != DMT_CONTROL &&
open_streams_.find(params.sid) == open_streams_.end()) {
- LOG(LS_WARNING) << debug_name_ << "->SendData(...): "
- << "Not sending data because sid is unknown: "
- << params.sid;
+ RTC_LOG(LS_WARNING) << debug_name_ << "->SendData(...): "
+ << "Not sending data because sid is unknown: "
+ << params.sid;
return false;
}
@@ -565,10 +568,11 @@
if (errno == SCTP_EWOULDBLOCK) {
*result = SDR_BLOCK;
ready_to_send_data_ = false;
- LOG(LS_INFO) << debug_name_ << "->SendData(...): EWOULDBLOCK returned";
+ RTC_LOG(LS_INFO) << debug_name_
+ << "->SendData(...): EWOULDBLOCK returned";
} else {
- LOG_ERRNO(LS_ERROR) << "ERROR:" << debug_name_ << "->SendData(...): "
- << " usrsctp_sendv: ";
+ RTC_LOG_ERRNO(LS_ERROR) << "ERROR:" << debug_name_ << "->SendData(...): "
+ << " usrsctp_sendv: ";
}
return false;
}
@@ -600,14 +604,15 @@
bool SctpTransport::Connect() {
RTC_DCHECK_RUN_ON(network_thread_);
- LOG(LS_VERBOSE) << debug_name_ << "->Connect().";
+ RTC_LOG(LS_VERBOSE) << debug_name_ << "->Connect().";
// If we already have a socket connection (which shouldn't ever happen), just
// return.
RTC_DCHECK(!sock_);
if (sock_) {
- LOG(LS_ERROR) << debug_name_ << "->Connect(): Ignored as socket "
- "is already established.";
+ RTC_LOG(LS_ERROR) << debug_name_
+ << "->Connect(): Ignored as socket "
+ "is already established.";
return true;
}
@@ -622,8 +627,8 @@
sockaddr_conn local_sconn = GetSctpSockAddr(local_port_);
if (usrsctp_bind(sock_, reinterpret_cast<sockaddr*>(&local_sconn),
sizeof(local_sconn)) < 0) {
- LOG_ERRNO(LS_ERROR) << debug_name_
- << "->Connect(): " << ("Failed usrsctp_bind");
+ RTC_LOG_ERRNO(LS_ERROR)
+ << debug_name_ << "->Connect(): " << ("Failed usrsctp_bind");
CloseSctpSocket();
return false;
}
@@ -633,9 +638,9 @@
int connect_result = usrsctp_connect(
sock_, reinterpret_cast<sockaddr*>(&remote_sconn), sizeof(remote_sconn));
if (connect_result < 0 && errno != SCTP_EINPROGRESS) {
- LOG_ERRNO(LS_ERROR) << debug_name_ << "->Connect(): "
- << "Failed usrsctp_connect. got errno=" << errno
- << ", but wanted " << SCTP_EINPROGRESS;
+ RTC_LOG_ERRNO(LS_ERROR) << debug_name_ << "->Connect(): "
+ << "Failed usrsctp_connect. got errno=" << errno
+ << ", but wanted " << SCTP_EINPROGRESS;
CloseSctpSocket();
return false;
}
@@ -647,8 +652,8 @@
params.spp_pathmtu = kSctpMtu;
if (usrsctp_setsockopt(sock_, IPPROTO_SCTP, SCTP_PEER_ADDR_PARAMS, ¶ms,
sizeof(params))) {
- LOG_ERRNO(LS_ERROR) << debug_name_ << "->Connect(): "
- << "Failed to set SCTP_PEER_ADDR_PARAMS.";
+ RTC_LOG_ERRNO(LS_ERROR) << debug_name_ << "->Connect(): "
+ << "Failed to set SCTP_PEER_ADDR_PARAMS.";
}
// Since this is a fresh SCTP association, we'll always start out with empty
// queues, so "ReadyToSendData" should be true.
@@ -659,8 +664,8 @@
bool SctpTransport::OpenSctpSocket() {
RTC_DCHECK_RUN_ON(network_thread_);
if (sock_) {
- LOG(LS_WARNING) << debug_name_ << "->OpenSctpSocket(): "
- << "Ignoring attempt to re-create existing socket.";
+ RTC_LOG(LS_WARNING) << debug_name_ << "->OpenSctpSocket(): "
+ << "Ignoring attempt to re-create existing socket.";
return false;
}
@@ -675,8 +680,8 @@
AF_CONN, SOCK_STREAM, IPPROTO_SCTP, &UsrSctpWrapper::OnSctpInboundPacket,
&UsrSctpWrapper::SendThresholdCallback, kSendThreshold, this);
if (!sock_) {
- LOG_ERRNO(LS_ERROR) << debug_name_ << "->OpenSctpSocket(): "
- << "Failed to create SCTP socket.";
+ RTC_LOG_ERRNO(LS_ERROR) << debug_name_ << "->OpenSctpSocket(): "
+ << "Failed to create SCTP socket.";
UsrSctpWrapper::DecrementUsrSctpUsageCount();
return false;
}
@@ -699,8 +704,8 @@
// Make the socket non-blocking. Connect, close, shutdown etc will not block
// the thread waiting for the socket operation to complete.
if (usrsctp_set_non_blocking(sock_, 1) < 0) {
- LOG_ERRNO(LS_ERROR) << debug_name_ << "->ConfigureSctpSocket(): "
- << "Failed to set SCTP to non blocking.";
+ RTC_LOG_ERRNO(LS_ERROR) << debug_name_ << "->ConfigureSctpSocket(): "
+ << "Failed to set SCTP to non blocking.";
return false;
}
@@ -712,8 +717,8 @@
linger_opt.l_linger = 0;
if (usrsctp_setsockopt(sock_, SOL_SOCKET, SO_LINGER, &linger_opt,
sizeof(linger_opt))) {
- LOG_ERRNO(LS_ERROR) << debug_name_ << "->ConfigureSctpSocket(): "
- << "Failed to set SO_LINGER.";
+ RTC_LOG_ERRNO(LS_ERROR) << debug_name_ << "->ConfigureSctpSocket(): "
+ << "Failed to set SO_LINGER.";
return false;
}
@@ -723,9 +728,9 @@
stream_rst.assoc_value = 1;
if (usrsctp_setsockopt(sock_, IPPROTO_SCTP, SCTP_ENABLE_STREAM_RESET,
&stream_rst, sizeof(stream_rst))) {
- LOG_ERRNO(LS_ERROR) << debug_name_ << "->ConfigureSctpSocket(): "
+ RTC_LOG_ERRNO(LS_ERROR) << debug_name_ << "->ConfigureSctpSocket(): "
- << "Failed to set SCTP_ENABLE_STREAM_RESET.";
+ << "Failed to set SCTP_ENABLE_STREAM_RESET.";
return false;
}
@@ -733,8 +738,8 @@
uint32_t nodelay = 1;
if (usrsctp_setsockopt(sock_, IPPROTO_SCTP, SCTP_NODELAY, &nodelay,
sizeof(nodelay))) {
- LOG_ERRNO(LS_ERROR) << debug_name_ << "->ConfigureSctpSocket(): "
- << "Failed to set SCTP_NODELAY.";
+ RTC_LOG_ERRNO(LS_ERROR) << debug_name_ << "->ConfigureSctpSocket(): "
+ << "Failed to set SCTP_NODELAY.";
return false;
}
@@ -749,9 +754,10 @@
event.se_type = event_types[i];
if (usrsctp_setsockopt(sock_, IPPROTO_SCTP, SCTP_EVENT, &event,
sizeof(event)) < 0) {
- LOG_ERRNO(LS_ERROR) << debug_name_ << "->ConfigureSctpSocket(): "
+ RTC_LOG_ERRNO(LS_ERROR)
+ << debug_name_ << "->ConfigureSctpSocket(): "
- << "Failed to set SCTP_EVENT type: " << event.se_type;
+ << "Failed to set SCTP_EVENT type: " << event.se_type;
return false;
}
}
@@ -778,10 +784,11 @@
return true;
}
- LOG(LS_VERBOSE) << "SendQueuedStreamResets[" << debug_name_ << "]: Sending ["
- << ListStreams(queued_reset_streams_) << "], Open: ["
- << ListStreams(open_streams_) << "], Sent: ["
- << ListStreams(sent_reset_streams_) << "]";
+ RTC_LOG(LS_VERBOSE) << "SendQueuedStreamResets[" << debug_name_
+ << "]: Sending [" << ListStreams(queued_reset_streams_)
+ << "], Open: [" << ListStreams(open_streams_)
+ << "], Sent: [" << ListStreams(sent_reset_streams_)
+ << "]";
const size_t num_streams = queued_reset_streams_.size();
const size_t num_bytes =
@@ -803,9 +810,10 @@
usrsctp_setsockopt(sock_, IPPROTO_SCTP, SCTP_RESET_STREAMS, resetp,
rtc::checked_cast<socklen_t>(reset_stream_buf.size()));
if (ret < 0) {
- LOG_ERRNO(LS_ERROR) << debug_name_ << "->SendQueuedStreamResets(): "
- "Failed to send a stream reset for "
- << num_streams << " streams";
+ RTC_LOG_ERRNO(LS_ERROR) << debug_name_
+ << "->SendQueuedStreamResets(): "
+ "Failed to send a stream reset for "
+ << num_streams << " streams";
return false;
}
@@ -849,8 +857,8 @@
return;
}
- LOG(LS_VERBOSE) << debug_name_ << "->OnPacketRead(...): "
- << " length=" << len << ", started: " << started_;
+ RTC_LOG(LS_VERBOSE) << debug_name_ << "->OnPacketRead(...): "
+ << " length=" << len << ", started: " << started_;
// Only give receiving packets to usrsctp after if connected. This enables two
// peers to each make a connect call, but for them not to receive an INIT
// packet before they have called connect; least the last receiver of the INIT
@@ -888,10 +896,10 @@
const rtc::CopyOnWriteBuffer& buffer) {
RTC_DCHECK_RUN_ON(network_thread_);
if (buffer.size() > (kSctpMtu)) {
- LOG(LS_ERROR) << debug_name_ << "->OnPacketFromSctpToNetwork(...): "
- << "SCTP seems to have made a packet that is bigger "
- << "than its official MTU: " << buffer.size() << " vs max of "
- << kSctpMtu;
+ RTC_LOG(LS_ERROR) << debug_name_ << "->OnPacketFromSctpToNetwork(...): "
+ << "SCTP seems to have made a packet that is bigger "
+ << "than its official MTU: " << buffer.size()
+ << " vs max of " << kSctpMtu;
}
TRACE_EVENT0("webrtc", "SctpTransport::OnPacketFromSctpToNetwork");
@@ -911,16 +919,18 @@
ReceiveDataParams params,
int flags) {
RTC_DCHECK_RUN_ON(network_thread_);
- LOG(LS_VERBOSE) << debug_name_ << "->OnInboundPacketFromSctpToChannel(...): "
- << "Received SCTP data:"
- << " sid=" << params.sid
- << " notification: " << (flags & MSG_NOTIFICATION)
- << " length=" << buffer.size();
+ RTC_LOG(LS_VERBOSE) << debug_name_
+ << "->OnInboundPacketFromSctpToChannel(...): "
+ << "Received SCTP data:"
+ << " sid=" << params.sid
+ << " notification: " << (flags & MSG_NOTIFICATION)
+ << " length=" << buffer.size();
// Sending a packet with data == NULL (no data) is SCTPs "close the
// connection" message. This sets sock_ = NULL;
if (!buffer.size() || !buffer.data()) {
- LOG(LS_INFO) << debug_name_ << "->OnInboundPacketFromSctpToChannel(...): "
- "No data, closing.";
+ RTC_LOG(LS_INFO) << debug_name_
+ << "->OnInboundPacketFromSctpToChannel(...): "
+ "No data, closing.";
return;
}
if (flags & MSG_NOTIFICATION) {
@@ -934,9 +944,9 @@
const ReceiveDataParams& params,
const rtc::CopyOnWriteBuffer& buffer) {
RTC_DCHECK_RUN_ON(network_thread_);
- LOG(LS_VERBOSE) << debug_name_ << "->OnDataFromSctpToChannel(...): "
- << "Posting with length: " << buffer.size() << " on stream "
- << params.sid;
+ RTC_LOG(LS_VERBOSE) << debug_name_ << "->OnDataFromSctpToChannel(...): "
+ << "Posting with length: " << buffer.size()
+ << " on stream " << params.sid;
// Reports all received messages to upper layers, no matter whether the sid
// is known.
SignalDataReceived(params, buffer);
@@ -952,43 +962,43 @@
// TODO(ldixon): handle notifications appropriately.
switch (notification.sn_header.sn_type) {
case SCTP_ASSOC_CHANGE:
- LOG(LS_VERBOSE) << "SCTP_ASSOC_CHANGE";
+ RTC_LOG(LS_VERBOSE) << "SCTP_ASSOC_CHANGE";
OnNotificationAssocChange(notification.sn_assoc_change);
break;
case SCTP_REMOTE_ERROR:
- LOG(LS_INFO) << "SCTP_REMOTE_ERROR";
+ RTC_LOG(LS_INFO) << "SCTP_REMOTE_ERROR";
break;
case SCTP_SHUTDOWN_EVENT:
- LOG(LS_INFO) << "SCTP_SHUTDOWN_EVENT";
+ RTC_LOG(LS_INFO) << "SCTP_SHUTDOWN_EVENT";
break;
case SCTP_ADAPTATION_INDICATION:
- LOG(LS_INFO) << "SCTP_ADAPTATION_INDICATION";
+ RTC_LOG(LS_INFO) << "SCTP_ADAPTATION_INDICATION";
break;
case SCTP_PARTIAL_DELIVERY_EVENT:
- LOG(LS_INFO) << "SCTP_PARTIAL_DELIVERY_EVENT";
+ RTC_LOG(LS_INFO) << "SCTP_PARTIAL_DELIVERY_EVENT";
break;
case SCTP_AUTHENTICATION_EVENT:
- LOG(LS_INFO) << "SCTP_AUTHENTICATION_EVENT";
+ RTC_LOG(LS_INFO) << "SCTP_AUTHENTICATION_EVENT";
break;
case SCTP_SENDER_DRY_EVENT:
- LOG(LS_VERBOSE) << "SCTP_SENDER_DRY_EVENT";
+ RTC_LOG(LS_VERBOSE) << "SCTP_SENDER_DRY_EVENT";
SetReadyToSendData();
break;
// TODO(ldixon): Unblock after congestion.
case SCTP_NOTIFICATIONS_STOPPED_EVENT:
- LOG(LS_INFO) << "SCTP_NOTIFICATIONS_STOPPED_EVENT";
+ RTC_LOG(LS_INFO) << "SCTP_NOTIFICATIONS_STOPPED_EVENT";
break;
case SCTP_SEND_FAILED_EVENT:
- LOG(LS_INFO) << "SCTP_SEND_FAILED_EVENT";
+ RTC_LOG(LS_INFO) << "SCTP_SEND_FAILED_EVENT";
break;
case SCTP_STREAM_RESET_EVENT:
OnStreamResetEvent(¬ification.sn_strreset_event);
break;
case SCTP_ASSOC_RESET_EVENT:
- LOG(LS_INFO) << "SCTP_ASSOC_RESET_EVENT";
+ RTC_LOG(LS_INFO) << "SCTP_ASSOC_RESET_EVENT";
break;
case SCTP_STREAM_CHANGE_EVENT:
- LOG(LS_INFO) << "SCTP_STREAM_CHANGE_EVENT";
+ RTC_LOG(LS_INFO) << "SCTP_STREAM_CHANGE_EVENT";
// An acknowledgment we get after our stream resets have gone through,
// if they've failed. We log the message, but don't react -- we don't
// keep around the last-transmitted set of SSIDs we wanted to close for
@@ -996,8 +1006,8 @@
// harmless within the lifetime of a single SCTP association.
break;
default:
- LOG(LS_WARNING) << "Unknown SCTP event: "
- << notification.sn_header.sn_type;
+ RTC_LOG(LS_WARNING) << "Unknown SCTP event: "
+ << notification.sn_header.sn_type;
break;
}
}
@@ -1006,22 +1016,22 @@
RTC_DCHECK_RUN_ON(network_thread_);
switch (change.sac_state) {
case SCTP_COMM_UP:
- LOG(LS_VERBOSE) << "Association change SCTP_COMM_UP";
+ RTC_LOG(LS_VERBOSE) << "Association change SCTP_COMM_UP";
break;
case SCTP_COMM_LOST:
- LOG(LS_INFO) << "Association change SCTP_COMM_LOST";
+ RTC_LOG(LS_INFO) << "Association change SCTP_COMM_LOST";
break;
case SCTP_RESTART:
- LOG(LS_INFO) << "Association change SCTP_RESTART";
+ RTC_LOG(LS_INFO) << "Association change SCTP_RESTART";
break;
case SCTP_SHUTDOWN_COMP:
- LOG(LS_INFO) << "Association change SCTP_SHUTDOWN_COMP";
+ RTC_LOG(LS_INFO) << "Association change SCTP_SHUTDOWN_COMP";
break;
case SCTP_CANT_STR_ASSOC:
- LOG(LS_INFO) << "Association change SCTP_CANT_STR_ASSOC";
+ RTC_LOG(LS_INFO) << "Association change SCTP_CANT_STR_ASSOC";
break;
default:
- LOG(LS_INFO) << "Association change UNKNOWN";
+ RTC_LOG(LS_INFO) << "Association change UNKNOWN";
break;
}
}
@@ -1036,14 +1046,15 @@
// RE-CONFIGs.
const int num_sids = (evt->strreset_length - sizeof(*evt)) /
sizeof(evt->strreset_stream_list[0]);
- LOG(LS_VERBOSE) << "SCTP_STREAM_RESET_EVENT(" << debug_name_
- << "): Flags = 0x" << std::hex << evt->strreset_flags << " ("
- << ListFlags(evt->strreset_flags) << ")";
- LOG(LS_VERBOSE) << "Assoc = " << evt->strreset_assoc_id << ", Streams = ["
- << ListArray(evt->strreset_stream_list, num_sids)
- << "], Open: [" << ListStreams(open_streams_) << "], Q'd: ["
- << ListStreams(queued_reset_streams_) << "], Sent: ["
- << ListStreams(sent_reset_streams_) << "]";
+ RTC_LOG(LS_VERBOSE) << "SCTP_STREAM_RESET_EVENT(" << debug_name_
+ << "): Flags = 0x" << std::hex << evt->strreset_flags
+ << " (" << ListFlags(evt->strreset_flags) << ")";
+ RTC_LOG(LS_VERBOSE) << "Assoc = " << evt->strreset_assoc_id << ", Streams = ["
+ << ListArray(evt->strreset_stream_list, num_sids)
+ << "], Open: [" << ListStreams(open_streams_)
+ << "], Q'd: [" << ListStreams(queued_reset_streams_)
+ << "], Sent: [" << ListStreams(sent_reset_streams_)
+ << "]";
// If both sides try to reset some streams at the same time (even if they're
// disjoint sets), we can get reset failures.
@@ -1067,14 +1078,14 @@
// The reset was requested locally.
if (it != sent_reset_streams_.end()) {
- LOG(LS_VERBOSE) << "SCTP_STREAM_RESET_EVENT(" << debug_name_
- << "): local sid " << stream_id << " acknowledged.";
+ RTC_LOG(LS_VERBOSE) << "SCTP_STREAM_RESET_EVENT(" << debug_name_
+ << "): local sid " << stream_id << " acknowledged.";
sent_reset_streams_.erase(it);
} else if ((it = open_streams_.find(stream_id)) != open_streams_.end()) {
// The peer requested the reset.
- LOG(LS_VERBOSE) << "SCTP_STREAM_RESET_EVENT(" << debug_name_
- << "): closing sid " << stream_id;
+ RTC_LOG(LS_VERBOSE) << "SCTP_STREAM_RESET_EVENT(" << debug_name_
+ << "): closing sid " << stream_id;
open_streams_.erase(it);
SignalStreamClosedRemotely(stream_id);
@@ -1082,8 +1093,8 @@
queued_reset_streams_.end()) {
// The peer requested the reset, but there was a local reset
// queued.
- LOG(LS_VERBOSE) << "SCTP_STREAM_RESET_EVENT(" << debug_name_
- << "): double-sided close for sid " << stream_id;
+ RTC_LOG(LS_VERBOSE) << "SCTP_STREAM_RESET_EVENT(" << debug_name_
+ << "): double-sided close for sid " << stream_id;
// Both sides want the stream closed, and the peer got to send the
// RE-CONFIG first. Treat it like the local Remove(Send|Recv)Stream
// finished quickly.
@@ -1092,8 +1103,8 @@
} else {
// This stream is unknown. Sometimes this can be from an
// RESET_FAILED-related retransmit.
- LOG(LS_VERBOSE) << "SCTP_STREAM_RESET_EVENT(" << debug_name_
- << "): Unknown sid " << stream_id;
+ RTC_LOG(LS_VERBOSE) << "SCTP_STREAM_RESET_EVENT(" << debug_name_
+ << "): Unknown sid " << stream_id;
}
}
}
diff --git a/media/sctp/sctptransport_unittest.cc b/media/sctp/sctptransport_unittest.cc
index 92f7cbb..32e439a 100644
--- a/media/sctp/sctptransport_unittest.cc
+++ b/media/sctp/sctptransport_unittest.cc
@@ -150,11 +150,12 @@
bool asymmetric = false;
fake_dtls1_->SetDestination(fake_dtls2_.get(), asymmetric);
- LOG(LS_VERBOSE) << "Transport setup ----------------------------- ";
+ RTC_LOG(LS_VERBOSE) << "Transport setup ----------------------------- ";
AddStream(1);
AddStream(2);
- LOG(LS_VERBOSE) << "Connect the transports -----------------------------";
+ RTC_LOG(LS_VERBOSE)
+ << "Connect the transports -----------------------------";
// Both transports need to have started (with matching ports) for an
// association to be formed.
transport1_->Start(port1, port2);
@@ -397,34 +398,34 @@
SetupConnectedTransportsWithTwoStreams();
SendDataResult result;
- LOG(LS_VERBOSE)
+ RTC_LOG(LS_VERBOSE)
<< "transport1 sending: 'hello?' -----------------------------";
ASSERT_TRUE(SendData(transport1(), 1, "hello?", &result));
EXPECT_EQ(SDR_SUCCESS, result);
EXPECT_TRUE_WAIT(ReceivedData(receiver2(), 1, "hello?"), kDefaultTimeout);
- LOG(LS_VERBOSE) << "recv2.received=" << receiver2()->received()
- << ", recv2.last_params.sid="
- << receiver2()->last_params().sid
- << ", recv2.last_params.timestamp="
- << receiver2()->last_params().timestamp
- << ", recv2.last_params.seq_num="
- << receiver2()->last_params().seq_num
- << ", recv2.last_data=" << receiver2()->last_data();
+ RTC_LOG(LS_VERBOSE) << "recv2.received=" << receiver2()->received()
+ << ", recv2.last_params.sid="
+ << receiver2()->last_params().sid
+ << ", recv2.last_params.timestamp="
+ << receiver2()->last_params().timestamp
+ << ", recv2.last_params.seq_num="
+ << receiver2()->last_params().seq_num
+ << ", recv2.last_data=" << receiver2()->last_data();
- LOG(LS_VERBOSE)
+ RTC_LOG(LS_VERBOSE)
<< "transport2 sending: 'hi transport1' -----------------------------";
ASSERT_TRUE(SendData(transport2(), 2, "hi transport1", &result));
EXPECT_EQ(SDR_SUCCESS, result);
EXPECT_TRUE_WAIT(ReceivedData(receiver1(), 2, "hi transport1"),
kDefaultTimeout);
- LOG(LS_VERBOSE) << "recv1.received=" << receiver1()->received()
- << ", recv1.last_params.sid="
- << receiver1()->last_params().sid
- << ", recv1.last_params.timestamp="
- << receiver1()->last_params().timestamp
- << ", recv1.last_params.seq_num="
- << receiver1()->last_params().seq_num
- << ", recv1.last_data=" << receiver1()->last_data();
+ RTC_LOG(LS_VERBOSE) << "recv1.received=" << receiver1()->received()
+ << ", recv1.last_params.sid="
+ << receiver1()->last_params().sid
+ << ", recv1.last_params.timestamp="
+ << receiver1()->last_params().timestamp
+ << ", recv1.last_params.seq_num="
+ << receiver1()->last_params().seq_num
+ << ", recv1.last_data=" << receiver1()->last_data();
}
// Sends a lot of large messages at once and verifies SDR_BLOCK is returned.
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..6c44b3e 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..bb3edfc 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..4d21165 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;
}
diff --git a/ortc/ortcfactory.cc b/ortc/ortcfactory.cc
index 7fadae9..62939b9 100644
--- a/ortc/ortcfactory.cc
+++ b/ortc/ortcfactory.cc
@@ -175,7 +175,7 @@
audio_encoder_factory_(CreateBuiltinAudioEncoderFactory()),
audio_decoder_factory_(CreateBuiltinAudioDecoderFactory()) {
if (!rtc::CreateRandomString(kDefaultRtcpCnameLength, &default_cname_)) {
- LOG(LS_ERROR) << "Failed to generate CNAME?";
+ RTC_LOG(LS_ERROR) << "Failed to generate CNAME?";
RTC_NOTREACHED();
}
if (!network_thread_) {
@@ -447,8 +447,8 @@
LOG_AND_RETURN_ERROR_EX(RTCErrorType::RESOURCE_EXHAUSTED,
"Local socket allocation failure.", LS_WARNING);
}
- LOG(LS_INFO) << "Created UDP socket with address "
- << socket->GetLocalAddress().ToSensitiveString() << ".";
+ RTC_LOG(LS_INFO) << "Created UDP socket with address "
+ << socket->GetLocalAddress().ToSensitiveString() << ".";
// Make a unique debug name (for logging/diagnostics only).
std::ostringstream oss;
static int udp_id = 0;
diff --git a/ortc/rtpparametersconversion.cc b/ortc/rtpparametersconversion.cc
index 0376abd..d45b577 100644
--- a/ortc/rtpparametersconversion.cc
+++ b/ortc/rtpparametersconversion.cc
@@ -237,8 +237,8 @@
return rtc::Optional<RtcpFeedback>(
{RtcpFeedbackType::CCM, RtcpFeedbackMessageType::FIR});
} else {
- LOG(LS_WARNING) << "Unsupported parameter for CCM RTCP feedback: "
- << cricket_feedback.param();
+ RTC_LOG(LS_WARNING) << "Unsupported parameter for CCM RTCP feedback: "
+ << cricket_feedback.param();
return rtc::Optional<RtcpFeedback>();
}
} else if (cricket_feedback.id() == cricket::kRtcpFbParamNack) {
@@ -249,21 +249,21 @@
return rtc::Optional<RtcpFeedback>(
{RtcpFeedbackType::NACK, RtcpFeedbackMessageType::PLI});
} else {
- LOG(LS_WARNING) << "Unsupported parameter for NACK RTCP feedback: "
- << cricket_feedback.param();
+ RTC_LOG(LS_WARNING) << "Unsupported parameter for NACK RTCP feedback: "
+ << cricket_feedback.param();
return rtc::Optional<RtcpFeedback>();
}
} else if (cricket_feedback.id() == cricket::kRtcpFbParamRemb) {
if (!cricket_feedback.param().empty()) {
- LOG(LS_WARNING) << "Unsupported parameter for REMB RTCP feedback: "
- << cricket_feedback.param();
+ RTC_LOG(LS_WARNING) << "Unsupported parameter for REMB RTCP feedback: "
+ << cricket_feedback.param();
return rtc::Optional<RtcpFeedback>();
} else {
return rtc::Optional<RtcpFeedback>(RtcpFeedback(RtcpFeedbackType::REMB));
}
} else if (cricket_feedback.id() == cricket::kRtcpFbParamTransportCc) {
if (!cricket_feedback.param().empty()) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "Unsupported parameter for transport-cc RTCP feedback: "
<< cricket_feedback.param();
return rtc::Optional<RtcpFeedback>();
@@ -272,8 +272,8 @@
RtcpFeedback(RtcpFeedbackType::TRANSPORT_CC));
}
}
- LOG(LS_WARNING) << "Unsupported RTCP feedback type: "
- << cricket_feedback.id();
+ RTC_LOG(LS_WARNING) << "Unsupported RTCP feedback type: "
+ << cricket_feedback.id();
return rtc::Optional<RtcpFeedback>();
}
diff --git a/ortc/rtptransportcontrolleradapter.cc b/ortc/rtptransportcontrolleradapter.cc
index eaf5232..a0ccda6 100644
--- a/ortc/rtptransportcontrolleradapter.cc
+++ b/ortc/rtptransportcontrolleradapter.cc
@@ -107,7 +107,7 @@
RtpTransportControllerAdapter::~RtpTransportControllerAdapter() {
RTC_DCHECK_RUN_ON(signaling_thread_);
if (!transport_proxies_.empty()) {
- LOG(LS_ERROR)
+ RTC_LOG(LS_ERROR)
<< "Destroying RtpTransportControllerAdapter while RtpTransports "
"are still using it; this is unsafe.";
}
diff --git a/p2p/base/basicpacketsocketfactory.cc b/p2p/base/basicpacketsocketfactory.cc
index 7438a9b..86b9e85 100644
--- a/p2p/base/basicpacketsocketfactory.cc
+++ b/p2p/base/basicpacketsocketfactory.cc
@@ -56,8 +56,7 @@
return NULL;
}
if (BindSocket(socket, address, min_port, max_port) < 0) {
- LOG(LS_ERROR) << "UDP bind failed with error "
- << socket->GetError();
+ RTC_LOG(LS_ERROR) << "UDP bind failed with error " << socket->GetError();
delete socket;
return NULL;
}
@@ -71,7 +70,7 @@
int opts) {
// Fail if TLS is required.
if (opts & PacketSocketFactory::OPT_TLS) {
- LOG(LS_ERROR) << "TLS support currently is not available.";
+ RTC_LOG(LS_ERROR) << "TLS support currently is not available.";
return NULL;
}
@@ -82,8 +81,7 @@
}
if (BindSocket(socket, local_address, min_port, max_port) < 0) {
- LOG(LS_ERROR) << "TCP bind failed with error "
- << socket->GetError();
+ RTC_LOG(LS_ERROR) << "TCP bind failed with error " << socket->GetError();
delete socket;
return NULL;
}
@@ -133,10 +131,10 @@
// is mostly redundant in the first place. The socket will be bound when we
// call Connect() instead.
if (local_address.IsAnyIP()) {
- LOG(LS_WARNING) << "TCP bind failed with error " << socket->GetError()
- << "; ignoring since socket is using 'any' address.";
+ RTC_LOG(LS_WARNING) << "TCP bind failed with error " << socket->GetError()
+ << "; ignoring since socket is using 'any' address.";
} else {
- LOG(LS_ERROR) << "TCP bind failed with error " << socket->GetError();
+ RTC_LOG(LS_ERROR) << "TCP bind failed with error " << socket->GetError();
delete socket;
return NULL;
}
@@ -186,8 +184,7 @@
}
if (socket->Connect(remote_address) < 0) {
- LOG(LS_ERROR) << "TCP connect failed with error "
- << socket->GetError();
+ RTC_LOG(LS_ERROR) << "TCP connect failed with error " << socket->GetError();
delete socket;
return NULL;
}
diff --git a/p2p/base/common.h b/p2p/base/common.h
index ce92642..aa5da42 100644
--- a/p2p/base/common.h
+++ b/p2p/base/common.h
@@ -14,7 +14,7 @@
#include "rtc_base/logging.h"
// Common log description format for jingle messages
-#define LOG_J(sev, obj) LOG(sev) << "Jingle:" << obj->ToString() << ": "
-#define LOG_JV(sev, obj) LOG_V(sev) << "Jingle:" << obj->ToString() << ": "
+#define LOG_J(sev, obj) RTC_LOG(sev) << "Jingle:" << obj->ToString() << ": "
+#define LOG_JV(sev, obj) RTC_LOG_V(sev) << "Jingle:" << obj->ToString() << ": "
#endif // P2P_BASE_COMMON_H_
diff --git a/p2p/base/dtlstransport.cc b/p2p/base/dtlstransport.cc
index 267d0c7..c1b65ee 100644
--- a/p2p/base/dtlstransport.cc
+++ b/p2p/base/dtlstransport.cc
@@ -186,8 +186,8 @@
bool DtlsTransport::SetSslMaxProtocolVersion(rtc::SSLProtocolVersion version) {
if (dtls_active_) {
- LOG(LS_ERROR) << "Not changing max. protocol version "
- << "while DTLS is negotiating";
+ RTC_LOG(LS_ERROR) << "Not changing max. protocol version "
+ << "while DTLS is negotiating";
return false;
}
@@ -198,7 +198,8 @@
bool DtlsTransport::SetSslRole(rtc::SSLRole role) {
if (dtls_) {
if (ssl_role_ != role) {
- LOG(LS_ERROR) << "SSL Role can't be reversed after the session is setup.";
+ RTC_LOG(LS_ERROR)
+ << "SSL Role can't be reversed after the session is setup.";
return false;
}
return true;
diff --git a/p2p/base/dtlstransport_unittest.cc b/p2p/base/dtlstransport_unittest.cc
index fbc86f3..eaa0cec 100644
--- a/p2p/base/dtlstransport_unittest.cc
+++ b/p2p/base/dtlstransport_unittest.cc
@@ -24,10 +24,10 @@
#include "rtc_base/sslstreamadapter.h"
#include "rtc_base/stringutils.h"
-#define MAYBE_SKIP_TEST(feature) \
- if (!(rtc::SSLStreamAdapter::feature())) { \
- LOG(LS_INFO) << #feature " feature disabled... skipping"; \
- return; \
+#define MAYBE_SKIP_TEST(feature) \
+ if (!(rtc::SSLStreamAdapter::feature())) { \
+ RTC_LOG(LS_INFO) << #feature " feature disabled... skipping"; \
+ return; \
}
static const char kIceUfrag1[] = "TESTICEUFRAG0001";
@@ -359,8 +359,8 @@
// Transport channel callbacks
void OnTransportChannelWritableState(
rtc::PacketTransportInternal* transport) {
- LOG(LS_INFO) << name_ << ": Channel '" << transport->debug_name()
- << "' is writable";
+ RTC_LOG(LS_INFO) << name_ << ": Channel '" << transport->debug_name()
+ << "' is writable";
}
void OnTransportChannelReadPacket(rtc::PacketTransportInternal* transport,
@@ -587,7 +587,7 @@
}
void TestTransfer(size_t transport, size_t size, size_t count, bool srtp) {
- LOG(LS_INFO) << "Expect packets, size=" << size;
+ RTC_LOG(LS_INFO) << "Expect packets, size=" << size;
client2_.ExpectPackets(transport, size);
client1_.SendPackets(transport, size, count, srtp);
EXPECT_EQ_SIMULATED_WAIT(count, client2_.NumPacketsReceived(), kTimeout,
diff --git a/p2p/base/fakeicetransport.h b/p2p/base/fakeicetransport.h
index e53705a..7b6f78a 100644
--- a/p2p/base/fakeicetransport.h
+++ b/p2p/base/fakeicetransport.h
@@ -210,7 +210,7 @@
if (writable_ == writable) {
return;
}
- LOG(INFO) << "set_writable from:" << writable_ << " to " << writable;
+ RTC_LOG(INFO) << "set_writable from:" << writable_ << " to " << writable;
writable_ = writable;
if (writable_) {
SignalReadyToSend(this);
diff --git a/p2p/base/jseptransport.cc b/p2p/base/jseptransport.cc
index ad84e47..dbbb875 100644
--- a/p2p/base/jseptransport.cc
+++ b/p2p/base/jseptransport.cc
@@ -107,7 +107,7 @@
if (err_desc) {
*err_desc = desc;
}
- LOG(LS_ERROR) << desc;
+ RTC_LOG(LS_ERROR) << desc;
return false;
}
@@ -171,7 +171,8 @@
bool JsepTransport::AddChannel(DtlsTransportInternal* dtls, int component) {
if (channels_.find(component) != channels_.end()) {
- LOG(LS_ERROR) << "Adding channel for component " << component << " twice.";
+ RTC_LOG(LS_ERROR) << "Adding channel for component " << component
+ << " twice.";
return false;
}
channels_[component] = dtls;
@@ -182,8 +183,8 @@
// TODO(deadbeef): Once this is fixed, make the warning an error, and remove
// the calls to "ApplyXTransportDescription" below.
if (local_description_set_ || remote_description_set_) {
- LOG(LS_WARNING) << "Adding new transport channel after "
- "transport description already applied.";
+ RTC_LOG(LS_WARNING) << "Adding new transport channel after "
+ "transport description already applied.";
}
bool ret = true;
std::string err;
@@ -202,8 +203,8 @@
bool JsepTransport::RemoveChannel(int component) {
auto it = channels_.find(component);
if (it == channels_.end()) {
- LOG(LS_ERROR) << "Trying to remove channel for component " << component
- << ", which doesn't exist.";
+ RTC_LOG(LS_ERROR) << "Trying to remove channel for component " << component
+ << ", which doesn't exist.";
return false;
}
channels_.erase(component);
@@ -274,7 +275,8 @@
if (needs_ice_restart_ && ice_restarting) {
needs_ice_restart_ = false;
- LOG(LS_VERBOSE) << "needs-ice-restart flag cleared for transport " << mid();
+ RTC_LOG(LS_VERBOSE) << "needs-ice-restart flag cleared for transport "
+ << mid();
}
local_description_set_ = true;
@@ -311,7 +313,7 @@
void JsepTransport::SetNeedsIceRestartFlag() {
if (!needs_ice_restart_) {
needs_ice_restart_ = true;
- LOG(LS_VERBOSE) << "needs-ice-restart flag set for transport " << mid();
+ RTC_LOG(LS_VERBOSE) << "needs-ice-restart flag set for transport " << mid();
}
}
diff --git a/p2p/base/p2ptransportchannel.cc b/p2p/base/p2ptransportchannel.cc
index cebff9e..71af75c 100644
--- a/p2p/base/p2ptransportchannel.cc
+++ b/p2p/base/p2ptransportchannel.cc
@@ -233,7 +233,7 @@
bool missed_receiving_unchanged_threshold = false;
if (ShouldSwitchSelectedConnection(new_connection,
&missed_receiving_unchanged_threshold)) {
- LOG(LS_INFO) << "Switching selected connection due to " << reason;
+ RTC_LOG(LS_INFO) << "Switching selected connection due to " << reason;
SwitchSelectedConnection(new_connection);
return true;
}
@@ -271,7 +271,7 @@
void P2PTransportChannel::SetIceTiebreaker(uint64_t tiebreaker) {
RTC_DCHECK(network_thread_ == rtc::Thread::Current());
if (!ports_.empty() || !pruned_ports_.empty()) {
- LOG(LS_ERROR)
+ RTC_LOG(LS_ERROR)
<< "Attempt to change tiebreaker after Port has been allocated.";
return;
}
@@ -347,9 +347,9 @@
void P2PTransportChannel::SetIceParameters(const IceParameters& ice_params) {
RTC_DCHECK(network_thread_ == rtc::Thread::Current());
- LOG(LS_INFO) << "Set ICE ufrag: " << ice_params.ufrag
- << " pwd: " << ice_params.pwd << " on transport "
- << transport_name();
+ RTC_LOG(LS_INFO) << "Set ICE ufrag: " << ice_params.ufrag
+ << " pwd: " << ice_params.pwd << " on transport "
+ << transport_name();
ice_parameters_ = ice_params;
// Note: Candidate gathering will restart when MaybeStartGathering is next
// called.
@@ -358,9 +358,9 @@
void P2PTransportChannel::SetRemoteIceParameters(
const IceParameters& ice_params) {
RTC_DCHECK(network_thread_ == rtc::Thread::Current());
- LOG(LS_INFO) << "Received remote ICE parameters: ufrag=" << ice_params.ufrag
- << ", renomination "
- << (ice_params.renomination ? "enabled" : "disabled");
+ RTC_LOG(LS_INFO) << "Received remote ICE parameters: ufrag="
+ << ice_params.ufrag << ", renomination "
+ << (ice_params.renomination ? "enabled" : "disabled");
IceParameters* current_ice = remote_ice();
if (!current_ice || *current_ice != ice_params) {
// Keep the ICE credentials so that newer connections
@@ -392,12 +392,12 @@
void P2PTransportChannel::SetIceConfig(const IceConfig& config) {
if (config_.continual_gathering_policy != config.continual_gathering_policy) {
if (!allocator_sessions_.empty()) {
- LOG(LS_ERROR) << "Trying to change continual gathering policy "
- << "when gathering has already started!";
+ RTC_LOG(LS_ERROR) << "Trying to change continual gathering policy "
+ << "when gathering has already started!";
} else {
config_.continual_gathering_policy = config.continual_gathering_policy;
- LOG(LS_INFO) << "Set continual_gathering_policy to "
- << config_.continual_gathering_policy;
+ RTC_LOG(LS_INFO) << "Set continual_gathering_policy to "
+ << config_.continual_gathering_policy;
}
}
@@ -406,8 +406,9 @@
config.backup_connection_ping_interval) {
config_.backup_connection_ping_interval =
config.backup_connection_ping_interval;
- LOG(LS_INFO) << "Set backup connection ping interval to "
- << config_.backup_connection_ping_interval << " milliseconds.";
+ RTC_LOG(LS_INFO) << "Set backup connection ping interval to "
+ << config_.backup_connection_ping_interval
+ << " milliseconds.";
}
if (config.receiving_timeout >= 0 &&
@@ -419,42 +420,42 @@
for (Connection* connection : connections_) {
connection->set_receiving_timeout(config_.receiving_timeout);
}
- LOG(LS_INFO) << "Set ICE receiving timeout to " << config_.receiving_timeout
- << " milliseconds";
+ RTC_LOG(LS_INFO) << "Set ICE receiving timeout to "
+ << config_.receiving_timeout << " milliseconds";
}
config_.prioritize_most_likely_candidate_pairs =
config.prioritize_most_likely_candidate_pairs;
- LOG(LS_INFO) << "Set ping most likely connection to "
- << config_.prioritize_most_likely_candidate_pairs;
+ RTC_LOG(LS_INFO) << "Set ping most likely connection to "
+ << config_.prioritize_most_likely_candidate_pairs;
if (config.stable_writable_connection_ping_interval >= 0 &&
config_.stable_writable_connection_ping_interval !=
config.stable_writable_connection_ping_interval) {
config_.stable_writable_connection_ping_interval =
config.stable_writable_connection_ping_interval;
- LOG(LS_INFO) << "Set stable_writable_connection_ping_interval to "
- << config_.stable_writable_connection_ping_interval;
+ RTC_LOG(LS_INFO) << "Set stable_writable_connection_ping_interval to "
+ << config_.stable_writable_connection_ping_interval;
}
if (config.presume_writable_when_fully_relayed !=
config_.presume_writable_when_fully_relayed) {
if (!connections_.empty()) {
- LOG(LS_ERROR) << "Trying to change 'presume writable' "
- << "while connections already exist!";
+ RTC_LOG(LS_ERROR) << "Trying to change 'presume writable' "
+ << "while connections already exist!";
} else {
config_.presume_writable_when_fully_relayed =
config.presume_writable_when_fully_relayed;
- LOG(LS_INFO) << "Set presume writable when fully relayed to "
- << config_.presume_writable_when_fully_relayed;
+ RTC_LOG(LS_INFO) << "Set presume writable when fully relayed to "
+ << config_.presume_writable_when_fully_relayed;
}
}
if (config.regather_on_failed_networks_interval) {
config_.regather_on_failed_networks_interval =
config.regather_on_failed_networks_interval;
- LOG(LS_INFO) << "Set regather_on_failed_networks_interval to "
- << *config_.regather_on_failed_networks_interval;
+ RTC_LOG(LS_INFO) << "Set regather_on_failed_networks_interval to "
+ << *config_.regather_on_failed_networks_interval;
}
if (config.regather_all_networks_interval_range) {
@@ -462,26 +463,26 @@
RTC_DCHECK(config.continual_gathering_policy != GATHER_ONCE);
config_.regather_all_networks_interval_range =
config.regather_all_networks_interval_range;
- LOG(LS_INFO) << "Set regather_all_networks_interval_range to "
- << config.regather_all_networks_interval_range->ToString();
+ RTC_LOG(LS_INFO) << "Set regather_all_networks_interval_range to "
+ << config.regather_all_networks_interval_range->ToString();
}
if (config.receiving_switching_delay) {
config_.receiving_switching_delay = config.receiving_switching_delay;
- LOG(LS_INFO) << "Set receiving_switching_delay to"
- << *config_.receiving_switching_delay;
+ RTC_LOG(LS_INFO) << "Set receiving_switching_delay to"
+ << *config_.receiving_switching_delay;
}
if (config_.default_nomination_mode != config.default_nomination_mode) {
config_.default_nomination_mode = config.default_nomination_mode;
- LOG(LS_INFO) << "Set default nomination mode to "
- << static_cast<int>(config_.default_nomination_mode);
+ RTC_LOG(LS_INFO) << "Set default nomination mode to "
+ << static_cast<int>(config_.default_nomination_mode);
}
if (config_.ice_check_min_interval != config.ice_check_min_interval) {
config_.ice_check_min_interval = config.ice_check_min_interval;
- LOG(LS_INFO) << "Set min ping interval to "
- << *config_.ice_check_min_interval;
+ RTC_LOG(LS_INFO) << "Set min ping interval to "
+ << *config_.ice_check_min_interval;
}
}
@@ -496,9 +497,10 @@
void P2PTransportChannel::MaybeStartGathering() {
if (ice_parameters_.ufrag.empty() || ice_parameters_.pwd.empty()) {
- LOG(LS_ERROR) << "Cannot gather candidates because ICE parameters are empty"
- << " ufrag: " << ice_parameters_.ufrag
- << " pwd: " << ice_parameters_.pwd;
+ RTC_LOG(LS_ERROR)
+ << "Cannot gather candidates because ICE parameters are empty"
+ << " ufrag: " << ice_parameters_.ufrag
+ << " pwd: " << ice_parameters_.pwd;
return;
}
// Start gathering if we never started before, or if an ICE restart occurred.
@@ -610,15 +612,15 @@
PortAllocatorSession* session) {
RTC_DCHECK(network_thread_ == rtc::Thread::Current());
if (config_.gather_continually()) {
- LOG(LS_INFO) << "P2PTransportChannel: " << transport_name()
- << ", component " << component()
- << " gathering complete, but using continual "
- << "gathering so not changing gathering state.";
+ RTC_LOG(LS_INFO) << "P2PTransportChannel: " << transport_name()
+ << ", component " << component()
+ << " gathering complete, but using continual "
+ << "gathering so not changing gathering state.";
return;
}
gathering_state_ = kIceGatheringComplete;
- LOG(LS_INFO) << "P2PTransportChannel: " << transport_name() << ", component "
- << component() << " gathering complete";
+ RTC_LOG(LS_INFO) << "P2PTransportChannel: " << transport_name()
+ << ", component " << component() << " gathering complete";
SignalGatheringState(this);
}
@@ -666,9 +668,9 @@
const StunUInt32Attribute* priority_attr =
stun_msg->GetUInt32(STUN_ATTR_PRIORITY);
if (!priority_attr) {
- LOG(LS_WARNING) << "P2PTransportChannel::OnUnknownAddress - "
- << "No STUN_ATTR_PRIORITY found in the "
- << "stun request message";
+ RTC_LOG(LS_WARNING) << "P2PTransportChannel::OnUnknownAddress - "
+ << "No STUN_ATTR_PRIORITY found in the "
+ << "stun request message";
port->SendBindingErrorResponse(stun_msg, address, STUN_ERROR_BAD_REQUEST,
STUN_ERROR_REASON_BAD_REQUEST);
return;
@@ -712,8 +714,8 @@
// simply ignore the signal otherwise send server error.
if (port->GetConnection(remote_candidate.address())) {
if (port_muxed) {
- LOG(LS_INFO) << "Connection already exists for peer reflexive "
- << "candidate: " << remote_candidate.ToString();
+ RTC_LOG(LS_INFO) << "Connection already exists for peer reflexive "
+ << "candidate: " << remote_candidate.ToString();
return;
} else {
RTC_NOTREACHED();
@@ -734,9 +736,10 @@
return;
}
- LOG(LS_INFO) << "Adding connection from "
- << (remote_candidate_is_new ? "peer reflexive" : "resurrected")
- << " candidate: " << remote_candidate.ToString();
+ RTC_LOG(LS_INFO) << "Adding connection from "
+ << (remote_candidate_is_new ? "peer reflexive"
+ : "resurrected")
+ << " candidate: " << remote_candidate.ToString();
AddConnection(connection);
connection->HandleBindingRequest(stun_msg);
@@ -780,7 +783,7 @@
// connections and update the read/write state of the channel.
RequestSortAndStateUpdate();
} else {
- LOG(LS_INFO)
+ RTC_LOG(LS_INFO)
<< "Not switching the selected connection on controlled side yet: "
<< conn->ToString();
}
@@ -792,9 +795,9 @@
uint32_t generation = GetRemoteCandidateGeneration(candidate);
// If a remote candidate with a previous generation arrives, drop it.
if (generation < remote_ice_generation()) {
- LOG(LS_WARNING) << "Dropping a remote candidate because its ufrag "
- << candidate.username()
- << " indicates it was for a previous generation.";
+ RTC_LOG(LS_WARNING) << "Dropping a remote candidate because its ufrag "
+ << candidate.username()
+ << " indicates it was for a previous generation.";
return;
}
@@ -815,8 +818,9 @@
} else {
// The candidate belongs to the next generation. Its pwd will be set
// when the new remote ICE credentials arrive.
- LOG(LS_WARNING) << "A remote candidate arrives with an unknown ufrag: "
- << candidate.username();
+ RTC_LOG(LS_WARNING)
+ << "A remote candidate arrives with an unknown ufrag: "
+ << candidate.username();
}
}
@@ -841,7 +845,8 @@
return cand_to_remove.MatchesForRemoval(candidate);
});
if (iter != remote_candidates_.end()) {
- LOG(LS_VERBOSE) << "Removed remote candidate " << cand_to_remove.ToString();
+ RTC_LOG(LS_VERBOSE) << "Removed remote candidate "
+ << cand_to_remove.ToString();
remote_candidates_.erase(iter, remote_candidates_.end());
}
}
@@ -927,10 +932,10 @@
// It is not legal to try to change any of the parameters of an existing
// connection; however, the other side can send a duplicate candidate.
if (!remote_candidate.IsEquivalent(connection->remote_candidate())) {
- LOG(INFO) << "Attempt to change a remote candidate."
- << " Existing remote candidate: "
- << connection->remote_candidate().ToString()
- << "New remote candidate: " << remote_candidate.ToString();
+ RTC_LOG(INFO) << "Attempt to change a remote candidate."
+ << " Existing remote candidate: "
+ << connection->remote_candidate().ToString()
+ << "New remote candidate: " << remote_candidate.ToString();
}
return false;
}
@@ -979,8 +984,8 @@
size_t i = 0;
while (i < remote_candidates_.size()) {
if (remote_candidates_[i].generation() < remote_candidate.generation()) {
- LOG(INFO) << "Pruning candidate from old generation: "
- << remote_candidates_[i].address().ToSensitiveString();
+ RTC_LOG(INFO) << "Pruning candidate from old generation: "
+ << remote_candidates_[i].address().ToSensitiveString();
remote_candidates_.erase(remote_candidates_.begin() + i);
} else {
i += 1;
@@ -989,7 +994,7 @@
// Make sure this candidate is not a duplicate.
if (IsDuplicateRemoteCandidate(remote_candidate)) {
- LOG(INFO) << "Duplicate candidate: " << remote_candidate.ToString();
+ RTC_LOG(INFO) << "Duplicate candidate: " << remote_candidate.ToString();
return;
}
@@ -1015,8 +1020,8 @@
if (val < 0) {
// Because this also occurs deferred, probably no point in reporting an
// error
- LOG(WARNING) << "SetOption(" << opt << ", " << value
- << ") failed: " << port->GetError();
+ RTC_LOG(WARNING) << "SetOption(" << opt << ", " << value
+ << ") failed: " << port->GetError();
}
}
return 0;
@@ -1339,10 +1344,10 @@
return a->rtt() < b->rtt();
});
- LOG(LS_VERBOSE) << "Sorting " << connections_.size()
- << " available connections:";
+ RTC_LOG(LS_VERBOSE) << "Sorting " << connections_.size()
+ << " available connections:";
for (size_t i = 0; i < connections_.size(); ++i) {
- LOG(LS_VERBOSE) << connections_[i]->ToString();
+ RTC_LOG(LS_VERBOSE) << connections_[i]->ToString();
}
Connection* top_connection =
@@ -1926,7 +1931,7 @@
// we can just set selected to nullptr and re-choose a best assuming that
// there was no selected connection.
if (selected_connection_ == connection) {
- LOG(LS_INFO) << "Selected connection destroyed. Will choose a new one.";
+ RTC_LOG(LS_INFO) << "Selected connection destroyed. Will choose a new one.";
SwitchSelectedConnection(nullptr);
RequestSortAndStateUpdate();
} else {
@@ -1946,8 +1951,8 @@
pruned_ports_.erase(
std::remove(pruned_ports_.begin(), pruned_ports_.end(), port),
pruned_ports_.end());
- LOG(INFO) << "Removed port because it is destroyed: " << ports_.size()
- << " remaining";
+ RTC_LOG(INFO) << "Removed port because it is destroyed: " << ports_.size()
+ << " remaining";
}
void P2PTransportChannel::OnPortsPruned(
@@ -1956,8 +1961,8 @@
RTC_DCHECK(network_thread_ == rtc::Thread::Current());
for (PortInterface* port : ports) {
if (PrunePort(port)) {
- LOG(INFO) << "Removed port: " << port->ToString() << " " << ports_.size()
- << " remaining";
+ RTC_LOG(INFO) << "Removed port: " << port->ToString() << " "
+ << ports_.size() << " remaining";
}
}
}
@@ -2076,8 +2081,8 @@
}
if (oldest_needing_triggered_check) {
- LOG(LS_INFO) << "Selecting connection for triggered check: "
- << oldest_needing_triggered_check->ToString();
+ RTC_LOG(LS_INFO) << "Selecting connection for triggered check: "
+ << oldest_needing_triggered_check->ToString();
}
return oldest_needing_triggered_check;
}
diff --git a/p2p/base/p2ptransportchannel_unittest.cc b/p2p/base/p2ptransportchannel_unittest.cc
index ca1156c..326cafa 100644
--- a/p2p/base/p2ptransportchannel_unittest.cc
+++ b/p2p/base/p2ptransportchannel_unittest.cc
@@ -557,10 +557,10 @@
expected.connect_wait + kShortTimeout, clock);
connect_time = rtc::TimeMillis() - connect_start;
if (connect_time < expected.connect_wait) {
- LOG(LS_INFO) << "Connect time: " << connect_time << " ms";
+ RTC_LOG(LS_INFO) << "Connect time: " << connect_time << " ms";
} else {
- LOG(LS_INFO) << "Connect time: " << "TIMEOUT ("
- << expected.connect_wait << " ms)";
+ RTC_LOG(LS_INFO) << "Connect time: "
+ << "TIMEOUT (" << expected.connect_wait << " ms)";
}
// Allow a few turns of the crank for the selected connections to emerge.
@@ -582,10 +582,10 @@
converge_time = rtc::TimeMillis() - converge_start;
int64_t converge_wait = 2000;
if (converge_time < converge_wait) {
- LOG(LS_INFO) << "Converge time: " << converge_time << " ms";
+ RTC_LOG(LS_INFO) << "Converge time: " << converge_time << " ms";
} else {
- LOG(LS_INFO) << "Converge time: " << "TIMEOUT ("
- << converge_wait << " ms)";
+ RTC_LOG(LS_INFO) << "Converge time: "
+ << "TIMEOUT (" << converge_wait << " ms)";
}
}
// Try sending some data to other end.
@@ -766,8 +766,8 @@
c.set_username("");
c.set_password("");
}
- LOG(LS_INFO) << "Candidate(" << data->channel->component() << "->"
- << rch->component() << "): " << c.ToString();
+ RTC_LOG(LS_INFO) << "Candidate(" << data->channel->component() << "->"
+ << rch->component() << "): " << c.ToString();
rch->AddRemoteCandidate(c);
}
break;
@@ -780,7 +780,7 @@
return;
}
for (Candidate& c : data->candidates) {
- LOG(LS_INFO) << "Removed remote candidate " << c.ToString();
+ RTC_LOG(LS_INFO) << "Removed remote candidate " << c.ToString();
rch->RemoveRemoteCandidate(c);
}
break;
@@ -1113,7 +1113,7 @@
if (kMatrix[x][y] != NULL) \
Test(*kMatrix[x][y]); \
else \
- LOG(LS_WARNING) << "Not yet implemented"; \
+ RTC_LOG(LS_WARNING) << "Not yet implemented"; \
}
#define P2P_TEST(x, y) \
@@ -2294,7 +2294,7 @@
RemoteCandidate(ep1_ch1())->address().EqualIPs(kPublicAddrs[1]));
// Blackhole any traffic to or from the public addrs.
- LOG(LS_INFO) << "Failing over...";
+ RTC_LOG(LS_INFO) << "Failing over...";
fw()->AddRule(false, rtc::FP_ANY, rtc::FD_ANY, kPublicAddrs[1]);
// The selected connections may switch, so keep references to them.
const Connection* selected_connection1 = ep1_ch1()->selected_connection();
@@ -2345,7 +2345,7 @@
RemoteCandidate(ep1_ch1())->address().EqualIPs(kPublicAddrs[1]));
// Blackhole any traffic to or from the public addrs.
- LOG(LS_INFO) << "Failing over...";
+ RTC_LOG(LS_INFO) << "Failing over...";
fw()->AddRule(false, rtc::FP_ANY, rtc::FD_ANY, kPublicAddrs[0]);
// The selected connections will switch, so keep references to them.
const Connection* selected_connection1 = ep1_ch1()->selected_connection();
@@ -2422,7 +2422,7 @@
kMediumTimeout, clock);
// Blackhole any traffic to or from the wifi on endpoint 1.
- LOG(LS_INFO) << "Failing over...";
+ RTC_LOG(LS_INFO) << "Failing over...";
fw()->AddRule(false, rtc::FP_ANY, rtc::FD_ANY, wifi[0]);
fw()->AddRule(false, rtc::FP_ANY, rtc::FD_ANY, wifiIpv6[0]);
@@ -2502,7 +2502,7 @@
EXPECT_FALSE(nominated());
// Blackhole any traffic to or from the public addrs.
- LOG(LS_INFO) << "Failing over...";
+ RTC_LOG(LS_INFO) << "Failing over...";
fw()->AddRule(false, rtc::FP_ANY, rtc::FD_ANY, kPublicAddrs[0]);
// The selected connection on the controlling side should switch.
@@ -2555,7 +2555,7 @@
reset_selected_candidate_pair_switches();
// Blackhole any traffic to or from the public addrs.
- LOG(LS_INFO) << "Failing over...";
+ RTC_LOG(LS_INFO) << "Failing over...";
fw()->AddRule(false, rtc::FP_ANY, rtc::FD_ANY, kPublicAddrs[1]);
// The selected connections may switch, so keep references to them.
@@ -2613,7 +2613,7 @@
reset_selected_candidate_pair_switches();
// Blackhole any traffic to or from the public addrs.
- LOG(LS_INFO) << "Failing over...";
+ RTC_LOG(LS_INFO) << "Failing over...";
fw()->AddRule(false, rtc::FP_ANY, rtc::FD_ANY, kPublicAddrs[0]);
// The selected connections may switch, so keep references to them.
const Connection* selected_connection1 = ep1_ch1()->selected_connection();
@@ -2681,7 +2681,7 @@
clock);
reset_selected_candidate_pair_switches();
// Blackhole any traffic to or from the remote WiFi networks.
- LOG(LS_INFO) << "Failing over...";
+ RTC_LOG(LS_INFO) << "Failing over...";
fw()->AddRule(false, rtc::FP_ANY, rtc::FD_ANY, wifi[1]);
int num_switches = 0;
@@ -2790,7 +2790,7 @@
kDefaultTimeout);
int time_elapsed =
backup_conn->last_ping_response_received() - last_ping_response_ms;
- LOG(LS_INFO) << "Time elapsed: " << time_elapsed;
+ RTC_LOG(LS_INFO) << "Time elapsed: " << time_elapsed;
EXPECT_GE(time_elapsed, backup_ping_interval);
DestroyChannels();
@@ -2929,7 +2929,7 @@
RemoteCandidate(ep1_ch1())->address().EqualIPs(kPublicAddrs[1]));
// Add the new address first and then remove the other one.
- LOG(LS_INFO) << "Draining...";
+ RTC_LOG(LS_INFO) << "Draining...";
AddAddress(1, kAlternateAddrs[1]);
RemoveAddress(1, kPublicAddrs[1]);
// We should switch to use the alternate address after an exchange of pings.
@@ -2940,7 +2940,7 @@
kMediumTimeout, clock);
// Remove one address first and then add another address.
- LOG(LS_INFO) << "Draining again...";
+ RTC_LOG(LS_INFO) << "Draining again...";
RemoveAddress(1, kAlternateAddrs[1]);
AddAddress(1, kAlternateAddrs[0]);
EXPECT_TRUE_SIMULATED_WAIT(
diff --git a/p2p/base/port.cc b/p2p/base/port.cc
index f742dee..8ffc688 100644
--- a/p2p/base/port.cc
+++ b/p2p/base/port.cc
@@ -374,13 +374,13 @@
} else if (!msg) {
// STUN message handled already
} else if (msg->type() == STUN_BINDING_REQUEST) {
- LOG(LS_INFO) << "Received STUN ping "
- << " id=" << rtc::hex_encode(msg->transaction_id())
- << " from unknown address " << addr.ToSensitiveString();
+ RTC_LOG(LS_INFO) << "Received STUN ping "
+ << " id=" << rtc::hex_encode(msg->transaction_id())
+ << " from unknown address " << addr.ToSensitiveString();
// Check for role conflicts.
if (!MaybeIceRoleConflict(addr, msg.get(), remote_username)) {
- LOG(LS_INFO) << "Received conflicting role from the peer.";
+ RTC_LOG(LS_INFO) << "Received conflicting role from the peer.";
return;
}
@@ -764,10 +764,11 @@
if (network_cost_ == new_cost) {
return;
}
- LOG(LS_INFO) << "Network cost changed from " << network_cost_
- << " to " << new_cost
- << ". Number of candidates created: " << candidates_.size()
- << ". Number of connections created: " << connections_.size();
+ RTC_LOG(LS_INFO) << "Network cost changed from " << network_cost_ << " to "
+ << new_cost
+ << ". Number of candidates created: " << candidates_.size()
+ << ". Number of connections created: "
+ << connections_.size();
network_cost_ = new_cost;
for (cricket::Candidate& candidate : candidates_) {
candidate.set_network_cost(network_cost_);
@@ -1058,8 +1059,9 @@
// If timed out sending writability checks, start up again
if (!pruned_ && (write_state_ == STATE_WRITE_TIMEOUT)) {
- LOG(LS_WARNING) << "Received a data packet on a timed-out Connection. "
- << "Resetting state to STATE_WRITE_INIT.";
+ RTC_LOG(LS_WARNING)
+ << "Received a data packet on a timed-out Connection. "
+ << "Resetting state to STATE_WRITE_INIT.";
set_write_state(STATE_WRITE_INIT);
}
} else if (!msg) {
@@ -1126,7 +1128,7 @@
// Check for role conflicts.
if (!port_->MaybeIceRoleConflict(remote_addr, msg, remote_ufrag)) {
// Received conflicting role from the peer.
- LOG(LS_INFO) << "Received conflicting role from the peer.";
+ RTC_LOG(LS_INFO) << "Received conflicting role from the peer.";
return;
}
@@ -1147,7 +1149,7 @@
if (nomination_attr) {
nomination = nomination_attr->value();
if (nomination == 0) {
- LOG(LS_ERROR) << "Invalid nomination: " << nomination;
+ RTC_LOG(LS_ERROR) << "Invalid nomination: " << nomination;
}
} else {
const StunByteStringAttribute* use_candidate_attr =
@@ -1232,7 +1234,7 @@
void Connection::UpdateState(int64_t now) {
int rtt = ConservativeRTTEstimate(rtt_);
- if (LOG_CHECK_LEVEL(LS_VERBOSE)) {
+ if (RTC_LOG_CHECK_LEVEL(LS_VERBOSE)) {
std::string pings;
PrintPingsSinceLastResponse(&pings, 5);
LOG_J(LS_VERBOSE, this) << "UpdateState()"
@@ -1447,7 +1449,7 @@
int rtt = request->Elapsed();
- if (LOG_CHECK_LEVEL_V(sev)) {
+ if (RTC_LOG_CHECK_LEVEL_V(sev)) {
std::string pings;
PrintPingsSinceLastResponse(&pings, 5);
LOG_JV(sev, this) << "Received STUN ping response"
@@ -1547,8 +1549,8 @@
void Connection::OnMessage(rtc::Message *pmsg) {
RTC_DCHECK(pmsg->message_id == MSG_DELETE);
- LOG(LS_INFO) << "Connection deleted with number of pings sent: "
- << num_pings_sent_;
+ RTC_LOG(LS_INFO) << "Connection deleted with number of pings sent: "
+ << num_pings_sent_;
SignalDestroyed(this);
delete this;
}
@@ -1589,9 +1591,10 @@
const StunAddressAttribute* addr =
response->GetAddress(STUN_ATTR_XOR_MAPPED_ADDRESS);
if (!addr) {
- LOG(LS_WARNING) << "Connection::OnConnectionRequestResponse - "
- << "No MAPPED-ADDRESS or XOR-MAPPED-ADDRESS found in the "
- << "stun response message";
+ RTC_LOG(LS_WARNING)
+ << "Connection::OnConnectionRequestResponse - "
+ << "No MAPPED-ADDRESS or XOR-MAPPED-ADDRESS found in the "
+ << "stun response message";
return;
}
@@ -1614,9 +1617,9 @@
const StunUInt32Attribute* priority_attr =
request->msg()->GetUInt32(STUN_ATTR_PRIORITY);
if (!priority_attr) {
- LOG(LS_WARNING) << "Connection::OnConnectionRequestResponse - "
- << "No STUN_ATTR_PRIORITY found in the "
- << "stun response message";
+ RTC_LOG(LS_WARNING) << "Connection::OnConnectionRequestResponse - "
+ << "No STUN_ATTR_PRIORITY found in the "
+ << "stun response message";
return;
}
const uint32_t priority = priority_attr->value();
diff --git a/p2p/base/port_unittest.cc b/p2p/base/port_unittest.cc
index af853ca..12fab0f 100644
--- a/p2p/base/port_unittest.cc
+++ b/p2p/base/port_unittest.cc
@@ -335,7 +335,7 @@
void OnDestroyed(Connection* conn) {
ASSERT_EQ(conn_, conn);
- LOG(INFO) << "OnDestroy connection " << conn << " deleted";
+ RTC_LOG(INFO) << "OnDestroy connection " << conn << " deleted";
conn_ = NULL;
// When the connection is destroyed, also clear these fields so future
// connections are possible.
@@ -835,7 +835,7 @@
bool accept, bool same_addr1,
bool same_addr2, bool possible) {
rtc::ScopedFakeClock clock;
- LOG(LS_INFO) << "Test: " << name1 << " to " << name2 << ": ";
+ RTC_LOG(LS_INFO) << "Test: " << name1 << " to " << name2 << ": ";
port1->set_component(cricket::ICE_CANDIDATE_COMPONENT_DEFAULT);
port2->set_component(cricket::ICE_CANDIDATE_COMPONENT_DEFAULT);
diff --git a/p2p/base/portallocator.cc b/p2p/base/portallocator.cc
index 6ec6417..a091325 100644
--- a/p2p/base/portallocator.cc
+++ b/p2p/base/portallocator.cc
@@ -109,15 +109,16 @@
if (candidate_pool_frozen_) {
if (candidate_pool_size != candidate_pool_size_) {
- LOG(LS_ERROR) << "Trying to change candidate pool size after pool was "
- << "frozen.";
+ RTC_LOG(LS_ERROR)
+ << "Trying to change candidate pool size after pool was "
+ << "frozen.";
return false;
}
return true;
}
if (candidate_pool_size < 0) {
- LOG(LS_ERROR) << "Can't set negative pool size.";
+ RTC_LOG(LS_ERROR) << "Can't set negative pool size.";
return false;
}
diff --git a/p2p/base/pseudotcp.cc b/p2p/base/pseudotcp.cc
index 33ece44..610dece 100644
--- a/p2p/base/pseudotcp.cc
+++ b/p2p/base/pseudotcp.cc
@@ -189,7 +189,7 @@
(i == 0) ? "" : ",", STAT_NAMES[i], g_stats[i]);
g_stats[i] = 0;
}
- LOG(LS_INFO) << "Stats[" << buffer << "]";
+ RTC_LOG(LS_INFO) << "Stats[" << buffer << "]";
}
#endif
@@ -266,7 +266,7 @@
}
m_state = TCP_SYN_SENT;
- LOG(LS_INFO) << "State: TCP_SYN_SENT";
+ RTC_LOG(LS_INFO) << "State: TCP_SYN_SENT";
queueConnectMessage();
attemptSend();
@@ -293,11 +293,10 @@
// Note: (m_slist.front().xmit == 0)) {
// retransmit segments
#if _DEBUGMSG >= _DBG_NORMAL
- LOG(LS_INFO) << "timeout retransmit (rto: " << m_rx_rto
- << ") (rto_base: " << m_rto_base
- << ") (now: " << now
- << ") (dup_acks: " << static_cast<unsigned>(m_dup_acks)
- << ")";
+ RTC_LOG(LS_INFO) << "timeout retransmit (rto: " << m_rx_rto
+ << ") (rto_base: " << m_rto_base << ") (now: " << now
+ << ") (dup_acks: " << static_cast<unsigned>(m_dup_acks)
+ << ")";
#endif // _DEBUGMSG
if (!transmit(m_slist.begin(), now)) {
closedown(ECONNABORTED);
@@ -306,7 +305,8 @@
uint32_t nInFlight = m_snd_nxt - m_snd_una;
m_ssthresh = std::max(nInFlight / 2, 2 * m_mss);
- //LOG(LS_INFO) << "m_ssthresh: " << m_ssthresh << " nInFlight: " << nInFlight << " m_mss: " << m_mss;
+ // RTC_LOG(LS_INFO) << "m_ssthresh: " << m_ssthresh << " nInFlight: " <<
+ // nInFlight << " m_mss: " << m_mss;
m_cwnd = m_mss;
// Back off retransmit timer. Note: the limit is lower when connecting.
@@ -355,7 +355,7 @@
bool PseudoTcp::NotifyPacket(const char* buffer, size_t len) {
if (len > MAX_PACKET) {
- LOG_F(WARNING) << "packet too large";
+ RTC_LOG_F(WARNING) << "packet too large";
return false;
}
return parse(reinterpret_cast<const uint8_t*>(buffer), uint32_t(len));
@@ -471,7 +471,7 @@
}
void PseudoTcp::Close(bool force) {
- LOG_F(LS_VERBOSE) << "(" << (force ? "true" : "false") << ")";
+ RTC_LOG_F(LS_VERBOSE) << "(" << (force ? "true" : "false") << ")";
m_shutdown = force ? SD_FORCEFUL : SD_GRACEFUL;
}
@@ -540,14 +540,13 @@
}
#if _DEBUGMSG >= _DBG_VERBOSE
- LOG(LS_INFO) << "<-- <CONV=" << m_conv
- << "><FLG=" << static_cast<unsigned>(flags)
- << "><SEQ=" << seq << ":" << seq + len
- << "><ACK=" << m_rcv_nxt
- << "><WND=" << m_rcv_wnd
- << "><TS=" << (now % 10000)
- << "><TSR=" << (m_ts_recent % 10000)
- << "><LEN=" << len << ">";
+ RTC_LOG(LS_INFO) << "<-- <CONV=" << m_conv
+ << "><FLG=" << static_cast<unsigned>(flags)
+ << "><SEQ=" << seq << ":" << seq + len
+ << "><ACK=" << m_rcv_nxt << "><WND=" << m_rcv_wnd
+ << "><TS=" << (now % 10000)
+ << "><TSR=" << (m_ts_recent % 10000) << "><LEN=" << len
+ << ">";
#endif // _DEBUGMSG
IPseudoTcpNotify::WriteResult wres = m_notify->TcpWritePacket(
@@ -586,14 +585,13 @@
seg.len = size - HEADER_SIZE;
#if _DEBUGMSG >= _DBG_VERBOSE
- LOG(LS_INFO) << "--> <CONV=" << seg.conv
- << "><FLG=" << static_cast<unsigned>(seg.flags)
- << "><SEQ=" << seg.seq << ":" << seg.seq + seg.len
- << "><ACK=" << seg.ack
- << "><WND=" << seg.wnd
- << "><TS=" << (seg.tsval % 10000)
- << "><TSR=" << (seg.tsecr % 10000)
- << "><LEN=" << seg.len << ">";
+ RTC_LOG(LS_INFO) << "--> <CONV=" << seg.conv
+ << "><FLG=" << static_cast<unsigned>(seg.flags)
+ << "><SEQ=" << seg.seq << ":" << seg.seq + seg.len
+ << "><ACK=" << seg.ack << "><WND=" << seg.wnd
+ << "><TS=" << (seg.tsval % 10000)
+ << "><TSR=" << (seg.tsecr % 10000) << "><LEN=" << seg.len
+ << ">";
#endif // _DEBUGMSG
return process(seg);
@@ -648,7 +646,7 @@
//if ((seg.flags & FLAG_RST) == 0) {
// packet(tcb, seg.ack, 0, FLAG_RST, 0, 0);
//}
- LOG_F(LS_ERROR) << "wrong conversation";
+ RTC_LOG_F(LS_ERROR) << "wrong conversation";
return false;
}
@@ -658,7 +656,7 @@
if (m_state == TCP_CLOSED) {
// !?! send reset?
- LOG_F(LS_ERROR) << "closed";
+ RTC_LOG_F(LS_ERROR) << "closed";
return false;
}
@@ -672,7 +670,7 @@
bool bConnect = false;
if (seg.flags & FLAG_CTL) {
if (seg.len == 0) {
- LOG_F(LS_ERROR) << "Missing control code";
+ RTC_LOG_F(LS_ERROR) << "Missing control code";
return false;
} else if (seg.data[0] == CTL_CONNECT) {
bConnect = true;
@@ -682,12 +680,12 @@
if (m_state == TCP_LISTEN) {
m_state = TCP_SYN_RECEIVED;
- LOG(LS_INFO) << "State: TCP_SYN_RECEIVED";
+ RTC_LOG(LS_INFO) << "State: TCP_SYN_RECEIVED";
//m_notify->associate(addr);
queueConnectMessage();
} else if (m_state == TCP_SYN_SENT) {
m_state = TCP_ESTABLISHED;
- LOG(LS_INFO) << "State: TCP_ESTABLISHED";
+ RTC_LOG(LS_INFO) << "State: TCP_ESTABLISHED";
adjustMTU();
if (m_notify) {
m_notify->OnTcpOpen(this);
@@ -695,7 +693,7 @@
//notify(evOpen);
}
} else {
- LOG_F(LS_WARNING) << "Unknown control code: " << seg.data[0];
+ RTC_LOG_F(LS_WARNING) << "Unknown control code: " << seg.data[0];
return false;
}
}
@@ -725,9 +723,8 @@
m_rx_rto = rtc::SafeClamp(m_rx_srtt + rtc::SafeMax(1, 4 * m_rx_rttvar),
MIN_RTO, MAX_RTO);
#if _DEBUGMSG >= _DBG_VERBOSE
- LOG(LS_INFO) << "rtt: " << rtt
- << " srtt: " << m_rx_srtt
- << " rto: " << m_rx_rto;
+ RTC_LOG(LS_INFO) << "rtt: " << rtt << " srtt: " << m_rx_srtt
+ << " rto: " << m_rx_rto;
#endif // _DEBUGMSG
} else {
RTC_NOTREACHED();
@@ -762,12 +759,12 @@
uint32_t nInFlight = m_snd_nxt - m_snd_una;
m_cwnd = std::min(m_ssthresh, nInFlight + m_mss); // (Fast Retransmit)
#if _DEBUGMSG >= _DBG_NORMAL
- LOG(LS_INFO) << "exit recovery";
+ RTC_LOG(LS_INFO) << "exit recovery";
#endif // _DEBUGMSG
m_dup_acks = 0;
} else {
#if _DEBUGMSG >= _DBG_NORMAL
- LOG(LS_INFO) << "recovery retransmit";
+ RTC_LOG(LS_INFO) << "recovery retransmit";
#endif // _DEBUGMSG
if (!transmit(m_slist.begin(), now)) {
closedown(ECONNABORTED);
@@ -795,8 +792,8 @@
m_dup_acks += 1;
if (m_dup_acks == 3) { // (Fast Retransmit)
#if _DEBUGMSG >= _DBG_NORMAL
- LOG(LS_INFO) << "enter recovery";
- LOG(LS_INFO) << "recovery retransmit";
+ RTC_LOG(LS_INFO) << "enter recovery";
+ RTC_LOG(LS_INFO) << "recovery retransmit";
#endif // _DEBUGMSG
if (!transmit(m_slist.begin(), now)) {
closedown(ECONNABORTED);
@@ -805,7 +802,8 @@
m_recover = m_snd_nxt;
uint32_t nInFlight = m_snd_nxt - m_snd_una;
m_ssthresh = std::max(nInFlight / 2, 2 * m_mss);
- //LOG(LS_INFO) << "m_ssthresh: " << m_ssthresh << " nInFlight: " << nInFlight << " m_mss: " << m_mss;
+ // RTC_LOG(LS_INFO) << "m_ssthresh: " << m_ssthresh << " nInFlight: "
+ // << nInFlight << " m_mss: " << m_mss;
m_cwnd = m_ssthresh + 3 * m_mss;
} else if (m_dup_acks > 3) {
m_cwnd += m_mss;
@@ -818,7 +816,7 @@
// !?! A bit hacky
if ((m_state == TCP_SYN_RECEIVED) && !bConnect) {
m_state = TCP_ESTABLISHED;
- LOG(LS_INFO) << "State: TCP_ESTABLISHED";
+ RTC_LOG(LS_INFO) << "State: TCP_ESTABLISHED";
adjustMTU();
if (m_notify) {
m_notify->OnTcpOpen(this);
@@ -860,9 +858,9 @@
#if _DEBUGMSG >= _DBG_NORMAL
if (sflags == sfImmediateAck) {
if (seg.seq > m_rcv_nxt) {
- LOG_F(LS_INFO) << "too new";
+ RTC_LOG_F(LS_INFO) << "too new";
} else if (seg.seq + seg.len <= m_rcv_nxt) {
- LOG_F(LS_INFO) << "too old";
+ RTC_LOG_F(LS_INFO) << "too old";
}
}
#endif // _DEBUGMSG
@@ -925,7 +923,9 @@
sflags = sfImmediateAck; // (Fast Recovery)
uint32_t nAdjust = (it->seq + it->len) - m_rcv_nxt;
#if _DEBUGMSG >= _DBG_NORMAL
- LOG(LS_INFO) << "Recovered " << nAdjust << " bytes (" << m_rcv_nxt << " -> " << m_rcv_nxt + nAdjust << ")";
+ RTC_LOG(LS_INFO)
+ << "Recovered " << nAdjust << " bytes (" << m_rcv_nxt << " -> "
+ << m_rcv_nxt + nAdjust << ")";
#endif // _DEBUGMSG
m_rbuf.ConsumeWriteBuffer(nAdjust);
m_rcv_nxt += nAdjust;
@@ -935,7 +935,8 @@
}
} else {
#if _DEBUGMSG >= _DBG_NORMAL
- LOG(LS_INFO) << "Saving " << seg.len << " bytes (" << seg.seq << " -> " << seg.seq + seg.len << ")";
+ RTC_LOG(LS_INFO) << "Saving " << seg.len << " bytes (" << seg.seq
+ << " -> " << seg.seq + seg.len << ")";
#endif // _DEBUGMSG
RSegment rseg;
rseg.seq = seg.seq;
@@ -965,7 +966,7 @@
bool PseudoTcp::transmit(const SList::iterator& seg, uint32_t now) {
if (seg->xmit >= ((m_state == TCP_ESTABLISHED) ? 15 : 30)) {
- LOG_F(LS_VERBOSE) << "too many retransmits";
+ RTC_LOG_F(LS_VERBOSE) << "too many retransmits";
return false;
}
@@ -983,7 +984,7 @@
break;
if (wres == IPseudoTcpNotify::WR_FAIL) {
- LOG_F(LS_VERBOSE) << "packet failed";
+ RTC_LOG_F(LS_VERBOSE) << "packet failed";
return false;
}
@@ -991,7 +992,7 @@
while (true) {
if (PACKET_MAXIMUMS[m_msslevel + 1] == 0) {
- LOG_F(LS_VERBOSE) << "MTU too small";
+ RTC_LOG_F(LS_VERBOSE) << "MTU too small";
return false;
}
// !?! We need to break up all outstanding and pending packets and then retransmit!?!
@@ -1004,12 +1005,12 @@
}
}
#if _DEBUGMSG >= _DBG_NORMAL
- LOG(LS_INFO) << "Adjusting mss to " << m_mss << " bytes";
+ RTC_LOG(LS_INFO) << "Adjusting mss to " << m_mss << " bytes";
#endif // _DEBUGMSG
}
if (nTransmit < seg->len) {
- LOG_F(LS_VERBOSE) << "mss reduced to " << m_mss;
+ RTC_LOG_F(LS_VERBOSE) << "mss reduced to " << m_mss;
SSegment subseg(seg->seq + nTransmit, seg->len - nTransmit, seg->bCtrl);
//subseg.tstamp = seg->tstamp;
@@ -1072,13 +1073,12 @@
m_sbuf.GetWriteRemaining(&available_space);
bFirst = false;
- LOG(LS_INFO) << "[cwnd: " << m_cwnd
- << " nWindow: " << nWindow
- << " nInFlight: " << nInFlight
- << " nAvailable: " << nAvailable
- << " nQueued: " << snd_buffered
- << " nEmpty: " << available_space
- << " ssthresh: " << m_ssthresh << "]";
+ RTC_LOG(LS_INFO) << "[cwnd: " << m_cwnd << " nWindow: " << nWindow
+ << " nInFlight: " << nInFlight
+ << " nAvailable: " << nAvailable
+ << " nQueued: " << snd_buffered
+ << " nEmpty: " << available_space
+ << " ssthresh: " << m_ssthresh << "]";
}
#endif // _DEBUGMSG
@@ -1119,7 +1119,7 @@
}
if (!transmit(seg, now)) {
- LOG_F(LS_VERBOSE) << "transmit failed";
+ RTC_LOG_F(LS_VERBOSE) << "transmit failed";
// TODO: consider closing socket
return;
}
@@ -1129,7 +1129,7 @@
}
void PseudoTcp::closedown(uint32_t err) {
- LOG(LS_INFO) << "State: TCP_CLOSED";
+ RTC_LOG(LS_INFO) << "State: TCP_CLOSED";
m_state = TCP_CLOSED;
if (m_notify) {
m_notify->OnTcpClosed(this, err);
@@ -1148,7 +1148,7 @@
m_mss = m_mtu_advise - PACKET_OVERHEAD;
// !?! Should we reset m_largest here?
#if _DEBUGMSG >= _DBG_NORMAL
- LOG(LS_INFO) << "Adjusting mss to " << m_mss << " bytes";
+ RTC_LOG(LS_INFO) << "Adjusting mss to " << m_mss << " bytes";
#endif // _DEBUGMSG
// Enforce minimums on ssthresh and cwnd
m_ssthresh = std::max(m_ssthresh, 2 * m_mss);
@@ -1209,14 +1209,14 @@
applyOption(kind, buf.Data(), opt_len);
buf.Consume(opt_len);
} else {
- LOG(LS_ERROR) << "Invalid option length received.";
+ RTC_LOG(LS_ERROR) << "Invalid option length received.";
return;
}
options_specified.insert(kind);
}
if (options_specified.find(TCP_OPT_WND_SCALE) == options_specified.end()) {
- LOG(LS_WARNING) << "Peer doesn't support window scaling";
+ RTC_LOG(LS_WARNING) << "Peer doesn't support window scaling";
if (m_rwnd_scale > 0) {
// Peer doesn't support TCP options and window scaling.
@@ -1229,13 +1229,13 @@
void PseudoTcp::applyOption(char kind, const char* data, uint32_t len) {
if (kind == TCP_OPT_MSS) {
- LOG(LS_WARNING) << "Peer specified MSS option which is not supported.";
+ RTC_LOG(LS_WARNING) << "Peer specified MSS option which is not supported.";
// TODO: Implement.
} else if (kind == TCP_OPT_WND_SCALE) {
// Window scale factor.
// http://www.ietf.org/rfc/rfc1323.txt
if (len != 1) {
- LOG_F(WARNING) << "Invalid window scale option received.";
+ RTC_LOG_F(WARNING) << "Invalid window scale option received.";
return;
}
applyWindowScaleOption(data[0]);
diff --git a/p2p/base/pseudotcp_unittest.cc b/p2p/base/pseudotcp_unittest.cc
index d26f261..ddab588 100644
--- a/p2p/base/pseudotcp_unittest.cc
+++ b/p2p/base/pseudotcp_unittest.cc
@@ -116,7 +116,7 @@
virtual void OnTcpOpen(PseudoTcp* tcp) {
// Consider ourselves connected when the local side gets OnTcpOpen.
// OnTcpWriteable isn't fired at open, so we trigger it now.
- LOG(LS_VERBOSE) << "Opened";
+ RTC_LOG(LS_VERBOSE) << "Opened";
if (tcp == &local_) {
have_connected_ = true;
OnTcpWriteable(tcp);
@@ -130,7 +130,7 @@
// Consider ourselves closed when the remote side gets OnTcpClosed.
// TODO: OnTcpClosed is only ever notified in case of error in
// the current implementation. Solicited close is not (yet) supported.
- LOG(LS_VERBOSE) << "Closed";
+ RTC_LOG(LS_VERBOSE) << "Closed";
EXPECT_EQ(0U, error);
if (tcp == &remote_) {
have_disconnected_ = true;
@@ -141,9 +141,10 @@
// Randomly drop the desired percentage of packets.
// Also drop packets that are larger than the configured MTU.
if (rtc::CreateRandomId() % 100 < static_cast<uint32_t>(loss_)) {
- LOG(LS_VERBOSE) << "Randomly dropping packet, size=" << len;
+ RTC_LOG(LS_VERBOSE) << "Randomly dropping packet, size=" << len;
} else if (len > static_cast<size_t>(std::min(local_mtu_, remote_mtu_))) {
- LOG(LS_VERBOSE) << "Dropping packet that exceeds path MTU, size=" << len;
+ RTC_LOG(LS_VERBOSE) << "Dropping packet that exceeds path MTU, size="
+ << len;
} else {
int id = (tcp == &local_) ? MSG_RPACKET : MSG_LPACKET;
std::string packet(buffer, len);
@@ -236,8 +237,8 @@
EXPECT_EQ(static_cast<size_t>(size), received);
EXPECT_EQ(0, memcmp(send_stream_.GetBuffer(),
recv_stream_.GetBuffer(), size));
- LOG(LS_INFO) << "Transferred " << received << " bytes in " << elapsed
- << " ms (" << size * 8 / elapsed << " Kbps)";
+ RTC_LOG(LS_INFO) << "Transferred " << received << " bytes in " << elapsed
+ << " ms (" << size * 8 / elapsed << " Kbps)";
}
private:
@@ -262,7 +263,7 @@
// Write bytes from the send stream when we can.
// Shut down when we've sent everything.
if (tcp == &local_) {
- LOG(LS_VERBOSE) << "Flow Control Lifted";
+ RTC_LOG(LS_VERBOSE) << "Flow Control Lifted";
bool done;
WriteData(&done);
if (done) {
@@ -280,7 +281,7 @@
if (rcvd != -1) {
recv_stream_.Write(block, rcvd, NULL, NULL);
recv_stream_.GetPosition(&position);
- LOG(LS_VERBOSE) << "Received: " << position;
+ RTC_LOG(LS_VERBOSE) << "Received: " << position;
}
} while (rcvd > 0);
}
@@ -296,10 +297,10 @@
UpdateLocalClock();
if (sent != -1) {
send_stream_.SetPosition(position + sent);
- LOG(LS_VERBOSE) << "Sent: " << position + sent;
+ RTC_LOG(LS_VERBOSE) << "Sent: " << position + sent;
} else {
send_stream_.SetPosition(position);
- LOG(LS_VERBOSE) << "Flow Controlled";
+ RTC_LOG(LS_VERBOSE) << "Flow Controlled";
}
} else {
sent = static_cast<int>(tosend = 0);
@@ -347,8 +348,8 @@
// number of iterations have completed.
EXPECT_TRUE_WAIT(have_disconnected_, kTransferTimeoutMs);
elapsed = rtc::TimeSince(start);
- LOG(LS_INFO) << "Performed " << iterations << " pings in "
- << elapsed << " ms";
+ RTC_LOG(LS_INFO) << "Performed " << iterations << " pings in " << elapsed
+ << " ms";
}
private:
@@ -356,7 +357,7 @@
virtual void OnTcpReadable(PseudoTcp* tcp) {
if (tcp != receiver_) {
- LOG_F(LS_ERROR) << "unexpected OnTcpReadable";
+ RTC_LOG_F(LS_ERROR) << "unexpected OnTcpReadable";
return;
}
// Stream bytes to the recv stream as they arrive.
@@ -386,7 +387,7 @@
return;
// Write bytes from the send stream when we can.
// Shut down when we've sent everything.
- LOG(LS_VERBOSE) << "Flow Control Lifted";
+ RTC_LOG(LS_VERBOSE) << "Flow Control Lifted";
WriteData();
}
@@ -399,7 +400,7 @@
if (rcvd != -1) {
recv_stream_.Write(block, rcvd, NULL, NULL);
recv_stream_.GetPosition(&position);
- LOG(LS_VERBOSE) << "Received: " << position;
+ RTC_LOG(LS_VERBOSE) << "Received: " << position;
}
} while (rcvd > 0);
}
@@ -416,10 +417,10 @@
UpdateLocalClock();
if (sent != -1) {
send_stream_.SetPosition(position + sent);
- LOG(LS_VERBOSE) << "Sent: " << position + sent;
+ RTC_LOG(LS_VERBOSE) << "Sent: " << position + sent;
} else {
send_stream_.SetPosition(position);
- LOG(LS_VERBOSE) << "Flow Controlled";
+ RTC_LOG(LS_VERBOSE) << "Flow Controlled";
}
} else {
sent = static_cast<int>(tosend = 0);
@@ -515,7 +516,7 @@
if (rcvd != -1) {
recv_stream_.Write(block, rcvd, NULL, NULL);
recv_stream_.GetPosition(&position);
- LOG(LS_VERBOSE) << "Received: " << position;
+ RTC_LOG(LS_VERBOSE) << "Received: " << position;
}
} while (rcvd > 0);
@@ -543,10 +544,10 @@
UpdateLocalClock();
if (sent != -1) {
send_stream_.SetPosition(position + sent);
- LOG(LS_VERBOSE) << "Sent: " << position + sent;
+ RTC_LOG(LS_VERBOSE) << "Sent: " << position + sent;
} else {
send_stream_.SetPosition(position);
- LOG(LS_VERBOSE) << "Flow Controlled";
+ RTC_LOG(LS_VERBOSE) << "Flow Controlled";
}
} else {
sent = static_cast<int>(tosend = 0);
@@ -566,9 +567,9 @@
rtc::Thread::Current()->PostDelayed(RTC_FROM_HERE, 10, this, MSG_WRITE);
} else {
if (!remote_.isReceiveBufferFull()) {
- LOG(LS_ERROR) << "This shouldn't happen - the send buffer is full, "
- << "the receive buffer is not, and there are no "
- << "remaining messages to process.";
+ RTC_LOG(LS_ERROR) << "This shouldn't happen - the send buffer is full, "
+ << "the receive buffer is not, and there are no "
+ << "remaining messages to process.";
}
send_stream_.GetPosition(&position);
send_position_.push_back(position);
diff --git a/p2p/base/relayport.cc b/p2p/base/relayport.cc
index 7d5c9a8..411bfd4 100644
--- a/p2p/base/relayport.cc
+++ b/p2p/base/relayport.cc
@@ -224,8 +224,8 @@
for (std::vector<ProtocolAddress>::iterator it = external_addr_.begin();
it != external_addr_.end(); ++it) {
if ((it->address == addr.address) && (it->proto == addr.proto)) {
- LOG(INFO) << "Redundant relay address: " << proto_name
- << " @ " << addr.address.ToSensitiveString();
+ RTC_LOG(INFO) << "Redundant relay address: " << proto_name << " @ "
+ << addr.address.ToSensitiveString();
return;
}
}
@@ -443,8 +443,8 @@
rtc::PacketOptions options; // Default dscp set to NO_CHANGE.
int sent = socket_->SendTo(data, size, GetAddress(), options);
if (sent <= 0) {
- LOG(LS_VERBOSE) << "OnSendPacket: failed sending to " << GetAddress() <<
- strerror(socket_->GetError());
+ RTC_LOG(LS_VERBOSE) << "OnSendPacket: failed sending to " << GetAddress()
+ << strerror(socket_->GetError());
RTC_DCHECK(sent < 0);
}
}
@@ -479,7 +479,7 @@
// If we've exhausted all options, bail out.
const ProtocolAddress* ra = port()->ServerAddress(server_index_);
if (!ra) {
- LOG(LS_WARNING) << "No more relay addresses left to try";
+ RTC_LOG(LS_WARNING) << "No more relay addresses left to try";
return;
}
@@ -490,8 +490,8 @@
}
// Try to set up our new socket.
- LOG(LS_INFO) << "Connecting to relay via " << ProtoToString(ra->proto) <<
- " @ " << ra->address.ToSensitiveString();
+ RTC_LOG(LS_INFO) << "Connecting to relay via " << ProtoToString(ra->proto)
+ << " @ " << ra->address.ToSensitiveString();
rtc::AsyncPacketSocket* socket = NULL;
@@ -508,12 +508,12 @@
rtc::SocketAddress(port_->Network()->GetBestIP(), 0), ra->address,
port_->proxy(), port_->user_agent(), opts);
} else {
- LOG(LS_WARNING) << "Unknown protocol (" << ra->proto << ")";
+ RTC_LOG(LS_WARNING) << "Unknown protocol (" << ra->proto << ")";
}
// If we failed to get a socket, move on to the next protocol.
if (!socket) {
- LOG(LS_WARNING) << "Socket creation failed";
+ RTC_LOG(LS_WARNING) << "Socket creation failed";
port()->thread()->Post(RTC_FROM_HERE, this, kMessageConnectTimeout);
return;
}
@@ -556,8 +556,8 @@
RelayConnection* connection) {
// We are connected, notify our parent.
ProtocolType proto = PROTO_UDP;
- LOG(INFO) << "Relay allocate succeeded: " << ProtoToString(proto)
- << " @ " << mapped_addr.ToSensitiveString();
+ RTC_LOG(INFO) << "Relay allocate succeeded: " << ProtoToString(proto) << " @ "
+ << mapped_addr.ToSensitiveString();
connected_ = true;
port_->AddExternalAddress(ProtocolAddress(mapped_addr, proto));
@@ -651,8 +651,8 @@
RTC_DCHECK(pmsg->message_id == kMessageConnectTimeout);
if (current_connection_) {
const ProtocolAddress* ra = current_connection_->protocol_address();
- LOG(LS_WARNING) << "Relay " << ra->proto << " connection to " <<
- ra->address << " timed out";
+ RTC_LOG(LS_WARNING) << "Relay " << ra->proto << " connection to "
+ << ra->address << " timed out";
// Currently we connect to each server address in sequence. If we
// have more addresses to try, treat this is an error and move on to
@@ -669,8 +669,8 @@
}
void RelayEntry::OnSocketConnect(rtc::AsyncPacketSocket* socket) {
- LOG(INFO) << "relay tcp connected to " <<
- socket->GetRemoteAddress().ToSensitiveString();
+ RTC_LOG(INFO) << "relay tcp connected to "
+ << socket->GetRemoteAddress().ToSensitiveString();
if (current_connection_ != NULL) {
current_connection_->SendAllocateRequest(this, 0);
}
@@ -678,7 +678,7 @@
void RelayEntry::OnSocketClose(rtc::AsyncPacketSocket* socket,
int error) {
- PLOG(LERROR, error) << "Relay connection failed: socket closed";
+ RTC_PLOG(LERROR, error) << "Relay connection failed: socket closed";
HandleConnectFailure(socket);
}
@@ -692,7 +692,7 @@
if (current_connection_ == NULL || socket != current_connection_->socket()) {
// This packet comes from an unknown address.
- LOG(WARNING) << "Dropping packet: unknown address";
+ RTC_LOG(WARNING) << "Dropping packet: unknown address";
return;
}
@@ -702,7 +702,7 @@
if (locked_) {
port_->OnReadPacket(data, size, ext_addr_, PROTO_UDP, packet_time);
} else {
- LOG(WARNING) << "Dropping packet: entry not locked";
+ RTC_LOG(WARNING) << "Dropping packet: entry not locked";
}
return;
}
@@ -710,7 +710,7 @@
rtc::ByteBufferReader buf(data, size);
RelayMessage msg;
if (!msg.Read(&buf)) {
- LOG(INFO) << "Incoming packet was not STUN";
+ RTC_LOG(INFO) << "Incoming packet was not STUN";
return;
}
@@ -727,7 +727,7 @@
}
return;
} else if (msg.type() != STUN_DATA_INDICATION) {
- LOG(INFO) << "Received BAD stun type from server: " << msg.type();
+ RTC_LOG(INFO) << "Received BAD stun type from server: " << msg.type();
return;
}
@@ -736,10 +736,10 @@
const StunAddressAttribute* addr_attr =
msg.GetAddress(STUN_ATTR_SOURCE_ADDRESS2);
if (!addr_attr) {
- LOG(INFO) << "Data indication has no source address";
+ RTC_LOG(INFO) << "Data indication has no source address";
return;
} else if (addr_attr->family() != 1) {
- LOG(INFO) << "Source address has bad family";
+ RTC_LOG(INFO) << "Source address has bad family";
return;
}
@@ -747,7 +747,7 @@
const StunByteStringAttribute* data_attr = msg.GetByteString(STUN_ATTR_DATA);
if (!data_attr) {
- LOG(INFO) << "Data indication has no data";
+ RTC_LOG(INFO) << "Data indication has no data";
return;
}
@@ -814,9 +814,9 @@
const StunAddressAttribute* addr_attr =
response->GetAddress(STUN_ATTR_MAPPED_ADDRESS);
if (!addr_attr) {
- LOG(INFO) << "Allocate response missing mapped address.";
+ RTC_LOG(INFO) << "Allocate response missing mapped address.";
} else if (addr_attr->family() != 1) {
- LOG(INFO) << "Mapped address has bad family";
+ RTC_LOG(INFO) << "Mapped address has bad family";
} else {
rtc::SocketAddress addr(addr_attr->ipaddr(), addr_attr->port());
entry_->OnConnect(addr, connection_);
@@ -830,11 +830,11 @@
void AllocateRequest::OnErrorResponse(StunMessage* response) {
const StunErrorCodeAttribute* attr = response->GetErrorCode();
if (!attr) {
- LOG(LS_ERROR) << "Missing allocate response error code.";
+ RTC_LOG(LS_ERROR) << "Missing allocate response error code.";
} else {
- LOG(INFO) << "Allocate error response:"
- << " code=" << attr->code()
- << " reason='" << attr->reason() << "'";
+ RTC_LOG(INFO) << "Allocate error response:"
+ << " code=" << attr->code() << " reason='" << attr->reason()
+ << "'";
}
if (rtc::TimeMillis() - start_time_ <= kRetryTimeout)
@@ -842,7 +842,7 @@
}
void AllocateRequest::OnTimeout() {
- LOG(INFO) << "Allocate request timed out";
+ RTC_LOG(INFO) << "Allocate request timed out";
entry_->HandleConnectFailure(connection_->socket());
}
diff --git a/p2p/base/relayserver.cc b/p2p/base/relayserver.cc
index 831c6d7..bb78819 100644
--- a/p2p/base/relayserver.cc
+++ b/p2p/base/relayserver.cc
@@ -36,10 +36,10 @@
rtc::PacketOptions options;
int result = socket->SendTo(bytes, size, addr, options);
if (result < static_cast<int>(size)) {
- LOG(LS_ERROR) << "SendTo wrote only " << result << " of " << size
- << " bytes";
+ RTC_LOG(LS_ERROR) << "SendTo wrote only " << result << " of " << size
+ << " bytes";
} else if (result < 0) {
- LOG_ERR(LS_ERROR) << "SendTo";
+ RTC_LOG_ERR(LS_ERROR) << "SendTo";
}
}
@@ -209,7 +209,7 @@
// that this connection has been locked. (Otherwise, we would not know what
// address to forward to.)
if (!int_conn->locked()) {
- LOG(LS_WARNING) << "Dropping packet: connection not locked";
+ RTC_LOG(LS_WARNING) << "Dropping packet: connection not locked";
return;
}
@@ -221,7 +221,7 @@
ext_conn->Send(bytes, size);
} else {
// This happens very often and is not an error.
- LOG(LS_INFO) << "Dropping packet: no external connection";
+ RTC_LOG(LS_INFO) << "Dropping packet: no external connection";
}
}
@@ -253,7 +253,7 @@
RelayMessage msg;
rtc::ByteBufferReader buf(bytes, size);
if (!msg.Read(&buf)) {
- LOG(LS_WARNING) << "Dropping packet: first packet not STUN";
+ RTC_LOG(LS_WARNING) << "Dropping packet: first packet not STUN";
return;
}
@@ -261,7 +261,7 @@
const StunByteStringAttribute* username_attr =
msg.GetByteString(STUN_ATTR_USERNAME);
if (!username_attr) {
- LOG(LS_WARNING) << "Dropping packet: no username";
+ RTC_LOG(LS_WARNING) << "Dropping packet: no username";
return;
}
@@ -273,7 +273,7 @@
// The binding should already be present.
BindingMap::iterator biter = bindings_.find(username);
if (biter == bindings_.end()) {
- LOG(LS_WARNING) << "Dropping packet: no binding with username";
+ RTC_LOG(LS_WARNING) << "Dropping packet: no binding with username";
return;
}
@@ -369,8 +369,8 @@
bindings_[username] = binding;
if (log_bindings_) {
- LOG(LS_INFO) << "Added new binding " << username << ", "
- << bindings_.size() << " total";
+ RTC_LOG(LS_INFO) << "Added new binding " << username << ", "
+ << bindings_.size() << " total";
}
}
@@ -524,8 +524,8 @@
bindings_.erase(iter);
if (log_bindings_) {
- LOG(LS_INFO) << "Removed binding " << binding->username() << ", "
- << bindings_.size() << " remaining";
+ RTC_LOG(LS_INFO) << "Removed binding " << binding->username() << ", "
+ << bindings_.size() << " remaining";
}
}
@@ -734,7 +734,7 @@
// If the lifetime timeout has been exceeded, then send a signal.
// Otherwise, just keep waiting.
if (rtc::TimeMillis() >= last_used_ + lifetime_) {
- LOG(LS_INFO) << "Expiring binding " << username_;
+ RTC_LOG(LS_INFO) << "Expiring binding " << username_;
SignalTimeout(this);
} else {
server_->thread()->PostDelayed(RTC_FROM_HERE, lifetime_, this,
diff --git a/p2p/base/stun.cc b/p2p/base/stun.cc
index 9d76b1c..1e7cf16 100644
--- a/p2p/base/stun.cc
+++ b/p2p/base/stun.cc
@@ -244,8 +244,8 @@
hmac, sizeof(hmac));
RTC_DCHECK(ret == sizeof(hmac));
if (ret != sizeof(hmac)) {
- LOG(LS_ERROR) << "HMAC computation failed. Message-Integrity "
- << "has dummy value.";
+ RTC_LOG(LS_ERROR) << "HMAC computation failed. Message-Integrity "
+ << "has dummy value.";
return false;
}
@@ -575,7 +575,7 @@
bool StunAddressAttribute::Write(ByteBufferWriter* buf) const {
StunAddressFamily address_family = family();
if (address_family == STUN_ADDRESS_UNDEF) {
- LOG(LS_ERROR) << "Error writing address attribute: unknown family.";
+ RTC_LOG(LS_ERROR) << "Error writing address attribute: unknown family.";
return false;
}
buf->WriteUInt8(0);
@@ -663,7 +663,7 @@
bool StunXorAddressAttribute::Write(ByteBufferWriter* buf) const {
StunAddressFamily address_family = family();
if (address_family == STUN_ADDRESS_UNDEF) {
- LOG(LS_ERROR) << "Error writing xor-address attribute: unknown family.";
+ RTC_LOG(LS_ERROR) << "Error writing xor-address attribute: unknown family.";
return false;
}
rtc::IPAddress xored_ip = GetXoredIP();
@@ -859,7 +859,7 @@
return false;
if ((val >> 11) != 0)
- LOG(LS_ERROR) << "error-code bits not zero";
+ RTC_LOG(LS_ERROR) << "error-code bits not zero";
class_ = ((val >> 8) & 0x7);
number_ = (val & 0xff);
diff --git a/p2p/base/stunport.cc b/p2p/base/stunport.cc
index d06ad69..1685351 100644
--- a/p2p/base/stunport.cc
+++ b/p2p/base/stunport.cc
@@ -43,10 +43,10 @@
const StunAddressAttribute* addr_attr =
response->GetAddress(STUN_ATTR_MAPPED_ADDRESS);
if (!addr_attr) {
- LOG(LS_ERROR) << "Binding response missing mapped address.";
+ RTC_LOG(LS_ERROR) << "Binding response missing mapped address.";
} else if (addr_attr->family() != STUN_ADDRESS_IPV4 &&
addr_attr->family() != STUN_ADDRESS_IPV6) {
- LOG(LS_ERROR) << "Binding address has bad family";
+ RTC_LOG(LS_ERROR) << "Binding address has bad family";
} else {
rtc::SocketAddress addr(addr_attr->ipaddr(), addr_attr->port());
port_->OnStunBindingRequestSucceeded(server_addr_, addr);
@@ -63,12 +63,12 @@
void OnErrorResponse(StunMessage* response) override {
const StunErrorCodeAttribute* attr = response->GetErrorCode();
if (!attr) {
- LOG(LS_ERROR) << "Missing binding response error code.";
+ RTC_LOG(LS_ERROR) << "Missing binding response error code.";
} else {
- LOG(LS_ERROR) << "Binding error response:"
- << " class=" << attr->eclass()
- << " number=" << attr->number() << " reason='"
- << attr->reason() << "'";
+ RTC_LOG(LS_ERROR) << "Binding error response:"
+ << " class=" << attr->eclass()
+ << " number=" << attr->number() << " reason='"
+ << attr->reason() << "'";
}
port_->OnStunBindingOrResolveRequestFailed(server_addr_);
@@ -82,9 +82,9 @@
}
}
void OnTimeout() override {
- LOG(LS_ERROR) << "Binding request timed out from "
- << port_->GetLocalAddress().ToSensitiveString() << " ("
- << port_->Network()->name() << ")";
+ RTC_LOG(LS_ERROR) << "Binding request timed out from "
+ << port_->GetLocalAddress().ToSensitiveString() << " ("
+ << port_->Network()->name() << ")";
port_->OnStunBindingOrResolveRequestFailed(server_addr_);
}
@@ -419,7 +419,7 @@
} else {
// Since we can't send stun messages to the server, we should mark this
// port ready.
- LOG(LS_WARNING) << "STUN server address is incompatible.";
+ RTC_LOG(LS_WARNING) << "STUN server address is incompatible.";
OnStunBindingOrResolveRequestFailed(stun_addr);
}
}
@@ -515,7 +515,7 @@
StunBindingRequest* sreq = static_cast<StunBindingRequest*>(req);
rtc::PacketOptions options(DefaultDscpValue());
if (socket_->SendTo(data, size, sreq->server_addr(), options) < 0)
- PLOG(LERROR, socket_->GetError()) << "sendto";
+ RTC_PLOG(LERROR, socket_->GetError()) << "sendto";
}
bool UDPPort::HasCandidateWithAddress(const rtc::SocketAddress& addr) const {
diff --git a/p2p/base/stunrequest.cc b/p2p/base/stunrequest.cc
index cec9ce3..15ee24b 100644
--- a/p2p/base/stunrequest.cc
+++ b/p2p/base/stunrequest.cc
@@ -125,9 +125,9 @@
} else if (msg->type() == GetStunErrorResponseType(request->type())) {
request->OnErrorResponse(msg);
} else {
- LOG(LERROR) << "Received response with wrong type: " << msg->type()
- << " (expecting "
- << GetStunSuccessResponseType(request->type()) << ")";
+ RTC_LOG(LERROR) << "Received response with wrong type: " << msg->type()
+ << " (expecting "
+ << GetStunSuccessResponseType(request->type()) << ")";
return false;
}
@@ -157,7 +157,8 @@
rtc::ByteBufferReader buf(data, size);
std::unique_ptr<StunMessage> response(iter->second->msg_->CreateNew());
if (!response->Read(&buf)) {
- LOG(LS_WARNING) << "Failed to read STUN response " << rtc::hex_encode(id);
+ RTC_LOG(LS_WARNING) << "Failed to read STUN response "
+ << rtc::hex_encode(id);
return false;
}
@@ -248,8 +249,8 @@
if (retransmissions >= STUN_MAX_RETRANSMISSIONS) {
timeout_ = true;
}
- LOG(LS_VERBOSE) << "Sent STUN request " << count_
- << "; resend delay = " << resend_delay();
+ RTC_LOG(LS_VERBOSE) << "Sent STUN request " << count_
+ << "; resend delay = " << resend_delay();
}
int StunRequest::resend_delay() {
diff --git a/p2p/base/stunrequest_unittest.cc b/p2p/base/stunrequest_unittest.cc
index 0b109b1..bfcc046 100644
--- a/p2p/base/stunrequest_unittest.cc
+++ b/p2p/base/stunrequest_unittest.cc
@@ -149,8 +149,8 @@
EXPECT_TRUE_SIMULATED_WAIT(request_count_ != i, STUN_TOTAL_TIMEOUT,
fake_clock);
int64_t elapsed = rtc::TimeMillis() - start;
- LOG(LS_INFO) << "STUN request #" << (i + 1)
- << " sent at " << elapsed << " ms";
+ RTC_LOG(LS_INFO) << "STUN request #" << (i + 1) << " sent at " << elapsed
+ << " ms";
EXPECT_EQ(TotalDelay(i), elapsed);
}
EXPECT_TRUE(manager_.CheckResponse(res));
diff --git a/p2p/base/stunserver.cc b/p2p/base/stunserver.cc
index cfce926..197c28c 100644
--- a/p2p/base/stunserver.cc
+++ b/p2p/base/stunserver.cc
@@ -76,7 +76,7 @@
msg.Write(&buf);
rtc::PacketOptions options;
if (socket_->SendTo(buf.Data(), buf.Length(), addr, options) < 0)
- LOG_ERR(LS_ERROR) << "sendto";
+ RTC_LOG_ERR(LS_ERROR) << "sendto";
}
void StunServer::GetStunBindReqponse(StunMessage* request,
diff --git a/p2p/base/stunserver_unittest.cc b/p2p/base/stunserver_unittest.cc
index 060305e..5868058 100644
--- a/p2p/base/stunserver_unittest.cc
+++ b/p2p/base/stunserver_unittest.cc
@@ -86,10 +86,8 @@
EXPECT_EQ(1, mapped_addr->family());
EXPECT_EQ(client_addr.port(), mapped_addr->port());
if (mapped_addr->ipaddr() != client_addr.ipaddr()) {
- LOG(LS_WARNING) << "Warning: mapped IP ("
- << mapped_addr->ipaddr()
- << ") != local IP (" << client_addr.ipaddr()
- << ")";
+ RTC_LOG(LS_WARNING) << "Warning: mapped IP (" << mapped_addr->ipaddr()
+ << ") != local IP (" << client_addr.ipaddr() << ")";
}
delete msg;
diff --git a/p2p/base/tcpport.cc b/p2p/base/tcpport.cc
index cf1eb7a..85d2d8a 100644
--- a/p2p/base/tcpport.cc
+++ b/p2p/base/tcpport.cc
@@ -164,8 +164,8 @@
// If socket isn't bound yet the address will be added in
// OnAddressReady(). Socket may be in the CLOSED state if Listen()
// failed, we still want to add the socket address.
- LOG(LS_VERBOSE) << "Preparing TCP address, current state: "
- << socket_->GetState();
+ RTC_LOG(LS_VERBOSE) << "Preparing TCP address, current state: "
+ << socket_->GetState();
if (socket_->GetState() == rtc::AsyncPacketSocket::STATE_BOUND ||
socket_->GetState() == rtc::AsyncPacketSocket::STATE_CLOSED)
AddAddress(socket_->GetLocalAddress(), socket_->GetLocalAddress(),
@@ -429,23 +429,24 @@
<< socket->GetRemoteAddress().ToSensitiveString();
} else {
if (socket->GetLocalAddress().IsLoopbackIP()) {
- LOG(LS_WARNING) << "Socket is bound to the address:"
- << socket_address.ipaddr().ToString()
- << ", rather then an address associated with network:"
- << port_->Network()->ToString()
- << ". Still allowing it since it's localhost.";
+ RTC_LOG(LS_WARNING) << "Socket is bound to the address:"
+ << socket_address.ipaddr().ToString()
+ << ", rather then an address associated with network:"
+ << port_->Network()->ToString()
+ << ". Still allowing it since it's localhost.";
} else if (IPIsAny(port_->Network()->GetBestIP())) {
- LOG(LS_WARNING) << "Socket is bound to the address:"
- << socket_address.ipaddr().ToString()
- << ", rather then an address associated with network:"
- << port_->Network()->ToString()
- << ". Still allowing it since it's the 'any' address"
- << ", possibly caused by multiple_routes being disabled.";
+ RTC_LOG(LS_WARNING)
+ << "Socket is bound to the address:"
+ << socket_address.ipaddr().ToString()
+ << ", rather then an address associated with network:"
+ << port_->Network()->ToString()
+ << ". Still allowing it since it's the 'any' address"
+ << ", possibly caused by multiple_routes being disabled.";
} else {
- LOG(LS_WARNING) << "Dropping connection as TCP socket bound to IP "
- << socket_address.ipaddr().ToString()
- << ", rather then an address associated with network:"
- << port_->Network()->ToString();
+ RTC_LOG(LS_WARNING) << "Dropping connection as TCP socket bound to IP "
+ << socket_address.ipaddr().ToString()
+ << ", rather then an address associated with network:"
+ << port_->Network()->ToString();
OnClose(socket, 0);
return;
}
diff --git a/p2p/base/transportdescriptionfactory.cc b/p2p/base/transportdescriptionfactory.cc
index 8ccb4b6..d5f8561 100644
--- a/p2p/base/transportdescriptionfactory.cc
+++ b/p2p/base/transportdescriptionfactory.cc
@@ -63,8 +63,8 @@
const TransportDescription* current_description) const {
// TODO(juberti): Figure out why we get NULL offers, and fix this upstream.
if (!offer) {
- LOG(LS_WARNING) << "Failed to create TransportDescription answer " <<
- "because offer is NULL";
+ RTC_LOG(LS_WARNING) << "Failed to create TransportDescription answer "
+ << "because offer is NULL";
return NULL;
}
@@ -98,8 +98,8 @@
}
} else if (require_transport_attributes && secure_ == SEC_REQUIRED) {
// We require DTLS, but the other side didn't offer it. Fail.
- LOG(LS_WARNING) << "Failed to create TransportDescription answer "
- "because of incompatible security settings";
+ RTC_LOG(LS_WARNING) << "Failed to create TransportDescription answer "
+ "because of incompatible security settings";
return NULL;
}
@@ -109,7 +109,7 @@
bool TransportDescriptionFactory::SetSecurityInfo(
TransportDescription* desc, ConnectionRole role) const {
if (!certificate_) {
- LOG(LS_ERROR) << "Cannot create identity digest with no certificate";
+ RTC_LOG(LS_ERROR) << "Cannot create identity digest with no certificate";
return false;
}
diff --git a/p2p/base/turnport.cc b/p2p/base/turnport.cc
index 0e7c0b1..00fdbb2 100644
--- a/p2p/base/turnport.cc
+++ b/p2p/base/turnport.cc
@@ -307,8 +307,8 @@
void TurnPort::PrepareAddress() {
if (credentials_.username.empty() ||
credentials_.password.empty()) {
- LOG(LS_ERROR) << "Allocation can't be started without setting the"
- << " TURN server credentials for the user.";
+ RTC_LOG(LS_ERROR) << "Allocation can't be started without setting the"
+ << " TURN server credentials for the user.";
OnAllocateError();
return;
}
@@ -323,9 +323,9 @@
} else {
// If protocol family of server address doesn't match with local, return.
if (!IsCompatibleAddress(server_address_.address)) {
- LOG(LS_ERROR) << "IP address family does not match: "
- << "server: " << server_address_.address.family()
- << " local: " << Network()->GetBestIP().family();
+ RTC_LOG(LS_ERROR) << "IP address family does not match: "
+ << "server: " << server_address_.address.family()
+ << " local: " << Network()->GetBestIP().family();
OnAllocateError();
return;
}
@@ -337,7 +337,7 @@
<< ProtoToString(server_address_.proto) << " @ "
<< server_address_.address.ToSensitiveString();
if (!CreateTurnClientSocket()) {
- LOG(LS_ERROR) << "Failed to create TURN client socket";
+ RTC_LOG(LS_ERROR) << "Failed to create TURN client socket";
OnAllocateError();
return;
}
@@ -437,23 +437,24 @@
if (std::find(desired_addresses.begin(), desired_addresses.end(),
socket_address.ipaddr()) == desired_addresses.end()) {
if (socket->GetLocalAddress().IsLoopbackIP()) {
- LOG(LS_WARNING) << "Socket is bound to the address:"
- << socket_address.ipaddr().ToString()
- << ", rather then an address associated with network:"
- << Network()->ToString()
- << ". Still allowing it since it's localhost.";
+ RTC_LOG(LS_WARNING) << "Socket is bound to the address:"
+ << socket_address.ipaddr().ToString()
+ << ", rather then an address associated with network:"
+ << Network()->ToString()
+ << ". Still allowing it since it's localhost.";
} else if (IPIsAny(Network()->GetBestIP())) {
- LOG(LS_WARNING) << "Socket is bound to the address:"
- << socket_address.ipaddr().ToString()
- << ", rather then an address associated with network:"
- << Network()->ToString()
- << ". Still allowing it since it's the 'any' address"
- << ", possibly caused by multiple_routes being disabled.";
+ RTC_LOG(LS_WARNING)
+ << "Socket is bound to the address:"
+ << socket_address.ipaddr().ToString()
+ << ", rather then an address associated with network:"
+ << Network()->ToString()
+ << ". Still allowing it since it's the 'any' address"
+ << ", possibly caused by multiple_routes being disabled.";
} else {
- LOG(LS_WARNING) << "Socket is bound to the address:"
- << socket_address.ipaddr().ToString()
- << ", rather then an address associated with network:"
- << Network()->ToString() << ". Discarding TURN port.";
+ RTC_LOG(LS_WARNING) << "Socket is bound to the address:"
+ << socket_address.ipaddr().ToString()
+ << ", rather then an address associated with network:"
+ << Network()->ToString() << ". Discarding TURN port.";
OnAllocateError();
return;
}
@@ -464,8 +465,8 @@
server_address_.address = socket_->GetRemoteAddress();
}
- LOG(LS_INFO) << "TurnPort connected to " << socket->GetRemoteAddress()
- << " using tcp.";
+ RTC_LOG(LS_INFO) << "TurnPort connected to " << socket->GetRemoteAddress()
+ << " using tcp.";
SendRequest(new TurnAllocateRequest(this), 0);
}
@@ -573,7 +574,7 @@
// Try to find an entry for this specific address; we should have one.
TurnEntry* entry = FindEntry(addr);
if (!entry) {
- LOG(LS_ERROR) << "Did not find the TurnEntry for address " << addr;
+ RTC_LOG(LS_ERROR) << "Did not find the TurnEntry for address " << addr;
return 0;
}
@@ -698,8 +699,8 @@
// If protocol family of server address doesn't match with local, return.
if (!IsCompatibleAddress(address)) {
- LOG(LS_WARNING) << "Server IP address family does not match with "
- << "local host address family type";
+ RTC_LOG(LS_WARNING) << "Server IP address family does not match with "
+ << "local host address family type";
return false;
}
@@ -1014,8 +1015,8 @@
const StunByteStringAttribute* realm_attr =
response->GetByteString(STUN_ATTR_REALM);
if (!realm_attr) {
- LOG(LS_ERROR) << "Missing STUN_ATTR_REALM attribute in "
- << "stale nonce error response.";
+ RTC_LOG(LS_ERROR) << "Missing STUN_ATTR_REALM attribute in "
+ << "stale nonce error response.";
return false;
}
set_realm(realm_attr->GetString());
@@ -1023,8 +1024,8 @@
const StunByteStringAttribute* nonce_attr =
response->GetByteString(STUN_ATTR_NONCE);
if (!nonce_attr) {
- LOG(LS_ERROR) << "Missing STUN_ATTR_NONCE attribute in "
- << "stale nonce error response.";
+ RTC_LOG(LS_ERROR) << "Missing STUN_ATTR_NONCE attribute in "
+ << "stale nonce error response.";
return false;
}
set_nonce(nonce_attr->GetString());
@@ -1642,8 +1643,8 @@
} else {
bool found = port_->FailAndPruneConnection(ext_addr_);
if (found) {
- LOG(LS_ERROR) << "Received TURN CreatePermission error response, "
- << "code=" << code << "; pruned connection.";
+ RTC_LOG(LS_ERROR) << "Received TURN CreatePermission error response, "
+ << "code=" << code << "; pruned connection.";
}
// Send signal with error code.
port_->SignalCreatePermissionResult(port_, ext_addr_, code);
diff --git a/p2p/base/turnserver.cc b/p2p/base/turnserver.cc
index 62a381a..6eedeaf 100644
--- a/p2p/base/turnserver.cc
+++ b/p2p/base/turnserver.cc
@@ -222,7 +222,7 @@
TurnMessage msg;
rtc::ByteBufferReader buf(data, size);
if (!msg.Read(&buf) || (buf.Length() > 0)) {
- LOG(LS_WARNING) << "Received invalid STUN message";
+ RTC_LOG(LS_WARNING) << "Received invalid STUN message";
return;
}
@@ -461,8 +461,8 @@
int code, const std::string& reason) {
TurnMessage resp;
InitErrorResponse(req, code, reason, &resp);
- LOG(LS_INFO) << "Sending error response, type=" << resp.type()
- << ", code=" << code << ", reason=" << reason;
+ RTC_LOG(LS_INFO) << "Sending error response, type=" << resp.type()
+ << ", code=" << code << ", reason=" << reason;
SendStun(conn, &resp);
}
diff --git a/p2p/base/udptransport.cc b/p2p/base/udptransport.cc
index 5925907..9f3d7d0 100644
--- a/p2p/base/udptransport.cc
+++ b/p2p/base/udptransport.cc
@@ -42,7 +42,7 @@
bool UdpTransport::SetRemoteAddress(const rtc::SocketAddress& addr) {
RTC_DCHECK_RUN_ON(&network_thread_checker_);
if (!addr.IsComplete()) {
- LOG(LS_WARNING) << "Remote address not complete.";
+ RTC_LOG(LS_WARNING) << "Remote address not complete.";
return false;
}
// TODO(johan): check for ipv4, other settings.
@@ -83,14 +83,14 @@
int flags) {
// No thread_checker in high frequency network function.
if (remote_address_.IsNil()) {
- LOG(LS_WARNING) << "Remote address not set.";
+ RTC_LOG(LS_WARNING) << "Remote address not set.";
send_error_ = ENOTCONN;
return -1;
}
int result =
socket_->SendTo((const void*)data, len, remote_address_, options);
if (result <= 0) {
- LOG(LS_VERBOSE) << "SendPacket() " << result;
+ RTC_LOG(LS_VERBOSE) << "SendPacket() " << result;
}
return result;
}
diff --git a/p2p/base/udptransport_unittest.cc b/p2p/base/udptransport_unittest.cc
index d8507c4..ead3665 100644
--- a/p2p/base/udptransport_unittest.cc
+++ b/p2p/base/udptransport_unittest.cc
@@ -91,7 +91,7 @@
const rtc::PacketTime& packet_time,
int flags) {
num_received_packets_++;
- LOG(LS_VERBOSE) << "OnReadPacket (unittest)";
+ RTC_LOG(LS_VERBOSE) << "OnReadPacket (unittest)";
ch_packets_.push_front(std::string(data, len));
}
diff --git a/p2p/client/basicportallocator.cc b/p2p/client/basicportallocator.cc
index c68c4fa..e161a86 100644
--- a/p2p/client/basicportallocator.cc
+++ b/p2p/client/basicportallocator.cc
@@ -287,8 +287,8 @@
network_thread_->Post(RTC_FROM_HERE, this, MSG_CONFIG_START);
- LOG(LS_INFO) << "Start getting ports with prune_turn_ports "
- << (prune_turn_ports_ ? "enabled" : "disabled");
+ RTC_LOG(LS_INFO) << "Start getting ports with prune_turn_ports "
+ << (prune_turn_ports_ ? "enabled" : "disabled");
}
void BasicPortAllocatorSession::StopGettingPorts() {
@@ -354,7 +354,7 @@
return;
}
- LOG(LS_INFO) << "Regather candidates on failed networks";
+ RTC_LOG(LS_INFO) << "Regather candidates on failed networks";
// Mark a sequence as "network failed" if its network is in the list of failed
// networks, so that it won't be considered as equivalent when the session
@@ -378,7 +378,7 @@
return;
}
- LOG(LS_INFO) << "Regather candidates on all networks";
+ RTC_LOG(LS_INFO) << "Regather candidates on all networks";
// We expect to generate candidates that are equivalent to what we have now.
// Force DoAllocate to generate them instead of skipping.
@@ -395,7 +395,7 @@
// the candidates on the remote side.
std::vector<PortData*> ports_to_prune = GetUnprunedPorts(networks);
if (!ports_to_prune.empty()) {
- LOG(LS_INFO) << "Prune " << ports_to_prune.size() << " ports";
+ RTC_LOG(LS_INFO) << "Prune " << ports_to_prune.size() << " ports";
PrunePortsAndRemoveCandidates(ports_to_prune);
}
@@ -659,10 +659,11 @@
bool done_signal_needed = false;
std::vector<rtc::Network*> networks = GetNetworks();
if (networks.empty()) {
- LOG(LS_WARNING) << "Machine has no networks; no ports will be allocated";
+ RTC_LOG(LS_WARNING)
+ << "Machine has no networks; no ports will be allocated";
done_signal_needed = true;
} else {
- LOG(LS_INFO) << "Allocate ports on "<< networks.size() << " networks";
+ RTC_LOG(LS_INFO) << "Allocate ports on " << networks.size() << " networks";
PortConfiguration* config = configs_.empty() ? nullptr : configs_.back();
for (uint32_t i = 0; i < networks.size(); ++i) {
uint32_t sequence_flags = flags();
@@ -732,8 +733,8 @@
}
std::vector<PortData*> ports_to_prune = GetUnprunedPorts(failed_networks);
if (!ports_to_prune.empty()) {
- LOG(LS_INFO) << "Prune " << ports_to_prune.size()
- << " ports because their networks were gone";
+ RTC_LOG(LS_INFO) << "Prune " << ports_to_prune.size()
+ << " ports because their networks were gone";
PrunePortsAndRemoveCandidates(ports_to_prune);
}
@@ -747,7 +748,7 @@
}
if (!network_manager_started_) {
- LOG(LS_INFO) << "Network manager has started";
+ RTC_LOG(LS_INFO) << "Network manager has started";
network_manager_started_ = true;
}
}
@@ -769,7 +770,7 @@
if (!port)
return;
- LOG(LS_INFO) << "Adding allocated port for " << content_name();
+ RTC_LOG(LS_INFO) << "Adding allocated port for " << content_name();
port->set_content_name(content_name());
port->set_component(component());
port->set_generation(generation());
@@ -810,7 +811,7 @@
// Discarding any candidate signal if port allocation status is
// already done with gathering.
if (!data->inprogress()) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "Discarding candidate because port is already done gathering.";
return;
}
@@ -844,7 +845,7 @@
candidates.push_back(SanitizeRelatedAddress(c));
SignalCandidatesReady(this, candidates);
} else {
- LOG(LS_INFO) << "Discarding candidate because it doesn't match filter.";
+ RTC_LOG(LS_INFO) << "Discarding candidate because it doesn't match filter.";
}
// If we have pruned any port, maybe need to signal port allocation done.
@@ -892,8 +893,8 @@
}
if (!ports_to_prune.empty()) {
- LOG(LS_INFO) << "Prune " << ports_to_prune.size()
- << " low-priority TURN ports";
+ RTC_LOG(LS_INFO) << "Prune " << ports_to_prune.size()
+ << " low-priority TURN ports";
PrunePortsAndRemoveCandidates(ports_to_prune);
}
return pruned;
@@ -999,10 +1000,10 @@
void BasicPortAllocatorSession::MaybeSignalCandidatesAllocationDone() {
if (CandidatesAllocationDone()) {
if (pooled()) {
- LOG(LS_INFO) << "All candidates gathered for pooled session.";
+ RTC_LOG(LS_INFO) << "All candidates gathered for pooled session.";
} else {
- LOG(LS_INFO) << "All candidates gathered for " << content_name() << ":"
- << component() << ":" << generation();
+ RTC_LOG(LS_INFO) << "All candidates gathered for " << content_name()
+ << ":" << component() << ":" << generation();
}
SignalCandidatesAllocationDone(this);
}
@@ -1067,7 +1068,8 @@
SignalPortsPruned(this, pruned_ports);
}
if (!removed_candidates.empty()) {
- LOG(LS_INFO) << "Removed " << removed_candidates.size() << " candidates";
+ RTC_LOG(LS_INFO) << "Removed " << removed_candidates.size()
+ << " candidates";
SignalCandidatesRemoved(this, removed_candidates);
}
}
@@ -1233,7 +1235,7 @@
void AllocationSequence::CreateUDPPorts() {
if (IsFlagSet(PORTALLOCATOR_DISABLE_UDP)) {
- LOG(LS_VERBOSE) << "AllocationSequence: UDP ports disabled, skipping.";
+ RTC_LOG(LS_VERBOSE) << "AllocationSequence: UDP ports disabled, skipping.";
return;
}
@@ -1265,8 +1267,9 @@
// If STUN is not disabled, setting stun server address to port.
if (!IsFlagSet(PORTALLOCATOR_DISABLE_STUN)) {
if (config_ && !config_->StunServers().empty()) {
- LOG(LS_INFO) << "AllocationSequence: UDPPort will be handling the "
- << "STUN candidate generation.";
+ RTC_LOG(LS_INFO)
+ << "AllocationSequence: UDPPort will be handling the "
+ << "STUN candidate generation.";
port->set_server_addresses(config_->StunServers());
}
}
@@ -1278,7 +1281,7 @@
void AllocationSequence::CreateTCPPorts() {
if (IsFlagSet(PORTALLOCATOR_DISABLE_TCP)) {
- LOG(LS_VERBOSE) << "AllocationSequence: TCP ports disabled, skipping.";
+ RTC_LOG(LS_VERBOSE) << "AllocationSequence: TCP ports disabled, skipping.";
return;
}
@@ -1296,7 +1299,7 @@
void AllocationSequence::CreateStunPorts() {
if (IsFlagSet(PORTALLOCATOR_DISABLE_STUN)) {
- LOG(LS_VERBOSE) << "AllocationSequence: STUN ports disabled, skipping.";
+ RTC_LOG(LS_VERBOSE) << "AllocationSequence: STUN ports disabled, skipping.";
return;
}
@@ -1305,7 +1308,7 @@
}
if (!(config_ && !config_->StunServers().empty())) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "AllocationSequence: No STUN server configured, skipping.";
return;
}
@@ -1324,8 +1327,9 @@
void AllocationSequence::CreateRelayPorts() {
if (IsFlagSet(PORTALLOCATOR_DISABLE_RELAY)) {
- LOG(LS_VERBOSE) << "AllocationSequence: Relay ports disabled, skipping.";
- return;
+ RTC_LOG(LS_VERBOSE)
+ << "AllocationSequence: Relay ports disabled, skipping.";
+ return;
}
// If BasicPortAllocatorSession::OnAllocate left relay ports enabled then we
@@ -1333,7 +1337,7 @@
RTC_DCHECK(config_);
RTC_DCHECK(!config_->relays.empty());
if (!(config_ && !config_->relays.empty())) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "AllocationSequence: No relay server configured, skipping.";
return;
}
@@ -1395,10 +1399,10 @@
int server_ip_family = relay_port->address.ipaddr().family();
int local_ip_family = network_->GetBestIP().family();
if (server_ip_family != AF_UNSPEC && server_ip_family != local_ip_family) {
- LOG(LS_INFO) << "Server and local address families are not compatible. "
- << "Server address: "
- << relay_port->address.ipaddr().ToString()
- << " Local address: " << network_->GetBestIP().ToString();
+ RTC_LOG(LS_INFO)
+ << "Server and local address families are not compatible. "
+ << "Server address: " << relay_port->address.ipaddr().ToString()
+ << " Local address: " << network_->GetBestIP().ToString();
continue;
}
@@ -1482,7 +1486,7 @@
if (it != turn_ports_.end()) {
turn_ports_.erase(it);
} else {
- LOG(LS_ERROR) << "Unexpected OnPortDestroyed for nonexistent port.";
+ RTC_LOG(LS_ERROR) << "Unexpected OnPortDestroyed for nonexistent port.";
RTC_NOTREACHED();
}
}
diff --git a/p2p/client/basicportallocator_unittest.cc b/p2p/client/basicportallocator_unittest.cc
index beebe97..78cc330 100644
--- a/p2p/client/basicportallocator_unittest.cc
+++ b/p2p/client/basicportallocator_unittest.cc
@@ -38,10 +38,10 @@
using rtc::SocketAddress;
using rtc::Thread;
-#define MAYBE_SKIP_IPV4 \
- if (!rtc::HasIPv4Enabled()) { \
- LOG(LS_INFO) << "No IPv4... skipping"; \
- return; \
+#define MAYBE_SKIP_IPV4 \
+ if (!rtc::HasIPv4Enabled()) { \
+ RTC_LOG(LS_INFO) << "No IPv4... skipping"; \
+ return; \
}
static const SocketAddress kAnyAddr("0.0.0.0", 0);
@@ -380,7 +380,7 @@
BasicPortAllocator& allocator() { return *allocator_; }
void OnPortReady(PortAllocatorSession* ses, PortInterface* port) {
- LOG(LS_INFO) << "OnPortReady: " << port->ToString();
+ RTC_LOG(LS_INFO) << "OnPortReady: " << port->ToString();
ports_.push_back(port);
// Make sure the new port is added to ReadyPorts.
auto ready_ports = ses->ReadyPorts();
@@ -389,7 +389,7 @@
}
void OnPortsPruned(PortAllocatorSession* ses,
const std::vector<PortInterface*>& pruned_ports) {
- LOG(LS_INFO) << "Number of ports pruned: " << pruned_ports.size();
+ RTC_LOG(LS_INFO) << "Number of ports pruned: " << pruned_ports.size();
auto ready_ports = ses->ReadyPorts();
auto new_end = ports_.end();
for (PortInterface* port : pruned_ports) {
@@ -404,7 +404,7 @@
void OnCandidatesReady(PortAllocatorSession* ses,
const std::vector<Candidate>& candidates) {
for (const Candidate& candidate : candidates) {
- LOG(LS_INFO) << "OnCandidatesReady: " << candidate.ToString();
+ RTC_LOG(LS_INFO) << "OnCandidatesReady: " << candidate.ToString();
// Sanity check that the ICE component is set.
EXPECT_EQ(ICE_CANDIDATE_COMPONENT_RTP, candidate.component());
candidates_.push_back(candidate);
diff --git a/pc/channel.cc b/pc/channel.cc
index 5d8bbcd..21e666c 100644
--- a/pc/channel.cc
+++ b/pc/channel.cc
@@ -174,7 +174,7 @@
// channel to signal.
rtp_transport_->SignalPacketReceived.connect(this,
&BaseChannel::OnPacketReceived);
- LOG(LS_INFO) << "Created channel for " << content_name;
+ RTC_LOG(LS_INFO) << "Created channel for " << content_name;
}
BaseChannel::~BaseChannel() {
@@ -189,7 +189,7 @@
// the media channel may try to send on the dead transport channel. NULLing
// is not an effective strategy since the sends will come on another thread.
media_channel_.reset();
- LOG(LS_INFO) << "Destroyed channel: " << content_name_;
+ RTC_LOG(LS_INFO) << "Destroyed channel: " << content_name_;
}
void BaseChannel::DisconnectTransportChannels_n() {
@@ -324,13 +324,14 @@
// If this BaseChannel doesn't require RTCP mux and we haven't fully
// negotiated RTCP mux, we need an RTCP transport.
if (rtcp_packet_transport) {
- LOG(LS_INFO) << "Setting RTCP Transport for " << content_name() << " on "
- << debug_name << " transport " << rtcp_packet_transport;
+ RTC_LOG(LS_INFO) << "Setting RTCP Transport for " << content_name()
+ << " on " << debug_name << " transport "
+ << rtcp_packet_transport;
SetTransport_n(true, rtcp_dtls_transport, rtcp_packet_transport);
}
- LOG(LS_INFO) << "Setting RTP Transport for " << content_name() << " on "
- << debug_name << " transport " << rtp_packet_transport;
+ RTC_LOG(LS_INFO) << "Setting RTP Transport for " << content_name() << " on "
+ << debug_name << " transport " << rtp_packet_transport;
SetTransport_n(false, rtp_dtls_transport, rtp_packet_transport);
// Update aggregate writable/ready-to-send state between RTP and RTCP upon
@@ -653,9 +654,9 @@
// Protect ourselves against crazy data.
if (!ValidPacket(rtcp, packet)) {
- LOG(LS_ERROR) << "Dropping outgoing " << content_name_ << " "
- << RtpRtcpStringLiteral(rtcp)
- << " packet: wrong size=" << packet->size();
+ RTC_LOG(LS_ERROR) << "Dropping outgoing " << content_name_ << " "
+ << RtpRtcpStringLiteral(rtcp)
+ << " packet: wrong size=" << packet->size();
return false;
}
@@ -669,8 +670,9 @@
}
// However, there shouldn't be any RTP packets sent before SRTP is set up
// (and SetSend(true) is called).
- LOG(LS_ERROR) << "Can't send outgoing RTP packet when SRTP is inactive"
- << " and crypto is required";
+ RTC_LOG(LS_ERROR)
+ << "Can't send outgoing RTP packet when SRTP is inactive"
+ << " and crypto is required";
RTC_NOTREACHED();
return false;
}
@@ -710,8 +712,9 @@
// before sending media, to prevent weird failure modes, so it's fine
// for us to just eat packets here. This is all sidestepped if RTCP mux
// is used anyway.
- LOG(LS_WARNING) << "Can't process incoming " << RtpRtcpStringLiteral(rtcp)
- << " packet when SRTP is inactive and crypto is required";
+ RTC_LOG(LS_WARNING)
+ << "Can't process incoming " << RtpRtcpStringLiteral(rtcp)
+ << " packet when SRTP is inactive and crypto is required";
return;
}
@@ -740,7 +743,7 @@
if (enabled_)
return;
- LOG(LS_INFO) << "Channel enabled";
+ RTC_LOG(LS_INFO) << "Channel enabled";
enabled_ = true;
UpdateMediaSendRecvState_w();
}
@@ -750,7 +753,7 @@
if (!enabled_)
return;
- LOG(LS_INFO) << "Channel disabled";
+ RTC_LOG(LS_INFO) << "Channel disabled";
enabled_ = false;
UpdateMediaSendRecvState_w();
}
@@ -774,11 +777,11 @@
return;
}
- LOG(LS_INFO) << "Channel writable (" << content_name_ << ")"
- << (was_ever_writable_ ? "" : " for the first time");
+ RTC_LOG(LS_INFO) << "Channel writable (" << content_name_ << ")"
+ << (was_ever_writable_ ? "" : " for the first time");
if (selected_candidate_pair_)
- LOG(LS_INFO)
+ RTC_LOG(LS_INFO)
<< "Using "
<< selected_candidate_pair_->local_candidate().ToSensitiveString()
<< "->"
@@ -821,18 +824,19 @@
int selected_crypto_suite;
if (!transport->GetSrtpCryptoSuite(&selected_crypto_suite)) {
- LOG(LS_ERROR) << "No DTLS-SRTP selected crypto suite";
+ RTC_LOG(LS_ERROR) << "No DTLS-SRTP selected crypto suite";
return false;
}
- LOG(LS_INFO) << "Installing keys from DTLS-SRTP on " << content_name() << " "
- << RtpRtcpStringLiteral(rtcp);
+ RTC_LOG(LS_INFO) << "Installing keys from DTLS-SRTP on " << content_name()
+ << " " << RtpRtcpStringLiteral(rtcp);
int key_len;
int salt_len;
if (!rtc::GetSrtpKeyAndSaltLengths(selected_crypto_suite, &key_len,
&salt_len)) {
- LOG(LS_ERROR) << "Unknown DTLS-SRTP crypto suite" << selected_crypto_suite;
+ RTC_LOG(LS_ERROR) << "Unknown DTLS-SRTP crypto suite"
+ << selected_crypto_suite;
return false;
}
@@ -842,7 +846,7 @@
// RFC 5705 exporter using the RFC 5764 parameters
if (!transport->ExportKeyingMaterial(kDtlsSrtpExporterLabel, NULL, 0, false,
&dtls_buffer[0], dtls_buffer.size())) {
- LOG(LS_WARNING) << "DTLS-SRTP key export failed";
+ RTC_LOG(LS_WARNING) << "DTLS-SRTP key export failed";
RTC_NOTREACHED(); // This should never happen
return false;
}
@@ -862,7 +866,7 @@
std::vector<unsigned char> *send_key, *recv_key;
rtc::SSLRole role;
if (!transport->GetSslRole(&role)) {
- LOG(LS_WARNING) << "GetSslRole failed";
+ RTC_LOG(LS_WARNING) << "GetSslRole failed";
return false;
}
@@ -896,7 +900,7 @@
}
if (!ret) {
- LOG(LS_WARNING) << "DTLS-SRTP key installation failed";
+ RTC_LOG(LS_WARNING) << "DTLS-SRTP key installation failed";
} else {
UpdateTransportOverhead();
}
@@ -934,7 +938,7 @@
if (!writable_)
return;
- LOG(LS_INFO) << "Channel not writable (" << content_name_ << ")";
+ RTC_LOG(LS_INFO) << "Channel not writable (" << content_name_ << ")";
writable_ = false;
UpdateMediaSendRecvState();
}
@@ -953,8 +957,8 @@
std::vector<int> encrypted_extension_ids;
for (const webrtc::RtpExtension& extension : extensions) {
if (extension.encrypt) {
- LOG(LS_INFO) << "Using " << (src == CS_LOCAL ? "local" : "remote")
- << " encrypted extension: " << extension.ToString();
+ RTC_LOG(LS_INFO) << "Using " << (src == CS_LOCAL ? "local" : "remote")
+ << " encrypted extension: " << extension.ToString();
encrypted_extension_ids.push_back(extension.id);
}
}
@@ -1013,7 +1017,7 @@
this, &BaseChannel::OnTransportReadyToSend);
rtp_transport_->SignalPacketReceived.connect(
this, &BaseChannel::OnPacketReceived);
- LOG(LS_INFO) << "Wrapping RtpTransport in SrtpTransport.";
+ RTC_LOG(LS_INFO) << "Wrapping RtpTransport in SrtpTransport.";
}
}
@@ -1082,7 +1086,7 @@
sdes_negotiator_.recv_key().data(),
static_cast<int>(sdes_negotiator_.recv_key().size()));
} else {
- LOG(LS_INFO) << "No crypto keys are provided for SDES.";
+ RTC_LOG(LS_INFO) << "No crypto keys are provided for SDES.";
if (action == CA_ANSWER && srtp_transport_) {
// Explicitly reset the |srtp_transport_| if no crypto param is
// provided in the answer. No need to call |ResetParams()| for
@@ -1139,8 +1143,9 @@
transport_name_.empty()
? rtp_transport_->rtp_packet_transport()->debug_name()
: transport_name_;
- LOG(LS_INFO) << "Enabling rtcp-mux for " << content_name()
- << "; no longer need RTCP transport for " << debug_name;
+ RTC_LOG(LS_INFO) << "Enabling rtcp-mux for " << content_name()
+ << "; no longer need RTCP transport for "
+ << debug_name;
if (rtp_transport_->rtcp_packet_transport()) {
SetTransport_n(true, nullptr, nullptr);
SignalRtcpMuxFullyActive(transport_name_);
@@ -1199,7 +1204,7 @@
if (!existing_stream && it->has_ssrcs()) {
if (media_channel()->AddSendStream(*it)) {
local_streams_.push_back(*it);
- LOG(LS_INFO) << "Add send stream ssrc: " << it->first_ssrc();
+ RTC_LOG(LS_INFO) << "Add send stream ssrc: " << it->first_ssrc();
} else {
std::ostringstream desc;
desc << "Failed to add send stream ssrc: " << it->first_ssrc();
@@ -1216,7 +1221,7 @@
}
RemoveStreamBySsrc(&local_streams_, existing_stream->first_ssrc());
} else {
- LOG(LS_WARNING) << "Ignore unsupported stream update";
+ RTC_LOG(LS_WARNING) << "Ignore unsupported stream update";
}
}
return true;
@@ -1242,7 +1247,7 @@
it != streams.end(); ++it) {
if (!GetStreamBySsrc(local_streams_, it->first_ssrc())) {
if (media_channel()->AddSendStream(*it)) {
- LOG(LS_INFO) << "Add send stream ssrc: " << it->ssrcs[0];
+ RTC_LOG(LS_INFO) << "Add send stream ssrc: " << it->ssrcs[0];
} else {
std::ostringstream desc;
desc << "Failed to add send stream ssrc: " << it->first_ssrc();
@@ -1272,7 +1277,7 @@
if (!existing_stream && it->has_ssrcs()) {
if (AddRecvStream_w(*it)) {
remote_streams_.push_back(*it);
- LOG(LS_INFO) << "Add remote stream ssrc: " << it->first_ssrc();
+ RTC_LOG(LS_INFO) << "Add remote stream ssrc: " << it->first_ssrc();
} else {
std::ostringstream desc;
desc << "Failed to add remote stream ssrc: " << it->first_ssrc();
@@ -1289,9 +1294,10 @@
}
RemoveStreamBySsrc(&remote_streams_, existing_stream->first_ssrc());
} else {
- LOG(LS_WARNING) << "Ignore unsupported stream update."
- << " Stream exists? " << (existing_stream != nullptr)
- << " new stream = " << it->ToString();
+ RTC_LOG(LS_WARNING)
+ << "Ignore unsupported stream update."
+ << " Stream exists? " << (existing_stream != nullptr)
+ << " new stream = " << it->ToString();
}
}
return true;
@@ -1317,7 +1323,7 @@
it != streams.end(); ++it) {
if (!GetStreamBySsrc(remote_streams_, it->first_ssrc())) {
if (AddRecvStream_w(*it)) {
- LOG(LS_INFO) << "Add remote ssrc: " << it->ssrcs[0];
+ RTC_LOG(LS_INFO) << "Add remote ssrc: " << it->ssrcs[0];
} else {
std::ostringstream desc;
desc << "Failed to add remote stream ssrc: " << it->first_ssrc();
@@ -1371,8 +1377,9 @@
srtp_transport_->CacheRtpAbsSendTimeHeaderExtension(
rtp_abs_sendtime_extn_id);
} else {
- LOG(LS_WARNING) << "Trying to cache the Absolute Send Time extension id "
- "but the SRTP is not active.";
+ RTC_LOG(LS_WARNING)
+ << "Trying to cache the Absolute Send Time extension id "
+ "but the SRTP is not active.";
}
}
@@ -1685,7 +1692,7 @@
bool send = IsReadyToSendMedia_w();
media_channel()->SetSend(send);
- LOG(LS_INFO) << "Changing voice state, recv=" << recv << " send=" << send;
+ RTC_LOG(LS_INFO) << "Changing voice state, recv=" << recv << " send=" << send;
}
bool VoiceChannel::SetLocalContent_w(const MediaContentDescription* content,
@@ -1693,7 +1700,7 @@
std::string* error_desc) {
TRACE_EVENT0("webrtc", "VoiceChannel::SetLocalContent_w");
RTC_DCHECK(worker_thread() == rtc::Thread::Current());
- LOG(LS_INFO) << "Setting local voice description";
+ RTC_LOG(LS_INFO) << "Setting local voice description";
const AudioContentDescription* audio =
static_cast<const AudioContentDescription*>(content);
@@ -1742,7 +1749,7 @@
std::string* error_desc) {
TRACE_EVENT0("webrtc", "VoiceChannel::SetRemoteContent_w");
RTC_DCHECK(worker_thread() == rtc::Thread::Current());
- LOG(LS_INFO) << "Setting remote voice description";
+ RTC_LOG(LS_INFO) << "Setting remote voice description";
const AudioContentDescription* audio =
static_cast<const AudioContentDescription*>(content);
@@ -1796,7 +1803,7 @@
void VoiceChannel::HandleEarlyMediaTimeout() {
// This occurs on the main thread, not the worker thread.
if (!received_media_) {
- LOG(LS_INFO) << "No early media received before timeout";
+ RTC_LOG(LS_INFO) << "No early media received before timeout";
SignalEarlyMediaTimeout(this);
}
}
@@ -1938,11 +1945,11 @@
// and we have had some form of connectivity.
bool send = IsReadyToSendMedia_w();
if (!media_channel()->SetSend(send)) {
- LOG(LS_ERROR) << "Failed to SetSend on video channel";
+ RTC_LOG(LS_ERROR) << "Failed to SetSend on video channel";
// TODO(gangji): Report error back to server.
}
- LOG(LS_INFO) << "Changing video state, send=" << send;
+ RTC_LOG(LS_INFO) << "Changing video state, send=" << send;
}
void VideoChannel::FillBitrateInfo(BandwidthEstimationInfo* bwe_info) {
@@ -1975,7 +1982,7 @@
std::string* error_desc) {
TRACE_EVENT0("webrtc", "VideoChannel::SetLocalContent_w");
RTC_DCHECK(worker_thread() == rtc::Thread::Current());
- LOG(LS_INFO) << "Setting local video description";
+ RTC_LOG(LS_INFO) << "Setting local video description";
const VideoContentDescription* video =
static_cast<const VideoContentDescription*>(content);
@@ -2024,7 +2031,7 @@
std::string* error_desc) {
TRACE_EVENT0("webrtc", "VideoChannel::SetRemoteContent_w");
RTC_DCHECK(worker_thread() == rtc::Thread::Current());
- LOG(LS_INFO) << "Setting remote video description";
+ RTC_LOG(LS_INFO) << "Setting remote video description";
const VideoContentDescription* video =
static_cast<const VideoContentDescription*>(content);
@@ -2168,7 +2175,7 @@
std::string* error_desc) {
TRACE_EVENT0("webrtc", "RtpDataChannel::SetLocalContent_w");
RTC_DCHECK(worker_thread() == rtc::Thread::Current());
- LOG(LS_INFO) << "Setting local data description";
+ RTC_LOG(LS_INFO) << "Setting local data description";
const DataContentDescription* data =
static_cast<const DataContentDescription*>(content);
@@ -2243,7 +2250,7 @@
RtpHeaderExtensions rtp_header_extensions =
GetFilteredRtpHeaderExtensions(data->rtp_header_extensions());
- LOG(LS_INFO) << "Setting remote data description";
+ RTC_LOG(LS_INFO) << "Setting remote data description";
if (!SetRtpTransportParameters(content, action, CS_REMOTE,
rtp_header_extensions, error_desc)) {
return false;
@@ -2279,20 +2286,20 @@
// content. We receive data on the default channel and multiplexed streams.
bool recv = IsReadyToReceiveMedia_w();
if (!media_channel()->SetReceive(recv)) {
- LOG(LS_ERROR) << "Failed to SetReceive on data channel";
+ RTC_LOG(LS_ERROR) << "Failed to SetReceive on data channel";
}
// Send outgoing data if we're the active call, we have the remote content,
// and we have had some form of connectivity.
bool send = IsReadyToSendMedia_w();
if (!media_channel()->SetSend(send)) {
- LOG(LS_ERROR) << "Failed to SetSend on data channel";
+ RTC_LOG(LS_ERROR) << "Failed to SetSend on data channel";
}
// Trigger SignalReadyToSendData asynchronously.
OnDataChannelReadyToSend(send);
- LOG(LS_INFO) << "Changing data state, recv=" << recv << " send=" << send;
+ RTC_LOG(LS_INFO) << "Changing data state, recv=" << recv << " send=" << send;
}
void RtpDataChannel::OnMessage(rtc::Message* pmsg) {
diff --git a/pc/channelmanager.cc b/pc/channelmanager.cc
index bb1548d..2d7c79a 100644
--- a/pc/channelmanager.cc
+++ b/pc/channelmanager.cc
@@ -56,7 +56,7 @@
enable_rtx_ = enable;
return true;
} else {
- LOG(LS_WARNING) << "Cannot toggle rtx after initialization!";
+ RTC_LOG(LS_WARNING) << "Cannot toggle rtx after initialization!";
return false;
}
}
@@ -355,7 +355,7 @@
RTC_DCHECK(initialized_);
DataMediaChannel* media_channel = data_engine_->CreateChannel(media_config);
if (!media_channel) {
- LOG(LS_WARNING) << "Failed to create RTP data channel.";
+ RTC_LOG(LS_WARNING) << "Failed to create RTP data channel.";
return nullptr;
}
diff --git a/pc/currentspeakermonitor.cc b/pc/currentspeakermonitor.cc
index 9765d2e..e210a45 100644
--- a/pc/currentspeakermonitor.cc
+++ b/pc/currentspeakermonitor.cc
@@ -169,7 +169,7 @@
if (earliest_permitted_switch_time_ <= now &&
current_speaker_ssrc_ != loudest_speaker_ssrc) {
current_speaker_ssrc_ = loudest_speaker_ssrc;
- LOG(LS_INFO) << "Current speaker changed to " << current_speaker_ssrc_;
+ RTC_LOG(LS_INFO) << "Current speaker changed to " << current_speaker_ssrc_;
earliest_permitted_switch_time_ = now + min_time_between_switches_;
SignalUpdate(this, current_speaker_ssrc_);
}
diff --git a/pc/datachannel.cc b/pc/datachannel.cc
index 9bc16df..950fbea 100644
--- a/pc/datachannel.cc
+++ b/pc/datachannel.cc
@@ -150,8 +150,8 @@
config.id != -1 ||
config.maxRetransmits != -1 ||
config.maxRetransmitTime != -1) {
- LOG(LS_ERROR) << "Failed to initialize the RTP data channel due to "
- << "invalid DataChannelInit.";
+ RTC_LOG(LS_ERROR) << "Failed to initialize the RTP data channel due to "
+ << "invalid DataChannelInit.";
return false;
}
handshake_state_ = kHandshakeReady;
@@ -159,13 +159,13 @@
if (config.id < -1 ||
config.maxRetransmits < -1 ||
config.maxRetransmitTime < -1) {
- LOG(LS_ERROR) << "Failed to initialize the SCTP data channel due to "
- << "invalid DataChannelInit.";
+ RTC_LOG(LS_ERROR) << "Failed to initialize the SCTP data channel due to "
+ << "invalid DataChannelInit.";
return false;
}
if (config.maxRetransmits != -1 && config.maxRetransmitTime != -1) {
- LOG(LS_ERROR) <<
- "maxRetransmits and maxRetransmitTime should not be both set.";
+ RTC_LOG(LS_ERROR)
+ << "maxRetransmits and maxRetransmitTime should not be both set.";
return false;
}
config_ = config;
@@ -344,18 +344,19 @@
RTC_DCHECK(data_channel_type_ == cricket::DCT_SCTP);
if (handshake_state_ != kHandshakeWaitingForAck) {
// Ignore it if we are not expecting an ACK message.
- LOG(LS_WARNING) << "DataChannel received unexpected CONTROL message, "
- << "sid = " << params.sid;
+ RTC_LOG(LS_WARNING) << "DataChannel received unexpected CONTROL message, "
+ << "sid = " << params.sid;
return;
}
if (ParseDataChannelOpenAckMessage(payload)) {
// We can send unordered as soon as we receive the ACK message.
handshake_state_ = kHandshakeReady;
- LOG(LS_INFO) << "DataChannel received OPEN_ACK message, sid = "
- << params.sid;
+ RTC_LOG(LS_INFO) << "DataChannel received OPEN_ACK message, sid = "
+ << params.sid;
} else {
- LOG(LS_WARNING) << "DataChannel failed to parse OPEN_ACK message, sid = "
- << params.sid;
+ RTC_LOG(LS_WARNING)
+ << "DataChannel failed to parse OPEN_ACK message, sid = "
+ << params.sid;
}
return;
}
@@ -363,7 +364,8 @@
RTC_DCHECK(params.type == cricket::DMT_BINARY ||
params.type == cricket::DMT_TEXT);
- LOG(LS_VERBOSE) << "DataChannel received DATA message, sid = " << params.sid;
+ RTC_LOG(LS_VERBOSE) << "DataChannel received DATA message, sid = "
+ << params.sid;
// We can send unordered as soon as we receive any DATA message since the
// remote side must have received the OPEN (and old clients do not send
// OPEN_ACK).
@@ -380,7 +382,7 @@
} else {
if (queued_received_data_.byte_count() + payload.size() >
kMaxQueuedReceivedDataBytes) {
- LOG(LS_ERROR) << "Queued received data exceeds the max buffer size.";
+ RTC_LOG(LS_ERROR) << "Queued received data exceeds the max buffer size.";
queued_received_data_.Clear();
if (data_channel_type_ != cricket::DCT_RTP) {
@@ -547,8 +549,9 @@
// Send as ordered if it is still going through OPEN/ACK signaling.
if (handshake_state_ != kHandshakeReady && !config_.ordered) {
send_params.ordered = true;
- LOG(LS_VERBOSE) << "Sending data as ordered for unordered DataChannel "
- << "because the OPEN_ACK message has not been received.";
+ RTC_LOG(LS_VERBOSE)
+ << "Sending data as ordered for unordered DataChannel "
+ << "because the OPEN_ACK message has not been received.";
}
send_params.max_rtx_count = config_.maxRetransmits;
@@ -579,8 +582,8 @@
}
// Close the channel if the error is not SDR_BLOCK, or if queuing the
// message failed.
- LOG(LS_ERROR) << "Closing the DataChannel due to a failure to send data, "
- << "send_result = " << send_result;
+ RTC_LOG(LS_ERROR) << "Closing the DataChannel due to a failure to send data, "
+ << "send_result = " << send_result;
Close();
return false;
@@ -589,7 +592,7 @@
bool DataChannel::QueueSendDataMessage(const DataBuffer& buffer) {
size_t start_buffered_amount = buffered_amount();
if (start_buffered_amount >= kMaxQueuedSendDataBytes) {
- LOG(LS_ERROR) << "Can't buffer any more data for the data channel.";
+ RTC_LOG(LS_ERROR) << "Can't buffer any more data for the data channel.";
return false;
}
queued_send_data_.Push(new DataBuffer(buffer));
@@ -635,7 +638,7 @@
cricket::SendDataResult send_result = cricket::SDR_SUCCESS;
bool retval = provider_->SendData(send_params, buffer, &send_result);
if (retval) {
- LOG(LS_INFO) << "Sent CONTROL message on channel " << config_.id;
+ RTC_LOG(LS_INFO) << "Sent CONTROL message on channel " << config_.id;
if (handshake_state_ == kHandshakeShouldSendAck) {
handshake_state_ = kHandshakeReady;
@@ -645,8 +648,8 @@
} else if (send_result == cricket::SDR_BLOCK) {
QueueControlMessage(buffer);
} else {
- LOG(LS_ERROR) << "Closing the DataChannel due to a failure to send"
- << " the CONTROL message, send_result = " << send_result;
+ RTC_LOG(LS_ERROR) << "Closing the DataChannel due to a failure to send"
+ << " the CONTROL message, send_result = " << send_result;
Close();
}
return retval;
diff --git a/pc/dtmfsender.cc b/pc/dtmfsender.cc
index 1400206..82644aa 100644
--- a/pc/dtmfsender.cc
+++ b/pc/dtmfsender.cc
@@ -118,7 +118,8 @@
if (duration > kDtmfMaxDurationMs ||
duration < kDtmfMinDurationMs ||
inter_tone_gap < kDtmfMinGapMs) {
- LOG(LS_ERROR) << "InsertDtmf is called with invalid duration or tones gap. "
+ RTC_LOG(LS_ERROR)
+ << "InsertDtmf is called with invalid duration or tones gap. "
<< "The duration cannot be more than " << kDtmfMaxDurationMs
<< "ms or less than " << kDtmfMinDurationMs << "ms. "
<< "The gap between tones must be at least " << kDtmfMinGapMs << "ms.";
@@ -126,7 +127,7 @@
}
if (!CanInsertDtmf()) {
- LOG(LS_ERROR)
+ RTC_LOG(LS_ERROR)
<< "InsertDtmf is called on DtmfSender that can't send DTMF.";
return false;
}
@@ -200,13 +201,13 @@
tone_gap = kDtmfTwoSecondInMs;
} else {
if (!provider_) {
- LOG(LS_ERROR) << "The DtmfProvider has been destroyed.";
+ RTC_LOG(LS_ERROR) << "The DtmfProvider has been destroyed.";
return;
}
// The provider starts playout of the given tone on the
// associated RTP media stream, using the appropriate codec.
if (!provider_->InsertDtmf(code, duration_)) {
- LOG(LS_ERROR) << "The DtmfProvider can no longer send DTMF.";
+ RTC_LOG(LS_ERROR) << "The DtmfProvider can no longer send DTMF.";
return;
}
// Wait for the number of milliseconds specified by |duration_|.
@@ -227,7 +228,7 @@
}
void DtmfSender::OnProviderDestroyed() {
- LOG(LS_INFO) << "The Dtmf provider is deleted. Clear the sending queue.";
+ RTC_LOG(LS_INFO) << "The Dtmf provider is deleted. Clear the sending queue.";
StopSending();
provider_ = NULL;
}
diff --git a/pc/externalhmac.cc b/pc/externalhmac.cc
index 91f7412..348b33b 100644
--- a/pc/externalhmac.cc
+++ b/pc/externalhmac.cc
@@ -141,8 +141,8 @@
srtp_err_status_t status = srtp_replace_auth_type(
const_cast<srtp_auth_type_t*>(&external_hmac), EXTERNAL_HMAC_SHA1);
if (status) {
- LOG(LS_ERROR) << "Error in replacing default auth module, error: "
- << status;
+ RTC_LOG(LS_ERROR) << "Error in replacing default auth module, error: "
+ << status;
return srtp_err_status_fail;
}
return srtp_err_status_ok;
diff --git a/pc/iceserverparsing.cc b/pc/iceserverparsing.cc
index ccc1e17..b260954 100644
--- a/pc/iceserverparsing.cc
+++ b/pc/iceserverparsing.cc
@@ -57,11 +57,11 @@
std::string* hostname) {
const std::string::size_type colonpos = in_str.find(':');
if (colonpos == std::string::npos) {
- LOG(LS_WARNING) << "Missing ':' in ICE URI: " << in_str;
+ RTC_LOG(LS_WARNING) << "Missing ':' in ICE URI: " << in_str;
return false;
}
if ((colonpos + 1) == in_str.length()) {
- LOG(LS_WARNING) << "Empty hostname in ICE URI: " << in_str;
+ RTC_LOG(LS_WARNING) << "Empty hostname in ICE URI: " << in_str;
return false;
}
*service_type = INVALID;
@@ -158,17 +158,17 @@
std::string uri_transport_param = tokens[1];
rtc::tokenize_with_empty_tokens(uri_transport_param, '=', &tokens);
if (tokens[0] != kTransport) {
- LOG(LS_WARNING) << "Invalid transport parameter key.";
+ RTC_LOG(LS_WARNING) << "Invalid transport parameter key.";
return RTCErrorType::SYNTAX_ERROR;
}
if (tokens.size() < 2) {
- LOG(LS_WARNING) << "Transport parameter missing value.";
+ RTC_LOG(LS_WARNING) << "Transport parameter missing value.";
return RTCErrorType::SYNTAX_ERROR;
}
if (!cricket::StringToProto(tokens[1].c_str(), &turn_transport_type) ||
(turn_transport_type != cricket::PROTO_UDP &&
turn_transport_type != cricket::PROTO_TCP)) {
- LOG(LS_WARNING) << "Transport parameter should always be udp or tcp.";
+ RTC_LOG(LS_WARNING) << "Transport parameter should always be udp or tcp.";
return RTCErrorType::SYNTAX_ERROR;
}
}
@@ -177,7 +177,7 @@
ServiceType service_type;
if (!GetServiceTypeAndHostnameFromUri(uri_without_transport, &service_type,
&hoststring)) {
- LOG(LS_WARNING) << "Invalid transport parameter in ICE URI: " << url;
+ RTC_LOG(LS_WARNING) << "Invalid transport parameter in ICE URI: " << url;
return RTCErrorType::SYNTAX_ERROR;
}
@@ -190,12 +190,12 @@
std::string username(server.username);
if (tokens.size() > kTurnHostTokensNum) {
- LOG(LS_WARNING) << "Invalid user@hostname format: " << hoststring;
+ RTC_LOG(LS_WARNING) << "Invalid user@hostname format: " << hoststring;
return RTCErrorType::SYNTAX_ERROR;
}
if (tokens.size() == kTurnHostTokensNum) {
if (tokens[0].empty() || tokens[1].empty()) {
- LOG(LS_WARNING) << "Invalid user@hostname format: " << hoststring;
+ RTC_LOG(LS_WARNING) << "Invalid user@hostname format: " << hoststring;
return RTCErrorType::SYNTAX_ERROR;
}
username.assign(rtc::s_url_decode(tokens[0]));
@@ -212,12 +212,12 @@
std::string address;
if (!ParseHostnameAndPortFromString(hoststring, &address, &port)) {
- LOG(WARNING) << "Invalid hostname format: " << uri_without_transport;
+ RTC_LOG(WARNING) << "Invalid hostname format: " << uri_without_transport;
return RTCErrorType::SYNTAX_ERROR;
}
if (port <= 0 || port > 0xffff) {
- LOG(WARNING) << "Invalid port: " << port;
+ RTC_LOG(WARNING) << "Invalid port: " << port;
return RTCErrorType::SYNTAX_ERROR;
}
@@ -244,8 +244,9 @@
if (!IPFromString(address, &ip)) {
// When hostname is set, the server address must be a
// resolved ip address.
- LOG(LS_ERROR) << "IceServer has hostname field set, but URI does not "
- "contain an IP address.";
+ RTC_LOG(LS_ERROR)
+ << "IceServer has hostname field set, but URI does not "
+ "contain an IP address.";
return RTCErrorType::INVALID_PARAMETER;
}
socket_address.SetResolvedIP(ip);
@@ -280,7 +281,7 @@
if (!server.urls.empty()) {
for (const std::string& url : server.urls) {
if (url.empty()) {
- LOG(LS_ERROR) << "Empty uri.";
+ RTC_LOG(LS_ERROR) << "Empty uri.";
return RTCErrorType::SYNTAX_ERROR;
}
RTCErrorType err =
@@ -297,7 +298,7 @@
return err;
}
} else {
- LOG(LS_ERROR) << "Empty uri.";
+ RTC_LOG(LS_ERROR) << "Empty uri.";
return RTCErrorType::SYNTAX_ERROR;
}
}
diff --git a/pc/mediasession.cc b/pc/mediasession.cc
index 3ca1074..87d6407 100644
--- a/pc/mediasession.cc
+++ b/pc/mediasession.cc
@@ -373,8 +373,8 @@
if (IsIdUsed(original_id)) {
new_id = FindUnusedId();
- LOG(LS_WARNING) << "Duplicate id found. Reassigning from " << original_id
- << " to " << new_id;
+ RTC_LOG(LS_WARNING) << "Duplicate id found. Reassigning from "
+ << original_id << " to " << new_id;
idstruct->id = new_id;
}
SetIdUsed(new_id);
@@ -491,7 +491,7 @@
stream_param.AddFecFrSsrc(ssrcs[0], flexfec_ssrcs[0]);
content_description->set_multistream(true);
} else if (!ssrcs.empty()) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "Our FlexFEC implementation only supports protecting "
<< "a single media streams. This session has multiple "
<< "media streams however, so no FlexFEC SSRC will be generated.";
@@ -848,7 +848,7 @@
&apt_value_1) ||
!potential_match.GetParam(kCodecParamAssociatedPayloadType,
&apt_value_2)) {
- LOG(LS_WARNING) << "RTX missing associated payload type.";
+ RTC_LOG(LS_WARNING) << "RTX missing associated payload type.";
continue;
}
if (!ReferencedCodecsMatch(codecs1, apt_value_1, codecs2,
@@ -872,24 +872,25 @@
std::string associated_pt_str;
if (!rtx_codec.GetParam(kCodecParamAssociatedPayloadType,
&associated_pt_str)) {
- LOG(LS_WARNING) << "RTX codec " << rtx_codec.name
- << " is missing an associated payload type.";
+ RTC_LOG(LS_WARNING) << "RTX codec " << rtx_codec.name
+ << " is missing an associated payload type.";
return nullptr;
}
int associated_pt;
if (!rtc::FromString(associated_pt_str, &associated_pt)) {
- LOG(LS_WARNING) << "Couldn't convert payload type " << associated_pt_str
- << " of RTX codec " << rtx_codec.name << " to an integer.";
+ RTC_LOG(LS_WARNING) << "Couldn't convert payload type " << associated_pt_str
+ << " of RTX codec " << rtx_codec.name
+ << " to an integer.";
return nullptr;
}
// Find the associated reference codec for the reference RTX codec.
const C* associated_codec = FindCodecById(codec_list, associated_pt);
if (!associated_codec) {
- LOG(LS_WARNING) << "Couldn't find associated codec with payload type "
- << associated_pt << " for RTX codec " << rtx_codec.name
- << ".";
+ RTC_LOG(LS_WARNING) << "Couldn't find associated codec with payload type "
+ << associated_pt << " for RTX codec " << rtx_codec.name
+ << ".";
}
return associated_codec;
}
@@ -928,8 +929,8 @@
C matching_codec;
if (!FindMatchingCodec<C>(reference_codecs, *offered_codecs,
*associated_codec, &matching_codec)) {
- LOG(LS_WARNING) << "Couldn't find matching " << associated_codec->name
- << " codec.";
+ RTC_LOG(LS_WARNING)
+ << "Couldn't find matching " << associated_codec->name << " codec.";
continue;
}
@@ -1428,11 +1429,12 @@
}
offer->AddGroup(offer_bundle);
if (!UpdateTransportInfoForBundle(offer_bundle, offer.get())) {
- LOG(LS_ERROR) << "CreateOffer failed to UpdateTransportInfoForBundle.";
+ RTC_LOG(LS_ERROR)
+ << "CreateOffer failed to UpdateTransportInfoForBundle.";
return nullptr;
}
if (!UpdateCryptoParamsForBundle(offer_bundle, offer.get())) {
- LOG(LS_ERROR) << "CreateOffer failed to UpdateCryptoParamsForBundle.";
+ RTC_LOG(LS_ERROR) << "CreateOffer failed to UpdateCryptoParamsForBundle.";
return nullptr;
}
}
@@ -1550,12 +1552,14 @@
// Share the same ICE credentials and crypto params across all contents,
// as BUNDLE requires.
if (!UpdateTransportInfoForBundle(answer_bundle, answer.get())) {
- LOG(LS_ERROR) << "CreateAnswer failed to UpdateTransportInfoForBundle.";
+ RTC_LOG(LS_ERROR)
+ << "CreateAnswer failed to UpdateTransportInfoForBundle.";
return NULL;
}
if (!UpdateCryptoParamsForBundle(answer_bundle, answer.get())) {
- LOG(LS_ERROR) << "CreateAnswer failed to UpdateCryptoParamsForBundle.";
+ RTC_LOG(LS_ERROR)
+ << "CreateAnswer failed to UpdateCryptoParamsForBundle.";
return NULL;
}
}
@@ -1795,8 +1799,8 @@
bool ret = (new_tdesc.get() != NULL &&
offer_desc->AddTransportInfo(TransportInfo(content_name, *new_tdesc)));
if (!ret) {
- LOG(LS_ERROR)
- << "Failed to AddTransportOffer, content name=" << content_name;
+ RTC_LOG(LS_ERROR) << "Failed to AddTransportOffer, content name="
+ << content_name;
}
return ret;
}
@@ -1824,8 +1828,8 @@
SessionDescription* answer_desc) const {
if (!answer_desc->AddTransportInfo(TransportInfo(content_name,
transport_desc))) {
- LOG(LS_ERROR)
- << "Failed to AddTransportAnswer, content name=" << content_name;
+ RTC_LOG(LS_ERROR) << "Failed to AddTransportAnswer, content name="
+ << content_name;
return false;
}
return true;
@@ -2152,8 +2156,8 @@
AddTransportAnswer(media_description_options.mid, *(audio_transport.get()),
answer);
} else {
- LOG(LS_INFO) << "Audio m= section '" << media_description_options.mid
- << "' being rejected in answer.";
+ RTC_LOG(LS_INFO) << "Audio m= section '" << media_description_options.mid
+ << "' being rejected in answer.";
}
answer->AddContent(media_description_options.mid, offer_content->type,
@@ -2239,8 +2243,8 @@
}
video_answer->set_bandwidth(kAutoBandwidth);
} else {
- LOG(LS_INFO) << "Video m= section '" << media_description_options.mid
- << "' being rejected in answer.";
+ RTC_LOG(LS_INFO) << "Video m= section '" << media_description_options.mid
+ << "' being rejected in answer.";
}
answer->AddContent(media_description_options.mid, offer_content->type,
rejected, video_answer.release());
@@ -2305,7 +2309,7 @@
} else {
// RFC 3264
// The answer MUST contain the same number of m-lines as the offer.
- LOG(LS_INFO) << "Data is not supported in the answer.";
+ RTC_LOG(LS_INFO) << "Data is not supported in the answer.";
}
answer->AddContent(media_description_options.mid, offer_content->type,
rejected, data_answer.release());
diff --git a/pc/peerconnection.cc b/pc/peerconnection.cc
index bf2c4c3..3ea4a3f 100644
--- a/pc/peerconnection.cc
+++ b/pc/peerconnection.cc
@@ -140,8 +140,8 @@
return false;
}
if (current_streams->find(new_stream->label()) != nullptr) {
- LOG(LS_ERROR) << "MediaStream with label " << new_stream->label()
- << " is already added.";
+ RTC_LOG(LS_ERROR) << "MediaStream with label " << new_stream->label()
+ << " is already added.";
return false;
}
return true;
@@ -417,20 +417,21 @@
const TransportInfo* tinfo = desc->GetTransportInfoByName(cinfo->name);
if (!media || !tinfo) {
// Something is not right.
- LOG(LS_ERROR) << kInvalidSdp;
+ RTC_LOG(LS_ERROR) << kInvalidSdp;
*error = kInvalidSdp;
return false;
}
if (dtls_enabled) {
if (!tinfo->description.identity_fingerprint) {
- LOG(LS_WARNING) << "Session description must have DTLS fingerprint if "
- "DTLS enabled.";
+ RTC_LOG(LS_WARNING)
+ << "Session description must have DTLS fingerprint if "
+ "DTLS enabled.";
*error = kSdpWithoutDtlsFingerprint;
return false;
}
} else {
if (media->cryptos().empty()) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "Session description must have SDES when DTLS disabled.";
*error = kSdpWithoutSdesCrypto;
return false;
@@ -466,12 +467,12 @@
const TransportInfo* tinfo = desc->GetTransportInfoByName(cinfo->name);
if (!tinfo) {
// Something is not right.
- LOG(LS_ERROR) << kInvalidSdp;
+ RTC_LOG(LS_ERROR) << kInvalidSdp;
return false;
}
if (tinfo->description.ice_ufrag.empty() ||
tinfo->description.ice_pwd.empty()) {
- LOG(LS_ERROR) << "Session description must have ice ufrag and pwd.";
+ RTC_LOG(LS_ERROR) << "Session description must have ice ufrag and pwd.";
return false;
}
}
@@ -554,7 +555,7 @@
if (err_desc) {
*err_desc = desc.str();
}
- LOG(LS_ERROR) << desc.str();
+ RTC_LOG(LS_ERROR) << desc.str();
return false;
}
@@ -659,8 +660,8 @@
if (cricket::IceCredentialsChanged(
old_transport_desc->ice_ufrag, old_transport_desc->ice_pwd,
new_transport_desc->ice_ufrag, new_transport_desc->ice_pwd)) {
- LOG(LS_INFO) << "Remote peer requests ICE restart for " << content_name
- << ".";
+ RTC_LOG(LS_INFO) << "Remote peer requests ICE restart for " << content_name
+ << ".";
return true;
}
return false;
@@ -749,7 +750,7 @@
std::string GenerateRtcpCname() {
std::string cname;
if (!rtc::CreateRandomString(kRtcpCnameLength, &cname)) {
- LOG(LS_ERROR) << "Failed to generate CNAME.";
+ RTC_LOG(LS_ERROR) << "Failed to generate CNAME.";
RTC_NOTREACHED();
}
return cname;
@@ -865,7 +866,7 @@
[this] { DestroySctpTransport_n(); });
}
- LOG(LS_INFO) << "Session: " << session_id() << " is destroyed.";
+ RTC_LOG(LS_INFO) << "Session: " << session_id() << " is destroyed.";
webrtc_session_desc_factory_.reset();
sctp_invoker_.reset();
@@ -891,20 +892,21 @@
RTCError config_error = ValidateConfiguration(configuration);
if (!config_error.ok()) {
- LOG(LS_ERROR) << "Invalid configuration: " << config_error.message();
+ RTC_LOG(LS_ERROR) << "Invalid configuration: " << config_error.message();
return false;
}
if (!allocator) {
- LOG(LS_ERROR) << "PeerConnection initialized without a PortAllocator? "
- << "This shouldn't happen if using PeerConnectionFactory.";
+ RTC_LOG(LS_ERROR)
+ << "PeerConnection initialized without a PortAllocator? "
+ << "This shouldn't happen if using PeerConnectionFactory.";
return false;
}
if (!observer) {
// TODO(deadbeef): Why do we do this?
- LOG(LS_ERROR) << "PeerConnection initialized without a "
- << "PeerConnectionObserver";
+ RTC_LOG(LS_ERROR) << "PeerConnection initialized without a "
+ << "PeerConnectionObserver";
return false;
}
observer_ = observer;
@@ -1108,13 +1110,14 @@
return nullptr;
}
if (streams.size() >= 2) {
- LOG(LS_ERROR)
+ RTC_LOG(LS_ERROR)
<< "Adding a track with two streams is not currently supported.";
return nullptr;
}
// TODO(deadbeef): Support adding a track to two different senders.
if (FindSenderForTrack(track) != senders_.end()) {
- LOG(LS_ERROR) << "Sender for track " << track->id() << " already exists.";
+ RTC_LOG(LS_ERROR) << "Sender for track " << track->id()
+ << " already exists.";
return nullptr;
}
@@ -1147,7 +1150,8 @@
new_sender->internal()->SetSsrc(track_info->ssrc);
}
} else {
- LOG(LS_ERROR) << "CreateSender called with invalid kind: " << track->kind();
+ RTC_LOG(LS_ERROR) << "CreateSender called with invalid kind: "
+ << track->kind();
return rtc::scoped_refptr<RtpSenderInterface>();
}
@@ -1164,7 +1168,8 @@
auto it = std::find(senders_.begin(), senders_.end(), sender);
if (it == senders_.end()) {
- LOG(LS_ERROR) << "Couldn't find sender " << sender->id() << " to remove.";
+ RTC_LOG(LS_ERROR) << "Couldn't find sender " << sender->id()
+ << " to remove.";
return false;
}
(*it)->internal()->Stop();
@@ -1181,12 +1186,12 @@
return nullptr;
}
if (!track) {
- LOG(LS_ERROR) << "CreateDtmfSender - track is NULL.";
+ RTC_LOG(LS_ERROR) << "CreateDtmfSender - track is NULL.";
return nullptr;
}
auto it = FindSenderForTrack(track);
if (it == senders_.end()) {
- LOG(LS_ERROR) << "CreateDtmfSender called with a non-added track.";
+ RTC_LOG(LS_ERROR) << "CreateDtmfSender called with a non-added track.";
return nullptr;
}
@@ -1208,7 +1213,7 @@
new_sender = RtpSenderProxyWithInternal<RtpSenderInternal>::Create(
signaling_thread(), new VideoRtpSender(video_channel()));
} else {
- LOG(LS_ERROR) << "CreateSender called with invalid kind: " << kind;
+ RTC_LOG(LS_ERROR) << "CreateSender called with invalid kind: " << kind;
return new_sender;
}
if (!stream_id.empty()) {
@@ -1242,7 +1247,7 @@
TRACE_EVENT0("webrtc", "PeerConnection::GetStats");
RTC_DCHECK(signaling_thread()->IsCurrent());
if (!observer) {
- LOG(LS_ERROR) << "GetStats - observer is NULL.";
+ RTC_LOG(LS_ERROR) << "GetStats - observer is NULL.";
return false;
}
@@ -1250,8 +1255,8 @@
// The StatsCollector is used to tell if a track is valid because it may
// remember tracks that the PeerConnection previously removed.
if (track && !stats_->IsValidTrack(track->id())) {
- LOG(LS_WARNING) << "GetStats is called with an invalid track: "
- << track->id();
+ RTC_LOG(LS_WARNING) << "GetStats is called with an invalid track: "
+ << track->id();
return false;
}
signaling_thread()->Post(RTC_FROM_HERE, this, MSG_GETSTATS,
@@ -1327,20 +1332,20 @@
TRACE_EVENT0("webrtc", "PeerConnection::CreateOffer");
if (!observer) {
- LOG(LS_ERROR) << "CreateOffer - observer is NULL.";
+ RTC_LOG(LS_ERROR) << "CreateOffer - observer is NULL.";
return;
}
if (IsClosed()) {
std::string error = "CreateOffer called when PeerConnection is closed.";
- LOG(LS_ERROR) << error;
+ RTC_LOG(LS_ERROR) << error;
PostCreateSessionDescriptionFailure(observer, error);
return;
}
if (!ValidateOfferAnswerOptions(options)) {
std::string error = "CreateOffer called with invalid options.";
- LOG(LS_ERROR) << error;
+ RTC_LOG(LS_ERROR) << error;
PostCreateSessionDescriptionFailure(observer, error);
return;
}
@@ -1356,7 +1361,7 @@
TRACE_EVENT0("webrtc", "PeerConnection::CreateAnswer");
if (!observer) {
- LOG(LS_ERROR) << "CreateAnswer - observer is NULL.";
+ RTC_LOG(LS_ERROR) << "CreateAnswer - observer is NULL.";
return;
}
@@ -1364,7 +1369,7 @@
if (!ConvertConstraintsToOfferAnswerOptions(constraints,
&offer_answer_options)) {
std::string error = "CreateAnswer called with invalid constraints.";
- LOG(LS_ERROR) << error;
+ RTC_LOG(LS_ERROR) << error;
PostCreateSessionDescriptionFailure(observer, error);
return;
}
@@ -1376,13 +1381,13 @@
const RTCOfferAnswerOptions& options) {
TRACE_EVENT0("webrtc", "PeerConnection::CreateAnswer");
if (!observer) {
- LOG(LS_ERROR) << "CreateAnswer - observer is NULL.";
+ RTC_LOG(LS_ERROR) << "CreateAnswer - observer is NULL.";
return;
}
if (IsClosed()) {
std::string error = "CreateAnswer called when PeerConnection is closed.";
- LOG(LS_ERROR) << error;
+ RTC_LOG(LS_ERROR) << error;
PostCreateSessionDescriptionFailure(observer, error);
return;
}
@@ -1390,7 +1395,7 @@
if (remote_description() &&
remote_description()->type() != SessionDescriptionInterface::kOffer) {
std::string error = "CreateAnswer called without remote offer.";
- LOG(LS_ERROR) << error;
+ RTC_LOG(LS_ERROR) << error;
PostCreateSessionDescriptionFailure(observer, error);
return;
}
@@ -1406,7 +1411,7 @@
SessionDescriptionInterface* desc) {
TRACE_EVENT0("webrtc", "PeerConnection::SetLocalDescription");
if (!observer) {
- LOG(LS_ERROR) << "SetLocalDescription - observer is NULL.";
+ RTC_LOG(LS_ERROR) << "SetLocalDescription - observer is NULL.";
return;
}
if (!desc) {
@@ -1420,7 +1425,7 @@
if (IsClosed()) {
std::string error = "Failed to set local " + desc->type() +
" sdp: Called in wrong state: STATE_CLOSED";
- LOG(LS_ERROR) << error;
+ RTC_LOG(LS_ERROR) << error;
PostSetSessionDescriptionFailure(observer, error);
return;
}
@@ -1510,7 +1515,7 @@
SessionDescriptionInterface* desc) {
TRACE_EVENT0("webrtc", "PeerConnection::SetRemoteDescription");
if (!observer) {
- LOG(LS_ERROR) << "SetRemoteDescription - observer is NULL.";
+ RTC_LOG(LS_ERROR) << "SetRemoteDescription - observer is NULL.";
return;
}
if (!desc) {
@@ -1524,7 +1529,7 @@
if (IsClosed()) {
std::string error = "Failed to set remote " + desc->type() +
" sdp: Called in wrong state: STATE_CLOSED";
- LOG(LS_ERROR) << error;
+ RTC_LOG(LS_ERROR) << error;
PostSetSessionDescriptionFailure(observer, error);
return;
}
@@ -1646,8 +1651,8 @@
if (local_description() && configuration.ice_candidate_pool_size !=
configuration_.ice_candidate_pool_size) {
- LOG(LS_ERROR) << "Can't change candidate pool size after calling "
- "SetLocalDescription.";
+ RTC_LOG(LS_ERROR) << "Can't change candidate pool size after calling "
+ "SetLocalDescription.";
return SafeSetError(RTCErrorType::INVALID_MODIFICATION, error);
}
@@ -1664,7 +1669,7 @@
modified_config.ice_check_min_interval = configuration.ice_check_min_interval;
modified_config.turn_customizer = configuration.turn_customizer;
if (configuration != modified_config) {
- LOG(LS_ERROR) << "Modifying the configuration in an unsupported way.";
+ RTC_LOG(LS_ERROR) << "Modifying the configuration in an unsupported way.";
return SafeSetError(RTCErrorType::INVALID_MODIFICATION, error);
}
@@ -1698,7 +1703,7 @@
modified_config.ice_candidate_pool_size,
modified_config.prune_turn_ports,
modified_config.turn_customizer))) {
- LOG(LS_ERROR) << "Failed to apply configuration to PortAllocator.";
+ RTC_LOG(LS_ERROR) << "Failed to apply configuration to PortAllocator.";
return SafeSetError(RTCErrorType::INTERNAL_ERROR, error);
}
@@ -1728,13 +1733,13 @@
}
if (!remote_description()) {
- LOG(LS_ERROR) << "ProcessIceMessage: ICE candidates can't be added "
- << "without any remote session description.";
+ RTC_LOG(LS_ERROR) << "ProcessIceMessage: ICE candidates can't be added "
+ << "without any remote session description.";
return false;
}
if (!ice_candidate) {
- LOG(LS_ERROR) << "ProcessIceMessage: Candidate is NULL.";
+ RTC_LOG(LS_ERROR) << "ProcessIceMessage: Candidate is NULL.";
return false;
}
@@ -1746,14 +1751,14 @@
// Add this candidate to the remote session description.
if (!mutable_remote_description()->AddCandidate(ice_candidate)) {
- LOG(LS_ERROR) << "ProcessIceMessage: Candidate cannot be used.";
+ RTC_LOG(LS_ERROR) << "ProcessIceMessage: Candidate cannot be used.";
return false;
}
if (ready) {
return UseCandidate(ice_candidate);
} else {
- LOG(LS_INFO) << "ProcessIceMessage: Not ready to use candidate.";
+ RTC_LOG(LS_INFO) << "ProcessIceMessage: Not ready to use candidate.";
return true;
}
}
@@ -1762,29 +1767,30 @@
const std::vector<cricket::Candidate>& candidates) {
TRACE_EVENT0("webrtc", "PeerConnection::RemoveIceCandidates");
if (!remote_description()) {
- LOG(LS_ERROR) << "RemoveRemoteIceCandidates: ICE candidates can't be "
- << "removed without any remote session description.";
+ RTC_LOG(LS_ERROR) << "RemoveRemoteIceCandidates: ICE candidates can't be "
+ << "removed without any remote session description.";
return false;
}
if (candidates.empty()) {
- LOG(LS_ERROR) << "RemoveRemoteIceCandidates: candidates are empty.";
+ RTC_LOG(LS_ERROR) << "RemoveRemoteIceCandidates: candidates are empty.";
return false;
}
size_t number_removed =
mutable_remote_description()->RemoveCandidates(candidates);
if (number_removed != candidates.size()) {
- LOG(LS_ERROR) << "RemoveRemoteIceCandidates: Failed to remove candidates. "
- << "Requested " << candidates.size() << " but only "
- << number_removed << " are removed.";
+ RTC_LOG(LS_ERROR)
+ << "RemoveRemoteIceCandidates: Failed to remove candidates. "
+ << "Requested " << candidates.size() << " but only " << number_removed
+ << " are removed.";
}
// Remove the candidates from the transport controller.
std::string error;
bool res = transport_controller_->RemoveRemoteCandidates(candidates, &error);
if (!res && !error.empty()) {
- LOG(LS_ERROR) << "Error when removing remote candidates: " << error;
+ RTC_LOG(LS_ERROR) << "Error when removing remote candidates: " << error;
}
return true;
}
@@ -2068,8 +2074,8 @@
const std::string& track_id) {
auto it = FindReceiverForTrack(track_id);
if (it == receivers_.end()) {
- LOG(LS_WARNING) << "RtpReceiver for track with id " << track_id
- << " doesn't exist.";
+ RTC_LOG(LS_WARNING) << "RtpReceiver for track with id " << track_id
+ << " doesn't exist.";
return nullptr;
}
(*it)->internal()->Stop();
@@ -2116,8 +2122,8 @@
RTC_DCHECK(!IsClosed());
auto sender = FindSenderForTrack(track);
if (sender == senders_.end()) {
- LOG(LS_WARNING) << "RtpSender for track with id " << track->id()
- << " doesn't exist.";
+ RTC_LOG(LS_WARNING) << "RtpSender for track with id " << track->id()
+ << " doesn't exist.";
return;
}
(*sender)->internal()->Stop();
@@ -2153,8 +2159,8 @@
RTC_DCHECK(!IsClosed());
auto sender = FindSenderForTrack(track);
if (sender == senders_.end()) {
- LOG(LS_WARNING) << "RtpSender for track with id " << track->id()
- << " doesn't exist.";
+ RTC_LOG(LS_WARNING) << "RtpSender for track with id " << track->id()
+ << " doesn't exist.";
return;
}
(*sender)->internal()->Stop();
@@ -2173,8 +2179,8 @@
return;
}
- LOG(LS_INFO) << "Changing IceConnectionState " << ice_connection_state_
- << " => " << new_state;
+ RTC_LOG(LS_INFO) << "Changing IceConnectionState " << ice_connection_state_
+ << " => " << new_state;
RTC_DCHECK(ice_connection_state_ !=
PeerConnectionInterface::kIceConnectionClosed);
@@ -2216,9 +2222,10 @@
if (signaling_state_ == signaling_state) {
return;
}
- LOG(LS_INFO) << "Session: " << session_id()
- << " Old state: " << GetSignalingStateString(signaling_state_)
- << " New state: " << GetSignalingStateString(signaling_state);
+ RTC_LOG(LS_INFO) << "Session: " << session_id() << " Old state: "
+ << GetSignalingStateString(signaling_state_)
+ << " New state: "
+ << GetSignalingStateString(signaling_state);
signaling_state_ = signaling_state;
if (signaling_state == kClosed) {
ice_connection_state_ = kIceConnectionClosed;
@@ -2711,14 +2718,14 @@
cricket::MediaType media_type) {
RtpSenderInternal* sender = FindSenderById(track_id);
if (!sender) {
- LOG(LS_WARNING) << "An unknown RtpSender with id " << track_id
- << " has been configured in the local description.";
+ RTC_LOG(LS_WARNING) << "An unknown RtpSender with id " << track_id
+ << " has been configured in the local description.";
return;
}
if (sender->media_type() != media_type) {
- LOG(LS_WARNING) << "An RtpSender has been configured in the local"
- << " description with an unexpected media type.";
+ RTC_LOG(LS_WARNING) << "An RtpSender has been configured in the local"
+ << " description with an unexpected media type.";
return;
}
@@ -2741,8 +2748,8 @@
// associated with the PeerConnection. This only occurs if the SDP doesn't
// match with the calls to CreateSender, AddStream and RemoveStream.
if (sender->media_type() != media_type) {
- LOG(LS_WARNING) << "An RtpSender has been configured in the local"
- << " description with an unexpected media type.";
+ RTC_LOG(LS_WARNING) << "An RtpSender has been configured in the local"
+ << " description with an unexpected media type.";
return;
}
@@ -2763,7 +2770,7 @@
const std::string& channel_label = params.sync_label;
auto data_channel_it = rtp_data_channels_.find(channel_label);
if (data_channel_it == rtp_data_channels_.end()) {
- LOG(LS_ERROR) << "channel label not found";
+ RTC_LOG(LS_ERROR) << "channel label not found";
continue;
}
// Set the SSRC the data channel should use for sending.
@@ -2830,8 +2837,8 @@
rtc::scoped_refptr<DataChannel> channel(
InternalCreateDataChannel(label, nullptr));
if (!channel.get()) {
- LOG(LS_WARNING) << "Remote peer requested a DataChannel but"
- << "CreateDataChannel failed.";
+ RTC_LOG(LS_WARNING) << "Remote peer requested a DataChannel but"
+ << "CreateDataChannel failed.";
return;
}
channel->SetReceiveSsrc(remote_ssrc);
@@ -2847,7 +2854,7 @@
return nullptr;
}
if (data_channel_type() == cricket::DCT_NONE) {
- LOG(LS_ERROR)
+ RTC_LOG(LS_ERROR)
<< "InternalCreateDataChannel: Data is not supported in this call.";
return nullptr;
}
@@ -2858,12 +2865,13 @@
rtc::SSLRole role;
if ((GetSctpSslRole(&role)) &&
!sid_allocator_.AllocateSid(role, &new_config.id)) {
- LOG(LS_ERROR) << "No id can be allocated for the SCTP data channel.";
+ RTC_LOG(LS_ERROR)
+ << "No id can be allocated for the SCTP data channel.";
return nullptr;
}
} else if (!sid_allocator_.ReserveSid(new_config.id)) {
- LOG(LS_ERROR) << "Failed to create a SCTP data channel "
- << "because the id is already in use or out of range.";
+ RTC_LOG(LS_ERROR) << "Failed to create a SCTP data channel "
+ << "because the id is already in use or out of range.";
return nullptr;
}
}
@@ -2877,8 +2885,8 @@
if (channel->data_channel_type() == cricket::DCT_RTP) {
if (rtp_data_channels_.find(channel->label()) != rtp_data_channels_.end()) {
- LOG(LS_ERROR) << "DataChannel with label " << channel->label()
- << " already exists.";
+ RTC_LOG(LS_ERROR) << "DataChannel with label " << channel->label()
+ << " already exists.";
return nullptr;
}
rtp_data_channels_[channel->label()] = channel;
@@ -2902,7 +2910,7 @@
if (channel->id() < 0) {
int sid;
if (!sid_allocator_.AllocateSid(role, &sid)) {
- LOG(LS_ERROR) << "Failed to allocate SCTP sid.";
+ RTC_LOG(LS_ERROR) << "Failed to allocate SCTP sid.";
continue;
}
channel->SetSctpSid(sid);
@@ -2951,7 +2959,7 @@
rtc::scoped_refptr<DataChannel> channel(
InternalCreateDataChannel(label, &config));
if (!channel.get()) {
- LOG(LS_ERROR) << "Failed to create DataChannel from the OPEN message.";
+ RTC_LOG(LS_ERROR) << "Failed to create DataChannel from the OPEN message.";
return;
}
@@ -3067,18 +3075,18 @@
if (configuration.disable_ipv6_on_wifi) {
portallocator_flags &= ~(cricket::PORTALLOCATOR_ENABLE_IPV6_ON_WIFI);
- LOG(LS_INFO) << "IPv6 candidates on Wi-Fi are disabled.";
+ RTC_LOG(LS_INFO) << "IPv6 candidates on Wi-Fi are disabled.";
}
if (configuration.tcp_candidate_policy == kTcpCandidatePolicyDisabled) {
portallocator_flags |= cricket::PORTALLOCATOR_DISABLE_TCP;
- LOG(LS_INFO) << "TCP candidates are disabled.";
+ RTC_LOG(LS_INFO) << "TCP candidates are disabled.";
}
if (configuration.candidate_network_policy ==
kCandidateNetworkPolicyLowCost) {
portallocator_flags |= cricket::PORTALLOCATOR_DISABLE_COSTLY_NETWORKS;
- LOG(LS_INFO) << "Do not gather candidates on high-cost networks";
+ RTC_LOG(LS_INFO) << "Do not gather candidates on high-cost networks";
}
port_allocator_->set_flags(portallocator_flags);
@@ -3152,13 +3160,14 @@
bool PeerConnection::GetSctpSslRole(rtc::SSLRole* role) {
if (!local_description() || !remote_description()) {
- LOG(LS_INFO) << "Local and Remote descriptions must be applied to get the "
- << "SSL Role of the SCTP transport.";
+ RTC_LOG(LS_INFO)
+ << "Local and Remote descriptions must be applied to get the "
+ << "SSL Role of the SCTP transport.";
return false;
}
if (!sctp_transport_) {
- LOG(LS_INFO) << "Non-rejected SCTP m= section is needed to get the "
- << "SSL Role of the SCTP transport.";
+ RTC_LOG(LS_INFO) << "Non-rejected SCTP m= section is needed to get the "
+ << "SSL Role of the SCTP transport.";
return false;
}
@@ -3168,8 +3177,9 @@
bool PeerConnection::GetSslRole(const std::string& content_name,
rtc::SSLRole* role) {
if (!local_description() || !remote_description()) {
- LOG(LS_INFO) << "Local and Remote descriptions must be applied to get the "
- << "SSL Role of the session.";
+ RTC_LOG(LS_INFO)
+ << "Local and Remote descriptions must be applied to get the "
+ << "SSL Role of the session.";
return false;
}
@@ -3406,7 +3416,7 @@
const cricket::ContentGroup* answer_bundle =
(source == cricket::CS_LOCAL ? local_bundle : remote_bundle);
if (!EnableBundle(*answer_bundle)) {
- LOG(LS_WARNING) << "Failed to enable BUNDLE.";
+ RTC_LOG(LS_WARNING) << "Failed to enable BUNDLE.";
return BadAnswerSdp(source, kEnableBundleFailed, err_desc);
}
}
@@ -3561,7 +3571,7 @@
bool PeerConnection::EnableBundle(const cricket::ContentGroup& bundle) {
const std::string* first_content_name = bundle.FirstContentName();
if (!first_content_name) {
- LOG(LS_WARNING) << "Tried to BUNDLE with no contents.";
+ RTC_LOG(LS_WARNING) << "Tried to BUNDLE with no contents.";
return false;
}
const std::string& transport_name = *first_content_name;
@@ -3574,8 +3584,8 @@
std::string old_transport_name = ch->transport_name();
if (old_transport_name == transport_name) {
- LOG(LS_INFO) << "BUNDLE already enabled for " << ch->content_name()
- << " on " << transport_name << ".";
+ RTC_LOG(LS_INFO) << "BUNDLE already enabled for " << ch->content_name()
+ << " on " << transport_name << ".";
return true;
}
@@ -3590,8 +3600,8 @@
}
ch->SetTransports(rtp_dtls_transport, rtcp_dtls_transport);
- LOG(LS_INFO) << "Enabled BUNDLE for " << ch->content_name() << " on "
- << transport_name << ".";
+ RTC_LOG(LS_INFO) << "Enabled BUNDLE for " << ch->content_name() << " on "
+ << transport_name << ".";
transport_controller_->DestroyDtlsTransport(
old_transport_name, cricket::ICE_CANDIDATE_COMPONENT_RTP);
// If the channel needs rtcp, it means that the channel used to have a
@@ -3677,8 +3687,8 @@
const rtc::CopyOnWriteBuffer& payload,
cricket::SendDataResult* result) {
if (!rtp_data_channel_ && !sctp_transport_) {
- LOG(LS_ERROR) << "SendData called when rtp_data_channel_ "
- << "and sctp_transport_ are NULL.";
+ RTC_LOG(LS_ERROR) << "SendData called when rtp_data_channel_ "
+ << "and sctp_transport_ are NULL.";
return false;
}
return rtp_data_channel_
@@ -3714,8 +3724,9 @@
void PeerConnection::DisconnectDataChannel(DataChannel* webrtc_data_channel) {
if (!rtp_data_channel_ && !sctp_transport_) {
- LOG(LS_ERROR) << "DisconnectDataChannel called when rtp_data_channel_ and "
- "sctp_transport_ are NULL.";
+ RTC_LOG(LS_ERROR)
+ << "DisconnectDataChannel called when rtp_data_channel_ and "
+ "sctp_transport_ are NULL.";
return;
}
if (rtp_data_channel_) {
@@ -3730,7 +3741,8 @@
void PeerConnection::AddSctpDataStream(int sid) {
if (!sctp_transport_) {
- LOG(LS_ERROR) << "AddSctpDataStream called when sctp_transport_ is NULL.";
+ RTC_LOG(LS_ERROR)
+ << "AddSctpDataStream called when sctp_transport_ is NULL.";
return;
}
network_thread()->Invoke<void>(
@@ -3740,8 +3752,8 @@
void PeerConnection::RemoveSctpDataStream(int sid) {
if (!sctp_transport_) {
- LOG(LS_ERROR) << "RemoveSctpDataStream called when sctp_transport_ is "
- << "NULL.";
+ RTC_LOG(LS_ERROR) << "RemoveSctpDataStream called when sctp_transport_ is "
+ << "NULL.";
return;
}
network_thread()->Invoke<void>(
@@ -3846,13 +3858,13 @@
SetIceConnectionState(PeerConnectionInterface::kIceConnectionFailed);
break;
case cricket::kIceConnectionConnected:
- LOG(LS_INFO) << "Changing to ICE connected state because "
- << "all transports are writable.";
+ RTC_LOG(LS_INFO) << "Changing to ICE connected state because "
+ << "all transports are writable.";
SetIceConnectionState(PeerConnectionInterface::kIceConnectionConnected);
break;
case cricket::kIceConnectionCompleted:
- LOG(LS_INFO) << "Changing to ICE completed state because "
- << "all transports are complete.";
+ RTC_LOG(LS_INFO) << "Changing to ICE completed state because "
+ << "all transports are complete.";
if (ice_connection_state_ !=
PeerConnectionInterface::kIceConnectionConnected) {
// If jumping directly from "checking" to "connected",
@@ -3875,8 +3887,9 @@
RTC_DCHECK(signaling_thread()->IsCurrent());
int sdp_mline_index;
if (!GetLocalCandidateMediaIndex(transport_name, &sdp_mline_index)) {
- LOG(LS_ERROR) << "OnTransportControllerCandidatesGathered: content name "
- << transport_name << " not found";
+ RTC_LOG(LS_ERROR)
+ << "OnTransportControllerCandidatesGathered: content name "
+ << transport_name << " not found";
return;
}
@@ -3898,9 +3911,9 @@
// Sanity check.
for (const cricket::Candidate& candidate : candidates) {
if (candidate.transport_name().empty()) {
- LOG(LS_ERROR) << "OnTransportControllerCandidatesRemoved: "
- << "empty content name in candidate "
- << candidate.ToString();
+ RTC_LOG(LS_ERROR) << "OnTransportControllerCandidatesRemoved: "
+ << "empty content name in candidate "
+ << candidate.ToString();
return;
}
}
@@ -3972,8 +3985,9 @@
bool valid = false;
if (!ReadyToUseRemoteCandidate(candidate, remote_desc, &valid)) {
if (valid) {
- LOG(LS_INFO) << "UseCandidatesInSessionDescription: Not ready to use "
- << "candidate.";
+ RTC_LOG(LS_INFO)
+ << "UseCandidatesInSessionDescription: Not ready to use "
+ << "candidate.";
}
continue;
}
@@ -3991,7 +4005,7 @@
size_t remote_content_size =
remote_description()->description()->contents().size();
if (mediacontent_index >= remote_content_size) {
- LOG(LS_ERROR) << "UseCandidate: Invalid candidate media index.";
+ RTC_LOG(LS_ERROR) << "UseCandidate: Invalid candidate media index.";
return false;
}
@@ -4020,7 +4034,7 @@
// TODO(bemasc): If state is Completed, go back to Connected.
} else {
if (!error.empty()) {
- LOG(LS_WARNING) << error;
+ RTC_LOG(LS_WARNING) << error;
}
}
return true;
@@ -4064,14 +4078,15 @@
}
const std::string* first_content_name = bundle->FirstContentName();
if (!first_content_name) {
- LOG(LS_WARNING) << "Tried to BUNDLE with no contents.";
+ RTC_LOG(LS_WARNING) << "Tried to BUNDLE with no contents.";
return nullptr;
}
if (!bundle->HasContentName(content->name)) {
- LOG(LS_WARNING) << content->name << " is not part of any bundle group";
+ RTC_LOG(LS_WARNING) << content->name << " is not part of any bundle group";
return nullptr;
}
- LOG(LS_INFO) << "Bundling " << content->name << " on " << *first_content_name;
+ RTC_LOG(LS_INFO) << "Bundling " << content->name << " on "
+ << *first_content_name;
return first_content_name;
}
@@ -4082,7 +4097,7 @@
PeerConnectionInterface::kBundlePolicyMaxBundle) {
bundle_group = desc->GetGroupByName(cricket::GROUP_TYPE_BUNDLE);
if (!bundle_group) {
- LOG(LS_WARNING) << "max-bundle specified without BUNDLE specified";
+ RTC_LOG(LS_WARNING) << "max-bundle specified without BUNDLE specified";
return false;
}
}
@@ -4091,7 +4106,7 @@
if (voice && !voice->rejected && !voice_channel()) {
if (!CreateVoiceChannel(voice,
GetBundleTransportName(voice, bundle_group))) {
- LOG(LS_ERROR) << "Failed to create voice channel.";
+ RTC_LOG(LS_ERROR) << "Failed to create voice channel.";
return false;
}
}
@@ -4100,7 +4115,7 @@
if (video && !video->rejected && !video_channel()) {
if (!CreateVideoChannel(video,
GetBundleTransportName(video, bundle_group))) {
- LOG(LS_ERROR) << "Failed to create video channel.";
+ RTC_LOG(LS_ERROR) << "Failed to create video channel.";
return false;
}
}
@@ -4109,7 +4124,7 @@
if (data_channel_type_ != cricket::DCT_NONE && data && !data->rejected &&
!rtp_data_channel_ && !sctp_transport_) {
if (!CreateDataChannel(data, GetBundleTransportName(data, bundle_group))) {
- LOG(LS_ERROR) << "Failed to create data channel.";
+ RTC_LOG(LS_ERROR) << "Failed to create data channel.";
return false;
}
}
@@ -4219,7 +4234,7 @@
bool sctp = (data_channel_type_ == cricket::DCT_SCTP);
if (sctp) {
if (!sctp_factory_) {
- LOG(LS_ERROR)
+ RTC_LOG(LS_ERROR)
<< "Trying to create SCTP transport, but didn't compile with "
"SCTP support (HAVE_SCTP)";
return false;
@@ -4396,8 +4411,8 @@
InternalDataChannelInit config;
config.id = params.ssrc;
if (!ParseDataChannelOpenMessage(payload, &label, &config)) {
- LOG(LS_WARNING) << "Failed to parse the OPEN message for sid "
- << params.ssrc;
+ RTC_LOG(LS_WARNING) << "Failed to parse the OPEN message for sid "
+ << params.ssrc;
return;
}
config.open_handshake_role = InternalDataChannelInit::kAcker;
@@ -4569,8 +4584,9 @@
size_t remote_content_size =
current_remote_desc->description()->contents().size();
if (mediacontent_index >= remote_content_size) {
- LOG(LS_ERROR) << "ReadyToUseRemoteCandidate: Invalid candidate media index "
- << mediacontent_index;
+ RTC_LOG(LS_ERROR)
+ << "ReadyToUseRemoteCandidate: Invalid candidate media index "
+ << mediacontent_index;
*valid = false;
return false;
diff --git a/pc/peerconnection_integrationtest.cc b/pc/peerconnection_integrationtest.cc
index a591351..0398ed3 100644
--- a/pc/peerconnection_integrationtest.cc
+++ b/pc/peerconnection_integrationtest.cc
@@ -677,7 +677,7 @@
}
void HandleIncomingOffer(const std::string& msg) {
- LOG(LS_INFO) << debug_name_ << ": HandleIncomingOffer";
+ RTC_LOG(LS_INFO) << debug_name_ << ": HandleIncomingOffer";
std::unique_ptr<SessionDescriptionInterface> desc(
webrtc::CreateSessionDescription("offer", msg, nullptr));
if (received_sdp_munger_) {
@@ -694,7 +694,7 @@
}
void HandleIncomingAnswer(const std::string& msg) {
- LOG(LS_INFO) << debug_name_ << ": HandleIncomingAnswer";
+ RTC_LOG(LS_INFO) << debug_name_ << ": HandleIncomingAnswer";
std::unique_ptr<SessionDescriptionInterface> desc(
webrtc::CreateSessionDescription("answer", msg, nullptr));
if (received_sdp_munger_) {
@@ -744,7 +744,7 @@
std::unique_ptr<SessionDescriptionInterface> desc) {
rtc::scoped_refptr<MockSetSessionDescriptionObserver> observer(
new rtc::RefCountedObject<MockSetSessionDescriptionObserver>());
- LOG(LS_INFO) << debug_name_ << ": SetLocalDescriptionAndSendSdpMessage";
+ RTC_LOG(LS_INFO) << debug_name_ << ": SetLocalDescriptionAndSendSdpMessage";
std::string type = desc->type();
std::string sdp;
EXPECT_TRUE(desc->ToString(&sdp));
@@ -759,7 +759,7 @@
bool SetRemoteDescription(std::unique_ptr<SessionDescriptionInterface> desc) {
rtc::scoped_refptr<MockSetSessionDescriptionObserver> observer(
new rtc::RefCountedObject<MockSetSessionDescriptionObserver>());
- LOG(LS_INFO) << debug_name_ << ": SetRemoteDescription";
+ RTC_LOG(LS_INFO) << debug_name_ << ": SetRemoteDescription";
pc()->SetRemoteDescription(observer, desc.release());
EXPECT_TRUE_WAIT(observer->called(), kDefaultTimeout);
return observer->result();
@@ -824,7 +824,7 @@
void ReceiveIceMessage(const std::string& sdp_mid,
int sdp_mline_index,
const std::string& msg) override {
- LOG(LS_INFO) << debug_name_ << ": ReceiveIceMessage";
+ RTC_LOG(LS_INFO) << debug_name_ << ": ReceiveIceMessage";
std::unique_ptr<webrtc::IceCandidateInterface> candidate(
webrtc::CreateIceCandidate(sdp_mid, sdp_mline_index, msg, nullptr));
EXPECT_TRUE(pc()->AddIceCandidate(candidate.get()));
@@ -860,7 +860,7 @@
ice_gathering_state_history_.push_back(new_state);
}
void OnIceCandidate(const webrtc::IceCandidateInterface* candidate) override {
- LOG(LS_INFO) << debug_name_ << ": OnIceCandidate";
+ RTC_LOG(LS_INFO) << debug_name_ << ": OnIceCandidate";
std::string ice_sdp;
EXPECT_TRUE(candidate->ToString(&ice_sdp));
@@ -872,7 +872,7 @@
}
void OnDataChannel(
rtc::scoped_refptr<DataChannelInterface> data_channel) override {
- LOG(LS_INFO) << debug_name_ << ": OnDataChannel";
+ RTC_LOG(LS_INFO) << debug_name_ << ": OnDataChannel";
data_channel_ = data_channel;
data_observer_.reset(new MockDataChannelObserver(data_channel));
}
@@ -2925,14 +2925,14 @@
for (const auto& caller_address : CallerAddresses()) {
firewall()->AddRule(false, rtc::FP_ANY, rtc::FD_ANY, caller_address);
}
- LOG(LS_INFO) << "Firewall rules applied";
+ RTC_LOG(LS_INFO) << "Firewall rules applied";
ASSERT_EQ_SIMULATED_WAIT(PeerConnectionInterface::kIceConnectionDisconnected,
caller()->ice_connection_state(), kDefaultTimeout,
fake_clock);
// Let ICE re-establish by removing the firewall rules.
firewall()->ClearRules();
- LOG(LS_INFO) << "Firewall rules cleared";
+ RTC_LOG(LS_INFO) << "Firewall rules cleared";
ASSERT_EQ_SIMULATED_WAIT(PeerConnectionInterface::kIceConnectionCompleted,
caller()->ice_connection_state(), kDefaultTimeout,
fake_clock);
@@ -2944,7 +2944,7 @@
for (const auto& caller_address : CallerAddresses()) {
firewall()->AddRule(false, rtc::FP_ANY, rtc::FD_ANY, caller_address);
}
- LOG(LS_INFO) << "Firewall rules applied again";
+ RTC_LOG(LS_INFO) << "Firewall rules applied again";
ASSERT_EQ_SIMULATED_WAIT(PeerConnectionInterface::kIceConnectionFailed,
caller()->ice_connection_state(), kConsentTimeout,
fake_clock);
diff --git a/pc/remoteaudiosource.cc b/pc/remoteaudiosource.cc
index c484095..d88fa69 100644
--- a/pc/remoteaudiosource.cc
+++ b/pc/remoteaudiosource.cc
@@ -103,7 +103,7 @@
RTC_DCHECK(sink);
if (state_ != MediaSourceInterface::kLive) {
- LOG(LS_ERROR) << "Can't register sink as the source isn't live.";
+ RTC_LOG(LS_ERROR) << "Can't register sink as the source isn't live.";
return;
}
diff --git a/pc/rtcpmuxfilter.cc b/pc/rtcpmuxfilter.cc
index b37b0d3..331c8df 100644
--- a/pc/rtcpmuxfilter.cc
+++ b/pc/rtcpmuxfilter.cc
@@ -40,7 +40,7 @@
}
if (!ExpectOffer(offer_enable, src)) {
- LOG(LS_ERROR) << "Invalid state for change of RTCP mux offer";
+ RTC_LOG(LS_ERROR) << "Invalid state for change of RTCP mux offer";
return false;
}
@@ -57,7 +57,7 @@
}
if (!ExpectAnswer(src)) {
- LOG(LS_ERROR) << "Invalid state for RTCP mux provisional answer";
+ RTC_LOG(LS_ERROR) << "Invalid state for RTCP mux provisional answer";
return false;
}
@@ -78,7 +78,7 @@
}
} else if (answer_enable) {
// If the offer didn't specify RTCP mux, the answer shouldn't either.
- LOG(LS_WARNING) << "Invalid parameters in RTCP mux provisional answer";
+ RTC_LOG(LS_WARNING) << "Invalid parameters in RTCP mux provisional answer";
return false;
}
@@ -92,7 +92,7 @@
}
if (!ExpectAnswer(src)) {
- LOG(LS_ERROR) << "Invalid state for RTCP mux answer";
+ RTC_LOG(LS_ERROR) << "Invalid state for RTCP mux answer";
return false;
}
@@ -100,7 +100,7 @@
state_ = ST_ACTIVE;
} else if (answer_enable) {
// If the offer didn't specify RTCP mux, the answer shouldn't either.
- LOG(LS_WARNING) << "Invalid parameters in RTCP mux answer";
+ RTC_LOG(LS_WARNING) << "Invalid parameters in RTCP mux answer";
return false;
} else {
state_ = ST_INIT;
diff --git a/pc/rtpreceiver.cc b/pc/rtpreceiver.cc
index 4dc9167..4d69aa2 100644
--- a/pc/rtpreceiver.cc
+++ b/pc/rtpreceiver.cc
@@ -59,7 +59,8 @@
RTC_DCHECK_LE(volume, 10);
cached_volume_ = volume;
if (!channel_) {
- LOG(LS_ERROR) << "AudioRtpReceiver::OnSetVolume: No audio channel exists.";
+ RTC_LOG(LS_ERROR)
+ << "AudioRtpReceiver::OnSetVolume: No audio channel exists.";
return;
}
// When the track is disabled, the volume of the source, which is the
@@ -107,7 +108,8 @@
void AudioRtpReceiver::Reconfigure() {
RTC_DCHECK(!stopped_);
if (!channel_) {
- LOG(LS_ERROR) << "AudioRtpReceiver::Reconfigure: No audio channel exists.";
+ RTC_LOG(LS_ERROR)
+ << "AudioRtpReceiver::Reconfigure: No audio channel exists.";
return;
}
if (!channel_->SetOutputVolume(ssrc_,
@@ -162,7 +164,7 @@
worker_thread))) {
source_->SetState(MediaSourceInterface::kLive);
if (!channel_) {
- LOG(LS_ERROR)
+ RTC_LOG(LS_ERROR)
<< "VideoRtpReceiver::VideoRtpReceiver: No video channel exists.";
} else {
if (!channel_->SetSink(ssrc_, &broadcaster_)) {
@@ -204,7 +206,7 @@
source_->SetState(MediaSourceInterface::kEnded);
source_->OnSourceDestroyed();
if (!channel_) {
- LOG(LS_WARNING) << "VideoRtpReceiver::Stop: No video channel exists.";
+ RTC_LOG(LS_WARNING) << "VideoRtpReceiver::Stop: No video channel exists.";
} else {
// Allow that SetSink fail. This is the normal case when the underlying
// media channel has already been deleted.
diff --git a/pc/rtpsender.cc b/pc/rtpsender.cc
index ac3a03c..2f9bf0c 100644
--- a/pc/rtpsender.cc
+++ b/pc/rtpsender.cc
@@ -100,13 +100,13 @@
bool AudioRtpSender::CanInsertDtmf() {
if (!channel_) {
- LOG(LS_ERROR) << "CanInsertDtmf: No audio channel exists.";
+ RTC_LOG(LS_ERROR) << "CanInsertDtmf: No audio channel exists.";
return false;
}
// Check that this RTP sender is active (description has been applied that
// matches an SSRC to its ID).
if (!ssrc_) {
- LOG(LS_ERROR) << "CanInsertDtmf: Sender does not have SSRC.";
+ RTC_LOG(LS_ERROR) << "CanInsertDtmf: Sender does not have SSRC.";
return false;
}
return channel_->CanInsertDtmf();
@@ -114,15 +114,15 @@
bool AudioRtpSender::InsertDtmf(int code, int duration) {
if (!channel_) {
- LOG(LS_ERROR) << "CanInsertDtmf: No audio channel exists.";
+ RTC_LOG(LS_ERROR) << "CanInsertDtmf: No audio channel exists.";
return false;
}
if (!ssrc_) {
- LOG(LS_ERROR) << "CanInsertDtmf: Sender does not have SSRC.";
+ RTC_LOG(LS_ERROR) << "CanInsertDtmf: Sender does not have SSRC.";
return false;
}
if (!channel_->InsertDtmf(ssrc_, code, duration)) {
- LOG(LS_ERROR) << "Failed to insert DTMF to channel.";
+ RTC_LOG(LS_ERROR) << "Failed to insert DTMF to channel.";
return false;
}
return true;
@@ -146,12 +146,12 @@
bool AudioRtpSender::SetTrack(MediaStreamTrackInterface* track) {
TRACE_EVENT0("webrtc", "AudioRtpSender::SetTrack");
if (stopped_) {
- LOG(LS_ERROR) << "SetTrack can't be called on a stopped RtpSender.";
+ RTC_LOG(LS_ERROR) << "SetTrack can't be called on a stopped RtpSender.";
return false;
}
if (track && track->kind() != MediaStreamTrackInterface::kAudioKind) {
- LOG(LS_ERROR) << "SetTrack called on audio RtpSender with " << track->kind()
- << " track.";
+ RTC_LOG(LS_ERROR) << "SetTrack called on audio RtpSender with "
+ << track->kind() << " track.";
return false;
}
AudioTrackInterface* audio_track = static_cast<AudioTrackInterface*>(track);
@@ -253,7 +253,7 @@
RTC_DCHECK(!stopped_);
RTC_DCHECK(can_send_track());
if (!channel_) {
- LOG(LS_ERROR) << "SetAudioSend: No audio channel exists.";
+ RTC_LOG(LS_ERROR) << "SetAudioSend: No audio channel exists.";
return;
}
cricket::AudioOptions options;
@@ -272,7 +272,7 @@
cricket::AudioSource* source = sink_adapter_.get();
RTC_DCHECK(source != nullptr);
if (!channel_->SetAudioSend(ssrc_, track_->enabled(), &options, source)) {
- LOG(LS_ERROR) << "SetAudioSend: ssrc is incorrect: " << ssrc_;
+ RTC_LOG(LS_ERROR) << "SetAudioSend: ssrc is incorrect: " << ssrc_;
}
}
@@ -280,12 +280,12 @@
RTC_DCHECK(ssrc_ != 0);
RTC_DCHECK(!stopped_);
if (!channel_) {
- LOG(LS_WARNING) << "ClearAudioSend: No audio channel exists.";
+ RTC_LOG(LS_WARNING) << "ClearAudioSend: No audio channel exists.";
return;
}
cricket::AudioOptions options;
if (!channel_->SetAudioSend(ssrc_, false, &options, nullptr)) {
- LOG(LS_WARNING) << "ClearAudioSend: ssrc is incorrect: " << ssrc_;
+ RTC_LOG(LS_WARNING) << "ClearAudioSend: ssrc is incorrect: " << ssrc_;
}
}
@@ -296,7 +296,7 @@
rtc::scoped_refptr<DtmfSenderInterface> sender(
DtmfSender::Create(track_, rtc::Thread::Current(), this));
if (!sender.get()) {
- LOG(LS_ERROR) << "CreateDtmfSender failed on DtmfSender::Create.";
+ RTC_LOG(LS_ERROR) << "CreateDtmfSender failed on DtmfSender::Create.";
RTC_NOTREACHED();
}
dtmf_sender_proxy_ =
@@ -356,12 +356,12 @@
bool VideoRtpSender::SetTrack(MediaStreamTrackInterface* track) {
TRACE_EVENT0("webrtc", "VideoRtpSender::SetTrack");
if (stopped_) {
- LOG(LS_ERROR) << "SetTrack can't be called on a stopped RtpSender.";
+ RTC_LOG(LS_ERROR) << "SetTrack can't be called on a stopped RtpSender.";
return false;
}
if (track && track->kind() != MediaStreamTrackInterface::kVideoKind) {
- LOG(LS_ERROR) << "SetTrack called on video RtpSender with " << track->kind()
- << " track.";
+ RTC_LOG(LS_ERROR) << "SetTrack called on video RtpSender with "
+ << track->kind() << " track.";
return false;
}
VideoTrackInterface* video_track = static_cast<VideoTrackInterface*>(track);
@@ -408,7 +408,7 @@
}
rtc::scoped_refptr<DtmfSenderInterface> VideoRtpSender::GetDtmfSender() const {
- LOG(LS_ERROR) << "Tried to get DTMF sender from video sender.";
+ RTC_LOG(LS_ERROR) << "Tried to get DTMF sender from video sender.";
return nullptr;
}
@@ -446,7 +446,7 @@
RTC_DCHECK(!stopped_);
RTC_DCHECK(can_send_track());
if (!channel_) {
- LOG(LS_ERROR) << "SetVideoSend: No video channel exists.";
+ RTC_LOG(LS_ERROR) << "SetVideoSend: No video channel exists.";
return;
}
cricket::VideoOptions options;
@@ -474,7 +474,7 @@
RTC_DCHECK(ssrc_ != 0);
RTC_DCHECK(!stopped_);
if (!channel_) {
- LOG(LS_WARNING) << "SetVideoSend: No video channel exists.";
+ RTC_LOG(LS_WARNING) << "SetVideoSend: No video channel exists.";
return;
}
// Allow SetVideoSend to fail since |enable| is false and |source| is null.
diff --git a/pc/rtptransport.cc b/pc/rtptransport.cc
index 78a2af5..1701c4d 100644
--- a/pc/rtptransport.cc
+++ b/pc/rtptransport.cc
@@ -99,7 +99,7 @@
flags);
if (ret != static_cast<int>(packet->size())) {
if (transport->GetError() == ENOTCONN) {
- LOG(LS_WARNING) << "Got ENOTCONN from transport.";
+ RTC_LOG(LS_WARNING) << "Got ENOTCONN from transport.";
SetReadyToSend(rtcp, false);
}
return false;
@@ -215,8 +215,9 @@
const rtc::CopyOnWriteBuffer* packet) {
// Protect ourselves against crazy data.
if (!packet || !cricket::IsValidRtpRtcpPacketSize(rtcp, packet->size())) {
- LOG(LS_ERROR) << "Dropping incoming " << cricket::RtpRtcpStringLiteral(rtcp)
- << " packet: wrong size=" << packet->size();
+ RTC_LOG(LS_ERROR) << "Dropping incoming "
+ << cricket::RtpRtcpStringLiteral(rtcp)
+ << " packet: wrong size=" << packet->size();
return false;
}
if (rtcp) {
diff --git a/pc/sctputils.cc b/pc/sctputils.cc
index 3433b00..6f0ef01 100644
--- a/pc/sctputils.cc
+++ b/pc/sctputils.cc
@@ -35,7 +35,7 @@
// Format defined at
// http://tools.ietf.org/html/draft-jesup-rtcweb-data-protocol-04
if (payload.size() < 1) {
- LOG(LS_WARNING) << "Could not read OPEN message type.";
+ RTC_LOG(LS_WARNING) << "Could not read OPEN message type.";
return false;
}
@@ -52,47 +52,48 @@
rtc::ByteBufferReader buffer(payload.data<char>(), payload.size());
uint8_t message_type;
if (!buffer.ReadUInt8(&message_type)) {
- LOG(LS_WARNING) << "Could not read OPEN message type.";
+ RTC_LOG(LS_WARNING) << "Could not read OPEN message type.";
return false;
}
if (message_type != DATA_CHANNEL_OPEN_MESSAGE_TYPE) {
- LOG(LS_WARNING) << "Data Channel OPEN message of unexpected type: "
- << message_type;
+ RTC_LOG(LS_WARNING) << "Data Channel OPEN message of unexpected type: "
+ << message_type;
return false;
}
uint8_t channel_type;
if (!buffer.ReadUInt8(&channel_type)) {
- LOG(LS_WARNING) << "Could not read OPEN message channel type.";
+ RTC_LOG(LS_WARNING) << "Could not read OPEN message channel type.";
return false;
}
uint16_t priority;
if (!buffer.ReadUInt16(&priority)) {
- LOG(LS_WARNING) << "Could not read OPEN message reliabilility prioirty.";
+ RTC_LOG(LS_WARNING)
+ << "Could not read OPEN message reliabilility prioirty.";
return false;
}
uint32_t reliability_param;
if (!buffer.ReadUInt32(&reliability_param)) {
- LOG(LS_WARNING) << "Could not read OPEN message reliabilility param.";
+ RTC_LOG(LS_WARNING) << "Could not read OPEN message reliabilility param.";
return false;
}
uint16_t label_length;
if (!buffer.ReadUInt16(&label_length)) {
- LOG(LS_WARNING) << "Could not read OPEN message label length.";
+ RTC_LOG(LS_WARNING) << "Could not read OPEN message label length.";
return false;
}
uint16_t protocol_length;
if (!buffer.ReadUInt16(&protocol_length)) {
- LOG(LS_WARNING) << "Could not read OPEN message protocol length.";
+ RTC_LOG(LS_WARNING) << "Could not read OPEN message protocol length.";
return false;
}
if (!buffer.ReadString(label, (size_t) label_length)) {
- LOG(LS_WARNING) << "Could not read OPEN message label";
+ RTC_LOG(LS_WARNING) << "Could not read OPEN message label";
return false;
}
if (!buffer.ReadString(&config->protocol, protocol_length)) {
- LOG(LS_WARNING) << "Could not read OPEN message protocol.";
+ RTC_LOG(LS_WARNING) << "Could not read OPEN message protocol.";
return false;
}
@@ -121,14 +122,14 @@
bool ParseDataChannelOpenAckMessage(const rtc::CopyOnWriteBuffer& payload) {
if (payload.size() < 1) {
- LOG(LS_WARNING) << "Could not read OPEN_ACK message type.";
+ RTC_LOG(LS_WARNING) << "Could not read OPEN_ACK message type.";
return false;
}
uint8_t message_type = payload[0];
if (message_type != DATA_CHANNEL_OPEN_ACK_MESSAGE_TYPE) {
- LOG(LS_WARNING) << "Data Channel OPEN_ACK message of unexpected type: "
- << message_type;
+ RTC_LOG(LS_WARNING) << "Data Channel OPEN_ACK message of unexpected type: "
+ << message_type;
return false;
}
return true;
diff --git a/pc/srtpfilter.cc b/pc/srtpfilter.cc
index 5f581f3..a0dee64 100644
--- a/pc/srtpfilter.cc
+++ b/pc/srtpfilter.cc
@@ -38,8 +38,8 @@
bool SrtpFilter::SetOffer(const std::vector<CryptoParams>& offer_params,
ContentSource source) {
if (!ExpectOffer(source)) {
- LOG(LS_ERROR) << "Wrong state to update SRTP offer";
- return false;
+ RTC_LOG(LS_ERROR) << "Wrong state to update SRTP offer";
+ return false;
}
return StoreParams(offer_params, source);
}
@@ -91,7 +91,7 @@
ContentSource source,
bool final) {
if (!ExpectAnswer(source)) {
- LOG(LS_ERROR) << "Invalid state for SRTP answer";
+ RTC_LOG(LS_ERROR) << "Invalid state for SRTP answer";
return false;
}
@@ -155,7 +155,7 @@
}
if (!ret) {
- LOG(LS_WARNING) << "Invalid parameters in SRTP answer";
+ RTC_LOG(LS_WARNING) << "Invalid parameters in SRTP answer";
}
return ret;
}
@@ -175,7 +175,7 @@
bool SrtpFilter::ApplySendParams(const CryptoParams& send_params) {
if (applied_send_params_.cipher_suite == send_params.cipher_suite &&
applied_send_params_.key_params == send_params.key_params) {
- LOG(LS_INFO) << "Applying the same SRTP send parameters again. No-op.";
+ RTC_LOG(LS_INFO) << "Applying the same SRTP send parameters again. No-op.";
// We do not want to reset the ROC if the keys are the same. So just return.
return true;
@@ -184,16 +184,16 @@
send_cipher_suite_ = rtc::Optional<int>(
rtc::SrtpCryptoSuiteFromName(send_params.cipher_suite));
if (send_cipher_suite_ == rtc::SRTP_INVALID_CRYPTO_SUITE) {
- LOG(LS_WARNING) << "Unknown crypto suite(s) received:"
- << " send cipher_suite " << send_params.cipher_suite;
+ RTC_LOG(LS_WARNING) << "Unknown crypto suite(s) received:"
+ << " send cipher_suite " << send_params.cipher_suite;
return false;
}
int send_key_len, send_salt_len;
if (!rtc::GetSrtpKeyAndSaltLengths(*send_cipher_suite_, &send_key_len,
&send_salt_len)) {
- LOG(LS_WARNING) << "Could not get lengths for crypto suite(s):"
- << " send cipher_suite " << send_params.cipher_suite;
+ RTC_LOG(LS_WARNING) << "Could not get lengths for crypto suite(s):"
+ << " send cipher_suite " << send_params.cipher_suite;
return false;
}
@@ -205,7 +205,7 @@
bool SrtpFilter::ApplyRecvParams(const CryptoParams& recv_params) {
if (applied_recv_params_.cipher_suite == recv_params.cipher_suite &&
applied_recv_params_.key_params == recv_params.key_params) {
- LOG(LS_INFO) << "Applying the same SRTP recv parameters again. No-op.";
+ RTC_LOG(LS_INFO) << "Applying the same SRTP recv parameters again. No-op.";
// We do not want to reset the ROC if the keys are the same. So just return.
return true;
@@ -214,16 +214,16 @@
recv_cipher_suite_ = rtc::Optional<int>(
rtc::SrtpCryptoSuiteFromName(recv_params.cipher_suite));
if (recv_cipher_suite_ == rtc::SRTP_INVALID_CRYPTO_SUITE) {
- LOG(LS_WARNING) << "Unknown crypto suite(s) received:"
- << " recv cipher_suite " << recv_params.cipher_suite;
+ RTC_LOG(LS_WARNING) << "Unknown crypto suite(s) received:"
+ << " recv cipher_suite " << recv_params.cipher_suite;
return false;
}
int recv_key_len, recv_salt_len;
if (!rtc::GetSrtpKeyAndSaltLengths(*recv_cipher_suite_, &recv_key_len,
&recv_salt_len)) {
- LOG(LS_WARNING) << "Could not get lengths for crypto suite(s):"
- << " recv cipher_suite " << recv_params.cipher_suite;
+ RTC_LOG(LS_WARNING) << "Could not get lengths for crypto suite(s):"
+ << " recv cipher_suite " << recv_params.cipher_suite;
return false;
}
diff --git a/pc/srtpsession.cc b/pc/srtpsession.cc
index 4ba3619..8fe8dc0 100644
--- a/pc/srtpsession.cc
+++ b/pc/srtpsession.cc
@@ -51,14 +51,14 @@
bool SrtpSession::ProtectRtp(void* p, int in_len, int max_len, int* out_len) {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
if (!session_) {
- LOG(LS_WARNING) << "Failed to protect SRTP packet: no SRTP Session";
+ RTC_LOG(LS_WARNING) << "Failed to protect SRTP packet: no SRTP Session";
return false;
}
int need_len = in_len + rtp_auth_tag_len_; // NOLINT
if (max_len < need_len) {
- LOG(LS_WARNING) << "Failed to protect SRTP packet: The buffer length "
- << max_len << " is less than the needed " << need_len;
+ RTC_LOG(LS_WARNING) << "Failed to protect SRTP packet: The buffer length "
+ << max_len << " is less than the needed " << need_len;
return false;
}
@@ -67,9 +67,9 @@
int seq_num;
GetRtpSeqNum(p, in_len, &seq_num);
if (err != srtp_err_status_ok) {
- LOG(LS_WARNING) << "Failed to protect SRTP packet, seqnum=" << seq_num
- << ", err=" << err
- << ", last seqnum=" << last_send_seq_num_;
+ RTC_LOG(LS_WARNING) << "Failed to protect SRTP packet, seqnum=" << seq_num
+ << ", err=" << err
+ << ", last seqnum=" << last_send_seq_num_;
return false;
}
last_send_seq_num_ = seq_num;
@@ -90,21 +90,21 @@
bool SrtpSession::ProtectRtcp(void* p, int in_len, int max_len, int* out_len) {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
if (!session_) {
- LOG(LS_WARNING) << "Failed to protect SRTCP packet: no SRTP Session";
+ RTC_LOG(LS_WARNING) << "Failed to protect SRTCP packet: no SRTP Session";
return false;
}
int need_len = in_len + sizeof(uint32_t) + rtcp_auth_tag_len_; // NOLINT
if (max_len < need_len) {
- LOG(LS_WARNING) << "Failed to protect SRTCP packet: The buffer length "
- << max_len << " is less than the needed " << need_len;
+ RTC_LOG(LS_WARNING) << "Failed to protect SRTCP packet: The buffer length "
+ << max_len << " is less than the needed " << need_len;
return false;
}
*out_len = in_len;
int err = srtp_protect_rtcp(session_, p, out_len);
if (err != srtp_err_status_ok) {
- LOG(LS_WARNING) << "Failed to protect SRTCP packet, err=" << err;
+ RTC_LOG(LS_WARNING) << "Failed to protect SRTCP packet, err=" << err;
return false;
}
return true;
@@ -113,14 +113,14 @@
bool SrtpSession::UnprotectRtp(void* p, int in_len, int* out_len) {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
if (!session_) {
- LOG(LS_WARNING) << "Failed to unprotect SRTP packet: no SRTP Session";
+ RTC_LOG(LS_WARNING) << "Failed to unprotect SRTP packet: no SRTP Session";
return false;
}
*out_len = in_len;
int err = srtp_unprotect(session_, p, out_len);
if (err != srtp_err_status_ok) {
- LOG(LS_WARNING) << "Failed to unprotect SRTP packet, err=" << err;
+ RTC_LOG(LS_WARNING) << "Failed to unprotect SRTP packet, err=" << err;
return false;
}
return true;
@@ -129,14 +129,14 @@
bool SrtpSession::UnprotectRtcp(void* p, int in_len, int* out_len) {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
if (!session_) {
- LOG(LS_WARNING) << "Failed to unprotect SRTCP packet: no SRTP Session";
+ RTC_LOG(LS_WARNING) << "Failed to unprotect SRTCP packet: no SRTP Session";
return false;
}
*out_len = in_len;
int err = srtp_unprotect_rtcp(session_, p, out_len);
if (err != srtp_err_status_ok) {
- LOG(LS_WARNING) << "Failed to unprotect SRTCP packet, err=" << err;
+ RTC_LOG(LS_WARNING) << "Failed to unprotect SRTCP packet, err=" << err;
return false;
}
return true;
@@ -160,7 +160,7 @@
}
if (!external_hmac) {
- LOG(LS_ERROR) << "Failed to get auth keys from libsrtp!.";
+ RTC_LOG(LS_ERROR) << "Failed to get auth keys from libsrtp!.";
return false;
}
@@ -222,8 +222,8 @@
srtp_crypto_policy_set_aes_gcm_256_16_auth(&policy.rtp);
srtp_crypto_policy_set_aes_gcm_256_16_auth(&policy.rtcp);
} else {
- LOG(LS_WARNING) << "Failed to " << (session_ ? "update" : "create")
- << " SRTP session: unsupported cipher_suite " << cs;
+ RTC_LOG(LS_WARNING) << "Failed to " << (session_ ? "update" : "create")
+ << " SRTP session: unsupported cipher_suite " << cs;
return false;
}
@@ -232,7 +232,7 @@
if (!rtc::GetSrtpKeyAndSaltLengths(cs, &expected_key_len,
&expected_salt_len)) {
// This should never happen.
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "Failed to " << (session_ ? "update" : "create")
<< " SRTP session: unsupported cipher_suite without length information"
<< cs;
@@ -241,8 +241,8 @@
if (!key ||
len != static_cast<size_t>(expected_key_len + expected_salt_len)) {
- LOG(LS_WARNING) << "Failed to " << (session_ ? "update" : "create")
- << " SRTP session: invalid key";
+ RTC_LOG(LS_WARNING) << "Failed to " << (session_ ? "update" : "create")
+ << " SRTP session: invalid key";
return false;
}
@@ -273,14 +273,14 @@
int err = srtp_create(&session_, &policy);
if (err != srtp_err_status_ok) {
session_ = nullptr;
- LOG(LS_ERROR) << "Failed to create SRTP session, err=" << err;
+ RTC_LOG(LS_ERROR) << "Failed to create SRTP session, err=" << err;
return false;
}
srtp_set_user_data(session_, this);
} else {
int err = srtp_update(session_, &policy);
if (err != srtp_err_status_ok) {
- LOG(LS_ERROR) << "Failed to update SRTP session, err=" << err;
+ RTC_LOG(LS_ERROR) << "Failed to update SRTP session, err=" << err;
return false;
}
}
@@ -294,8 +294,8 @@
bool SrtpSession::SetKey(int type, int cs, const uint8_t* key, size_t len) {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
if (session_) {
- LOG(LS_ERROR) << "Failed to create SRTP session: "
- << "SRTP session already created";
+ RTC_LOG(LS_ERROR) << "Failed to create SRTP session: "
+ << "SRTP session already created";
return false;
}
@@ -313,7 +313,7 @@
bool SrtpSession::UpdateKey(int type, int cs, const uint8_t* key, size_t len) {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
if (!session_) {
- LOG(LS_ERROR) << "Failed to update non-existing SRTP session";
+ RTC_LOG(LS_ERROR) << "Failed to update non-existing SRTP session";
return false;
}
@@ -338,19 +338,19 @@
int err;
err = srtp_init();
if (err != srtp_err_status_ok) {
- LOG(LS_ERROR) << "Failed to init SRTP, err=" << err;
+ RTC_LOG(LS_ERROR) << "Failed to init SRTP, err=" << err;
return false;
}
err = srtp_install_event_handler(&SrtpSession::HandleEventThunk);
if (err != srtp_err_status_ok) {
- LOG(LS_ERROR) << "Failed to install SRTP event handler, err=" << err;
+ RTC_LOG(LS_ERROR) << "Failed to install SRTP event handler, err=" << err;
return false;
}
err = external_crypto_init();
if (err != srtp_err_status_ok) {
- LOG(LS_ERROR) << "Failed to initialize fake auth, err=" << err;
+ RTC_LOG(LS_ERROR) << "Failed to initialize fake auth, err=" << err;
return false;
}
}
@@ -366,7 +366,7 @@
if (--g_libsrtp_usage_count == 0) {
int err = srtp_shutdown();
if (err) {
- LOG(LS_ERROR) << "srtp_shutdown failed. err=" << err;
+ RTC_LOG(LS_ERROR) << "srtp_shutdown failed. err=" << err;
}
}
}
@@ -375,19 +375,20 @@
RTC_DCHECK(thread_checker_.CalledOnValidThread());
switch (ev->event) {
case event_ssrc_collision:
- LOG(LS_INFO) << "SRTP event: SSRC collision";
+ RTC_LOG(LS_INFO) << "SRTP event: SSRC collision";
break;
case event_key_soft_limit:
- LOG(LS_INFO) << "SRTP event: reached soft key usage limit";
+ RTC_LOG(LS_INFO) << "SRTP event: reached soft key usage limit";
break;
case event_key_hard_limit:
- LOG(LS_INFO) << "SRTP event: reached hard key usage limit";
+ RTC_LOG(LS_INFO) << "SRTP event: reached hard key usage limit";
break;
case event_packet_index_limit:
- LOG(LS_INFO) << "SRTP event: reached hard packet limit (2^48 packets)";
+ RTC_LOG(LS_INFO)
+ << "SRTP event: reached hard packet limit (2^48 packets)";
break;
default:
- LOG(LS_INFO) << "SRTP event: unknown " << ev->event;
+ RTC_LOG(LS_INFO) << "SRTP event: unknown " << ev->event;
break;
}
}
diff --git a/pc/srtptransport.cc b/pc/srtptransport.cc
index 0270da2..b71276c 100644
--- a/pc/srtptransport.cc
+++ b/pc/srtptransport.cc
@@ -61,7 +61,7 @@
const rtc::PacketOptions& options,
int flags) {
if (!IsActive()) {
- LOG(LS_ERROR)
+ RTC_LOG(LS_ERROR)
<< "Failed to send the packet because SRTP transport is inactive.";
return false;
}
@@ -108,9 +108,9 @@
uint32_t ssrc = 0;
cricket::GetRtpSeqNum(data, len, &seq_num);
cricket::GetRtpSsrc(data, len, &ssrc);
- LOG(LS_ERROR) << "Failed to protect " << content_name_
- << " RTP packet: size=" << len << ", seqnum=" << seq_num
- << ", SSRC=" << ssrc;
+ RTC_LOG(LS_ERROR) << "Failed to protect " << content_name_
+ << " RTP packet: size=" << len << ", seqnum=" << seq_num
+ << ", SSRC=" << ssrc;
return false;
}
} else {
@@ -118,8 +118,8 @@
if (!res) {
int type = -1;
cricket::GetRtcpType(data, len, &type);
- LOG(LS_ERROR) << "Failed to protect " << content_name_
- << " RTCP packet: size=" << len << ", type=" << type;
+ RTC_LOG(LS_ERROR) << "Failed to protect " << content_name_
+ << " RTCP packet: size=" << len << ", type=" << type;
return false;
}
}
@@ -134,7 +134,8 @@
rtc::CopyOnWriteBuffer* packet,
const rtc::PacketTime& packet_time) {
if (!IsActive()) {
- LOG(LS_WARNING) << "Inactive SRTP transport received a packet. Drop it.";
+ RTC_LOG(LS_WARNING)
+ << "Inactive SRTP transport received a packet. Drop it.";
return;
}
@@ -149,9 +150,9 @@
uint32_t ssrc = 0;
cricket::GetRtpSeqNum(data, len, &seq_num);
cricket::GetRtpSsrc(data, len, &ssrc);
- LOG(LS_ERROR) << "Failed to unprotect " << content_name_
- << " RTP packet: size=" << len << ", seqnum=" << seq_num
- << ", SSRC=" << ssrc;
+ RTC_LOG(LS_ERROR) << "Failed to unprotect " << content_name_
+ << " RTP packet: size=" << len << ", seqnum=" << seq_num
+ << ", SSRC=" << ssrc;
return;
}
} else {
@@ -159,8 +160,8 @@
if (!res) {
int type = -1;
cricket::GetRtcpType(data, len, &type);
- LOG(LS_ERROR) << "Failed to unprotect " << content_name_
- << " RTCP packet: size=" << len << ", type=" << type;
+ RTC_LOG(LS_ERROR) << "Failed to unprotect " << content_name_
+ << " RTCP packet: size=" << len << ", type=" << type;
return;
}
}
@@ -205,10 +206,10 @@
return false;
}
- LOG(LS_INFO) << "SRTP " << (new_sessions ? "activated" : "updated")
- << " with negotiated parameters:"
- << " send cipher_suite " << send_cs << " recv cipher_suite "
- << recv_cs;
+ RTC_LOG(LS_INFO) << "SRTP " << (new_sessions ? "activated" : "updated")
+ << " with negotiated parameters:"
+ << " send cipher_suite " << send_cs << " recv cipher_suite "
+ << recv_cs;
return true;
}
@@ -221,7 +222,7 @@
// This can only be called once, but can be safely called after
// SetRtpParams
if (send_rtcp_session_ || recv_rtcp_session_) {
- LOG(LS_ERROR) << "Tried to set SRTCP Params when filter already active";
+ RTC_LOG(LS_ERROR) << "Tried to set SRTCP Params when filter already active";
return false;
}
@@ -235,9 +236,9 @@
return false;
}
- LOG(LS_INFO) << "SRTCP activated with negotiated parameters:"
- << " send cipher_suite " << send_cs << " recv cipher_suite "
- << recv_cs;
+ RTC_LOG(LS_INFO) << "SRTCP activated with negotiated parameters:"
+ << " send cipher_suite " << send_cs << " recv cipher_suite "
+ << recv_cs;
return true;
}
@@ -251,7 +252,7 @@
recv_session_ = nullptr;
send_rtcp_session_ = nullptr;
recv_rtcp_session_ = nullptr;
- LOG(LS_INFO) << "The params in SRTP transport are reset.";
+ RTC_LOG(LS_INFO) << "The params in SRTP transport are reset.";
}
void SrtpTransport::SetEncryptedHeaderExtensionIds(
@@ -275,7 +276,7 @@
bool SrtpTransport::ProtectRtp(void* p, int in_len, int max_len, int* out_len) {
if (!IsActive()) {
- LOG(LS_WARNING) << "Failed to ProtectRtp: SRTP not active";
+ RTC_LOG(LS_WARNING) << "Failed to ProtectRtp: SRTP not active";
return false;
}
RTC_CHECK(send_session_);
@@ -288,7 +289,7 @@
int* out_len,
int64_t* index) {
if (!IsActive()) {
- LOG(LS_WARNING) << "Failed to ProtectRtp: SRTP not active";
+ RTC_LOG(LS_WARNING) << "Failed to ProtectRtp: SRTP not active";
return false;
}
RTC_CHECK(send_session_);
@@ -300,7 +301,7 @@
int max_len,
int* out_len) {
if (!IsActive()) {
- LOG(LS_WARNING) << "Failed to ProtectRtcp: SRTP not active";
+ RTC_LOG(LS_WARNING) << "Failed to ProtectRtcp: SRTP not active";
return false;
}
if (send_rtcp_session_) {
@@ -313,7 +314,7 @@
bool SrtpTransport::UnprotectRtp(void* p, int in_len, int* out_len) {
if (!IsActive()) {
- LOG(LS_WARNING) << "Failed to UnprotectRtp: SRTP not active";
+ RTC_LOG(LS_WARNING) << "Failed to UnprotectRtp: SRTP not active";
return false;
}
RTC_CHECK(recv_session_);
@@ -322,7 +323,7 @@
bool SrtpTransport::UnprotectRtcp(void* p, int in_len, int* out_len) {
if (!IsActive()) {
- LOG(LS_WARNING) << "Failed to UnprotectRtcp: SRTP not active";
+ RTC_LOG(LS_WARNING) << "Failed to UnprotectRtcp: SRTP not active";
return false;
}
if (recv_rtcp_session_) {
@@ -337,7 +338,7 @@
int* key_len,
int* tag_len) {
if (!IsActive()) {
- LOG(LS_WARNING) << "Failed to GetRtpAuthParams: SRTP not active";
+ RTC_LOG(LS_WARNING) << "Failed to GetRtpAuthParams: SRTP not active";
return false;
}
@@ -347,7 +348,7 @@
bool SrtpTransport::GetSrtpOverhead(int* srtp_overhead) const {
if (!IsActive()) {
- LOG(LS_WARNING) << "Failed to GetSrtpOverhead: SRTP not active";
+ RTC_LOG(LS_WARNING) << "Failed to GetSrtpOverhead: SRTP not active";
return false;
}
@@ -367,7 +368,8 @@
bool SrtpTransport::IsExternalAuthActive() const {
if (!IsActive()) {
- LOG(LS_WARNING) << "Failed to check IsExternalAuthActive: SRTP not active";
+ RTC_LOG(LS_WARNING)
+ << "Failed to check IsExternalAuthActive: SRTP not active";
return false;
}
diff --git a/pc/srtptransport_unittest.cc b/pc/srtptransport_unittest.cc
index d551c83..35a792d 100644
--- a/pc/srtptransport_unittest.cc
+++ b/pc/srtptransport_unittest.cc
@@ -77,14 +77,14 @@
void OnPacketReceived1(bool rtcp,
rtc::CopyOnWriteBuffer* packet,
const rtc::PacketTime& packet_time) {
- LOG(LS_INFO) << "SrtpTransport1 Received a packet.";
+ RTC_LOG(LS_INFO) << "SrtpTransport1 Received a packet.";
last_recv_packet1_ = *packet;
}
void OnPacketReceived2(bool rtcp,
rtc::CopyOnWriteBuffer* packet,
const rtc::PacketTime& packet_time) {
- LOG(LS_INFO) << "SrtpTransport2 Received a packet.";
+ RTC_LOG(LS_INFO) << "SrtpTransport2 Received a packet.";
last_recv_packet2_ = *packet;
}
diff --git a/pc/statscollector.cc b/pc/statscollector.cc
index 1945816..c81b368 100644
--- a/pc/statscollector.cc
+++ b/pc/statscollector.cc
@@ -853,7 +853,7 @@
}
cricket::VoiceMediaInfo voice_info;
if (!pc_->voice_channel()->GetStats(&voice_info)) {
- LOG(LS_ERROR) << "Failed to get voice channel stats.";
+ RTC_LOG(LS_ERROR) << "Failed to get voice channel stats.";
return;
}
@@ -864,8 +864,8 @@
StatsReport::Id transport_id(GetTransportIdFromProxy(
proxy_to_transport_, pc_->voice_channel()->content_name()));
if (!transport_id.get()) {
- LOG(LS_ERROR) << "Failed to get transport name for proxy "
- << pc_->voice_channel()->content_name();
+ RTC_LOG(LS_ERROR) << "Failed to get transport name for proxy "
+ << pc_->voice_channel()->content_name();
return;
}
@@ -886,7 +886,7 @@
cricket::VideoMediaInfo video_info;
if (!pc_->video_channel()->GetStats(&video_info)) {
- LOG(LS_ERROR) << "Failed to get video channel stats.";
+ RTC_LOG(LS_ERROR) << "Failed to get video channel stats.";
return;
}
@@ -897,8 +897,8 @@
StatsReport::Id transport_id(GetTransportIdFromProxy(
proxy_to_transport_, pc_->video_channel()->content_name()));
if (!transport_id.get()) {
- LOG(LS_ERROR) << "Failed to get transport name for proxy "
- << pc_->video_channel()->content_name();
+ RTC_LOG(LS_ERROR) << "Failed to get transport name for proxy "
+ << pc_->video_channel()->content_name();
return;
}
ExtractStatsFromList(video_info.receivers, transport_id, this,
@@ -982,7 +982,7 @@
if (report == NULL) {
// This can happen if a local audio track is added to a stream on the
// fly and the report has not been set up yet. Do nothing in this case.
- LOG(LS_ERROR) << "Stats report does not exist for ssrc " << ssrc;
+ RTC_LOG(LS_ERROR) << "Stats report does not exist for ssrc " << ssrc;
continue;
}
@@ -1033,15 +1033,15 @@
RTC_DCHECK(pc_->signaling_thread()->IsCurrent());
if (direction == StatsReport::kSend) {
if (!pc_->GetLocalTrackIdBySsrc(ssrc, track_id)) {
- LOG(LS_WARNING) << "The SSRC " << ssrc
- << " is not associated with a sending track";
+ RTC_LOG(LS_WARNING) << "The SSRC " << ssrc
+ << " is not associated with a sending track";
return false;
}
} else {
RTC_DCHECK(direction == StatsReport::kReceive);
if (!pc_->GetRemoteTrackIdBySsrc(ssrc, track_id)) {
- LOG(LS_WARNING) << "The SSRC " << ssrc
- << " is not associated with a receiving track";
+ RTC_LOG(LS_WARNING) << "The SSRC " << ssrc
+ << " is not associated with a receiving track";
return false;
}
}
diff --git a/pc/test/fakedatachannelprovider.h b/pc/test/fakedatachannelprovider.h
index 2ac4f94..9aa0271 100644
--- a/pc/test/fakedatachannelprovider.h
+++ b/pc/test/fakedatachannelprovider.h
@@ -50,7 +50,7 @@
if (!transport_available_) {
return false;
}
- LOG(LS_INFO) << "DataChannel connected " << data_channel;
+ RTC_LOG(LS_INFO) << "DataChannel connected " << data_channel;
connected_channels_.insert(data_channel);
return true;
}
@@ -58,7 +58,7 @@
void DisconnectDataChannel(webrtc::DataChannel* data_channel) override {
RTC_CHECK(connected_channels_.find(data_channel) !=
connected_channels_.end());
- LOG(LS_INFO) << "DataChannel disconnected " << data_channel;
+ RTC_LOG(LS_INFO) << "DataChannel disconnected " << data_channel;
connected_channels_.erase(data_channel);
}
diff --git a/pc/test/peerconnectiontestwrapper.cc b/pc/test/peerconnectiontestwrapper.cc
index 6d28ef8..6bed036 100644
--- a/pc/test/peerconnectiontestwrapper.cc
+++ b/pc/test/peerconnectiontestwrapper.cc
@@ -97,8 +97,7 @@
void PeerConnectionTestWrapper::OnAddStream(
rtc::scoped_refptr<MediaStreamInterface> stream) {
- LOG(LS_INFO) << "PeerConnectionTestWrapper " << name_
- << ": OnAddStream";
+ RTC_LOG(LS_INFO) << "PeerConnectionTestWrapper " << name_ << ": OnAddStream";
// TODO(ronghuawu): support multiple streams.
if (stream->GetVideoTracks().size() > 0) {
renderer_.reset(new FakeVideoTrackRenderer(stream->GetVideoTracks()[0]));
@@ -126,8 +125,8 @@
std::string sdp;
EXPECT_TRUE(desc->ToString(&sdp));
- LOG(LS_INFO) << "PeerConnectionTestWrapper " << name_
- << ": " << desc->type() << " sdp created: " << sdp;
+ RTC_LOG(LS_INFO) << "PeerConnectionTestWrapper " << name_ << ": "
+ << desc->type() << " sdp created: " << sdp;
// Give the user a chance to modify sdp for testing.
SignalOnSdpCreated(&sdp);
@@ -139,15 +138,14 @@
void PeerConnectionTestWrapper::CreateOffer(
const MediaConstraintsInterface* constraints) {
- LOG(LS_INFO) << "PeerConnectionTestWrapper " << name_
- << ": CreateOffer.";
+ RTC_LOG(LS_INFO) << "PeerConnectionTestWrapper " << name_ << ": CreateOffer.";
peer_connection_->CreateOffer(this, constraints);
}
void PeerConnectionTestWrapper::CreateAnswer(
const MediaConstraintsInterface* constraints) {
- LOG(LS_INFO) << "PeerConnectionTestWrapper " << name_
- << ": CreateAnswer.";
+ RTC_LOG(LS_INFO) << "PeerConnectionTestWrapper " << name_
+ << ": CreateAnswer.";
peer_connection_->CreateAnswer(this, constraints);
}
@@ -162,8 +160,8 @@
void PeerConnectionTestWrapper::SetLocalDescription(const std::string& type,
const std::string& sdp) {
- LOG(LS_INFO) << "PeerConnectionTestWrapper " << name_
- << ": SetLocalDescription " << type << " " << sdp;
+ RTC_LOG(LS_INFO) << "PeerConnectionTestWrapper " << name_
+ << ": SetLocalDescription " << type << " " << sdp;
rtc::scoped_refptr<MockSetSessionDescriptionObserver>
observer(new rtc::RefCountedObject<
@@ -174,8 +172,8 @@
void PeerConnectionTestWrapper::SetRemoteDescription(const std::string& type,
const std::string& sdp) {
- LOG(LS_INFO) << "PeerConnectionTestWrapper " << name_
- << ": SetRemoteDescription " << type << " " << sdp;
+ RTC_LOG(LS_INFO) << "PeerConnectionTestWrapper " << name_
+ << ": SetRemoteDescription " << type << " " << sdp;
rtc::scoped_refptr<MockSetSessionDescriptionObserver>
observer(new rtc::RefCountedObject<
@@ -200,8 +198,7 @@
void PeerConnectionTestWrapper::WaitForConnection() {
EXPECT_TRUE_WAIT(CheckForConnection(), kMaxWait);
- LOG(LS_INFO) << "PeerConnectionTestWrapper " << name_
- << ": Connected.";
+ RTC_LOG(LS_INFO) << "PeerConnectionTestWrapper " << name_ << ": Connected.";
}
bool PeerConnectionTestWrapper::CheckForConnection() {
@@ -213,8 +210,8 @@
void PeerConnectionTestWrapper::WaitForAudio() {
EXPECT_TRUE_WAIT(CheckForAudio(), kMaxWait);
- LOG(LS_INFO) << "PeerConnectionTestWrapper " << name_
- << ": Got enough audio frames.";
+ RTC_LOG(LS_INFO) << "PeerConnectionTestWrapper " << name_
+ << ": Got enough audio frames.";
}
bool PeerConnectionTestWrapper::CheckForAudio() {
@@ -224,8 +221,8 @@
void PeerConnectionTestWrapper::WaitForVideo() {
EXPECT_TRUE_WAIT(CheckForVideo(), kMaxWait);
- LOG(LS_INFO) << "PeerConnectionTestWrapper " << name_
- << ": Got enough video frames.";
+ RTC_LOG(LS_INFO) << "PeerConnectionTestWrapper " << name_
+ << ": Got enough video frames.";
}
bool PeerConnectionTestWrapper::CheckForVideo() {
diff --git a/pc/transportcontroller.cc b/pc/transportcontroller.cc
index aa6ddec..57f90b7 100644
--- a/pc/transportcontroller.cc
+++ b/pc/transportcontroller.cc
@@ -302,9 +302,9 @@
RTC_DCHECK(network_thread_->IsCurrent());
auto it = GetChannelIterator_n(transport_name, component);
if (it == channels_.end()) {
- LOG(LS_WARNING) << "Attempting to delete " << transport_name
- << " TransportChannel " << component
- << ", which doesn't exist.";
+ RTC_LOG(LS_WARNING) << "Attempting to delete " << transport_name
+ << " TransportChannel " << component
+ << ", which doesn't exist.";
return;
}
// Release one reference to the RefCountedChannel, and do additional cleanup
@@ -617,7 +617,7 @@
SetIceRole(new_ice_role);
}
- LOG(LS_INFO) << "Set local transport description on " << transport_name;
+ RTC_LOG(LS_INFO) << "Set local transport description on " << transport_name;
return transport->SetLocalTransportDescription(tdesc, action, err);
}
@@ -645,7 +645,7 @@
return true;
}
- LOG(LS_INFO) << "Set remote transport description on " << transport_name;
+ RTC_LOG(LS_INFO) << "Set remote transport description on " << transport_name;
return transport->SetRemoteTransportDescription(tdesc, action, err);
}
@@ -700,9 +700,9 @@
if (!cand.transport_name().empty()) {
candidates_by_transport_name[cand.transport_name()].push_back(cand);
} else {
- LOG(LS_ERROR) << "Not removing candidate because it does not have a "
- "transport name set: "
- << cand.ToString();
+ RTC_LOG(LS_ERROR) << "Not removing candidate because it does not have a "
+ "transport name set: "
+ << cand.ToString();
}
}
@@ -761,8 +761,9 @@
void TransportController::OnChannelWritableState_n(
rtc::PacketTransportInternal* transport) {
RTC_DCHECK(network_thread_->IsCurrent());
- LOG(LS_INFO) << " TransportChannel " << transport->debug_name()
- << " writability changed to " << transport->writable() << ".";
+ RTC_LOG(LS_INFO) << " TransportChannel " << transport->debug_name()
+ << " writability changed to " << transport->writable()
+ << ".";
UpdateAggregateStates_n();
}
@@ -819,19 +820,19 @@
IceRole reversed_role = (ice_role_ == ICEROLE_CONTROLLING)
? ICEROLE_CONTROLLED
: ICEROLE_CONTROLLING;
- LOG(LS_INFO) << "Got role conflict; switching to "
- << (reversed_role == ICEROLE_CONTROLLING ? "controlling"
- : "controlled")
- << " role.";
+ RTC_LOG(LS_INFO) << "Got role conflict; switching to "
+ << (reversed_role == ICEROLE_CONTROLLING ? "controlling"
+ : "controlled")
+ << " role.";
SetIceRole_n(reversed_role);
}
void TransportController::OnChannelStateChanged_n(
IceTransportInternal* channel) {
RTC_DCHECK(network_thread_->IsCurrent());
- LOG(LS_INFO) << channel->transport_name() << " TransportChannel "
- << channel->component()
- << " state changed. Check if state is complete.";
+ RTC_LOG(LS_INFO) << channel->transport_name() << " TransportChannel "
+ << channel->component()
+ << " state changed. Check if state is complete.";
UpdateAggregateStates_n();
}
diff --git a/pc/videocapturertracksource.cc b/pc/videocapturertracksource.cc
index 2426cea..93654e8 100644
--- a/pc/videocapturertracksource.cc
+++ b/pc/videocapturertracksource.cc
@@ -156,8 +156,8 @@
// regardless of the format.
return true;
}
- LOG(LS_WARNING) << "Found unknown MediaStream constraint. Name:"
- << constraint.key << " Value:" << constraint.value;
+ RTC_LOG(LS_WARNING) << "Found unknown MediaStream constraint. Name:"
+ << constraint.key << " Value:" << constraint.value;
return false;
}
@@ -338,15 +338,15 @@
}
if (formats.size() == 0) {
- LOG(LS_WARNING) << "Failed to find a suitable video format.";
+ RTC_LOG(LS_WARNING) << "Failed to find a suitable video format.";
SetState(kEnded);
return;
}
if (!ExtractOption(constraints, MediaConstraintsInterface::kNoiseReduction,
&needs_denoising_)) {
- LOG(LS_WARNING) << "Invalid mandatory value for"
- << MediaConstraintsInterface::kNoiseReduction;
+ RTC_LOG(LS_WARNING) << "Invalid mandatory value for"
+ << MediaConstraintsInterface::kNoiseReduction;
SetState(kEnded);
return;
}
diff --git a/pc/webrtcsdp.cc b/pc/webrtcsdp.cc
index f053bf5..f2bc250 100644
--- a/pc/webrtcsdp.cc
+++ b/pc/webrtcsdp.cc
@@ -358,8 +358,8 @@
error->line = first_line;
error->description = description;
}
- LOG(LS_ERROR) << "Failed to parse: \"" << first_line
- << "\". Reason: " << description;
+ RTC_LOG(LS_ERROR) << "Failed to parse: \"" << first_line
+ << "\". Reason: " << description;
return false;
}
@@ -1486,8 +1486,9 @@
// a=msid:<stream id> <track id>
if (unified_plan_sdp && !media_desc->streams().empty()) {
if (media_desc->streams().size() > 1u) {
- LOG(LS_WARNING) << "Trying to serialize unified plan SDP with more than "
- << "one track in a media section. Omitting 'a=msid'.";
+ RTC_LOG(LS_WARNING)
+ << "Trying to serialize unified plan SDP with more than "
+ << "one track in a media section. Omitting 'a=msid'.";
} else {
auto track = media_desc->streams().begin();
const std::string& stream_id = track->sync_label;
@@ -1698,8 +1699,7 @@
cricket::DataCodec codec_port(cricket::kGoogleSctpDataCodecPlType,
cricket::kGoogleSctpDataCodecName);
codec_port.SetParam(cricket::kCodecParamPort, sctp_port);
- LOG(INFO) << "AddSctpDataCodec: Got SCTP Port Number "
- << sctp_port;
+ RTC_LOG(INFO) << "AddSctpDataCodec: Got SCTP Port Number " << sctp_port;
media_desc->AddCodec(codec_port);
return true;
}
@@ -2448,7 +2448,7 @@
}
}
} else {
- LOG(LS_WARNING) << "Unsupported media type: " << line;
+ RTC_LOG(LS_WARNING) << "Unsupported media type: " << line;
continue;
}
if (!content.get()) {
@@ -2464,7 +2464,7 @@
// Usage of bundle-only with a nonzero port is unspecified. So just
// ignore bundle-only if we see this.
bundle_only = false;
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "a=bundle-only attribute observed with a nonzero "
<< "port; this usage is unspecified so the attribute is being "
<< "ignored.";
@@ -2734,8 +2734,9 @@
// transitioned applications to doing the right thing, it would be
// better to treat this as a hard error instead of just ignoring it.
if (b == -1) {
- LOG(LS_WARNING) << "Ignoring \"b=AS:-1\"; will be treated as \"no "
- "bandwidth limit\".";
+ RTC_LOG(LS_WARNING)
+ << "Ignoring \"b=AS:-1\"; will be treated as \"no "
+ "bandwidth limit\".";
continue;
}
if (b < 0) {
@@ -2772,7 +2773,7 @@
if (!IsLineType(line, kLineTypeAttributes)) {
// TODO(deadbeef): Handle other lines if needed.
- LOG(LS_INFO) << "Ignored line: " << line;
+ RTC_LOG(LS_INFO) << "Ignored line: " << line;
continue;
}
@@ -2909,7 +2910,7 @@
}
} else {
// Only parse lines that we are interested of.
- LOG(LS_INFO) << "Ignored line: " << line;
+ RTC_LOG(LS_INFO) << "Ignored line: " << line;
continue;
}
}
@@ -3178,8 +3179,8 @@
if (std::find(payload_types.begin(), payload_types.end(), payload_type) ==
payload_types.end()) {
- LOG(LS_WARNING) << "Ignore rtpmap line that did not appear in the "
- << "<fmt> of the m-line: " << line;
+ RTC_LOG(LS_WARNING) << "Ignore rtpmap line that did not appear in the "
+ << "<fmt> of the m-line: " << line;
return true;
}
const std::string& encoder = fields[1];
diff --git a/pc/webrtcsessiondescriptionfactory.cc b/pc/webrtcsessiondescriptionfactory.cc
index 69c629e..8154c89 100644
--- a/pc/webrtcsessiondescriptionfactory.cc
+++ b/pc/webrtcsessiondescriptionfactory.cc
@@ -142,7 +142,7 @@
// SRTP-SDES is disabled if DTLS is on.
SetSdesPolicy(dtls_enabled ? cricket::SEC_DISABLED : cricket::SEC_REQUIRED);
if (!dtls_enabled) {
- LOG(LS_VERBOSE) << "DTLS-SRTP disabled.";
+ RTC_LOG(LS_VERBOSE) << "DTLS-SRTP disabled.";
return;
}
@@ -150,7 +150,7 @@
// Use |certificate|.
certificate_request_state_ = CERTIFICATE_WAITING;
- LOG(LS_VERBOSE) << "DTLS-SRTP enabled; has certificate parameter.";
+ RTC_LOG(LS_VERBOSE) << "DTLS-SRTP enabled; has certificate parameter.";
// We already have a certificate but we wait to do |SetIdentity|; if we do
// it in the constructor then the caller has not had a chance to connect to
// |SignalCertificateReady|.
@@ -169,8 +169,9 @@
this, &WebRtcSessionDescriptionFactory::SetCertificate);
rtc::KeyParams key_params = rtc::KeyParams();
- LOG(LS_VERBOSE) << "DTLS-SRTP enabled; sending DTLS identity request (key "
- << "type: " << key_params.type() << ").";
+ RTC_LOG(LS_VERBOSE)
+ << "DTLS-SRTP enabled; sending DTLS identity request (key "
+ << "type: " << key_params.type() << ").";
// Request certificate. This happens asynchronously, so that the caller gets
// a chance to connect to |SignalCertificateReady|.
@@ -211,14 +212,14 @@
std::string error = "CreateOffer";
if (certificate_request_state_ == CERTIFICATE_FAILED) {
error += kFailedDueToIdentityFailed;
- LOG(LS_ERROR) << error;
+ RTC_LOG(LS_ERROR) << error;
PostCreateSessionDescriptionFailed(observer, error);
return;
}
if (!ValidMediaSessionOptions(session_options)) {
error += " called with invalid session options";
- LOG(LS_ERROR) << error;
+ RTC_LOG(LS_ERROR) << error;
PostCreateSessionDescriptionFailed(observer, error);
return;
}
@@ -240,26 +241,26 @@
std::string error = "CreateAnswer";
if (certificate_request_state_ == CERTIFICATE_FAILED) {
error += kFailedDueToIdentityFailed;
- LOG(LS_ERROR) << error;
+ RTC_LOG(LS_ERROR) << error;
PostCreateSessionDescriptionFailed(observer, error);
return;
}
if (!pc_->remote_description()) {
error += " can't be called before SetRemoteDescription.";
- LOG(LS_ERROR) << error;
+ RTC_LOG(LS_ERROR) << error;
PostCreateSessionDescriptionFailed(observer, error);
return;
}
if (pc_->remote_description()->type() != JsepSessionDescription::kOffer) {
error += " failed because remote_description is not an offer.";
- LOG(LS_ERROR) << error;
+ RTC_LOG(LS_ERROR) << error;
PostCreateSessionDescriptionFailed(observer, error);
return;
}
if (!ValidMediaSessionOptions(session_options)) {
error += " called with invalid session options.";
- LOG(LS_ERROR) << error;
+ RTC_LOG(LS_ERROR) << error;
PostCreateSessionDescriptionFailed(observer, error);
return;
}
@@ -304,7 +305,7 @@
rtc::ScopedRefMessageData<rtc::RTCCertificate>* param =
static_cast<rtc::ScopedRefMessageData<rtc::RTCCertificate>*>(
msg->pdata);
- LOG(LS_INFO) << "Using certificate supplied to the constructor.";
+ RTC_LOG(LS_INFO) << "Using certificate supplied to the constructor.";
SetCertificate(param->data());
delete param;
break;
@@ -439,7 +440,7 @@
msg->error = error;
signaling_thread_->Post(RTC_FROM_HERE, this,
MSG_CREATE_SESSIONDESCRIPTION_FAILED, msg);
- LOG(LS_ERROR) << "Create SDP failed: " << error;
+ RTC_LOG(LS_ERROR) << "Create SDP failed: " << error;
}
void WebRtcSessionDescriptionFactory::PostCreateSessionDescriptionSucceeded(
@@ -454,7 +455,7 @@
void WebRtcSessionDescriptionFactory::OnCertificateRequestFailed() {
RTC_DCHECK(signaling_thread_->IsCurrent());
- LOG(LS_ERROR) << "Asynchronous certificate generation request failed.";
+ RTC_LOG(LS_ERROR) << "Asynchronous certificate generation request failed.";
certificate_request_state_ = CERTIFICATE_FAILED;
FailPendingRequests(kFailedDueToIdentityFailed);
@@ -463,7 +464,7 @@
void WebRtcSessionDescriptionFactory::SetCertificate(
const rtc::scoped_refptr<rtc::RTCCertificate>& certificate) {
RTC_DCHECK(certificate);
- LOG(LS_VERBOSE) << "Setting new certificate.";
+ RTC_LOG(LS_VERBOSE) << "Setting new certificate.";
certificate_request_state_ = CERTIFICATE_SUCCEEDED;
SignalCertificateReady(certificate);
diff --git a/rtc_base/asyncinvoker.cc b/rtc_base/asyncinvoker.cc
index 048fbb0..7f65dfc 100644
--- a/rtc_base/asyncinvoker.cc
+++ b/rtc_base/asyncinvoker.cc
@@ -76,7 +76,7 @@
// tasks that AsyncInvoke other tasks. But otherwise it indicates a race
// between a thread destroying the AsyncInvoker and a thread still trying
// to use it.
- LOG(LS_WARNING) << "Tried to invoke while destroying the invoker.";
+ RTC_LOG(LS_WARNING) << "Tried to invoke while destroying the invoker.";
return;
}
thread->Post(posted_from, this, id,
@@ -90,7 +90,7 @@
uint32_t id) {
if (destroying_.load(std::memory_order_relaxed)) {
// See above comment.
- LOG(LS_WARNING) << "Tried to invoke while destroying the invoker.";
+ RTC_LOG(LS_WARNING) << "Tried to invoke while destroying the invoker.";
return;
}
thread->PostDelayed(posted_from, delay_ms, this, id,
diff --git a/rtc_base/asynctcpsocket.cc b/rtc_base/asynctcpsocket.cc
index d3d88bc..9e0589c 100644
--- a/rtc_base/asynctcpsocket.cc
+++ b/rtc_base/asynctcpsocket.cc
@@ -46,11 +46,11 @@
const rtc::SocketAddress& remote_address) {
std::unique_ptr<rtc::AsyncSocket> owned_socket(socket);
if (socket->Bind(bind_address) < 0) {
- LOG(LS_ERROR) << "Bind() failed with error " << socket->GetError();
+ RTC_LOG(LS_ERROR) << "Bind() failed with error " << socket->GetError();
return nullptr;
}
if (socket->Connect(remote_address) < 0) {
- LOG(LS_ERROR) << "Connect() failed with error " << socket->GetError();
+ RTC_LOG(LS_ERROR) << "Connect() failed with error " << socket->GetError();
return nullptr;
}
return owned_socket.release();
@@ -76,7 +76,7 @@
if (listen_) {
if (socket_->Listen(kListenBacklog) < 0) {
- LOG(LS_ERROR) << "Listen() failed with error " << socket_->GetError();
+ RTC_LOG(LS_ERROR) << "Listen() failed with error " << socket_->GetError();
}
}
}
@@ -190,7 +190,8 @@
if (!new_socket) {
// TODO(stefan): Do something better like forwarding the error
// to the user.
- LOG(LS_ERROR) << "TCP accept failed with error " << socket_->GetError();
+ RTC_LOG(LS_ERROR) << "TCP accept failed with error "
+ << socket_->GetError();
return;
}
@@ -213,7 +214,7 @@
// TODO(stefan): Do something better like forwarding the error to the
// user.
if (!socket_->IsBlocking()) {
- LOG(LS_ERROR) << "Recv() returned error: " << socket_->GetError();
+ RTC_LOG(LS_ERROR) << "Recv() returned error: " << socket_->GetError();
}
break;
}
@@ -233,7 +234,7 @@
ProcessInput(inbuf_.data<char>(), &size);
if (size > inbuf_.size()) {
- LOG(LS_ERROR) << "input buffer overflow";
+ RTC_LOG(LS_ERROR) << "input buffer overflow";
RTC_NOTREACHED();
inbuf_.Clear();
} else {
diff --git a/rtc_base/asyncudpsocket.cc b/rtc_base/asyncudpsocket.cc
index 64bc8b1..0896e50 100644
--- a/rtc_base/asyncudpsocket.cc
+++ b/rtc_base/asyncudpsocket.cc
@@ -21,7 +21,7 @@
const SocketAddress& bind_address) {
std::unique_ptr<AsyncSocket> owned_socket(socket);
if (socket->Bind(bind_address) < 0) {
- LOG(LS_ERROR) << "Bind() failed with error " << socket->GetError();
+ RTC_LOG(LS_ERROR) << "Bind() failed with error " << socket->GetError();
return nullptr;
}
return new AsyncUDPSocket(owned_socket.release());
@@ -111,8 +111,9 @@
// When doing ICE, this kind of thing will often happen.
// TODO: Do something better like forwarding the error to the user.
SocketAddress local_addr = socket_->GetLocalAddress();
- LOG(LS_INFO) << "AsyncUDPSocket[" << local_addr.ToSensitiveString() << "] "
- << "receive failed with error " << socket_->GetError();
+ RTC_LOG(LS_INFO) << "AsyncUDPSocket[" << local_addr.ToSensitiveString()
+ << "] "
+ << "receive failed with error " << socket_->GetError();
return;
}
diff --git a/rtc_base/base64_unittest.cc b/rtc_base/base64_unittest.cc
index 0cb26c3..0f7c80d 100644
--- a/rtc_base/base64_unittest.cc
+++ b/rtc_base/base64_unittest.cc
@@ -320,13 +320,13 @@
// Only added because string.compare() in gcc-3.3.3 seems to misbehave with
// embedded nulls.
// TODO: switch back to string.compare() if/when gcc is fixed
-#define EXPECT_EQ_ARRAY(len, x, y, msg) \
+#define EXPECT_EQ_ARRAY(len, x, y, msg) \
for (size_t j = 0; j < len; ++j) { \
- if (x[j] != y[j]) { \
- LOG(LS_ERROR) << "" # x << " != " # y \
- << " byte " << j << " msg: " << msg; \
- } \
- }
+ if (x[j] != y[j]) { \
+ RTC_LOG(LS_ERROR) << "" #x << " != " #y << " byte " << j \
+ << " msg: " << msg; \
+ } \
+ }
size_t Base64Escape(const unsigned char *src, size_t szsrc, char *dest,
size_t szdest) {
@@ -351,7 +351,7 @@
}
TEST(Base64, EncodeDecodeBattery) {
- LOG(LS_VERBOSE) << "Testing base-64";
+ RTC_LOG(LS_VERBOSE) << "Testing base-64";
size_t i;
@@ -363,7 +363,7 @@
size_t decode_length;
size_t cypher_length;
- LOG(LS_VERBOSE) << "B64: " << base64_tests[i].cyphertext;
+ RTC_LOG(LS_VERBOSE) << "B64: " << base64_tests[i].cyphertext;
const unsigned char* unsigned_plaintext =
reinterpret_cast<const unsigned char*>(base64_tests[i].plaintext);
@@ -896,7 +896,7 @@
static std::string gCommandLine;
TEST(Base64, LargeSample) {
- LOG(LS_VERBOSE) << "Testing specific base64 file";
+ RTC_LOG(LS_VERBOSE) << "Testing specific base64 file";
char unescaped[64 * 1024];
diff --git a/rtc_base/checks.cc b/rtc_base/checks.cc
index 8f452e8..fc5c789 100644
--- a/rtc_base/checks.cc
+++ b/rtc_base/checks.cc
@@ -111,10 +111,11 @@
}
void FatalMessage::Init(const char* file, int line) {
- stream_ << std::endl << std::endl
+ stream_ << std::endl
+ << std::endl
<< "#" << std::endl
<< "# Fatal error in " << file << ", line " << line << std::endl
- << "# last system error: " << LAST_SYSTEM_ERROR << std::endl
+ << "# last system error: " << RTC_LAST_SYSTEM_ERROR << std::endl
<< "# ";
}
diff --git a/rtc_base/cpu_time.cc b/rtc_base/cpu_time.cc
index 3819e52..6c22880 100644
--- a/rtc_base/cpu_time.cc
+++ b/rtc_base/cpu_time.cc
@@ -41,7 +41,7 @@
if (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts) == 0) {
return ts.tv_sec * kNumNanosecsPerSec + ts.tv_nsec;
} else {
- LOG_ERR(LS_ERROR) << "clock_gettime() failed.";
+ RTC_LOG_ERR(LS_ERROR) << "clock_gettime() failed.";
}
#elif defined(WEBRTC_MAC)
struct rusage rusage;
@@ -49,7 +49,7 @@
return rusage.ru_utime.tv_sec * kNumNanosecsPerSec +
rusage.ru_utime.tv_usec * kNumNanosecsPerMicrosec;
} else {
- LOG_ERR(LS_ERROR) << "getrusage() failed.";
+ RTC_LOG_ERR(LS_ERROR) << "getrusage() failed.";
}
#elif defined(WEBRTC_WIN)
FILETIME createTime;
@@ -62,7 +62,7 @@
userTime.dwLowDateTime) *
kNanosecsPerFiletime;
} else {
- LOG_ERR(LS_ERROR) << "GetProcessTimes() failed.";
+ RTC_LOG_ERR(LS_ERROR) << "GetProcessTimes() failed.";
}
#else
// Not implemented yet.
@@ -78,7 +78,7 @@
if (clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts) == 0) {
return ts.tv_sec * kNumNanosecsPerSec + ts.tv_nsec;
} else {
- LOG_ERR(LS_ERROR) << "clock_gettime() failed.";
+ RTC_LOG_ERR(LS_ERROR) << "clock_gettime() failed.";
}
#elif defined(WEBRTC_MAC)
thread_basic_info_data_t info;
@@ -88,7 +88,7 @@
return info.user_time.seconds * kNumNanosecsPerSec +
info.user_time.microseconds * kNumNanosecsPerMicrosec;
} else {
- LOG_ERR(LS_ERROR) << "thread_info() failed.";
+ RTC_LOG_ERR(LS_ERROR) << "thread_info() failed.";
}
#elif defined(WEBRTC_WIN)
FILETIME createTime;
@@ -101,7 +101,7 @@
userTime.dwLowDateTime) *
kNanosecsPerFiletime;
} else {
- LOG_ERR(LS_ERROR) << "GetThreadTimes() failed.";
+ RTC_LOG_ERR(LS_ERROR) << "GetThreadTimes() failed.";
}
#else
// Not implemented yet.
diff --git a/rtc_base/event_tracer.cc b/rtc_base/event_tracer.cc
index 1b79786..9cbda97 100644
--- a/rtc_base/event_tracer.cc
+++ b/rtc_base/event_tracer.cc
@@ -385,8 +385,8 @@
FILE* file = fopen(filename, "w");
if (!file) {
- LOG(LS_ERROR) << "Failed to open trace file '" << filename
- << "' for writing.";
+ RTC_LOG(LS_ERROR) << "Failed to open trace file '" << filename
+ << "' for writing.";
return false;
}
g_event_logger->Start(file, true);
diff --git a/rtc_base/filerotatingstream.cc b/rtc_base/filerotatingstream.cc
index 3856155..4e3aa73 100644
--- a/rtc_base/filerotatingstream.cc
+++ b/rtc_base/filerotatingstream.cc
@@ -115,8 +115,9 @@
StreamResult result = file_stream_->Read(buffer, buffer_len, read, error);
if (result == SR_EOS || result == SR_ERROR) {
if (result == SR_ERROR) {
- LOG(LS_ERROR) << "Failed to read from: "
- << file_names_[current_file_index_] << "Error: " << error;
+ RTC_LOG(LS_ERROR) << "Failed to read from: "
+ << file_names_[current_file_index_]
+ << "Error: " << error;
}
// Reached the end of the file, read next file. If there is an error return
// the error status but allow for a next read by reading next file.
diff --git a/rtc_base/firewallsocketserver.cc b/rtc_base/firewallsocketserver.cc
index a8b0839..60f45ed 100644
--- a/rtc_base/firewallsocketserver.cc
+++ b/rtc_base/firewallsocketserver.cc
@@ -35,9 +35,9 @@
int Connect(const SocketAddress& addr) override {
if (type_ == SOCK_STREAM) {
if (!server_->Check(FP_TCP, GetLocalAddress(), addr)) {
- LOG(LS_VERBOSE) << "FirewallSocket outbound TCP connection from "
- << GetLocalAddress().ToSensitiveString() << " to "
- << addr.ToSensitiveString() << " denied";
+ RTC_LOG(LS_VERBOSE) << "FirewallSocket outbound TCP connection from "
+ << GetLocalAddress().ToSensitiveString() << " to "
+ << addr.ToSensitiveString() << " denied";
// TODO: Handle this asynchronously.
SetError(EHOSTUNREACH);
return SOCKET_ERROR;
@@ -52,9 +52,10 @@
RTC_DCHECK(type_ == SOCK_DGRAM || type_ == SOCK_STREAM);
FirewallProtocol protocol = (type_ == SOCK_DGRAM) ? FP_UDP : FP_TCP;
if (!server_->Check(protocol, GetLocalAddress(), addr)) {
- LOG(LS_VERBOSE) << "FirewallSocket outbound packet with type " << type_
- << " from " << GetLocalAddress().ToSensitiveString()
- << " to " << addr.ToSensitiveString() << " dropped";
+ RTC_LOG(LS_VERBOSE) << "FirewallSocket outbound packet with type "
+ << type_ << " from "
+ << GetLocalAddress().ToSensitiveString() << " to "
+ << addr.ToSensitiveString() << " dropped";
return static_cast<int>(cb);
}
return AsyncSocketAdapter::SendTo(pv, cb, addr);
@@ -74,9 +75,10 @@
return res;
if (server_->Check(FP_UDP, *paddr, GetLocalAddress()))
return res;
- LOG(LS_VERBOSE) << "FirewallSocket inbound UDP packet from "
- << paddr->ToSensitiveString() << " to "
- << GetLocalAddress().ToSensitiveString() << " dropped";
+ RTC_LOG(LS_VERBOSE)
+ << "FirewallSocket inbound UDP packet from "
+ << paddr->ToSensitiveString() << " to "
+ << GetLocalAddress().ToSensitiveString() << " dropped";
}
}
return AsyncSocketAdapter::RecvFrom(pv, cb, paddr, timestamp);
@@ -84,7 +86,7 @@
int Listen(int backlog) override {
if (!server_->tcp_listen_enabled()) {
- LOG(LS_VERBOSE) << "FirewallSocket listen attempt denied";
+ RTC_LOG(LS_VERBOSE) << "FirewallSocket listen attempt denied";
return -1;
}
@@ -100,9 +102,9 @@
}
sock->Close();
delete sock;
- LOG(LS_VERBOSE) << "FirewallSocket inbound TCP connection from "
- << addr.ToSensitiveString() << " to "
- << GetLocalAddress().ToSensitiveString() << " denied";
+ RTC_LOG(LS_VERBOSE) << "FirewallSocket inbound TCP connection from "
+ << addr.ToSensitiveString() << " to "
+ << GetLocalAddress().ToSensitiveString() << " denied";
}
return 0;
}
@@ -226,7 +228,7 @@
if (!sock ||
(type == SOCK_STREAM && !tcp_sockets_enabled_) ||
(type == SOCK_DGRAM && !udp_sockets_enabled_)) {
- LOG(LS_VERBOSE) << "FirewallSocketServer socket creation denied";
+ RTC_LOG(LS_VERBOSE) << "FirewallSocketServer socket creation denied";
delete sock;
return nullptr;
}
diff --git a/rtc_base/gunit.h b/rtc_base/gunit.h
index 333e85a..9ee3c72 100644
--- a/rtc_base/gunit.h
+++ b/rtc_base/gunit.h
@@ -83,19 +83,19 @@
// Version with a "soft" timeout and a margin. This logs if the timeout is
// exceeded, but it only fails if the expression still isn't true after the
// margin time passes.
-#define EXPECT_TRUE_WAIT_MARGIN(ex, timeout, margin) \
- GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
- if (bool res = true) { \
- WAIT_(ex, timeout, res); \
- if (res) \
- break; \
- LOG(LS_WARNING) << "Expression " << #ex << " still not true after " \
- << (timeout) << "ms; waiting an additional " << margin \
- << "ms"; \
- WAIT_(ex, margin, res); \
- if (!res) \
- goto GTEST_CONCAT_TOKEN_(gunit_label_, __LINE__); \
- } else \
+#define EXPECT_TRUE_WAIT_MARGIN(ex, timeout, margin) \
+ GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
+ if (bool res = true) { \
+ WAIT_(ex, timeout, res); \
+ if (res) \
+ break; \
+ RTC_LOG(LS_WARNING) << "Expression " << #ex << " still not true after " \
+ << (timeout) << "ms; waiting an additional " << margin \
+ << "ms"; \
+ WAIT_(ex, margin, res); \
+ if (!res) \
+ goto GTEST_CONCAT_TOKEN_(gunit_label_, __LINE__); \
+ } else \
GTEST_CONCAT_TOKEN_(gunit_label_, __LINE__) : EXPECT_TRUE(ex)
// Wait until "ex" is true, or "timeout" expires, using fake clock where
diff --git a/rtc_base/helpers.cc b/rtc_base/helpers.cc
index e62aaf8..b0c8856 100644
--- a/rtc_base/helpers.cc
+++ b/rtc_base/helpers.cc
@@ -110,7 +110,7 @@
bool InitRandom(const char* seed, size_t len) {
if (!Rng().Init(seed, len)) {
- LOG(LS_ERROR) << "Failed to init random generator!";
+ RTC_LOG(LS_ERROR) << "Failed to init random generator!";
return false;
}
return true;
@@ -128,12 +128,12 @@
str->clear();
// Avoid biased modulo division below.
if (256 % table_size) {
- LOG(LS_ERROR) << "Table size must divide 256 evenly!";
+ RTC_LOG(LS_ERROR) << "Table size must divide 256 evenly!";
return false;
}
std::unique_ptr<uint8_t[]> bytes(new uint8_t[len]);
if (!Rng().Generate(bytes.get(), len)) {
- LOG(LS_ERROR) << "Failed to generate random string!";
+ RTC_LOG(LS_ERROR) << "Failed to generate random string!";
return false;
}
str->reserve(len);
diff --git a/rtc_base/httpbase.cc b/rtc_base/httpbase.cc
index 9c5d1be..d28d800 100644
--- a/rtc_base/httpbase.cc
+++ b/rtc_base/httpbase.cc
@@ -84,7 +84,7 @@
len -= 1;
}
ProcessResult result = ProcessLine(line, len, error);
- LOG(LS_VERBOSE) << "Processed line, result=" << result;
+ RTC_LOG(LS_VERBOSE) << "Processed line, result=" << result;
if (PR_CONTINUE != result) {
return result;
@@ -106,8 +106,8 @@
size_t read = 0;
ProcessResult result = ProcessData(buffer + *processed, available, read,
error);
- LOG(LS_VERBOSE) << "Processed data, result: " << result << " read: "
- << read << " err: " << error;
+ RTC_LOG(LS_VERBOSE) << "Processed data, result: " << result
+ << " read: " << read << " err: " << error;
if (PR_CONTINUE != result) {
return result;
@@ -124,9 +124,9 @@
HttpParser::ProcessResult
HttpParser::ProcessLine(const char* line, size_t len, HttpError* error) {
- LOG_F(LS_VERBOSE) << " state: " << state_ << " line: "
- << std::string(line, len) << " len: " << len << " err: "
- << error;
+ RTC_LOG_F(LS_VERBOSE) << " state: " << state_
+ << " line: " << std::string(line, len)
+ << " len: " << len << " err: " << error;
switch (state_) {
case ST_LEADER:
@@ -494,7 +494,7 @@
} else if (error == SEC_E_CERT_EXPIRED) {
return HE_CERTIFICATE_EXPIRED;
}
- LOG_F(LS_ERROR) << "(" << error << ")";
+ RTC_LOG_F(LS_ERROR) << "(" << error << ")";
return (HM_CONNECT == mode_) ? HE_CONNECT_FAILED : HE_SOCKET_ERROR;
}
@@ -576,7 +576,7 @@
}
} while (++loop_count <= kMaxReadCount);
- LOG_F(LS_WARNING) << "danger of starvation";
+ RTC_LOG_F(LS_WARNING) << "danger of starvation";
return false;
}
@@ -668,7 +668,7 @@
// to be flushed to the network.
send_required = true;
} else {
- LOG_F(LS_ERROR) << "Read error: " << error;
+ RTC_LOG_F(LS_ERROR) << "Read error: " << error;
do_complete(HE_STREAM);
return;
}
@@ -699,7 +699,7 @@
}
} else {
RTC_DCHECK(result == SR_ERROR);
- LOG_F(LS_ERROR) << "error";
+ RTC_LOG_F(LS_ERROR) << "error";
OnHttpStreamEvent(http_stream_, SE_CLOSE, error);
return;
}
@@ -720,7 +720,8 @@
len_ += len;
++header_;
} else if (len_ == 0) {
- LOG(WARNING) << "discarding header that is too long: " << header_->first;
+ RTC_LOG(WARNING) << "discarding header that is too long: "
+ << header_->first;
++header_;
} else {
// Not enough room for the next header, write to network first.
@@ -806,7 +807,7 @@
}
if (events & SE_CLOSE) {
- LOG_F(LS_ERROR) << "Read error: " << error;
+ RTC_LOG_F(LS_ERROR) << "Read error: " << error;
do_complete(HE_STREAM);
return;
}
@@ -866,12 +867,12 @@
case SR_BLOCK:
return PR_BLOCK;
case SR_EOS:
- LOG_F(LS_ERROR) << "Unexpected EOS";
+ RTC_LOG_F(LS_ERROR) << "Unexpected EOS";
*error = HE_STREAM;
return PR_COMPLETE;
case SR_ERROR:
default:
- LOG_F(LS_ERROR) << "Write error: " << write_error;
+ RTC_LOG_F(LS_ERROR) << "Write error: " << write_error;
*error = HE_STREAM;
return PR_COMPLETE;
}
@@ -879,7 +880,7 @@
void
HttpBase::OnComplete(HttpError err) {
- LOG_F(LS_VERBOSE);
+ RTC_LOG_F(LS_VERBOSE);
do_complete(err);
}
diff --git a/rtc_base/httpbase_unittest.cc b/rtc_base/httpbase_unittest.cc
index 4c92f9b..1b7ab7f 100644
--- a/rtc_base/httpbase_unittest.cc
+++ b/rtc_base/httpbase_unittest.cc
@@ -63,7 +63,7 @@
}
HttpError onHttpHeaderComplete(bool chunked, size_t& data_size) override {
- LOG_F(LS_VERBOSE) << "chunked: " << chunked << " size: " << data_size;
+ RTC_LOG_F(LS_VERBOSE) << "chunked: " << chunked << " size: " << data_size;
Event e = { E_HEADER_COMPLETE, chunked, data_size, HM_NONE, HE_NONE};
events.push_back(e);
if (obtain_stream) {
@@ -72,12 +72,12 @@
return HE_NONE;
}
void onHttpComplete(HttpMode mode, HttpError err) override {
- LOG_F(LS_VERBOSE) << "mode: " << mode << " err: " << err;
+ RTC_LOG_F(LS_VERBOSE) << "mode: " << mode << " err: " << err;
Event e = { E_COMPLETE, false, 0, mode, err };
events.push_back(e);
}
void onHttpClosed(HttpError err) override {
- LOG_F(LS_VERBOSE) << "err: " << err;
+ RTC_LOG_F(LS_VERBOSE) << "err: " << err;
Event e = { E_CLOSED, false, 0, HM_NONE, err };
events.push_back(e);
}
@@ -115,7 +115,7 @@
};
void HttpBaseTest::SetupSource(const char* http_data) {
- LOG_F(LS_VERBOSE) << "Enter";
+ RTC_LOG_F(LS_VERBOSE) << "Enter";
src.SetState(SS_OPENING);
src.QueueString(http_data);
@@ -133,11 +133,11 @@
mem = new MemoryStream;
data.document.reset(mem);
- LOG_F(LS_VERBOSE) << "Exit";
+ RTC_LOG_F(LS_VERBOSE) << "Exit";
}
void HttpBaseTest::VerifyHeaderComplete(size_t event_count, bool empty_doc) {
- LOG_F(LS_VERBOSE) << "Enter";
+ RTC_LOG_F(LS_VERBOSE) << "Enter";
ASSERT_EQ(event_count, events.size());
EXPECT_EQ(E_HEADER_COMPLETE, events[0].event);
@@ -165,12 +165,12 @@
EXPECT_TRUE(data.hasHeader(HH_TRANSFER_ENCODING, &header));
EXPECT_EQ("chunked", header);
}
- LOG_F(LS_VERBOSE) << "Exit";
+ RTC_LOG_F(LS_VERBOSE) << "Exit";
}
void HttpBaseTest::VerifyDocumentContents(const char* expected_data,
size_t expected_length) {
- LOG_F(LS_VERBOSE) << "Enter";
+ RTC_LOG_F(LS_VERBOSE) << "Enter";
if (SIZE_UNKNOWN == expected_length) {
expected_length = strlen(expected_data);
@@ -181,20 +181,20 @@
mem->GetSize(&length);
EXPECT_EQ(expected_length, length);
EXPECT_TRUE(0 == memcmp(expected_data, mem->GetBuffer(), length));
- LOG_F(LS_VERBOSE) << "Exit";
+ RTC_LOG_F(LS_VERBOSE) << "Exit";
}
void HttpBaseTest::ObtainDocumentStream() {
- LOG_F(LS_VERBOSE) << "Enter";
+ RTC_LOG_F(LS_VERBOSE) << "Enter";
EXPECT_FALSE(http_stream);
http_stream = base.GetDocumentStream();
ASSERT_TRUE(nullptr != http_stream);
sink.Monitor(http_stream);
- LOG_F(LS_VERBOSE) << "Exit";
+ RTC_LOG_F(LS_VERBOSE) << "Exit";
}
void HttpBaseTest::VerifyDocumentStreamIsOpening() {
- LOG_F(LS_VERBOSE) << "Enter";
+ RTC_LOG_F(LS_VERBOSE) << "Enter";
ASSERT_TRUE(nullptr != http_stream);
EXPECT_EQ(0, sink.Events(http_stream));
EXPECT_EQ(SS_OPENING, http_stream->GetState());
@@ -203,11 +203,11 @@
char buffer[5] = { 0 };
EXPECT_EQ(SR_BLOCK,
http_stream->Read(buffer, sizeof(buffer), &read, nullptr));
- LOG_F(LS_VERBOSE) << "Exit";
+ RTC_LOG_F(LS_VERBOSE) << "Exit";
}
void HttpBaseTest::VerifyDocumentStreamOpenEvent() {
- LOG_F(LS_VERBOSE) << "Enter";
+ RTC_LOG_F(LS_VERBOSE) << "Enter";
ASSERT_TRUE(nullptr != http_stream);
EXPECT_EQ(SE_OPEN | SE_READ, sink.Events(http_stream));
@@ -216,11 +216,11 @@
// HTTP headers haven't arrived yet
EXPECT_EQ(0U, events.size());
EXPECT_EQ(static_cast<uint32_t>(HC_INTERNAL_SERVER_ERROR), data.scode);
- LOG_F(LS_VERBOSE) << "Exit";
+ RTC_LOG_F(LS_VERBOSE) << "Exit";
}
void HttpBaseTest::ReadDocumentStreamData(const char* expected_data) {
- LOG_F(LS_VERBOSE) << "Enter";
+ RTC_LOG_F(LS_VERBOSE) << "Enter";
ASSERT_TRUE(nullptr != http_stream);
EXPECT_EQ(SS_OPEN, http_stream->GetState());
@@ -239,11 +239,11 @@
EXPECT_TRUE(0 == memcmp(expected_data + verified_length, buffer, read));
verified_length += read;
}
- LOG_F(LS_VERBOSE) << "Exit";
+ RTC_LOG_F(LS_VERBOSE) << "Exit";
}
void HttpBaseTest::VerifyDocumentStreamIsEOS() {
- LOG_F(LS_VERBOSE) << "Enter";
+ RTC_LOG_F(LS_VERBOSE) << "Enter";
ASSERT_TRUE(nullptr != http_stream);
size_t read = 0;
@@ -253,11 +253,11 @@
// When EOS is caused by Read, we don't expect SE_CLOSE
EXPECT_EQ(0, sink.Events(http_stream));
- LOG_F(LS_VERBOSE) << "Exit";
+ RTC_LOG_F(LS_VERBOSE) << "Exit";
}
void HttpBaseTest::SetupDocument(const char* document_data) {
- LOG_F(LS_VERBOSE) << "Enter";
+ RTC_LOG_F(LS_VERBOSE) << "Enter";
src.SetState(SS_OPEN);
base.notify(this);
@@ -277,30 +277,30 @@
data.scode = HC_OK;
data.setHeader(HH_PROXY_AUTHORIZATION, "42");
data.setHeader(HH_CONNECTION, "Keep-Alive");
- LOG_F(LS_VERBOSE) << "Exit";
+ RTC_LOG_F(LS_VERBOSE) << "Exit";
}
void HttpBaseTest::VerifySourceContents(const char* expected_data,
size_t expected_length) {
- LOG_F(LS_VERBOSE) << "Enter";
+ RTC_LOG_F(LS_VERBOSE) << "Enter";
if (SIZE_UNKNOWN == expected_length) {
expected_length = strlen(expected_data);
}
std::string contents = src.ReadData();
EXPECT_EQ(expected_length, contents.length());
EXPECT_TRUE(0 == memcmp(expected_data, contents.data(), expected_length));
- LOG_F(LS_VERBOSE) << "Exit";
+ RTC_LOG_F(LS_VERBOSE) << "Exit";
}
void HttpBaseTest::VerifyTransferComplete(HttpMode mode, HttpError error) {
- LOG_F(LS_VERBOSE) << "Enter";
+ RTC_LOG_F(LS_VERBOSE) << "Enter";
// Verify that http operation has completed
ASSERT_TRUE(events.size() > 0);
size_t last_event = events.size() - 1;
EXPECT_EQ(E_COMPLETE, events[last_event].event);
EXPECT_EQ(mode, events[last_event].mode);
EXPECT_EQ(error, events[last_event].err);
- LOG_F(LS_VERBOSE) << "Exit";
+ RTC_LOG_F(LS_VERBOSE) << "Exit";
}
//
diff --git a/rtc_base/httpcommon.cc b/rtc_base/httpcommon.cc
index b2e4869..7667faf 100644
--- a/rtc_base/httpcommon.cc
+++ b/rtc_base/httpcommon.cc
@@ -652,7 +652,7 @@
// This server's response has no version. :( NOTE: This happens for every
// response to requests made from Chrome plugins, regardless of the server's
// behaviour.
- LOG(LS_VERBOSE) << "HTTP version missing from response";
+ RTC_LOG(LS_VERBOSE) << "HTTP version missing from response";
version = HVER_UNKNOWN;
} else if ((sscanf(line, "HTTP/%u.%u %u%n",
&vmajor, &vminor, &temp_scode, &temp_pos) == 3)
@@ -828,7 +828,7 @@
if (DsMakeSpn("HTTP", server.HostAsURIString().c_str(), nullptr,
server.port(),
0, &len, spn) != ERROR_SUCCESS) {
- LOG_F(WARNING) << "(Negotiate) - DsMakeSpn failed";
+ RTC_LOG_F(WARNING) << "(Negotiate) - DsMakeSpn failed";
return HAR_IGNORE;
}
#else
@@ -869,7 +869,8 @@
if (neg) {
const size_t max_steps = 10;
if (++neg->steps >= max_steps) {
- LOG(WARNING) << "AsyncHttpsProxySocket::Authenticate(Negotiate) too many retries";
+ RTC_LOG(WARNING) << "AsyncHttpsProxySocket::Authenticate(Negotiate) "
+ "too many retries";
return HAR_ERROR;
}
steps = neg->steps;
@@ -889,10 +890,11 @@
in_buf_desc.pBuffers = &in_sec;
ret = InitializeSecurityContextA(&neg->cred, &neg->ctx, spn, flags, 0, SECURITY_NATIVE_DREP, &in_buf_desc, 0, &neg->ctx, &out_buf_desc, &ret_flags, &lifetime);
- //LOG(INFO) << "$$$ InitializeSecurityContext @ " << TimeSince(now);
+ // RTC_LOG(INFO) << "$$$ InitializeSecurityContext @ " <<
+ // TimeSince(now);
if (FAILED(ret)) {
- LOG(LS_ERROR) << "InitializeSecurityContext returned: "
- << ErrorName(ret, SECURITY_ERRORS);
+ RTC_LOG(LS_ERROR) << "InitializeSecurityContext returned: "
+ << ErrorName(ret, SECURITY_ERRORS);
return HAR_ERROR;
}
} else if (neg->specified_credentials) {
@@ -946,19 +948,20 @@
auth_id.Password = passbuf;
auth_id.Flags = SEC_WINNT_AUTH_IDENTITY_ANSI;
pauth_id = &auth_id;
- LOG(LS_VERBOSE) << "Negotiate protocol: Using specified credentials";
+ RTC_LOG(LS_VERBOSE)
+ << "Negotiate protocol: Using specified credentials";
} else {
- LOG(LS_VERBOSE) << "Negotiate protocol: Using default credentials";
+ RTC_LOG(LS_VERBOSE) << "Negotiate protocol: Using default credentials";
}
CredHandle cred;
ret = AcquireCredentialsHandleA(
0, const_cast<char*>(want_negotiate ? NEGOSSP_NAME_A : NTLMSP_NAME_A),
SECPKG_CRED_OUTBOUND, 0, pauth_id, 0, 0, &cred, &lifetime);
- //LOG(INFO) << "$$$ AcquireCredentialsHandle @ " << TimeSince(now);
+ // RTC_LOG(INFO) << "$$$ AcquireCredentialsHandle @ " << TimeSince(now);
if (ret != SEC_E_OK) {
- LOG(LS_ERROR) << "AcquireCredentialsHandle error: "
- << ErrorName(ret, SECURITY_ERRORS);
+ RTC_LOG(LS_ERROR) << "AcquireCredentialsHandle error: "
+ << ErrorName(ret, SECURITY_ERRORS);
return HAR_IGNORE;
}
@@ -966,10 +969,10 @@
CtxtHandle ctx;
ret = InitializeSecurityContextA(&cred, 0, spn, flags, 0, SECURITY_NATIVE_DREP, 0, 0, &ctx, &out_buf_desc, &ret_flags, &lifetime);
- //LOG(INFO) << "$$$ InitializeSecurityContext @ " << TimeSince(now);
+ // RTC_LOG(INFO) << "$$$ InitializeSecurityContext @ " << TimeSince(now);
if (FAILED(ret)) {
- LOG(LS_ERROR) << "InitializeSecurityContext returned: "
- << ErrorName(ret, SECURITY_ERRORS);
+ RTC_LOG(LS_ERROR) << "InitializeSecurityContext returned: "
+ << ErrorName(ret, SECURITY_ERRORS);
FreeCredentialsHandle(&cred);
return HAR_IGNORE;
}
@@ -982,15 +985,15 @@
if ((ret == SEC_I_COMPLETE_NEEDED) || (ret == SEC_I_COMPLETE_AND_CONTINUE)) {
ret = CompleteAuthToken(&neg->ctx, &out_buf_desc);
- //LOG(INFO) << "$$$ CompleteAuthToken @ " << TimeSince(now);
- LOG(LS_VERBOSE) << "CompleteAuthToken returned: "
- << ErrorName(ret, SECURITY_ERRORS);
+ // RTC_LOG(INFO) << "$$$ CompleteAuthToken @ " << TimeSince(now);
+ RTC_LOG(LS_VERBOSE) << "CompleteAuthToken returned: "
+ << ErrorName(ret, SECURITY_ERRORS);
if (FAILED(ret)) {
return HAR_ERROR;
}
}
- //LOG(INFO) << "$$$ NEGOTIATE took " << TimeSince(now) << "ms";
+ // RTC_LOG(INFO) << "$$$ NEGOTIATE took " << TimeSince(now) << "ms";
std::string decoded(out_buf, out_buf + out_sec.cbBuffer);
response = auth_method;
diff --git a/rtc_base/httpserver.cc b/rtc_base/httpserver.cc
index 3f04b8f..9d5a890 100644
--- a/rtc_base/httpserver.cc
+++ b/rtc_base/httpserver.cc
@@ -30,7 +30,7 @@
HttpServer::~HttpServer() {
if (closing_) {
- LOG(LS_WARNING) << "HttpServer::CloseAll has not completed";
+ RTC_LOG(LS_WARNING) << "HttpServer::CloseAll has not completed";
}
for (ConnectionMap::iterator it = connections_.begin();
it != connections_.end();
diff --git a/rtc_base/java/src/org/webrtc/Logging.java b/rtc_base/java/src/org/webrtc/Logging.java
index fdde0bc..1e1b3d8 100644
--- a/rtc_base/java/src/org/webrtc/Logging.java
+++ b/rtc_base/java/src/org/webrtc/Logging.java
@@ -103,7 +103,7 @@
// Enable diagnostic logging for messages of |severity| to the platform debug
// output. On Android, the output will be directed to Logcat.
- // Note: this function starts collecting the output of the LOG() macros.
+ // Note: this function starts collecting the output of the RTC_LOG() macros.
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
@SuppressWarnings("NoSynchronizedMethodCheck")
public static synchronized void enableLogToDebugOutput(Severity severity) {
diff --git a/rtc_base/logging.cc b/rtc_base/logging.cc
index b853d7c..7ceb279 100644
--- a/rtc_base/logging.cc
+++ b/rtc_base/logging.cc
@@ -443,7 +443,7 @@
void LogMultiline(LoggingSeverity level, const char* label, bool input,
const void* data, size_t len, bool hex_mode,
LogMultilineState* state) {
- if (!LOG_CHECK_LEVEL_V(level))
+ if (!RTC_LOG_CHECK_LEVEL_V(level))
return;
const char * direction = (input ? " << " : " >> ");
@@ -451,9 +451,9 @@
// null data means to flush our count of unprintable characters.
if (!data) {
if (state && state->unprintable_count_[input]) {
- LOG_V(level) << label << direction << "## "
- << state->unprintable_count_[input]
- << " consecutive unprintable ##";
+ RTC_LOG_V(level) << label << direction << "## "
+ << state->unprintable_count_[input]
+ << " consecutive unprintable ##";
state->unprintable_count_[input] = 0;
}
return;
@@ -477,8 +477,8 @@
}
asc_line[sizeof(asc_line)-1] = 0;
hex_line[sizeof(hex_line)-1] = 0;
- LOG_V(level) << label << direction
- << asc_line << " " << hex_line << " ";
+ RTC_LOG_V(level) << label << direction << asc_line << " " << hex_line
+ << " ";
udata += line_len;
len -= line_len;
}
@@ -531,8 +531,8 @@
// Print out the current line, but prefix with a count of prior unprintable
// characters.
if (consecutive_unprintable) {
- LOG_V(level) << label << direction << "## " << consecutive_unprintable
- << " consecutive unprintable ##";
+ RTC_LOG_V(level) << label << direction << "## " << consecutive_unprintable
+ << " consecutive unprintable ##";
consecutive_unprintable = 0;
}
// Strip off trailing whitespace.
@@ -546,9 +546,9 @@
pos_private = substr.find("Passwd");
}
if (pos_private == std::string::npos) {
- LOG_V(level) << label << direction << substr;
+ RTC_LOG_V(level) << label << direction << substr;
} else {
- LOG_V(level) << label << direction << "## omitted for privacy ##";
+ RTC_LOG_V(level) << label << direction << "## omitted for privacy ##";
}
}
diff --git a/rtc_base/logging_unittest.cc b/rtc_base/logging_unittest.cc
index cd5cafe..a2d35fd 100644
--- a/rtc_base/logging_unittest.cc
+++ b/rtc_base/logging_unittest.cc
@@ -44,8 +44,8 @@
LogMessage::AddLogToStream(&stream, LS_INFO);
EXPECT_EQ(LS_INFO, LogMessage::GetLogToStream(&stream));
- LOG(LS_INFO) << "INFO";
- LOG(LS_VERBOSE) << "VERBOSE";
+ RTC_LOG(LS_INFO) << "INFO";
+ RTC_LOG(LS_VERBOSE) << "VERBOSE";
EXPECT_NE(std::string::npos, str.find("INFO"));
EXPECT_EQ(std::string::npos, str.find("VERBOSE"));
@@ -68,8 +68,8 @@
EXPECT_EQ(LS_INFO, LogMessage::GetLogToStream(&stream1));
EXPECT_EQ(LS_VERBOSE, LogMessage::GetLogToStream(&stream2));
- LOG(LS_INFO) << "INFO";
- LOG(LS_VERBOSE) << "VERBOSE";
+ RTC_LOG(LS_INFO) << "INFO";
+ RTC_LOG(LS_VERBOSE) << "VERBOSE";
EXPECT_NE(std::string::npos, str1.find("INFO"));
EXPECT_EQ(std::string::npos, str1.find("VERBOSE"));
@@ -97,7 +97,7 @@
private:
void Run() override {
// LS_SENSITIVE to avoid cluttering up any real logging going on
- LOG(LS_SENSITIVE) << "LOG";
+ RTC_LOG(LS_SENSITIVE) << "RTC_LOG";
}
};
@@ -149,7 +149,7 @@
int64_t start = TimeMillis(), finish;
std::string message('X', 80);
for (int i = 0; i < 1000; ++i) {
- LOG(LS_SENSITIVE) << message;
+ RTC_LOG(LS_SENSITIVE) << message;
}
finish = TimeMillis();
@@ -157,7 +157,7 @@
stream.Close();
webrtc::test::RemoveFile(path);
- LOG(LS_INFO) << "Average log time: " << TimeDiff(finish, start) << " ms";
+ RTC_LOG(LS_INFO) << "Average log time: " << TimeDiff(finish, start) << " ms";
}
} // namespace rtc
diff --git a/rtc_base/macifaddrs_converter.cc b/rtc_base/macifaddrs_converter.cc
index f3b22bb..254be9b 100644
--- a/rtc_base/macifaddrs_converter.cc
+++ b/rtc_base/macifaddrs_converter.cc
@@ -220,7 +220,7 @@
if (rv >= 0) {
*native_attributes = ifr.ifr_ifru.ifru_flags;
} else {
- LOG(LS_ERROR) << "ioctl returns " << errno;
+ RTC_LOG(LS_ERROR) << "ioctl returns " << errno;
}
return (rv >= 0);
}
diff --git a/rtc_base/memory_usage.cc b/rtc_base/memory_usage.cc
index c7c361b..41b27ed 100644
--- a/rtc_base/memory_usage.cc
+++ b/rtc_base/memory_usage.cc
@@ -30,13 +30,13 @@
#if defined(WEBRTC_LINUX)
FILE* file = fopen("/proc/self/statm", "r");
if (file == nullptr) {
- LOG(LS_ERROR) << "Failed to open /proc/self/statm";
+ RTC_LOG(LS_ERROR) << "Failed to open /proc/self/statm";
return -1;
}
int result = -1;
if (fscanf(file, "%*s%d", &result) != 1) {
fclose(file);
- LOG(LS_ERROR) << "Failed to parse /proc/self/statm";
+ RTC_LOG(LS_ERROR) << "Failed to parse /proc/self/statm";
return -1;
}
fclose(file);
@@ -47,14 +47,14 @@
if (task_info(mach_task_self(), TASK_BASIC_INFO_64,
reinterpret_cast<task_info_t>(&info),
&info_count) != KERN_SUCCESS) {
- LOG_ERR(LS_ERROR) << "task_info() failed";
+ RTC_LOG_ERR(LS_ERROR) << "task_info() failed";
return -1;
}
return info.resident_size;
#elif defined(WEBRTC_WIN)
PROCESS_MEMORY_COUNTERS pmc;
if (GetProcessMemoryInfo(GetCurrentProcess(), &pmc, sizeof(pmc)) == 0) {
- LOG_ERR(LS_ERROR) << "GetProcessMemoryInfo() failed";
+ RTC_LOG_ERR(LS_ERROR) << "GetProcessMemoryInfo() failed";
return -1;
}
return pmc.WorkingSetSize;
diff --git a/rtc_base/messagequeue.cc b/rtc_base/messagequeue.cc
index f863d0c..001d3ed 100644
--- a/rtc_base/messagequeue.cc
+++ b/rtc_base/messagequeue.cc
@@ -320,8 +320,9 @@
if (pmsg->ts_sensitive) {
int64_t delay = TimeDiff(msCurrent, pmsg->ts_sensitive);
if (delay > 0) {
- LOG_F(LS_WARNING) << "id: " << pmsg->message_id << " delay: "
- << (delay + kMaxMsgLatency) << "ms";
+ RTC_LOG_F(LS_WARNING)
+ << "id: " << pmsg->message_id
+ << " delay: " << (delay + kMaxMsgLatency) << "ms";
}
}
// If this was a dispose message, delete it and skip it.
@@ -531,8 +532,9 @@
int64_t end_time = TimeMillis();
int64_t diff = TimeDiff(end_time, start_time);
if (diff >= kSlowDispatchLoggingThreshold) {
- LOG(LS_INFO) << "Message took " << diff << "ms to dispatch. Posted from: "
- << pmsg->posted_from.ToString();
+ RTC_LOG(LS_INFO) << "Message took " << diff
+ << "ms to dispatch. Posted from: "
+ << pmsg->posted_from.ToString();
}
}
diff --git a/rtc_base/messagequeue_unittest.cc b/rtc_base/messagequeue_unittest.cc
index aa94962..9e1ba63 100644
--- a/rtc_base/messagequeue_unittest.cc
+++ b/rtc_base/messagequeue_unittest.cc
@@ -134,9 +134,10 @@
TEST(MessageQueueManager, Clear) {
UnwrapMainThreadScope s;
if (MessageQueueManager::IsInitialized()) {
- LOG(LS_INFO) << "Unable to run MessageQueueManager::Clear test, since the "
- << "MessageQueueManager was already initialized by some "
- << "other test in this run.";
+ RTC_LOG(LS_INFO)
+ << "Unable to run MessageQueueManager::Clear test, since the "
+ << "MessageQueueManager was already initialized by some "
+ << "other test in this run.";
return;
}
bool deleted = false;
diff --git a/rtc_base/nat_unittest.cc b/rtc_base/nat_unittest.cc
index 592fea4..d68df1d 100644
--- a/rtc_base/nat_unittest.cc
+++ b/rtc_base/nat_unittest.cc
@@ -215,7 +215,7 @@
}),
networks.end());
if (networks.empty()) {
- LOG(LS_WARNING) << "Not enough network adapters for test.";
+ RTC_LOG(LS_WARNING) << "Not enough network adapters for test.";
return;
}
@@ -232,11 +232,11 @@
}
}
if (ext_addr2.IsNil()) {
- LOG(LS_WARNING) << "No available IP of same family as " << int_addr;
+ RTC_LOG(LS_WARNING) << "No available IP of same family as " << int_addr;
return;
}
- LOG(LS_INFO) << "selected ip " << ext_addr2.ipaddr();
+ RTC_LOG(LS_INFO) << "selected ip " << ext_addr2.ipaddr();
SocketAddress ext_addrs[4] = {
SocketAddress(ext_addr1),
@@ -260,7 +260,7 @@
if (HasIPv6Enabled()) {
TestPhysicalInternal(SocketAddress("::1", 0));
} else {
- LOG(LS_WARNING) << "No IPv6, skipping";
+ RTC_LOG(LS_WARNING) << "No IPv6, skipping";
}
}
@@ -300,7 +300,7 @@
if (HasIPv6Enabled()) {
TestVirtualInternal(AF_INET6);
} else {
- LOG(LS_WARNING) << "No IPv6, skipping";
+ RTC_LOG(LS_WARNING) << "No IPv6, skipping";
}
}
diff --git a/rtc_base/natserver.cc b/rtc_base/natserver.cc
index 59bca4f..bf983fe 100644
--- a/rtc_base/natserver.cc
+++ b/rtc_base/natserver.cc
@@ -191,8 +191,8 @@
// Allow the NAT to reject this packet.
if (ShouldFilterOut(iter->second, remote_addr)) {
- LOG(LS_INFO) << "Packet from " << remote_addr.ToSensitiveString()
- << " was filtered out by the NAT.";
+ RTC_LOG(LS_INFO) << "Packet from " << remote_addr.ToSensitiveString()
+ << " was filtered out by the NAT.";
return;
}
@@ -213,7 +213,7 @@
AsyncUDPSocket* socket = AsyncUDPSocket::Create(external_, external_ip_);
if (!socket) {
- LOG(LS_ERROR) << "Couldn't find a free port!";
+ RTC_LOG(LS_ERROR) << "Couldn't find a free port!";
return;
}
diff --git a/rtc_base/natsocketfactory.cc b/rtc_base/natsocketfactory.cc
index dbcba97..dd4c030 100644
--- a/rtc_base/natsocketfactory.cc
+++ b/rtc_base/natsocketfactory.cc
@@ -189,8 +189,8 @@
*out_addr = real_remote_addr;
result = result - static_cast<int>(addrlength);
} else {
- LOG(LS_ERROR) << "Dropping packet from unknown remote address: "
- << real_remote_addr.ToString();
+ RTC_LOG(LS_ERROR) << "Dropping packet from unknown remote address: "
+ << real_remote_addr.ToString();
result = 0; // Tell the caller we didn't read anything
}
}
diff --git a/rtc_base/nethelpers.cc b/rtc_base/nethelpers.cc
index 673af0b..4702de7 100644
--- a/rtc_base/nethelpers.cc
+++ b/rtc_base/nethelpers.cc
@@ -36,7 +36,7 @@
std::vector<IPAddress>* addresses) {
#ifdef __native_client__
RTC_NOTREACHED();
- LOG(LS_WARNING) << "ResolveHostname() is not implemented for NaCl";
+ RTC_LOG(LS_WARNING) << "ResolveHostname() is not implemented for NaCl";
return -1;
#else // __native_client__
if (!addresses) {
diff --git a/rtc_base/network.cc b/rtc_base/network.cc
index bfe0fce..56d7299 100644
--- a/rtc_base/network.cc
+++ b/rtc_base/network.cc
@@ -324,7 +324,7 @@
if (pref > 0) {
--pref;
} else {
- LOG(LS_ERROR) << "Too many network interfaces to handle!";
+ RTC_LOG(LS_ERROR) << "Too many network interfaces to handle!";
break;
}
}
@@ -385,7 +385,7 @@
}
void BasicNetworkManager::OnNetworksChanged() {
- LOG(LS_INFO) << "Network change was observed";
+ RTC_LOG(LS_INFO) << "Network change was observed";
UpdateNetworksOnce();
}
@@ -394,7 +394,7 @@
bool BasicNetworkManager::CreateNetworks(bool include_ignored,
NetworkList* networks) const {
RTC_NOTREACHED();
- LOG(LS_WARNING) << "BasicNetworkManager doesn't work on NaCl yet";
+ RTC_LOG(LS_WARNING) << "BasicNetworkManager doesn't work on NaCl yet";
return false;
}
@@ -482,7 +482,8 @@
struct ifaddrs* interfaces;
int error = getifaddrs(&interfaces);
if (error != 0) {
- LOG_ERR(LERROR) << "getifaddrs failed to gather interface data: " << error;
+ RTC_LOG_ERR(LERROR) << "getifaddrs failed to gather interface data: "
+ << error;
return false;
}
@@ -646,8 +647,9 @@
bool IsDefaultRoute(const std::string& network_name) {
FileStream fs;
if (!fs.Open("/proc/net/route", "r", nullptr)) {
- LOG(LS_WARNING) << "Couldn't read /proc/net/route, skipping default "
- << "route check (assuming everything is a default route).";
+ RTC_LOG(LS_WARNING)
+ << "Couldn't read /proc/net/route, skipping default "
+ << "route check (assuming everything is a default route).";
return true;
} else {
std::string line;
@@ -821,7 +823,7 @@
std::unique_ptr<AsyncSocket> socket(
thread_->socketserver()->CreateAsyncSocket(family, SOCK_DGRAM));
if (!socket) {
- LOG_ERR(LERROR) << "Socket creation failed";
+ RTC_LOG_ERR(LERROR) << "Socket creation failed";
return IPAddress();
}
@@ -832,7 +834,7 @@
&& socket->GetError() != EHOSTUNREACH) {
// Ignore the expected case of "host/net unreachable" - which happens if
// the network is V4- or V6-only.
- LOG(LS_INFO) << "Connect failed with " << socket->GetError();
+ RTC_LOG(LS_INFO) << "Connect failed with " << socket->GetError();
}
return IPAddress();
}
@@ -870,11 +872,11 @@
void BasicNetworkManager::DumpNetworks() {
NetworkList list;
GetNetworks(&list);
- LOG(LS_INFO) << "NetworkManager detected " << list.size() << " networks:";
+ RTC_LOG(LS_INFO) << "NetworkManager detected " << list.size() << " networks:";
for (const Network* network : list) {
- LOG(LS_INFO) << network->ToString() << ": " << network->description()
- << ", active ? " << network->active()
- << ((network->ignored()) ? ", Ignored" : "");
+ RTC_LOG(LS_INFO) << network->ToString() << ": " << network->description()
+ << ", active ? " << network->active()
+ << ((network->ignored()) ? ", Ignored" : "");
}
}
diff --git a/rtc_base/network_unittest.cc b/rtc_base/network_unittest.cc
index 49b5e04..bf09c24 100644
--- a/rtc_base/network_unittest.cc
+++ b/rtc_base/network_unittest.cc
@@ -25,7 +25,7 @@
#endif // defined(WEBRTC_POSIX)
#include "rtc_base/gunit.h"
#if defined(WEBRTC_WIN)
-#include "rtc_base/logging.h" // For LOG_GLE
+#include "rtc_base/logging.h" // For RTC_LOG_GLE
#endif
namespace rtc {
@@ -250,7 +250,8 @@
reinterpret_cast<sockaddr*>(&storage),
static_cast<int>(ipsize));
#if defined(WEBRTC_WIN)
- if (success) LOG_GLE(LS_ERROR) << "Socket bind failed.";
+ if (success)
+ RTC_LOG_GLE(LS_ERROR) << "Socket bind failed.";
#endif
EXPECT_EQ(0, success);
#if defined(WEBRTC_WIN)
@@ -899,10 +900,10 @@
NetworkManager::NetworkList list;
list = GetNetworks(manager, false);
bool found_dummy = false;
- LOG(LS_INFO) << "Looking for dummy network: ";
+ RTC_LOG(LS_INFO) << "Looking for dummy network: ";
for (NetworkManager::NetworkList::iterator it = list.begin();
it != list.end(); ++it) {
- LOG(LS_INFO) << " Network name: " << (*it)->name();
+ RTC_LOG(LS_INFO) << " Network name: " << (*it)->name();
found_dummy |= (*it)->name().find("dummy0") != std::string::npos;
}
for (NetworkManager::NetworkList::iterator it = list.begin();
@@ -910,16 +911,16 @@
delete (*it);
}
if (!found_dummy) {
- LOG(LS_INFO) << "No dummy found, quitting.";
+ RTC_LOG(LS_INFO) << "No dummy found, quitting.";
return;
}
- LOG(LS_INFO) << "Found dummy, running again while ignoring non-default "
- << "routes.";
+ RTC_LOG(LS_INFO) << "Found dummy, running again while ignoring non-default "
+ << "routes.";
manager.set_ignore_non_default_routes(true);
list = GetNetworks(manager, false);
for (NetworkManager::NetworkList::iterator it = list.begin();
it != list.end(); ++it) {
- LOG(LS_INFO) << " Network name: " << (*it)->name();
+ RTC_LOG(LS_INFO) << " Network name: " << (*it)->name();
EXPECT_TRUE((*it)->name().find("dummy0") == std::string::npos);
}
for (NetworkManager::NetworkList::iterator it = list.begin();
diff --git a/rtc_base/networkmonitor.cc b/rtc_base/networkmonitor.cc
index 6a81e93..0272951 100644
--- a/rtc_base/networkmonitor.cc
+++ b/rtc_base/networkmonitor.cc
@@ -30,7 +30,7 @@
NetworkMonitorBase::~NetworkMonitorBase() {}
void NetworkMonitorBase::OnNetworksChanged() {
- LOG(LS_VERBOSE) << "Network change is received at the network monitor";
+ RTC_LOG(LS_VERBOSE) << "Network change is received at the network monitor";
worker_thread_->Post(RTC_FROM_HERE, this, UPDATE_NETWORKS_MESSAGE);
}
diff --git a/rtc_base/onetimeevent.h b/rtc_base/onetimeevent.h
index 7ef0376..8c55e26 100644
--- a/rtc_base/onetimeevent.h
+++ b/rtc_base/onetimeevent.h
@@ -21,7 +21,7 @@
// OneTimeEvent firstFrame;
// ...
// if (firstFrame()) {
-// LOG(LS_INFO) << "This is the first frame".
+// RTC_LOG(LS_INFO) << "This is the first frame".
// }
class OneTimeEvent {
public:
diff --git a/rtc_base/openssladapter.cc b/rtc_base/openssladapter.cc
index f0ecf09..a5ef0fe 100644
--- a/rtc_base/openssladapter.cc
+++ b/rtc_base/openssladapter.cc
@@ -163,8 +163,8 @@
do {
error_code = ERR_get_error_line(&file, &line);
if (ERR_GET_LIB(error_code) == ERR_LIB_SSL) {
- LOG(LS_ERROR) << "ERR_LIB_SSL: " << error_code << ", " << file << ":"
- << line;
+ RTC_LOG(LS_ERROR) << "ERR_LIB_SSL: " << error_code << ", " << file << ":"
+ << line;
break;
}
} while (error_code != 0);
@@ -368,7 +368,7 @@
}
int OpenSSLAdapter::BeginSSL() {
- LOG(LS_INFO) << "OpenSSLAdapter::BeginSSL: " << ssl_host_name_;
+ RTC_LOG(LS_INFO) << "OpenSSLAdapter::BeginSSL: " << ssl_host_name_;
RTC_DCHECK(state_ == SSL_CONNECTING);
int err = 0;
@@ -426,13 +426,13 @@
SSL_SESSION* cached = factory_->LookupSession(ssl_host_name_);
if (cached) {
if (SSL_set_session(ssl_, cached) == 0) {
- LOG(LS_WARNING) << "Failed to apply SSL session from cache";
+ RTC_LOG(LS_WARNING) << "Failed to apply SSL session from cache";
err = -1;
goto ssl_error;
}
- LOG(LS_INFO) << "Attempting to resume SSL session to "
- << ssl_host_name_;
+ RTC_LOG(LS_INFO) << "Attempting to resume SSL session to "
+ << ssl_host_name_;
}
}
}
@@ -484,7 +484,7 @@
switch (SSL_get_error(ssl_, code)) {
case SSL_ERROR_NONE:
if (!SSLPostConnectionCheck(ssl_, ssl_host_name_.c_str())) {
- LOG(LS_ERROR) << "TLS post connection check failed";
+ RTC_LOG(LS_ERROR) << "TLS post connection check failed";
// make sure we close the socket
Cleanup();
// The connect failed so return -1 to shut down the socket
@@ -496,15 +496,15 @@
#if 0 // TODO: worry about this
// Don't let ourselves go away during the callbacks
PRefPtr<OpenSSLAdapter> lock(this);
- LOG(LS_INFO) << " -- onStreamReadable";
+ RTC_LOG(LS_INFO) << " -- onStreamReadable";
AsyncSocketAdapter::OnReadEvent(this);
- LOG(LS_INFO) << " -- onStreamWriteable";
+ RTC_LOG(LS_INFO) << " -- onStreamWriteable";
AsyncSocketAdapter::OnWriteEvent(this);
#endif
break;
case SSL_ERROR_WANT_READ:
- LOG(LS_VERBOSE) << " -- error want read";
+ RTC_LOG(LS_VERBOSE) << " -- error want read";
struct timeval timeout;
if (DTLSv1_get_timeout(ssl_, &timeout)) {
int delay = timeout.tv_sec * 1000 + timeout.tv_usec/1000;
@@ -519,7 +519,7 @@
case SSL_ERROR_ZERO_RETURN:
default:
- LOG(LS_WARNING) << "ContinueSSL -- error " << code;
+ RTC_LOG(LS_WARNING) << "ContinueSSL -- error " << code;
return (code != 0) ? code : -1;
}
@@ -527,8 +527,8 @@
}
void OpenSSLAdapter::Error(const char* context, int err, bool signal) {
- LOG(LS_WARNING) << "OpenSSLAdapter::Error("
- << context << ", " << err << ")";
+ RTC_LOG(LS_WARNING) << "OpenSSLAdapter::Error(" << context << ", " << err
+ << ")";
state_ = SSL_ERROR;
SetError(err);
if (signal)
@@ -536,7 +536,7 @@
}
void OpenSSLAdapter::Cleanup() {
- LOG(LS_INFO) << "OpenSSLAdapter::Cleanup";
+ RTC_LOG(LS_INFO) << "OpenSSLAdapter::Cleanup";
state_ = SSL_NONE;
ssl_read_needs_write_ = false;
@@ -573,16 +573,16 @@
// Success!
return ret;
case SSL_ERROR_WANT_READ:
- LOG(LS_INFO) << " -- error want read";
+ RTC_LOG(LS_INFO) << " -- error want read";
ssl_write_needs_read_ = true;
SetError(EWOULDBLOCK);
break;
case SSL_ERROR_WANT_WRITE:
- LOG(LS_INFO) << " -- error want write";
+ RTC_LOG(LS_INFO) << " -- error want write";
SetError(EWOULDBLOCK);
break;
case SSL_ERROR_ZERO_RETURN:
- // LOG(LS_INFO) << " -- remote side closed";
+ // RTC_LOG(LS_INFO) << " -- remote side closed";
SetError(EWOULDBLOCK);
// do we need to signal closure?
break;
@@ -591,7 +591,7 @@
Error("SSL_write", ret ? ret : -1, false);
break;
default:
- LOG(LS_WARNING) << "Unknown error from SSL_write: " << *error;
+ RTC_LOG(LS_WARNING) << "Unknown error from SSL_write: " << *error;
Error("SSL_write", ret ? ret : -1, false);
break;
}
@@ -604,7 +604,7 @@
//
int OpenSSLAdapter::Send(const void* pv, size_t cb) {
- //LOG(LS_INFO) << "OpenSSLAdapter::Send(" << cb << ")";
+ // RTC_LOG(LS_INFO) << "OpenSSLAdapter::Send(" << cb << ")";
switch (state_) {
case SSL_NONE:
@@ -661,7 +661,7 @@
if (error == SSL_ERROR_WANT_READ || error == SSL_ERROR_WANT_WRITE) {
// Shouldn't be able to get to this point if we already have pending data.
RTC_DCHECK(pending_data_.empty());
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "SSL_write couldn't write to the underlying socket; buffering data.";
pending_data_.SetData(static_cast<const uint8_t*>(pv), cb);
// Since we're taking responsibility for sending this data, return its full
@@ -686,7 +686,7 @@
}
int OpenSSLAdapter::Recv(void* pv, size_t cb, int64_t* timestamp) {
- //LOG(LS_INFO) << "OpenSSLAdapter::Recv(" << cb << ")";
+ // RTC_LOG(LS_INFO) << "OpenSSLAdapter::Recv(" << cb << ")";
switch (state_) {
case SSL_NONE:
@@ -715,19 +715,19 @@
int error = SSL_get_error(ssl_, code);
switch (error) {
case SSL_ERROR_NONE:
- // LOG(LS_INFO) << " -- success";
+ // RTC_LOG(LS_INFO) << " -- success";
return code;
case SSL_ERROR_WANT_READ:
- // LOG(LS_INFO) << " -- error want read";
+ // RTC_LOG(LS_INFO) << " -- error want read";
SetError(EWOULDBLOCK);
break;
case SSL_ERROR_WANT_WRITE:
- // LOG(LS_INFO) << " -- error want write";
+ // RTC_LOG(LS_INFO) << " -- error want write";
ssl_read_needs_write_ = true;
SetError(EWOULDBLOCK);
break;
case SSL_ERROR_ZERO_RETURN:
- // LOG(LS_INFO) << " -- remote side closed";
+ // RTC_LOG(LS_INFO) << " -- remote side closed";
SetError(EWOULDBLOCK);
// do we need to signal closure?
break;
@@ -736,7 +736,7 @@
Error("SSL_read", (code ? code : -1), false);
break;
default:
- LOG(LS_WARNING) << "Unknown error from SSL_read: " << error;
+ RTC_LOG(LS_WARNING) << "Unknown error from SSL_read: " << error;
Error("SSL_read", (code ? code : -1), false);
break;
}
@@ -783,14 +783,14 @@
void OpenSSLAdapter::OnMessage(Message* msg) {
if (MSG_TIMEOUT == msg->message_id) {
- LOG(LS_INFO) << "DTLS timeout expired";
+ RTC_LOG(LS_INFO) << "DTLS timeout expired";
DTLSv1_handle_timeout(ssl_);
ContinueSSL();
}
}
void OpenSSLAdapter::OnConnectEvent(AsyncSocket* socket) {
- LOG(LS_INFO) << "OpenSSLAdapter::OnConnectEvent";
+ RTC_LOG(LS_INFO) << "OpenSSLAdapter::OnConnectEvent";
if (state_ != SSL_WAIT) {
RTC_DCHECK(state_ == SSL_NONE);
AsyncSocketAdapter::OnConnectEvent(socket);
@@ -804,7 +804,7 @@
}
void OpenSSLAdapter::OnReadEvent(AsyncSocket* socket) {
- //LOG(LS_INFO) << "OpenSSLAdapter::OnReadEvent";
+ // RTC_LOG(LS_INFO) << "OpenSSLAdapter::OnReadEvent";
if (state_ == SSL_NONE) {
AsyncSocketAdapter::OnReadEvent(socket);
@@ -824,16 +824,16 @@
// Don't let ourselves go away during the callbacks
//PRefPtr<OpenSSLAdapter> lock(this); // TODO: fix this
if (ssl_write_needs_read_) {
- //LOG(LS_INFO) << " -- onStreamWriteable";
+ // RTC_LOG(LS_INFO) << " -- onStreamWriteable";
AsyncSocketAdapter::OnWriteEvent(socket);
}
- //LOG(LS_INFO) << " -- onStreamReadable";
+ // RTC_LOG(LS_INFO) << " -- onStreamReadable";
AsyncSocketAdapter::OnReadEvent(socket);
}
void OpenSSLAdapter::OnWriteEvent(AsyncSocket* socket) {
- //LOG(LS_INFO) << "OpenSSLAdapter::OnWriteEvent";
+ // RTC_LOG(LS_INFO) << "OpenSSLAdapter::OnWriteEvent";
if (state_ == SSL_NONE) {
AsyncSocketAdapter::OnWriteEvent(socket);
@@ -854,7 +854,7 @@
//PRefPtr<OpenSSLAdapter> lock(this); // TODO: fix this
if (ssl_read_needs_write_) {
- //LOG(LS_INFO) << " -- onStreamReadable";
+ // RTC_LOG(LS_INFO) << " -- onStreamReadable";
AsyncSocketAdapter::OnReadEvent(socket);
}
@@ -868,12 +868,12 @@
}
}
- //LOG(LS_INFO) << " -- onStreamWriteable";
+ // RTC_LOG(LS_INFO) << " -- onStreamWriteable";
AsyncSocketAdapter::OnWriteEvent(socket);
}
void OpenSSLAdapter::OnCloseEvent(AsyncSocket* socket, int err) {
- LOG(LS_INFO) << "OpenSSLAdapter::OnCloseEvent(" << err << ")";
+ RTC_LOG(LS_INFO) << "OpenSSLAdapter::OnCloseEvent(" << err << ")";
AsyncSocketAdapter::OnCloseEvent(socket, err);
}
@@ -892,18 +892,18 @@
// Logging certificates is extremely verbose. So it is disabled by default.
#ifdef LOG_CERTIFICATES
{
- LOG(LS_INFO) << "Certificate from server:";
+ RTC_LOG(LS_INFO) << "Certificate from server:";
BIO* mem = BIO_new(BIO_s_mem());
X509_print_ex(mem, certificate, XN_FLAG_SEP_CPLUS_SPC, X509_FLAG_NO_HEADER);
BIO_write(mem, "\0", 1);
char* buffer;
BIO_get_mem_data(mem, &buffer);
- LOG(LS_INFO) << buffer;
+ RTC_LOG(LS_INFO) << buffer;
BIO_free(mem);
char* cipher_description =
SSL_CIPHER_description(SSL_get_current_cipher(ssl), nullptr, 128);
- LOG(LS_INFO) << "Cipher: " << cipher_description;
+ RTC_LOG(LS_INFO) << "Cipher: " << cipher_description;
OPENSSL_free(cipher_description);
}
#endif
@@ -944,8 +944,8 @@
// This should only ever be turned on for debugging and development.
if (!ok && ignore_bad_cert) {
- LOG(LS_WARNING) << "TLS certificate check FAILED. "
- << "Allowing connection anyway.";
+ RTC_LOG(LS_WARNING) << "TLS certificate check FAILED. "
+ << "Allowing connection anyway.";
ok = true;
}
@@ -961,7 +961,7 @@
}
if (!ok && ignore_bad_cert_) {
- LOG(LS_INFO) << "Other TLS post connection checks failed.";
+ RTC_LOG(LS_INFO) << "Other TLS post connection checks failed.";
ok = true;
}
@@ -981,17 +981,17 @@
str = "SSL_accept";
}
if (where & SSL_CB_LOOP) {
- LOG(LS_INFO) << str << ":" << SSL_state_string_long(s);
+ RTC_LOG(LS_INFO) << str << ":" << SSL_state_string_long(s);
} else if (where & SSL_CB_ALERT) {
str = (where & SSL_CB_READ) ? "read" : "write";
- LOG(LS_INFO) << "SSL3 alert " << str
- << ":" << SSL_alert_type_string_long(ret)
- << ":" << SSL_alert_desc_string_long(ret);
+ RTC_LOG(LS_INFO) << "SSL3 alert " << str << ":"
+ << SSL_alert_type_string_long(ret) << ":"
+ << SSL_alert_desc_string_long(ret);
} else if (where & SSL_CB_EXIT) {
if (ret == 0) {
- LOG(LS_INFO) << str << ":failed in " << SSL_state_string_long(s);
+ RTC_LOG(LS_INFO) << str << ":failed in " << SSL_state_string_long(s);
} else if (ret < 0) {
- LOG(LS_INFO) << str << ":error in " << SSL_state_string_long(s);
+ RTC_LOG(LS_INFO) << str << ":error in " << SSL_state_string_long(s);
}
}
}
@@ -1006,13 +1006,13 @@
int depth = X509_STORE_CTX_get_error_depth(store);
int err = X509_STORE_CTX_get_error(store);
- LOG(LS_INFO) << "Error with certificate at depth: " << depth;
+ RTC_LOG(LS_INFO) << "Error with certificate at depth: " << depth;
X509_NAME_oneline(X509_get_issuer_name(cert), data, sizeof(data));
- LOG(LS_INFO) << " issuer = " << data;
+ RTC_LOG(LS_INFO) << " issuer = " << data;
X509_NAME_oneline(X509_get_subject_name(cert), data, sizeof(data));
- LOG(LS_INFO) << " subject = " << data;
- LOG(LS_INFO) << " err = " << err
- << ":" << X509_verify_cert_error_string(err);
+ RTC_LOG(LS_INFO) << " subject = " << data;
+ RTC_LOG(LS_INFO) << " err = " << err << ":"
+ << X509_verify_cert_error_string(err);
}
#endif
@@ -1029,14 +1029,14 @@
reinterpret_cast<void*>(X509_STORE_CTX_get_current_cert(store));
if (custom_verify_callback_(cert)) {
stream->custom_verification_succeeded_ = true;
- LOG(LS_INFO) << "validated certificate using custom callback";
+ RTC_LOG(LS_INFO) << "validated certificate using custom callback";
ok = true;
}
}
// Should only be used for debugging and development.
if (!ok && stream->ignore_bad_cert_) {
- LOG(LS_WARNING) << "Ignoring cert error while verifying cert chain";
+ RTC_LOG(LS_WARNING) << "Ignoring cert error while verifying cert chain";
ok = 1;
}
@@ -1047,7 +1047,7 @@
OpenSSLAdapter* stream =
reinterpret_cast<OpenSSLAdapter*>(SSL_get_app_data(ssl));
RTC_DCHECK(stream->factory_);
- LOG(LS_INFO) << "Caching SSL session for " << stream->ssl_host_name_;
+ RTC_LOG(LS_INFO) << "Caching SSL session for " << stream->ssl_host_name_;
stream->factory_->AddSession(stream->ssl_host_name_, session);
return 1; // We've taken ownership of the session; OpenSSL shouldn't free it.
}
@@ -1063,7 +1063,7 @@
if (cert) {
int return_value = X509_STORE_add_cert(SSL_CTX_get_cert_store(ctx), cert);
if (return_value == 0) {
- LOG(LS_WARNING) << "Unable to add certificate.";
+ RTC_LOG(LS_WARNING) << "Unable to add certificate.";
} else {
count_of_added_certs++;
}
@@ -1087,9 +1087,9 @@
#endif // OPENSSL_IS_BORINGSSL
if (ctx == nullptr) {
unsigned long error = ERR_get_error(); // NOLINT: type used by OpenSSL.
- LOG(LS_WARNING) << "SSL_CTX creation failed: "
- << '"' << ERR_reason_error_string(error) << "\" "
- << "(error=" << error << ')';
+ RTC_LOG(LS_WARNING) << "SSL_CTX creation failed: " << '"'
+ << ERR_reason_error_string(error) << "\" "
+ << "(error=" << error << ')';
return nullptr;
}
if (!ConfigureTrustedRootCertificates(ctx)) {
@@ -1131,14 +1131,14 @@
std::string transformed_alpn;
for (const std::string& proto : alpn_protocols) {
if (proto.size() == 0 || proto.size() > 0xFF) {
- LOG(LS_ERROR) << "OpenSSLAdapter::Error("
- << "TransformAlpnProtocols received proto with size "
- << proto.size() << ")";
+ RTC_LOG(LS_ERROR) << "OpenSSLAdapter::Error("
+ << "TransformAlpnProtocols received proto with size "
+ << proto.size() << ")";
return "";
}
transformed_alpn += static_cast<char>(proto.size());
transformed_alpn += proto;
- LOG(LS_VERBOSE) << "TransformAlpnProtocols: Adding proto: " << proto;
+ RTC_LOG(LS_VERBOSE) << "TransformAlpnProtocols: Adding proto: " << proto;
}
return transformed_alpn;
}
diff --git a/rtc_base/opensslidentity.cc b/rtc_base/opensslidentity.cc
index 075a1b5..8eb1c42 100644
--- a/rtc_base/opensslidentity.cc
+++ b/rtc_base/opensslidentity.cc
@@ -38,7 +38,7 @@
// Generate a key pair. Caller is responsible for freeing the returned object.
static EVP_PKEY* MakeKey(const KeyParams& key_params) {
- LOG(LS_INFO) << "Making key pair";
+ RTC_LOG(LS_INFO) << "Making key pair";
EVP_PKEY* pkey = EVP_PKEY_new();
if (key_params.type() == KT_RSA) {
int key_length = key_params.rsa_params().mod_size;
@@ -51,7 +51,7 @@
EVP_PKEY_free(pkey);
BN_free(exponent);
RSA_free(rsa);
- LOG(LS_ERROR) << "Failed to make RSA key pair";
+ RTC_LOG(LS_ERROR) << "Failed to make RSA key pair";
return nullptr;
}
// ownership of rsa struct was assigned, don't free it.
@@ -70,30 +70,30 @@
!EVP_PKEY_assign_EC_KEY(pkey, ec_key)) {
EVP_PKEY_free(pkey);
EC_KEY_free(ec_key);
- LOG(LS_ERROR) << "Failed to make EC key pair";
+ RTC_LOG(LS_ERROR) << "Failed to make EC key pair";
return nullptr;
}
// ownership of ec_key struct was assigned, don't free it.
} else {
// Add generation of any other curves here.
EVP_PKEY_free(pkey);
- LOG(LS_ERROR) << "ECDSA key requested for unknown curve";
+ RTC_LOG(LS_ERROR) << "ECDSA key requested for unknown curve";
return nullptr;
}
} else {
EVP_PKEY_free(pkey);
- LOG(LS_ERROR) << "Key type requested not understood";
+ RTC_LOG(LS_ERROR) << "Key type requested not understood";
return nullptr;
}
- LOG(LS_INFO) << "Returning key pair";
+ RTC_LOG(LS_INFO) << "Returning key pair";
return pkey;
}
// Generate a self-signed certificate, with the public key from the
// given key pair. Caller is responsible for freeing the returned object.
static X509* MakeCertificate(EVP_PKEY* pkey, const SSLIdentityParams& params) {
- LOG(LS_INFO) << "Making certificate for " << params.common_name;
+ RTC_LOG(LS_INFO) << "Making certificate for " << params.common_name;
X509* x509 = nullptr;
BIGNUM* serial_number = nullptr;
X509_NAME* name = nullptr;
@@ -140,7 +140,7 @@
BN_free(serial_number);
X509_NAME_free(name);
- LOG(LS_INFO) << "Returning certificate";
+ RTC_LOG(LS_INFO) << "Returning certificate";
return x509;
error:
@@ -157,7 +157,7 @@
while ((err = ERR_get_error()) != 0) {
ERR_error_string_n(err, error_buf, sizeof(error_buf));
- LOG(LS_ERROR) << prefix << ": " << error_buf << "\n";
+ RTC_LOG(LS_ERROR) << prefix << ": " << error_buf << "\n";
}
}
@@ -174,7 +174,7 @@
const std::string& pem_string) {
BIO* bio = BIO_new_mem_buf(const_cast<char*>(pem_string.c_str()), -1);
if (!bio) {
- LOG(LS_ERROR) << "Failed to create a new BIO buffer.";
+ RTC_LOG(LS_ERROR) << "Failed to create a new BIO buffer.";
return nullptr;
}
BIO_set_mem_eof_return(bio, 0);
@@ -182,11 +182,12 @@
PEM_read_bio_PrivateKey(bio, nullptr, nullptr, const_cast<char*>("\0"));
BIO_free(bio); // Frees the BIO, but not the pointed-to string.
if (!pkey) {
- LOG(LS_ERROR) << "Failed to create the private key from PEM string.";
+ RTC_LOG(LS_ERROR) << "Failed to create the private key from PEM string.";
return nullptr;
}
if (EVP_PKEY_missing_parameters(pkey) != 0) {
- LOG(LS_ERROR) << "The resulting key pair is missing public key parameters.";
+ RTC_LOG(LS_ERROR)
+ << "The resulting key pair is missing public key parameters.";
EVP_PKEY_free(pkey);
return nullptr;
}
@@ -213,13 +214,13 @@
std::string OpenSSLKeyPair::PrivateKeyToPEMString() const {
BIO* temp_memory_bio = BIO_new(BIO_s_mem());
if (!temp_memory_bio) {
- LOG_F(LS_ERROR) << "Failed to allocate temporary memory bio";
+ RTC_LOG_F(LS_ERROR) << "Failed to allocate temporary memory bio";
RTC_NOTREACHED();
return "";
}
if (!PEM_write_bio_PrivateKey(
temp_memory_bio, pkey_, nullptr, nullptr, 0, nullptr, nullptr)) {
- LOG_F(LS_ERROR) << "Failed to write private key";
+ RTC_LOG_F(LS_ERROR) << "Failed to write private key";
BIO_free(temp_memory_bio);
RTC_NOTREACHED();
return "";
@@ -235,12 +236,12 @@
std::string OpenSSLKeyPair::PublicKeyToPEMString() const {
BIO* temp_memory_bio = BIO_new(BIO_s_mem());
if (!temp_memory_bio) {
- LOG_F(LS_ERROR) << "Failed to allocate temporary memory bio";
+ RTC_LOG_F(LS_ERROR) << "Failed to allocate temporary memory bio";
RTC_NOTREACHED();
return "";
}
if (!PEM_write_bio_PUBKEY(temp_memory_bio, pkey_)) {
- LOG_F(LS_ERROR) << "Failed to write public key";
+ RTC_LOG_F(LS_ERROR) << "Failed to write public key";
BIO_free(temp_memory_bio);
RTC_NOTREACHED();
return "";
@@ -266,14 +267,14 @@
static void PrintCert(X509* x509) {
BIO* temp_memory_bio = BIO_new(BIO_s_mem());
if (!temp_memory_bio) {
- LOG_F(LS_ERROR) << "Failed to allocate temporary memory bio";
+ RTC_LOG_F(LS_ERROR) << "Failed to allocate temporary memory bio";
return;
}
X509_print_ex(temp_memory_bio, x509, XN_FLAG_SEP_CPLUS_SPC, 0);
BIO_write(temp_memory_bio, "\0", 1);
char* buffer;
BIO_get_mem_data(temp_memory_bio, &buffer);
- LOG(LS_VERBOSE) << buffer;
+ RTC_LOG(LS_VERBOSE) << buffer;
BIO_free(temp_memory_bio);
}
#endif
@@ -354,7 +355,7 @@
default:
// Unknown algorithm. There are several unhandled options that are less
// common and more complex.
- LOG(LS_ERROR) << "Unknown signature algorithm NID: " << nid;
+ RTC_LOG(LS_ERROR) << "Unknown signature algorithm NID: " << nid;
algorithm->clear();
return false;
}
@@ -492,7 +493,7 @@
return new OpenSSLIdentity(key_pair, certificate);
delete key_pair;
}
- LOG(LS_INFO) << "Identity generation failed";
+ RTC_LOG(LS_INFO) << "Identity generation failed";
return nullptr;
}
@@ -522,14 +523,14 @@
std::unique_ptr<OpenSSLCertificate> cert(
OpenSSLCertificate::FromPEMString(certificate));
if (!cert) {
- LOG(LS_ERROR) << "Failed to create OpenSSLCertificate from PEM string.";
+ RTC_LOG(LS_ERROR) << "Failed to create OpenSSLCertificate from PEM string.";
return nullptr;
}
OpenSSLKeyPair* key_pair =
OpenSSLKeyPair::FromPrivateKeyPEMString(private_key);
if (!key_pair) {
- LOG(LS_ERROR) << "Failed to create key pair from PEM string.";
+ RTC_LOG(LS_ERROR) << "Failed to create key pair from PEM string.";
return nullptr;
}
diff --git a/rtc_base/opensslstreamadapter.cc b/rtc_base/opensslstreamadapter.cc
index ec9f238..c1ce2c6 100644
--- a/rtc_base/opensslstreamadapter.cc
+++ b/rtc_base/opensslstreamadapter.cc
@@ -303,7 +303,7 @@
}
if (!OpenSSLDigest::GetDigestSize(digest_alg, &expected_len)) {
- LOG(LS_WARNING) << "Unknown digest algorithm: " << digest_alg;
+ RTC_LOG(LS_WARNING) << "Unknown digest algorithm: " << digest_alg;
if (error) {
*error = SSLPeerCertificateDigestError::UNKNOWN_ALGORITHM;
}
@@ -437,7 +437,7 @@
}
if (!found) {
- LOG(LS_ERROR) << "Could not find cipher: " << *cipher;
+ RTC_LOG(LS_ERROR) << "Could not find cipher: " << *cipher;
return false;
}
}
@@ -511,7 +511,7 @@
StreamResult OpenSSLStreamAdapter::Write(const void* data, size_t data_len,
size_t* written, int* error) {
- LOG(LS_VERBOSE) << "OpenSSLStreamAdapter::Write(" << data_len << ")";
+ RTC_LOG(LS_VERBOSE) << "OpenSSLStreamAdapter::Write(" << data_len << ")";
switch (state_) {
case SSL_NONE:
@@ -549,18 +549,18 @@
int ssl_error = SSL_get_error(ssl_, code);
switch (ssl_error) {
case SSL_ERROR_NONE:
- LOG(LS_VERBOSE) << " -- success";
+ RTC_LOG(LS_VERBOSE) << " -- success";
RTC_DCHECK_GT(code, 0);
RTC_DCHECK_LE(code, data_len);
if (written)
*written = code;
return SR_SUCCESS;
case SSL_ERROR_WANT_READ:
- LOG(LS_VERBOSE) << " -- error want read";
+ RTC_LOG(LS_VERBOSE) << " -- error want read";
ssl_write_needs_read_ = true;
return SR_BLOCK;
case SSL_ERROR_WANT_WRITE:
- LOG(LS_VERBOSE) << " -- error want write";
+ RTC_LOG(LS_VERBOSE) << " -- error want write";
return SR_BLOCK;
case SSL_ERROR_ZERO_RETURN:
@@ -575,7 +575,7 @@
StreamResult OpenSSLStreamAdapter::Read(void* data, size_t data_len,
size_t* read, int* error) {
- LOG(LS_VERBOSE) << "OpenSSLStreamAdapter::Read(" << data_len << ")";
+ RTC_LOG(LS_VERBOSE) << "OpenSSLStreamAdapter::Read(" << data_len << ")";
switch (state_) {
case SSL_NONE:
// pass-through in clear text
@@ -614,7 +614,7 @@
int ssl_error = SSL_get_error(ssl_, code);
switch (ssl_error) {
case SSL_ERROR_NONE:
- LOG(LS_VERBOSE) << " -- success";
+ RTC_LOG(LS_VERBOSE) << " -- success";
RTC_DCHECK_GT(code, 0);
RTC_DCHECK_LE(code, data_len);
if (read)
@@ -625,7 +625,7 @@
unsigned int pending = SSL_pending(ssl_);
if (pending) {
- LOG(LS_INFO) << " -- short DTLS read. flushing";
+ RTC_LOG(LS_INFO) << " -- short DTLS read. flushing";
FlushInput(pending);
if (error)
*error = SSE_MSG_TRUNC;
@@ -634,19 +634,19 @@
}
return SR_SUCCESS;
case SSL_ERROR_WANT_READ:
- LOG(LS_VERBOSE) << " -- error want read";
+ RTC_LOG(LS_VERBOSE) << " -- error want read";
return SR_BLOCK;
case SSL_ERROR_WANT_WRITE:
- LOG(LS_VERBOSE) << " -- error want write";
+ RTC_LOG(LS_VERBOSE) << " -- error want write";
ssl_read_needs_write_ = true;
return SR_BLOCK;
case SSL_ERROR_ZERO_RETURN:
- LOG(LS_VERBOSE) << " -- remote side closed";
+ RTC_LOG(LS_VERBOSE) << " -- remote side closed";
Close();
return SR_EOS;
break;
default:
- LOG(LS_VERBOSE) << " -- error " << code;
+ RTC_LOG(LS_VERBOSE) << " -- error " << code;
Error("SSL_read", (ssl_error ? ssl_error : -1), 0, false);
if (error)
*error = ssl_error_code_;
@@ -667,12 +667,12 @@
RTC_DCHECK(ssl_error == SSL_ERROR_NONE);
if (ssl_error != SSL_ERROR_NONE) {
- LOG(LS_VERBOSE) << " -- error " << code;
+ RTC_LOG(LS_VERBOSE) << " -- error " << code;
Error("SSL_read", (ssl_error ? ssl_error : -1), 0, false);
return;
}
- LOG(LS_VERBOSE) << " -- flushed " << code << " bytes";
+ RTC_LOG(LS_VERBOSE) << " -- flushed " << code << " bytes";
left -= code;
}
}
@@ -708,7 +708,7 @@
int signal_error = 0;
RTC_DCHECK(stream == this->stream());
if ((events & SE_OPEN)) {
- LOG(LS_VERBOSE) << "OpenSSLStreamAdapter::OnEvent SE_OPEN";
+ RTC_LOG(LS_VERBOSE) << "OpenSSLStreamAdapter::OnEvent SE_OPEN";
if (state_ != SSL_WAIT) {
RTC_DCHECK(state_ == SSL_NONE);
events_to_signal |= SE_OPEN;
@@ -721,9 +721,9 @@
}
}
if ((events & (SE_READ|SE_WRITE))) {
- LOG(LS_VERBOSE) << "OpenSSLStreamAdapter::OnEvent"
- << ((events & SE_READ) ? " SE_READ" : "")
- << ((events & SE_WRITE) ? " SE_WRITE" : "");
+ RTC_LOG(LS_VERBOSE) << "OpenSSLStreamAdapter::OnEvent"
+ << ((events & SE_READ) ? " SE_READ" : "")
+ << ((events & SE_WRITE) ? " SE_WRITE" : "");
if (state_ == SSL_NONE) {
events_to_signal |= events & (SE_READ|SE_WRITE);
} else if (state_ == SSL_CONNECTING) {
@@ -734,18 +734,19 @@
} else if (state_ == SSL_CONNECTED) {
if (((events & SE_READ) && ssl_write_needs_read_) ||
(events & SE_WRITE)) {
- LOG(LS_VERBOSE) << " -- onStreamWriteable";
+ RTC_LOG(LS_VERBOSE) << " -- onStreamWriteable";
events_to_signal |= SE_WRITE;
}
if (((events & SE_WRITE) && ssl_read_needs_write_) ||
(events & SE_READ)) {
- LOG(LS_VERBOSE) << " -- onStreamReadable";
+ RTC_LOG(LS_VERBOSE) << " -- onStreamReadable";
events_to_signal |= SE_READ;
}
}
}
if ((events & SE_CLOSE)) {
- LOG(LS_VERBOSE) << "OpenSSLStreamAdapter::OnEvent(SE_CLOSE, " << err << ")";
+ RTC_LOG(LS_VERBOSE) << "OpenSSLStreamAdapter::OnEvent(SE_CLOSE, " << err
+ << ")";
Cleanup(0);
events_to_signal |= SE_CLOSE;
// SE_CLOSE is the only event that uses the final parameter to OnEvent().
@@ -759,7 +760,7 @@
int OpenSSLStreamAdapter::BeginSSL() {
RTC_DCHECK(state_ == SSL_CONNECTING);
// The underlying stream has opened.
- LOG(LS_INFO) << "BeginSSL with peer.";
+ RTC_LOG(LS_INFO) << "BeginSSL with peer.";
BIO* bio = nullptr;
@@ -813,7 +814,7 @@
}
int OpenSSLStreamAdapter::ContinueSSL() {
- LOG(LS_VERBOSE) << "ContinueSSL";
+ RTC_LOG(LS_VERBOSE) << "ContinueSSL";
RTC_DCHECK(state_ == SSL_CONNECTING);
// Clear the DTLS timer
@@ -823,7 +824,7 @@
int ssl_error;
switch (ssl_error = SSL_get_error(ssl_, code)) {
case SSL_ERROR_NONE:
- LOG(LS_VERBOSE) << " -- success";
+ RTC_LOG(LS_VERBOSE) << " -- success";
// By this point, OpenSSL should have given us a certificate, or errored
// out if one was missing.
RTC_DCHECK(peer_certificate_ || !client_auth_enabled());
@@ -844,24 +845,24 @@
break;
case SSL_ERROR_WANT_READ: {
- LOG(LS_VERBOSE) << " -- error want read";
- struct timeval timeout;
- if (DTLSv1_get_timeout(ssl_, &timeout)) {
- int delay = timeout.tv_sec * 1000 + timeout.tv_usec/1000;
+ RTC_LOG(LS_VERBOSE) << " -- error want read";
+ struct timeval timeout;
+ if (DTLSv1_get_timeout(ssl_, &timeout)) {
+ int delay = timeout.tv_sec * 1000 + timeout.tv_usec / 1000;
- Thread::Current()->PostDelayed(RTC_FROM_HERE, delay, this,
- MSG_TIMEOUT, 0);
+ Thread::Current()->PostDelayed(RTC_FROM_HERE, delay, this, MSG_TIMEOUT,
+ 0);
}
}
break;
case SSL_ERROR_WANT_WRITE:
- LOG(LS_VERBOSE) << " -- error want write";
+ RTC_LOG(LS_VERBOSE) << " -- error want write";
break;
case SSL_ERROR_ZERO_RETURN:
default:
- LOG(LS_VERBOSE) << " -- error " << code;
+ RTC_LOG(LS_VERBOSE) << " -- error " << code;
SSLHandshakeError ssl_handshake_err = SSLHandshakeError::UNKNOWN;
int err_code = ERR_peek_last_error();
if (err_code != 0 && ERR_GET_REASON(err_code) == SSL_R_NO_SHARED_CIPHER) {
@@ -878,8 +879,8 @@
int err,
uint8_t alert,
bool signal) {
- LOG(LS_WARNING) << "OpenSSLStreamAdapter::Error(" << context << ", " << err
- << ", " << static_cast<int>(alert) << ")";
+ RTC_LOG(LS_WARNING) << "OpenSSLStreamAdapter::Error(" << context << ", "
+ << err << ", " << static_cast<int>(alert) << ")";
state_ = SSL_ERROR;
ssl_error_code_ = err;
Cleanup(alert);
@@ -888,7 +889,7 @@
}
void OpenSSLStreamAdapter::Cleanup(uint8_t alert) {
- LOG(LS_INFO) << "Cleanup";
+ RTC_LOG(LS_INFO) << "Cleanup";
if (state_ != SSL_ERROR) {
state_ = SSL_CLOSED;
@@ -902,15 +903,15 @@
if (alert) {
ret = SSL_send_fatal_alert(ssl_, alert);
if (ret < 0) {
- LOG(LS_WARNING) << "SSL_send_fatal_alert failed, error = "
- << SSL_get_error(ssl_, ret);
+ RTC_LOG(LS_WARNING) << "SSL_send_fatal_alert failed, error = "
+ << SSL_get_error(ssl_, ret);
}
} else {
#endif
ret = SSL_shutdown(ssl_);
if (ret < 0) {
- LOG(LS_WARNING) << "SSL_shutdown failed, error = "
- << SSL_get_error(ssl_, ret);
+ RTC_LOG(LS_WARNING)
+ << "SSL_shutdown failed, error = " << SSL_get_error(ssl_, ret);
}
#ifdef OPENSSL_IS_BORINGSSL
}
@@ -933,7 +934,7 @@
void OpenSSLStreamAdapter::OnMessage(Message* msg) {
// Process our own messages and then pass others to the superclass
if (MSG_TIMEOUT == msg->message_id) {
- LOG(LS_INFO) << "DTLS timeout expired";
+ RTC_LOG(LS_INFO) << "DTLS timeout expired";
DTLSv1_handle_timeout(ssl_);
ContinueSSL();
} else {
@@ -1076,7 +1077,7 @@
bool OpenSSLStreamAdapter::VerifyPeerCertificate() {
if (!has_peer_certificate_digest() || !peer_certificate_) {
- LOG(LS_WARNING) << "Missing digest or peer certificate.";
+ RTC_LOG(LS_WARNING) << "Missing digest or peer certificate.";
return false;
}
@@ -1085,19 +1086,20 @@
if (!OpenSSLCertificate::ComputeDigest(
peer_certificate_->x509(), peer_certificate_digest_algorithm_, digest,
sizeof(digest), &digest_length)) {
- LOG(LS_WARNING) << "Failed to compute peer cert digest.";
+ RTC_LOG(LS_WARNING) << "Failed to compute peer cert digest.";
return false;
}
Buffer computed_digest(digest, digest_length);
if (computed_digest != peer_certificate_digest_value_) {
- LOG(LS_WARNING) << "Rejected peer certificate due to mismatched digest.";
+ RTC_LOG(LS_WARNING)
+ << "Rejected peer certificate due to mismatched digest.";
return false;
}
// Ignore any verification error if the digest matches, since there is no
// value in checking the validity of a self-signed cert issued by untrusted
// sources.
- LOG(LS_INFO) << "Accepted peer certificate.";
+ RTC_LOG(LS_INFO) << "Accepted peer certificate.";
peer_certificate_verified_ = true;
return true;
}
@@ -1117,7 +1119,7 @@
// If the peer certificate digest isn't known yet, we'll wait to verify
// until it's known, and for now just return a success status.
if (stream->peer_certificate_digest_algorithm_.empty()) {
- LOG(LS_INFO) << "Waiting to verify certificate until digest is known.";
+ RTC_LOG(LS_INFO) << "Waiting to verify certificate until digest is known.";
return 1;
}
diff --git a/rtc_base/optionsfile.cc b/rtc_base/optionsfile.cc
index a76270d..c3b6a6a 100644
--- a/rtc_base/optionsfile.cc
+++ b/rtc_base/optionsfile.cc
@@ -29,7 +29,7 @@
FileStream stream;
int err;
if (!stream.Open(path_, "r", &err)) {
- LOG_F(LS_WARNING) << "Could not open file, err=" << err;
+ RTC_LOG_F(LS_WARNING) << "Could not open file, err=" << err;
// We do not consider this an error because we expect there to be no file
// until the user saves a setting.
return true;
@@ -46,7 +46,7 @@
if (equals_pos == std::string::npos) {
// We do not consider this an error. Instead we ignore the line and
// keep going.
- LOG_F(LS_WARNING) << "Ignoring malformed line in " << path_;
+ RTC_LOG_F(LS_WARNING) << "Ignoring malformed line in " << path_;
continue;
}
std::string key(line, 0, equals_pos);
@@ -54,7 +54,7 @@
options_[key] = value;
}
if (res != SR_EOS) {
- LOG_F(LS_ERROR) << "Error when reading from file";
+ RTC_LOG_F(LS_ERROR) << "Error when reading from file";
return false;
} else {
return true;
@@ -66,7 +66,7 @@
FileStream stream;
int err;
if (!stream.Open(path_, "w", &err)) {
- LOG_F(LS_ERROR) << "Could not open file, err=" << err;
+ RTC_LOG_F(LS_ERROR) << "Could not open file, err=" << err;
return false;
}
// Write out all the data.
@@ -95,7 +95,7 @@
}
}
if (res != SR_SUCCESS) {
- LOG_F(LS_ERROR) << "Unable to write to file";
+ RTC_LOG_F(LS_ERROR) << "Unable to write to file";
return false;
} else {
return true;
@@ -106,7 +106,7 @@
for (size_t pos = 0; pos < name.length(); ++pos) {
if (name[pos] == '\n' || name[pos] == '\\' || name[pos] == '=') {
// Illegal character.
- LOG(LS_WARNING) << "Ignoring operation for illegal option " << name;
+ RTC_LOG(LS_WARNING) << "Ignoring operation for illegal option " << name;
return false;
}
}
@@ -117,7 +117,7 @@
for (size_t pos = 0; pos < value.length(); ++pos) {
if (value[pos] == '\n' || value[pos] == '\\') {
// Illegal character.
- LOG(LS_WARNING) << "Ignoring operation for illegal value " << value;
+ RTC_LOG(LS_WARNING) << "Ignoring operation for illegal value " << value;
return false;
}
}
@@ -126,8 +126,7 @@
bool OptionsFile::GetStringValue(const std::string& option,
std::string *out_val) const {
- LOG(LS_VERBOSE) << "OptionsFile::GetStringValue "
- << option;
+ RTC_LOG(LS_VERBOSE) << "OptionsFile::GetStringValue " << option;
if (!IsLegalName(option)) {
return false;
}
@@ -141,8 +140,7 @@
bool OptionsFile::GetIntValue(const std::string& option,
int *out_val) const {
- LOG(LS_VERBOSE) << "OptionsFile::GetIntValue "
- << option;
+ RTC_LOG(LS_VERBOSE) << "OptionsFile::GetIntValue " << option;
if (!IsLegalName(option)) {
return false;
}
@@ -155,8 +153,8 @@
bool OptionsFile::SetStringValue(const std::string& option,
const std::string& value) {
- LOG(LS_VERBOSE) << "OptionsFile::SetStringValue "
- << option << ":" << value;
+ RTC_LOG(LS_VERBOSE) << "OptionsFile::SetStringValue " << option << ":"
+ << value;
if (!IsLegalName(option) || !IsLegalValue(value)) {
return false;
}
@@ -166,8 +164,7 @@
bool OptionsFile::SetIntValue(const std::string& option,
int value) {
- LOG(LS_VERBOSE) << "OptionsFile::SetIntValue "
- << option << ":" << value;
+ RTC_LOG(LS_VERBOSE) << "OptionsFile::SetIntValue " << option << ":" << value;
if (!IsLegalName(option)) {
return false;
}
@@ -175,7 +172,7 @@
}
bool OptionsFile::RemoveValue(const std::string& option) {
- LOG(LS_VERBOSE) << "OptionsFile::RemoveValue " << option;
+ RTC_LOG(LS_VERBOSE) << "OptionsFile::RemoveValue " << option;
if (!IsLegalName(option)) {
return false;
}
diff --git a/rtc_base/physicalsocketserver.cc b/rtc_base/physicalsocketserver.cc
index db27827..422171d 100644
--- a/rtc_base/physicalsocketserver.cc
+++ b/rtc_base/physicalsocketserver.cc
@@ -182,8 +182,8 @@
if (result >= 0) {
SocketAddressFromSockAddrStorage(addr_storage, &address);
} else {
- LOG(LS_WARNING) << "GetLocalAddress: unable to get local addr, socket="
- << s_;
+ RTC_LOG(LS_WARNING) << "GetLocalAddress: unable to get local addr, socket="
+ << s_;
}
return address;
}
@@ -197,8 +197,8 @@
if (result >= 0) {
SocketAddressFromSockAddrStorage(addr_storage, &address);
} else {
- LOG(LS_WARNING) << "GetRemoteAddress: unable to get remote addr, socket="
- << s_;
+ RTC_LOG(LS_WARNING)
+ << "GetRemoteAddress: unable to get remote addr, socket=" << s_;
}
return address;
}
@@ -217,19 +217,19 @@
// the bind() call; bind() just needs to assign a port.
copied_bind_addr.SetIP(GetAnyIP(copied_bind_addr.ipaddr().family()));
} else if (result == NetworkBindingResult::NOT_IMPLEMENTED) {
- LOG(LS_INFO) << "Can't bind socket to network because "
- "network binding is not implemented for this OS.";
+ RTC_LOG(LS_INFO) << "Can't bind socket to network because "
+ "network binding is not implemented for this OS.";
} else {
if (bind_addr.IsLoopbackIP()) {
// If we couldn't bind to a loopback IP (which should only happen in
// test scenarios), continue on. This may be expected behavior.
- LOG(LS_VERBOSE) << "Binding socket to loopback address "
- << bind_addr.ipaddr().ToString()
- << " failed; result: " << static_cast<int>(result);
+ RTC_LOG(LS_VERBOSE) << "Binding socket to loopback address "
+ << bind_addr.ipaddr().ToString()
+ << " failed; result: " << static_cast<int>(result);
} else {
- LOG(LS_WARNING) << "Binding socket to network address "
- << bind_addr.ipaddr().ToString()
- << " failed; result: " << static_cast<int>(result);
+ RTC_LOG(LS_WARNING) << "Binding socket to network address "
+ << bind_addr.ipaddr().ToString()
+ << " failed; result: " << static_cast<int>(result);
// If a network binding was attempted and failed, we should stop here
// and not try to use the socket. Otherwise, we may end up sending
// packets with an invalid source address.
@@ -260,7 +260,7 @@
return SOCKET_ERROR;
}
if (addr.IsUnresolvedIP()) {
- LOG(LS_VERBOSE) << "Resolving addr in PhysicalSocket::Connect";
+ RTC_LOG(LS_VERBOSE) << "Resolving addr in PhysicalSocket::Connect";
resolver_ = new AsyncResolver();
resolver_->SignalDone.connect(this, &PhysicalSocket::OnResolveResult);
resolver_->Start(addr);
@@ -394,7 +394,7 @@
// Note: on graceful shutdown, recv can return 0. In this case, we
// pretend it is blocking, and then signal close, so that simplifying
// assumptions can be made about Recv.
- LOG(LS_WARNING) << "EOF from socket; deferring close event";
+ RTC_LOG(LS_WARNING) << "EOF from socket; deferring close event";
// Must turn this back on so that the select() loop will notice the close
// event.
EnableEvents(DE_READ);
@@ -411,7 +411,7 @@
EnableEvents(DE_READ);
}
if (!success) {
- LOG_F(LS_VERBOSE) << "Error = " << error;
+ RTC_LOG_F(LS_VERBOSE) << "Error = " << error;
}
return received;
}
@@ -437,7 +437,7 @@
EnableEvents(DE_READ);
}
if (!success) {
- LOG_F(LS_VERBOSE) << "Error = " << error;
+ RTC_LOG_F(LS_VERBOSE) << "Error = " << error;
}
return received;
}
@@ -525,7 +525,7 @@
}
void PhysicalSocket::UpdateLastError() {
- SetError(LAST_SYSTEM_ERROR);
+ SetError(RTC_LAST_SYSTEM_ERROR);
}
void PhysicalSocket::MaybeRemapSendError() {
@@ -561,7 +561,7 @@
*sopt = IP_DONTFRAGMENT;
break;
#elif defined(WEBRTC_MAC) || defined(BSD) || defined(__native_client__)
- LOG(LS_WARNING) << "Socket::OPT_DONTFRAGMENT not supported.";
+ RTC_LOG(LS_WARNING) << "Socket::OPT_DONTFRAGMENT not supported.";
return -1;
#elif defined(WEBRTC_POSIX)
*slevel = IPPROTO_IP;
@@ -581,7 +581,7 @@
*sopt = TCP_NODELAY;
break;
case OPT_DSCP:
- LOG(LS_WARNING) << "Socket::OPT_DSCP not supported.";
+ RTC_LOG(LS_WARNING) << "Socket::OPT_DSCP not supported.";
return -1;
case OPT_RTP_SENDTIME_EXTN_ID:
return -1; // No logging is necessary as this not a OS socket option.
@@ -727,7 +727,7 @@
// "connection lost"-type error as a blocking error, because typically
// the next recv() will get EOF, so we'll still eventually notice that
// the socket is closed.
- LOG_ERR(LS_WARNING) << "Assuming benign blocking error";
+ RTC_LOG_ERR(LS_WARNING) << "Assuming benign blocking error";
return false;
}
}
@@ -759,7 +759,7 @@
// something like a READ followed by a CONNECT, which would be odd.
if (((ff & DE_CONNECT) != 0) && (id_ == cache_id)) {
if (ff != DE_CONNECT)
- LOG(LS_VERBOSE) << "Signalled with DE_CONNECT: " << ff;
+ RTC_LOG(LS_VERBOSE) << "Signalled with DE_CONNECT: " << ff;
DisableEvents(DE_CONNECT);
#if !defined(NDEBUG)
dbg_addr_ = "Connected @ ";
@@ -895,7 +895,7 @@
public:
EventDispatcher(PhysicalSocketServer* ss) : ss_(ss), fSignaled_(false) {
if (pipe(afd_) < 0)
- LOG(LERROR) << "pipe failed";
+ RTC_LOG(LERROR) << "pipe failed";
ss_->Add(this);
}
@@ -1012,14 +1012,14 @@
private:
PosixSignalHandler() {
if (pipe(afd_) < 0) {
- LOG_ERR(LS_ERROR) << "pipe failed";
+ RTC_LOG_ERR(LS_ERROR) << "pipe failed";
return;
}
if (fcntl(afd_[0], F_SETFL, O_NONBLOCK) < 0) {
- LOG_ERR(LS_WARNING) << "fcntl #1 failed";
+ RTC_LOG_ERR(LS_WARNING) << "fcntl #1 failed";
}
if (fcntl(afd_[1], F_SETFL, O_NONBLOCK) < 0) {
- LOG_ERR(LS_WARNING) << "fcntl #2 failed";
+ RTC_LOG_ERR(LS_WARNING) << "fcntl #2 failed";
}
memset(const_cast<void *>(static_cast<volatile void *>(received_signal_)),
0,
@@ -1076,9 +1076,9 @@
uint8_t b[16];
ssize_t ret = read(GetDescriptor(), b, sizeof(b));
if (ret < 0) {
- LOG_ERR(LS_WARNING) << "Error in read()";
+ RTC_LOG_ERR(LS_WARNING) << "Error in read()";
} else if (ret == 0) {
- LOG(LS_WARNING) << "Should have read at least one byte";
+ RTC_LOG(LS_WARNING) << "Should have read at least one byte";
}
}
@@ -1092,7 +1092,7 @@
// This can happen if a signal is delivered to our process at around
// the same time as we unset our handler for it. It is not an error
// condition, but it's unusual enough to be worth logging.
- LOG(LS_INFO) << "Received signal with no handler: " << signum;
+ RTC_LOG(LS_INFO) << "Received signal with no handler: " << signum;
} else {
// Otherwise, execute our handler.
(*i->second)(signum);
@@ -1209,7 +1209,7 @@
epoll_fd_ = epoll_create(FD_SETSIZE);
if (epoll_fd_ == -1) {
// Not an error, will fall back to "select" below.
- LOG_E(LS_WARNING, EN, errno) << "epoll_create";
+ RTC_LOG_E(LS_WARNING, EN, errno) << "epoll_create";
epoll_fd_ = INVALID_SOCKET;
}
#endif
@@ -1305,16 +1305,17 @@
// invalidating the iterator in "Wait".
if (!pending_add_dispatchers_.erase(pdispatcher) &&
dispatchers_.find(pdispatcher) == dispatchers_.end()) {
- LOG(LS_WARNING) << "PhysicalSocketServer asked to remove a unknown "
- << "dispatcher, potentially from a duplicate call to "
- << "Add.";
+ RTC_LOG(LS_WARNING) << "PhysicalSocketServer asked to remove a unknown "
+ << "dispatcher, potentially from a duplicate call to "
+ << "Add.";
return;
}
pending_remove_dispatchers_.insert(pdispatcher);
} else if (!dispatchers_.erase(pdispatcher)) {
- LOG(LS_WARNING) << "PhysicalSocketServer asked to remove a unknown "
- << "dispatcher, potentially from a duplicate call to Add.";
+ RTC_LOG(LS_WARNING)
+ << "PhysicalSocketServer asked to remove a unknown "
+ << "dispatcher, potentially from a duplicate call to Add.";
return;
}
#if defined(WEBRTC_USE_EPOLL)
@@ -1494,7 +1495,7 @@
// If error, return error.
if (n < 0) {
if (errno != EINTR) {
- LOG_E(LS_ERROR, EN, errno) << "select";
+ RTC_LOG_E(LS_ERROR, EN, errno) << "select";
return false;
}
// Else ignore the error and keep going. If this EINTR was for one of the
@@ -1577,7 +1578,7 @@
int err = epoll_ctl(epoll_fd_, EPOLL_CTL_ADD, fd, &event);
RTC_DCHECK_EQ(err, 0);
if (err == -1) {
- LOG_E(LS_ERROR, EN, errno) << "epoll_ctl EPOLL_CTL_ADD";
+ RTC_LOG_E(LS_ERROR, EN, errno) << "epoll_ctl EPOLL_CTL_ADD";
}
}
@@ -1595,9 +1596,9 @@
if (err == -1) {
if (errno == ENOENT) {
// Socket has already been closed.
- LOG_E(LS_VERBOSE, EN, errno) << "epoll_ctl EPOLL_CTL_DEL";
+ RTC_LOG_E(LS_VERBOSE, EN, errno) << "epoll_ctl EPOLL_CTL_DEL";
} else {
- LOG_E(LS_ERROR, EN, errno) << "epoll_ctl EPOLL_CTL_DEL";
+ RTC_LOG_E(LS_ERROR, EN, errno) << "epoll_ctl EPOLL_CTL_DEL";
}
}
}
@@ -1616,7 +1617,7 @@
int err = epoll_ctl(epoll_fd_, EPOLL_CTL_MOD, fd, &event);
RTC_DCHECK_EQ(err, 0);
if (err == -1) {
- LOG_E(LS_ERROR, EN, errno) << "epoll_ctl EPOLL_CTL_MOD";
+ RTC_LOG_E(LS_ERROR, EN, errno) << "epoll_ctl EPOLL_CTL_MOD";
}
}
@@ -1646,7 +1647,7 @@
static_cast<int>(tvWait));
if (n < 0) {
if (errno != EINTR) {
- LOG_E(LS_ERROR, EN, errno) << "epoll";
+ RTC_LOG_E(LS_ERROR, EN, errno) << "epoll";
return false;
}
// Else ignore the error and keep going. If this EINTR was for one of the
@@ -1727,7 +1728,7 @@
int n = poll(&fds, 1, static_cast<int>(tvWait));
if (n < 0) {
if (errno != EINTR) {
- LOG_E(LS_ERROR, EN, errno) << "poll";
+ RTC_LOG_E(LS_ERROR, EN, errno) << "poll";
return false;
}
// Else ignore the error and keep going. If this EINTR was for one of the
@@ -1801,7 +1802,7 @@
struct sigaction act;
// It doesn't really matter what we set this mask to.
if (sigemptyset(&act.sa_mask) != 0) {
- LOG_ERR(LS_ERROR) << "Couldn't set mask";
+ RTC_LOG_ERR(LS_ERROR) << "Couldn't set mask";
return false;
}
act.sa_handler = handler;
@@ -1814,7 +1815,7 @@
act.sa_flags = 0;
#endif
if (sigaction(signum, &act, nullptr) != 0) {
- LOG_ERR(LS_ERROR) << "Couldn't set sigaction";
+ RTC_LOG_ERR(LS_ERROR) << "Couldn't set sigaction";
return false;
}
return true;
@@ -1914,28 +1915,33 @@
{
if ((wsaEvents.lNetworkEvents & FD_READ) &&
wsaEvents.iErrorCode[FD_READ_BIT] != 0) {
- LOG(WARNING) << "PhysicalSocketServer got FD_READ_BIT error "
- << wsaEvents.iErrorCode[FD_READ_BIT];
+ RTC_LOG(WARNING)
+ << "PhysicalSocketServer got FD_READ_BIT error "
+ << wsaEvents.iErrorCode[FD_READ_BIT];
}
if ((wsaEvents.lNetworkEvents & FD_WRITE) &&
wsaEvents.iErrorCode[FD_WRITE_BIT] != 0) {
- LOG(WARNING) << "PhysicalSocketServer got FD_WRITE_BIT error "
- << wsaEvents.iErrorCode[FD_WRITE_BIT];
+ RTC_LOG(WARNING)
+ << "PhysicalSocketServer got FD_WRITE_BIT error "
+ << wsaEvents.iErrorCode[FD_WRITE_BIT];
}
if ((wsaEvents.lNetworkEvents & FD_CONNECT) &&
wsaEvents.iErrorCode[FD_CONNECT_BIT] != 0) {
- LOG(WARNING) << "PhysicalSocketServer got FD_CONNECT_BIT error "
- << wsaEvents.iErrorCode[FD_CONNECT_BIT];
+ RTC_LOG(WARNING)
+ << "PhysicalSocketServer got FD_CONNECT_BIT error "
+ << wsaEvents.iErrorCode[FD_CONNECT_BIT];
}
if ((wsaEvents.lNetworkEvents & FD_ACCEPT) &&
wsaEvents.iErrorCode[FD_ACCEPT_BIT] != 0) {
- LOG(WARNING) << "PhysicalSocketServer got FD_ACCEPT_BIT error "
- << wsaEvents.iErrorCode[FD_ACCEPT_BIT];
+ RTC_LOG(WARNING)
+ << "PhysicalSocketServer got FD_ACCEPT_BIT error "
+ << wsaEvents.iErrorCode[FD_ACCEPT_BIT];
}
if ((wsaEvents.lNetworkEvents & FD_CLOSE) &&
wsaEvents.iErrorCode[FD_CLOSE_BIT] != 0) {
- LOG(WARNING) << "PhysicalSocketServer got FD_CLOSE_BIT error "
- << wsaEvents.iErrorCode[FD_CLOSE_BIT];
+ RTC_LOG(WARNING)
+ << "PhysicalSocketServer got FD_CLOSE_BIT error "
+ << wsaEvents.iErrorCode[FD_CLOSE_BIT];
}
}
uint32_t ff = 0;
diff --git a/rtc_base/physicalsocketserver_unittest.cc b/rtc_base/physicalsocketserver_unittest.cc
index 2320e97..d09385b 100644
--- a/rtc_base/physicalsocketserver_unittest.cc
+++ b/rtc_base/physicalsocketserver_unittest.cc
@@ -22,16 +22,16 @@
namespace rtc {
-#define MAYBE_SKIP_IPV4 \
- if (!HasIPv4Enabled()) { \
- LOG(LS_INFO) << "No IPv4... skipping"; \
- return; \
+#define MAYBE_SKIP_IPV4 \
+ if (!HasIPv4Enabled()) { \
+ RTC_LOG(LS_INFO) << "No IPv4... skipping"; \
+ return; \
}
-#define MAYBE_SKIP_IPV6 \
- if (!HasIPv6Enabled()) { \
- LOG(LS_INFO) << "No IPv6... skipping"; \
- return; \
+#define MAYBE_SKIP_IPV6 \
+ if (!HasIPv6Enabled()) { \
+ RTC_LOG(LS_INFO) << "No IPv6... skipping"; \
+ return; \
}
class PhysicalSocketTest;
@@ -516,12 +516,12 @@
bool ExpectSignal(int signum) {
if (signals_received_.empty()) {
- LOG(LS_ERROR) << "ExpectSignal(): No signal received";
+ RTC_LOG(LS_ERROR) << "ExpectSignal(): No signal received";
return false;
}
if (signals_received_[0] != signum) {
- LOG(LS_ERROR) << "ExpectSignal(): Received signal " <<
- signals_received_[0] << ", expected " << signum;
+ RTC_LOG(LS_ERROR) << "ExpectSignal(): Received signal "
+ << signals_received_[0] << ", expected " << signum;
return false;
}
signals_received_.erase(signals_received_.begin());
@@ -531,8 +531,8 @@
bool ExpectNone() {
bool ret = signals_received_.empty();
if (!ret) {
- LOG(LS_ERROR) << "ExpectNone(): Received signal " << signals_received_[0]
- << ", expected none";
+ RTC_LOG(LS_ERROR) << "ExpectNone(): Received signal "
+ << signals_received_[0] << ", expected none";
}
return ret;
}
diff --git a/rtc_base/proxyserver.cc b/rtc_base/proxyserver.cc
index ede2968..5ab7943 100644
--- a/rtc_base/proxyserver.cc
+++ b/rtc_base/proxyserver.cc
@@ -53,7 +53,8 @@
ext_socket->Bind(ext_ip_);
bindings_.push_back(new ProxyBinding(wrapped_socket, ext_socket));
} else {
- LOG(LS_ERROR) << "Unable to create external socket on proxy accept event";
+ RTC_LOG(LS_ERROR)
+ << "Unable to create external socket on proxy accept event";
}
}
diff --git a/rtc_base/socket_unittest.cc b/rtc_base/socket_unittest.cc
index 9e44572..a31cc02 100644
--- a/rtc_base/socket_unittest.cc
+++ b/rtc_base/socket_unittest.cc
@@ -32,10 +32,10 @@
using webrtc::testing::SSE_WRITE;
using webrtc::testing::StreamSink;
-#define MAYBE_SKIP_IPV6 \
- if (!HasIPv6Enabled()) { \
- LOG(LS_INFO) << "No IPv6... skipping"; \
- return; \
+#define MAYBE_SKIP_IPV6 \
+ if (!HasIPv6Enabled()) { \
+ RTC_LOG(LS_INFO) << "No IPv6... skipping"; \
+ return; \
}
// Data size to be used in TcpInternal tests.
@@ -60,7 +60,7 @@
void SocketTest::TestConnectWithDnsLookupIPv6() {
// TODO: Enable this when DNS resolution supports IPv6.
- LOG(LS_INFO) << "Skipping IPv6 DNS test";
+ RTC_LOG(LS_INFO) << "Skipping IPv6 DNS test";
// ConnectWithDnsLookupInternal(kIPv6Loopback, "localhost6");
}
@@ -377,8 +377,8 @@
WAIT_(client->GetState() == AsyncSocket::CS_CLOSED, kTimeout,
dns_lookup_finished);
if (!dns_lookup_finished) {
- LOG(LS_WARNING) << "Skipping test; DNS resolution took longer than 5 "
- << "seconds.";
+ RTC_LOG(LS_WARNING) << "Skipping test; DNS resolution took longer than 5 "
+ << "seconds.";
return;
}
@@ -970,8 +970,8 @@
if (ret != test_packet_size) {
error = client->GetError();
if (error == expected_error) {
- LOG(LS_INFO) << "Got expected error code after sending "
- << sent_packet_num << " packets.";
+ RTC_LOG(LS_INFO) << "Got expected error code after sending "
+ << sent_packet_num << " packets.";
break;
}
}
@@ -979,7 +979,7 @@
EXPECT_EQ(expected_error, error);
EXPECT_FALSE(client->ready_to_send());
EXPECT_TRUE_WAIT(client->ready_to_send(), kTimeout);
- LOG(LS_INFO) << "Got SignalReadyToSend";
+ RTC_LOG(LS_INFO) << "Got SignalReadyToSend";
}
void SocketTest::GetSetOptionsInternal(const IPAddress& loopback) {
diff --git a/rtc_base/socketadapters.cc b/rtc_base/socketadapters.cc
index 175110b..4cde690 100644
--- a/rtc_base/socketadapters.cc
+++ b/rtc_base/socketadapters.cc
@@ -104,7 +104,7 @@
}
if (data_len_ >= buffer_size_) {
- LOG(INFO) << "Input buffer overflow";
+ RTC_LOG(INFO) << "Input buffer overflow";
RTC_NOTREACHED();
data_len_ = 0;
}
@@ -113,7 +113,7 @@
socket_->Recv(buffer_ + data_len_, buffer_size_ - data_len_, nullptr);
if (len < 0) {
// TODO: Do something better like forwarding the error to the user.
- LOG_ERR(INFO) << "Recv";
+ RTC_LOG_ERR(INFO) << "Recv";
return;
}
@@ -260,8 +260,8 @@
int AsyncHttpsProxySocket::Connect(const SocketAddress& addr) {
int ret;
- LOG(LS_VERBOSE) << "AsyncHttpsProxySocket::Connect("
- << proxy_.ToSensitiveString() << ")";
+ RTC_LOG(LS_VERBOSE) << "AsyncHttpsProxySocket::Connect("
+ << proxy_.ToSensitiveString() << ")";
dest_ = addr;
state_ = PS_INIT;
if (ShouldIssueConnect()) {
@@ -296,7 +296,7 @@
}
void AsyncHttpsProxySocket::OnConnectEvent(AsyncSocket * socket) {
- LOG(LS_VERBOSE) << "AsyncHttpsProxySocket::OnConnectEvent";
+ RTC_LOG(LS_VERBOSE) << "AsyncHttpsProxySocket::OnConnectEvent";
if (!ShouldIssueConnect()) {
state_ = PS_TUNNEL;
BufferedReadAdapter::OnConnectEvent(socket);
@@ -306,7 +306,7 @@
}
void AsyncHttpsProxySocket::OnCloseEvent(AsyncSocket * socket, int err) {
- LOG(LS_VERBOSE) << "AsyncHttpsProxySocket::OnCloseEvent(" << err << ")";
+ RTC_LOG(LS_VERBOSE) << "AsyncHttpsProxySocket::OnCloseEvent(" << err << ")";
if ((state_ == PS_WAIT_CLOSE) && (err == 0)) {
state_ = PS_ERROR;
Connect(dest_);
@@ -380,11 +380,11 @@
content_length_ = 0;
headers_.clear();
- LOG(LS_VERBOSE) << "AsyncHttpsProxySocket >> " << str;
+ RTC_LOG(LS_VERBOSE) << "AsyncHttpsProxySocket >> " << str;
}
void AsyncHttpsProxySocket::ProcessLine(char * data, size_t len) {
- LOG(LS_VERBOSE) << "AsyncHttpsProxySocket << " << data;
+ RTC_LOG(LS_VERBOSE) << "AsyncHttpsProxySocket << " << data;
if (len == 0) {
if (state_ == PS_TUNNEL_HEADERS) {
@@ -419,7 +419,7 @@
#endif
#if defined(WEBRTC_POSIX)
// TODO: Raise a signal so the UI can be separated.
- LOG(LS_ERROR) << "Oops!\n\n" << msg;
+ RTC_LOG(LS_ERROR) << "Oops!\n\n" << msg;
#endif
}
// Unexpected end of headers
@@ -455,7 +455,7 @@
proxy_, "CONNECT", "/",
user_, pass_, context_, response, auth_method)) {
case HAR_IGNORE:
- LOG(LS_VERBOSE) << "Ignoring Proxy-Authenticate: " << auth_method;
+ RTC_LOG(LS_VERBOSE) << "Ignoring Proxy-Authenticate: " << auth_method;
if (!unknown_mechanisms_.empty())
unknown_mechanisms_.append(", ");
unknown_mechanisms_.append(auth_method);
@@ -610,7 +610,7 @@
if (!response.ReadUInt32(&addr) ||
!response.ReadUInt16(&port))
return;
- LOG(LS_VERBOSE) << "Bound on " << addr << ":" << port;
+ RTC_LOG(LS_VERBOSE) << "Bound on " << addr << ":" << port;
} else if (atyp == 3) {
uint8_t len;
std::string addr;
@@ -618,13 +618,13 @@
!response.ReadString(&addr, len) ||
!response.ReadUInt16(&port))
return;
- LOG(LS_VERBOSE) << "Bound on " << addr << ":" << port;
+ RTC_LOG(LS_VERBOSE) << "Bound on " << addr << ":" << port;
} else if (atyp == 4) {
std::string addr;
if (!response.ReadString(&addr, 16) ||
!response.ReadUInt16(&port))
return;
- LOG(LS_VERBOSE) << "Bound on <IPV6>:" << port;
+ RTC_LOG(LS_VERBOSE) << "Bound on <IPV6>:" << port;
} else {
Error(0);
return;
diff --git a/rtc_base/ssladapter_unittest.cc b/rtc_base/ssladapter_unittest.cc
index f82f89b..0996b01 100644
--- a/rtc_base/ssladapter_unittest.cc
+++ b/rtc_base/ssladapter_unittest.cc
@@ -81,13 +81,13 @@
}
int Connect(const std::string& hostname, const rtc::SocketAddress& address) {
- LOG(LS_INFO) << "Initiating connection with " << address;
+ RTC_LOG(LS_INFO) << "Initiating connection with " << address;
int rv = ssl_adapter_->Connect(address);
if (rv == 0) {
- LOG(LS_INFO) << "Starting " << GetSSLProtocolName(ssl_mode_)
- << " handshake with " << hostname;
+ RTC_LOG(LS_INFO) << "Starting " << GetSSLProtocolName(ssl_mode_)
+ << " handshake with " << hostname;
if (ssl_adapter_->StartSSL(hostname.c_str(), false) != 0) {
return -1;
@@ -102,7 +102,7 @@
}
int Send(const std::string& message) {
- LOG(LS_INFO) << "Client sending '" << message << "'";
+ RTC_LOG(LS_INFO) << "Client sending '" << message << "'";
return ssl_adapter_->Send(message.data(), message.length());
}
@@ -115,7 +115,7 @@
if (read != -1) {
buffer[read] = '\0';
- LOG(LS_INFO) << "Client received '" << buffer << "'";
+ RTC_LOG(LS_INFO) << "Client received '" << buffer << "'";
data_ += buffer;
}
@@ -155,8 +155,9 @@
server_socket_->Listen(1);
}
- LOG(LS_INFO) << ((ssl_mode_ == rtc::SSL_MODE_DTLS) ? "UDP" : "TCP")
- << " server listening on " << server_socket_->GetLocalAddress();
+ RTC_LOG(LS_INFO) << ((ssl_mode_ == rtc::SSL_MODE_DTLS) ? "UDP" : "TCP")
+ << " server listening on "
+ << server_socket_->GetLocalAddress();
}
rtc::SocketAddress GetAddress() const {
@@ -180,7 +181,7 @@
return -1;
}
- LOG(LS_INFO) << "Server sending '" << message << "'";
+ RTC_LOG(LS_INFO) << "Server sending '" << message << "'";
size_t written;
int error;
@@ -228,7 +229,7 @@
stream->Read(buffer, sizeof(buffer) - 1, &read, &error);
if (r == rtc::SR_SUCCESS) {
buffer[read] = '\0';
- LOG(LS_INFO) << "Server received '" << buffer << "'";
+ RTC_LOG(LS_INFO) << "Server received '" << buffer << "'";
data_ += buffer;
}
}
@@ -321,14 +322,15 @@
EXPECT_EQ_WAIT(rtc::AsyncSocket::CS_CONNECTED, client_->GetState(),
handshake_wait_);
- LOG(LS_INFO) << GetSSLProtocolName(ssl_mode_) << " handshake complete.";
+ RTC_LOG(LS_INFO) << GetSSLProtocolName(ssl_mode_)
+ << " handshake complete.";
} else {
// On handshake failure the client should end up in the CS_CLOSED state.
EXPECT_EQ_WAIT(rtc::AsyncSocket::CS_CLOSED, client_->GetState(),
handshake_wait_);
- LOG(LS_INFO) << GetSSLProtocolName(ssl_mode_) << " handshake failed.";
+ RTC_LOG(LS_INFO) << GetSSLProtocolName(ssl_mode_) << " handshake failed.";
}
}
@@ -347,7 +349,7 @@
// The client should have received the server's message.
EXPECT_EQ_WAIT(message, client_->GetReceivedData(), kTimeout);
- LOG(LS_INFO) << "Transfer complete.";
+ RTC_LOG(LS_INFO) << "Transfer complete.";
}
protected:
diff --git a/rtc_base/sslfingerprint.cc b/rtc_base/sslfingerprint.cc
index 3f4555b..dda46f1 100644
--- a/rtc_base/sslfingerprint.cc
+++ b/rtc_base/sslfingerprint.cc
@@ -67,14 +67,15 @@
const RTCCertificate* cert) {
std::string digest_alg;
if (!cert->ssl_certificate().GetSignatureDigestAlgorithm(&digest_alg)) {
- LOG(LS_ERROR) << "Failed to retrieve the certificate's digest algorithm";
+ RTC_LOG(LS_ERROR)
+ << "Failed to retrieve the certificate's digest algorithm";
return nullptr;
}
SSLFingerprint* fingerprint = Create(digest_alg, cert->identity());
if (!fingerprint) {
- LOG(LS_ERROR) << "Failed to create identity fingerprint, alg="
- << digest_alg;
+ RTC_LOG(LS_ERROR) << "Failed to create identity fingerprint, alg="
+ << digest_alg;
}
return fingerprint;
}
diff --git a/rtc_base/sslidentity_unittest.cc b/rtc_base/sslidentity_unittest.cc
index 6932298..c26d8d7 100644
--- a/rtc_base/sslidentity_unittest.cc
+++ b/rtc_base/sslidentity_unittest.cc
@@ -563,7 +563,7 @@
memcpy(buf, entry.string, length); // Copy the ASN1 string...
buf[length] = rtc::CreateRandomId(); // ...and terminate it with junk.
int64_t res = rtc::ASN1TimeToSec(buf, length, entry.long_format);
- LOG(LS_VERBOSE) << entry.string;
+ RTC_LOG(LS_VERBOSE) << entry.string;
ASSERT_EQ(entry.want, res);
}
// Run all examples again, but with an invalid length.
@@ -572,7 +572,7 @@
memcpy(buf, entry.string, length); // Copy the ASN1 string...
buf[length] = rtc::CreateRandomId(); // ...and terminate it with junk.
int64_t res = rtc::ASN1TimeToSec(buf, length - 1, entry.long_format);
- LOG(LS_VERBOSE) << entry.string;
+ RTC_LOG(LS_VERBOSE) << entry.string;
ASSERT_EQ(-1, res);
}
}
diff --git a/rtc_base/sslstreamadapter_unittest.cc b/rtc_base/sslstreamadapter_unittest.cc
index 3999ac5..2a3af85 100644
--- a/rtc_base/sslstreamadapter_unittest.cc
+++ b/rtc_base/sslstreamadapter_unittest.cc
@@ -107,8 +107,8 @@
int mask = (rtc::SE_READ | rtc::SE_CLOSE);
if (sig & mask) {
- LOG(LS_VERBOSE) << "SSLDummyStreamBase::OnEvent side=" << side_
- << " sig=" << sig << " forwarding upward";
+ RTC_LOG(LS_VERBOSE) << "SSLDummyStreamBase::OnEvent side=" << side_
+ << " sig=" << sig << " forwarding upward";
PostEvent(sig & mask, 0);
}
}
@@ -116,8 +116,8 @@
// Catch writeability events on out and pass them up.
void OnEventOut(rtc::StreamInterface* stream, int sig, int err) {
if (sig & rtc::SE_WRITE) {
- LOG(LS_VERBOSE) << "SSLDummyStreamBase::OnEvent side=" << side_
- << " sig=" << sig << " forwarding upward";
+ RTC_LOG(LS_VERBOSE) << "SSLDummyStreamBase::OnEvent side=" << side_
+ << " sig=" << sig << " forwarding upward";
PostEvent(sig & rtc::SE_WRITE, 0);
}
@@ -133,7 +133,7 @@
size_t* written, int* error) override;
void Close() override {
- LOG(LS_INFO) << "Closing outbound stream";
+ RTC_LOG(LS_INFO) << "Closing outbound stream";
out_->Close();
}
@@ -308,7 +308,7 @@
}
virtual void OnEvent(rtc::StreamInterface *stream, int sig, int err) {
- LOG(LS_VERBOSE) << "SSLStreamAdapterTestBase::OnEvent sig=" << sig;
+ RTC_LOG(LS_VERBOSE) << "SSLStreamAdapterTestBase::OnEvent sig=" << sig;
if (sig & rtc::SE_READ) {
ReadData(stream);
@@ -331,7 +331,7 @@
? rtc::SSLPeerCertificateDigestError::NONE
: rtc::SSLPeerCertificateDigestError::VERIFICATION_FAILED;
- LOG(LS_INFO) << "Setting peer identities by digest";
+ RTC_LOG(LS_INFO) << "Setting peer identities by digest";
rv = server_identity_->certificate().ComputeDigest(
rtc::DIGEST_SHA_1, server_digest, 20, &server_digest_len);
@@ -341,7 +341,7 @@
ASSERT_TRUE(rv);
if (!correct) {
- LOG(LS_INFO) << "Setting bogus digest for server cert";
+ RTC_LOG(LS_INFO) << "Setting bogus digest for server cert";
server_digest[0]++;
}
rv = client_ssl_->SetPeerCertificateDigest(rtc::DIGEST_SHA_1, server_digest,
@@ -350,7 +350,7 @@
EXPECT_EQ(expect_success, rv);
if (!correct) {
- LOG(LS_INFO) << "Setting bogus digest for client cert";
+ RTC_LOG(LS_INFO) << "Setting bogus digest for client cert";
client_digest[0]++;
}
rv = server_ssl_->SetPeerCertificateDigest(rtc::DIGEST_SHA_1, client_digest,
@@ -464,12 +464,12 @@
int *error) {
// Randomly drop loss_ percent of packets
if (rtc::CreateRandomId() % 100 < static_cast<uint32_t>(loss_)) {
- LOG(LS_VERBOSE) << "Randomly dropping packet, size=" << data_len;
+ RTC_LOG(LS_VERBOSE) << "Randomly dropping packet, size=" << data_len;
*written = data_len;
return rtc::SR_SUCCESS;
}
if (dtls_ && (data_len > mtu_)) {
- LOG(LS_VERBOSE) << "Dropping packet > mtu, size=" << data_len;
+ RTC_LOG(LS_VERBOSE) << "Dropping packet > mtu, size=" << data_len;
*written = data_len;
return rtc::SR_SUCCESS;
}
@@ -480,7 +480,7 @@
if (damage_ && (*static_cast<const unsigned char *>(data) == 23)) {
std::vector<char> buf(data_len);
- LOG(LS_VERBOSE) << "Damaging packet";
+ RTC_LOG(LS_VERBOSE) << "Damaging packet";
memcpy(&buf[0], data, data_len);
buf[data_len - 1]++;
@@ -620,7 +620,7 @@
// Test data transfer for TLS
void TestTransfer(int size) override {
- LOG(LS_INFO) << "Starting transfer test with " << size << " bytes";
+ RTC_LOG(LS_INFO) << "Starting transfer test with " << size << " bytes";
// Create some dummy data to send.
size_t received;
@@ -666,9 +666,9 @@
if (rv == rtc::SR_SUCCESS) {
send_stream_.SetPosition(position + sent);
- LOG(LS_VERBOSE) << "Sent: " << position + sent;
+ RTC_LOG(LS_VERBOSE) << "Sent: " << position + sent;
} else if (rv == rtc::SR_BLOCK) {
- LOG(LS_VERBOSE) << "Blocked...";
+ RTC_LOG(LS_VERBOSE) << "Blocked...";
send_stream_.SetPosition(position);
break;
} else {
@@ -677,7 +677,7 @@
}
} else {
// Now close
- LOG(LS_INFO) << "Wrote " << position << " bytes. Closing";
+ RTC_LOG(LS_INFO) << "Wrote " << position << " bytes. Closing";
client_ssl_->Close();
break;
}
@@ -704,7 +704,7 @@
break;
ASSERT_EQ(rtc::SR_SUCCESS, r);
- LOG(LS_VERBOSE) << "Read " << bread;
+ RTC_LOG(LS_VERBOSE) << "Read " << bread;
recv_stream_.Write(buffer, bread, nullptr, nullptr);
}
@@ -763,10 +763,10 @@
size_t sent;
rtc::StreamResult rv = client_ssl_->Write(packet, packet_size_, &sent, 0);
if (rv == rtc::SR_SUCCESS) {
- LOG(LS_VERBOSE) << "Sent: " << sent_;
+ RTC_LOG(LS_VERBOSE) << "Sent: " << sent_;
sent_++;
} else if (rv == rtc::SR_BLOCK) {
- LOG(LS_VERBOSE) << "Blocked...";
+ RTC_LOG(LS_VERBOSE) << "Blocked...";
break;
} else {
ADD_FAILURE();
@@ -797,7 +797,7 @@
break;
ASSERT_EQ(rtc::SR_SUCCESS, r);
- LOG(LS_VERBOSE) << "Read " << bread;
+ RTC_LOG(LS_VERBOSE) << "Read " << bread;
// Now parse the datagram
ASSERT_EQ(packet_size_, bread);
@@ -819,7 +819,7 @@
WriteData();
EXPECT_TRUE_WAIT(sent_ == count_, 10000);
- LOG(LS_INFO) << "sent_ == " << sent_;
+ RTC_LOG(LS_INFO) << "sent_ == " << sent_;
if (damage_) {
WAIT(false, 2000);
@@ -827,8 +827,8 @@
} else if (loss_ == 0) {
EXPECT_EQ_WAIT(static_cast<size_t>(sent_), received_.size(), 1000);
} else {
- LOG(LS_INFO) << "Sent " << sent_ << " packets; received " <<
- received_.size();
+ RTC_LOG(LS_INFO) << "Sent " << sent_ << " packets; received "
+ << received_.size();
}
};
@@ -844,12 +844,12 @@
rtc::StreamResult SSLDummyStreamBase::Write(const void* data, size_t data_len,
size_t* written, int* error) {
- LOG(LS_VERBOSE) << "Writing to loopback " << data_len;
+ RTC_LOG(LS_VERBOSE) << "Writing to loopback " << data_len;
if (first_packet_) {
first_packet_ = false;
if (test_base_->GetLoseFirstPacket()) {
- LOG(LS_INFO) << "Losing initial packet of length " << data_len;
+ RTC_LOG(LS_INFO) << "Losing initial packet of length " << data_len;
*written = data_len; // Fake successful writing also to writer.
return rtc::SR_SUCCESS;
}
diff --git a/rtc_base/stream.cc b/rtc_base/stream.cc
index f64b32d..c762277 100644
--- a/rtc_base/stream.cc
+++ b/rtc_base/stream.cc
@@ -931,17 +931,17 @@
void LoggingAdapter::Close() {
LogMultiline(level_, label_.c_str(), false, nullptr, 0, hex_mode_, &lms_);
LogMultiline(level_, label_.c_str(), true, nullptr, 0, hex_mode_, &lms_);
- LOG_V(level_) << label_ << " Closed locally";
+ RTC_LOG_V(level_) << label_ << " Closed locally";
StreamAdapterInterface::Close();
}
void LoggingAdapter::OnEvent(StreamInterface* stream, int events, int err) {
if (events & SE_OPEN) {
- LOG_V(level_) << label_ << " Open";
+ RTC_LOG_V(level_) << label_ << " Open";
} else if (events & SE_CLOSE) {
LogMultiline(level_, label_.c_str(), false, nullptr, 0, hex_mode_, &lms_);
LogMultiline(level_, label_.c_str(), true, nullptr, 0, hex_mode_, &lms_);
- LOG_V(level_) << label_ << " Closed with error: " << err;
+ RTC_LOG_V(level_) << label_ << " Closed with error: " << err;
}
StreamAdapterInterface::OnEvent(stream, events, err);
}
diff --git a/rtc_base/task_queue.h b/rtc_base/task_queue.h
index 7842ea3..2f247e6 100644
--- a/rtc_base/task_queue.h
+++ b/rtc_base/task_queue.h
@@ -119,7 +119,7 @@
// }
// ...
// my_class->StartWorkAndLetMeKnowWhenDone(
-// NewClosure([]() { LOG(INFO) << "The work is done!";}));
+// NewClosure([]() { RTC_LOG(INFO) << "The work is done!";}));
//
// 3) Posting a custom task on a timer. The task posts itself again after
// every running:
diff --git a/rtc_base/task_queue_libevent.cc b/rtc_base/task_queue_libevent.cc
index 3d9188e..eb242b6 100644
--- a/rtc_base/task_queue_libevent.cc
+++ b/rtc_base/task_queue_libevent.cc
@@ -358,7 +358,7 @@
}
char message = kRunTask;
if (write(wakeup_pipe_in_, &message, sizeof(message)) != sizeof(message)) {
- LOG(WARNING) << "Failed to queue task.";
+ RTC_LOG(WARNING) << "Failed to queue task.";
CritScope lock(&pending_lock_);
pending_.remove_if([task_id](std::unique_ptr<QueuedTask>& t) {
return t.get() == task_id;
diff --git a/rtc_base/testclient_unittest.cc b/rtc_base/testclient_unittest.cc
index f3c8561..1d1d3f2 100644
--- a/rtc_base/testclient_unittest.cc
+++ b/rtc_base/testclient_unittest.cc
@@ -18,16 +18,16 @@
using namespace rtc;
-#define MAYBE_SKIP_IPV4 \
- if (!HasIPv4Enabled()) { \
- LOG(LS_INFO) << "No IPv4... skipping"; \
- return; \
+#define MAYBE_SKIP_IPV4 \
+ if (!HasIPv4Enabled()) { \
+ RTC_LOG(LS_INFO) << "No IPv4... skipping"; \
+ return; \
}
-#define MAYBE_SKIP_IPV6 \
- if (!HasIPv6Enabled()) { \
- LOG(LS_INFO) << "No IPv6... skipping"; \
- return; \
+#define MAYBE_SKIP_IPV6 \
+ if (!HasIPv6Enabled()) { \
+ RTC_LOG(LS_INFO) << "No IPv6... skipping"; \
+ return; \
}
void TestUdpInternal(const SocketAddress& loopback) {
diff --git a/rtc_base/testutils.h b/rtc_base/testutils.h
index a3ced7c..d901f82 100644
--- a/rtc_base/testutils.h
+++ b/rtc_base/testutils.h
@@ -471,12 +471,13 @@
// Helpers for determining if X/screencasting is available (on linux).
-#define MAYBE_SKIP_SCREENCAST_TEST() \
- if (!testing::IsScreencastingAvailable()) { \
- LOG(LS_WARNING) << "Skipping test, since it doesn't have the requisite " \
- << "X environment for screen capture."; \
- return; \
- } \
+#define MAYBE_SKIP_SCREENCAST_TEST() \
+ if (!testing::IsScreencastingAvailable()) { \
+ RTC_LOG(LS_WARNING) \
+ << "Skipping test, since it doesn't have the requisite " \
+ << "X environment for screen capture."; \
+ return; \
+ }
#if defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID)
struct XDisplay {
@@ -495,18 +496,18 @@
#if defined(WEBRTC_LINUX) && !defined(WEBRTC_ANDROID)
XDisplay display;
if (!display.IsValid()) {
- LOG(LS_WARNING) << "No X Display available.";
+ RTC_LOG(LS_WARNING) << "No X Display available.";
return false;
}
int ignored_int, major_version, minor_version;
if (!XRRQueryExtension(display, &ignored_int, &ignored_int) ||
!XRRQueryVersion(display, &major_version, &minor_version)) {
- LOG(LS_WARNING) << "XRandr is not supported.";
+ RTC_LOG(LS_WARNING) << "XRandr is not supported.";
return false;
}
if (major_version < 1 || (major_version < 2 && minor_version < 3)) {
- LOG(LS_WARNING) << "XRandr is too old (version: " << major_version << "."
- << minor_version << "). Need 1.3 or later.";
+ RTC_LOG(LS_WARNING) << "XRandr is too old (version: " << major_version
+ << "." << minor_version << "). Need 1.3 or later.";
return false;
}
#endif
diff --git a/rtc_base/thread.cc b/rtc_base/thread.cc
index 41ba04e..6dda762 100644
--- a/rtc_base/thread.cc
+++ b/rtc_base/thread.cc
@@ -176,7 +176,7 @@
ts.tv_nsec = (milliseconds % 1000) * 1000000;
int ret = nanosleep(&ts, nullptr);
if (ret != 0) {
- LOG_ERR(LS_WARNING) << "nanosleep() returning early";
+ RTC_LOG_ERR(LS_WARNING) << "nanosleep() returning early";
return false;
}
return true;
@@ -222,7 +222,7 @@
int error_code = pthread_create(&thread_, &attr, PreRun, init);
if (0 != error_code) {
- LOG(LS_ERROR) << "Unable to create pthread, error " << error_code;
+ RTC_LOG(LS_ERROR) << "Unable to create pthread, error " << error_code;
return false;
}
running_.Set();
@@ -240,7 +240,8 @@
#if defined(WEBRTC_WIN)
if (thread_ != nullptr) {
if (!CloseHandle(thread_)) {
- LOG_GLE(LS_ERROR) << "When unwrapping thread, failed to close handle.";
+ RTC_LOG_GLE(LS_ERROR)
+ << "When unwrapping thread, failed to close handle.";
}
thread_ = nullptr;
}
@@ -256,8 +257,8 @@
if (running()) {
RTC_DCHECK(!IsCurrent());
if (Current() && !Current()->blocking_calls_allowed_) {
- LOG(LS_WARNING) << "Waiting for the thread to join, "
- << "but blocking calls have been disallowed";
+ RTC_LOG(LS_WARNING) << "Waiting for the thread to join, "
+ << "but blocking calls have been disallowed";
}
#if defined(WEBRTC_WIN)
@@ -506,7 +507,7 @@
// This gives us the best chance of succeeding.
thread_ = OpenThread(SYNCHRONIZE, FALSE, GetCurrentThreadId());
if (!thread_) {
- LOG_GLE(LS_ERROR) << "Unable to get handle to thread.";
+ RTC_LOG_GLE(LS_ERROR) << "Unable to get handle to thread.";
return false;
}
thread_id_ = GetCurrentThreadId();
diff --git a/rtc_base/timestampaligner.cc b/rtc_base/timestampaligner.cc
index 22a4436..a9bcafb 100644
--- a/rtc_base/timestampaligner.cc
+++ b/rtc_base/timestampaligner.cc
@@ -86,9 +86,9 @@
// below this threshold.
static const int64_t kResetThresholdUs = 300000;
if (std::abs(error_us) > kResetThresholdUs) {
- LOG(LS_INFO) << "Resetting timestamp translation after averaging "
- << frames_seen_ << " frames. Old offset: " << offset_us_
- << ", new offset: " << diff_us;
+ RTC_LOG(LS_INFO) << "Resetting timestamp translation after averaging "
+ << frames_seen_ << " frames. Old offset: " << offset_us_
+ << ", new offset: " << diff_us;
frames_seen_ = 0;
clip_bias_us_ = 0;
}
@@ -119,10 +119,10 @@
// timestamps with with too short inter-frame interval. We may even return
// duplicate timestamps in case this function is called several times with
// exactly the same |system_time_us|.
- LOG(LS_WARNING) << "too short translated timestamp interval: "
- << "system time (us) = " << system_time_us
- << ", interval (us) = "
- << system_time_us - prev_translated_time_us_;
+ RTC_LOG(LS_WARNING) << "too short translated timestamp interval: "
+ << "system time (us) = " << system_time_us
+ << ", interval (us) = "
+ << system_time_us - prev_translated_time_us_;
time_us = system_time_us;
}
}
diff --git a/rtc_base/trace_event.h b/rtc_base/trace_event.h
index 9497a2d..7a9f2dd 100644
--- a/rtc_base/trace_event.h
+++ b/rtc_base/trace_event.h
@@ -28,7 +28,7 @@
// Begin and end of function calls
// Counters
//
-// Events are issued against categories. Whereas LOG's
+// Events are issued against categories. Whereas RTC_LOG's
// categories are statically defined, TRACE categories are created
// implicitly with a string. For example:
// TRACE_EVENT_INSTANT0("MY_SUBSYSTEM", "SomeImportantEvent")
@@ -141,7 +141,6 @@
// Thread safety is provided by methods defined in event_tracer.h. See the file
// for details.
-
// By default, const char* argument values are assumed to have long-lived scope
// and will not be copied. Use this macro to force a const char* to be copied.
#define TRACE_STR_COPY(str) \
diff --git a/rtc_base/unittest_main.cc b/rtc_base/unittest_main.cc
index dd294c2..cff32ef 100644
--- a/rtc_base/unittest_main.cc
+++ b/rtc_base/unittest_main.cc
@@ -44,18 +44,20 @@
const wchar_t* file,
unsigned int line,
uintptr_t pReserved) {
- LOG(LS_ERROR) << "InvalidParameter Handler called. Exiting.";
- LOG(LS_ERROR) << expression << std::endl << function << std::endl << file
- << std::endl << line;
+ RTC_LOG(LS_ERROR) << "InvalidParameter Handler called. Exiting.";
+ RTC_LOG(LS_ERROR) << expression << std::endl
+ << function << std::endl
+ << file << std::endl
+ << line;
exit(1);
}
void TestPureCallHandler() {
- LOG(LS_ERROR) << "Purecall Handler called. Exiting.";
+ RTC_LOG(LS_ERROR) << "Purecall Handler called. Exiting.";
exit(1);
}
int TestCrtReportHandler(int report_type, char* msg, int* retval) {
- LOG(LS_ERROR) << "CrtReport Handler called...";
- LOG(LS_ERROR) << msg;
+ RTC_LOG(LS_ERROR) << "CrtReport Handler called...";
+ RTC_LOG(LS_ERROR) << msg;
if (report_type == _CRT_ASSERT) {
exit(1);
} else {
diff --git a/rtc_base/unixfilesystem.cc b/rtc_base/unixfilesystem.cc
index 8355141..8732d47 100644
--- a/rtc_base/unixfilesystem.cc
+++ b/rtc_base/unixfilesystem.cc
@@ -58,7 +58,7 @@
UnixFilesystem::~UnixFilesystem() {}
bool UnixFilesystem::DeleteFile(const Pathname &filename) {
- LOG(LS_INFO) << "Deleting file:" << filename.pathname();
+ RTC_LOG(LS_INFO) << "Deleting file:" << filename.pathname();
if (!IsFile(filename)) {
RTC_DCHECK(IsFile(filename));
@@ -89,8 +89,8 @@
RTC_DCHECK(IsFile(old_path));
return false;
}
- LOG(LS_VERBOSE) << "Moving " << old_path.pathname()
- << " to " << new_path.pathname();
+ RTC_LOG(LS_VERBOSE) << "Moving " << old_path.pathname() << " to "
+ << new_path.pathname();
if (rename(old_path.pathname().c_str(), new_path.pathname().c_str()) != 0) {
return false;
}
diff --git a/rtc_base/virtualsocket_unittest.cc b/rtc_base/virtualsocket_unittest.cc
index 6081346..a6a4ee1 100644
--- a/rtc_base/virtualsocket_unittest.cc
+++ b/rtc_base/virtualsocket_unittest.cc
@@ -707,7 +707,7 @@
// address.
void DelayTest(const SocketAddress& initial_addr) {
time_t seed = ::time(nullptr);
- LOG(LS_VERBOSE) << "seed = " << seed;
+ RTC_LOG(LS_VERBOSE) << "seed = " << seed;
srand(static_cast<unsigned int>(seed));
const uint32_t mean = 2000;
@@ -744,7 +744,8 @@
receiver.samples * receiver.sum_sq - receiver.sum * receiver.sum;
double den = receiver.samples * (receiver.samples - 1);
const double sample_stddev = sqrt(num / den);
- LOG(LS_VERBOSE) << "mean=" << sample_mean << " stddev=" << sample_stddev;
+ RTC_LOG(LS_VERBOSE) << "mean=" << sample_mean
+ << " stddev=" << sample_stddev;
EXPECT_LE(500u, receiver.samples);
// We initially used a 0.1 fudge factor, but on the build machine, we
diff --git a/rtc_base/virtualsocketserver.cc b/rtc_base/virtualsocketserver.cc
index e799cea..d461bf1 100644
--- a/rtc_base/virtualsocketserver.cc
+++ b/rtc_base/virtualsocketserver.cc
@@ -409,7 +409,7 @@
} else if ((SOCK_STREAM == type_) && (CS_CONNECTING == state_)) {
CompleteConnect(data->addr, true);
} else {
- LOG(LS_VERBOSE) << "Socket at " << local_addr_ << " is not listening";
+ RTC_LOG(LS_VERBOSE) << "Socket at " << local_addr_ << " is not listening";
server_->Disconnect(server_->LookupBinding(data->addr));
}
delete data;
@@ -804,8 +804,8 @@
uint32_t delay = use_delay ? GetTransitDelay(socket) : 0;
VirtualSocket* remote = LookupBinding(remote_addr);
if (!CanInteractWith(socket, remote)) {
- LOG(LS_INFO) << "Address family mismatch between "
- << socket->GetLocalAddress() << " and " << remote_addr;
+ RTC_LOG(LS_INFO) << "Address family mismatch between "
+ << socket->GetLocalAddress() << " and " << remote_addr;
return -1;
}
if (remote != nullptr) {
@@ -813,7 +813,7 @@
msg_queue_->PostDelayed(RTC_FROM_HERE, delay, remote, MSG_ID_CONNECT,
new MessageAddress(addr));
} else {
- LOG(LS_INFO) << "No one listening at " << remote_addr;
+ RTC_LOG(LS_INFO) << "No one listening at " << remote_addr;
msg_queue_->PostDelayed(RTC_FROM_HERE, delay, socket, MSG_ID_DISCONNECT);
}
return 0;
@@ -843,7 +843,7 @@
// See if we want to drop this packet.
if (Random() < drop_prob_) {
- LOG(LS_VERBOSE) << "Dropping packet: bad luck";
+ RTC_LOG(LS_VERBOSE) << "Dropping packet: bad luck";
return static_cast<int>(data_size);
}
@@ -854,17 +854,18 @@
CreateSocketInternal(AF_INET, SOCK_DGRAM));
dummy_socket->SetLocalAddress(remote_addr);
if (!CanInteractWith(socket, dummy_socket.get())) {
- LOG(LS_VERBOSE) << "Incompatible address families: "
- << socket->GetLocalAddress() << " and " << remote_addr;
+ RTC_LOG(LS_VERBOSE) << "Incompatible address families: "
+ << socket->GetLocalAddress() << " and "
+ << remote_addr;
return -1;
}
- LOG(LS_VERBOSE) << "No one listening at " << remote_addr;
+ RTC_LOG(LS_VERBOSE) << "No one listening at " << remote_addr;
return static_cast<int>(data_size);
}
if (!CanInteractWith(socket, recipient)) {
- LOG(LS_VERBOSE) << "Incompatible address families: "
- << socket->GetLocalAddress() << " and " << remote_addr;
+ RTC_LOG(LS_VERBOSE) << "Incompatible address families: "
+ << socket->GetLocalAddress() << " and " << remote_addr;
return -1;
}
@@ -884,7 +885,7 @@
size_t packet_size = data_size + UDP_HEADER_SIZE;
if (socket->network_size_ + packet_size > network_capacity_) {
- LOG(LS_VERBOSE) << "Dropping packet: network capacity exceeded";
+ RTC_LOG(LS_VERBOSE) << "Dropping packet: network capacity exceeded";
return static_cast<int>(data_size);
}
@@ -912,7 +913,7 @@
VirtualSocket* recipient = LookupConnection(socket->local_addr_,
socket->remote_addr_);
if (!recipient) {
- LOG(LS_VERBOSE) << "Sending data to no one.";
+ RTC_LOG(LS_VERBOSE) << "Sending data to no one.";
return;
}
@@ -1088,7 +1089,7 @@
// Otherwise, use the delay from the distribution distribution.
size_t index = rand() % delay_dist_->size();
double delay = (*delay_dist_)[index].second;
- // LOG_F(LS_INFO) << "random[" << index << "] = " << delay;
+ // RTC_LOG_F(LS_INFO) << "random[" << index << "] = " << delay;
return static_cast<uint32_t>(delay);
}
diff --git a/rtc_base/win32filesystem.cc b/rtc_base/win32filesystem.cc
index 024aa84..511f966 100644
--- a/rtc_base/win32filesystem.cc
+++ b/rtc_base/win32filesystem.cc
@@ -34,7 +34,7 @@
namespace rtc {
bool Win32Filesystem::DeleteFile(const Pathname &filename) {
- LOG(LS_INFO) << "Deleting file " << filename.pathname();
+ RTC_LOG(LS_INFO) << "Deleting file " << filename.pathname();
if (!IsFile(filename)) {
RTC_DCHECK(IsFile(filename));
return false;
@@ -58,8 +58,8 @@
RTC_DCHECK(IsFile(old_path));
return false;
}
- LOG(LS_INFO) << "Moving " << old_path.pathname()
- << " to " << new_path.pathname();
+ RTC_LOG(LS_INFO) << "Moving " << old_path.pathname() << " to "
+ << new_path.pathname();
return ::MoveFile(ToUtf16(old_path.pathname()).c_str(),
ToUtf16(new_path.pathname()).c_str()) != 0;
}
diff --git a/rtc_base/win32socketserver.cc b/rtc_base/win32socketserver.cc
index 72d352d..d79a1b3 100644
--- a/rtc_base/win32socketserver.cc
+++ b/rtc_base/win32socketserver.cc
@@ -125,9 +125,8 @@
void ReportWSAError(LPCSTR context, int error, const SocketAddress& address) {
LPCSTR description_string;
LPCSTR error_string = WSAErrorToString(error, &description_string);
- LOG(LS_INFO) << context << " = " << error
- << " (" << error_string << ":" << description_string << ") ["
- << address.ToString() << "]";
+ RTC_LOG(LS_INFO) << context << " = " << error << " (" << error_string << ":"
+ << description_string << ") [" << address.ToString() << "]";
}
#else
void ReportWSAError(LPCSTR context, int error, const SocketAddress& address) {}
@@ -216,8 +215,8 @@
void Win32Socket::EventSink::OnNcDestroy() {
if (parent_) {
- LOG(LS_ERROR) << "EventSink hwnd is being destroyed, but the event sink"
- " hasn't yet been disposed.";
+ RTC_LOG(LS_ERROR) << "EventSink hwnd is being destroyed, but the event sink"
+ " hasn't yet been disposed.";
} else {
delete this;
}
@@ -287,8 +286,8 @@
if (result >= 0) {
SocketAddressFromSockAddrStorage(addr, &address);
} else {
- LOG(LS_WARNING) << "GetLocalAddress: unable to get local addr, socket="
- << socket_;
+ RTC_LOG(LS_WARNING) << "GetLocalAddress: unable to get local addr, socket="
+ << socket_;
}
return address;
}
@@ -302,8 +301,8 @@
if (result >= 0) {
SocketAddressFromSockAddrStorage(addr, &address);
} else {
- LOG(LS_WARNING) << "GetRemoteAddress: unable to get remote addr, socket="
- << socket_;
+ RTC_LOG(LS_WARNING)
+ << "GetRemoteAddress: unable to get remote addr, socket=" << socket_;
}
return address;
}
@@ -332,7 +331,7 @@
return DoConnect(addr);
}
- LOG_F(LS_INFO) << "async dns lookup (" << addr.hostname() << ")";
+ RTC_LOG_F(LS_INFO) << "async dns lookup (" << addr.hostname() << ")";
DnsLookup * dns = new DnsLookup;
if (!sink_) {
// Explicitly create the sink ourselves here; we can't rely on SetAsync
@@ -345,7 +344,7 @@
sizeof(dns->buffer));
if (!dns->handle) {
- LOG_F(LS_ERROR) << "WSAAsyncGetHostByName error: " << WSAGetLastError();
+ RTC_LOG_F(LS_ERROR) << "WSAAsyncGetHostByName error: " << WSAGetLastError();
delete dns;
UpdateLastError();
Close();
@@ -590,7 +589,7 @@
*sopt = TCP_NODELAY;
break;
case OPT_DSCP:
- LOG(LS_WARNING) << "Socket::OPT_DSCP not supported.";
+ RTC_LOG(LS_WARNING) << "Socket::OPT_DSCP not supported.";
return -1;
default:
RTC_NOTREACHED();
@@ -611,8 +610,8 @@
ReportWSAError("WSAAsync:connect notify", error, addr_);
#if !defined(NDEBUG)
int64_t duration = TimeSince(connect_time_);
- LOG(LS_INFO) << "WSAAsync:connect error (" << duration
- << " ms), faking close";
+ RTC_LOG(LS_INFO) << "WSAAsync:connect error (" << duration
+ << " ms), faking close";
#endif
state_ = CS_CLOSED;
// If you get an error connecting, close doesn't really do anything
@@ -624,7 +623,7 @@
} else {
#if !defined(NDEBUG)
int64_t duration = TimeSince(connect_time_);
- LOG(LS_INFO) << "WSAAsync:connect (" << duration << " ms)";
+ RTC_LOG(LS_INFO) << "WSAAsync:connect (" << duration << " ms)";
#endif
state_ = CS_CONNECTED;
SignalConnectEvent(this);
@@ -669,8 +668,8 @@
ip = NetworkToHost32(net_ip);
}
- LOG_F(LS_INFO) << "(" << IPAddress(ip).ToSensitiveString()
- << ", " << error << ")";
+ RTC_LOG_F(LS_INFO) << "(" << IPAddress(ip).ToSensitiveString() << ", "
+ << error << ")";
if (error == 0) {
SocketAddress address(ip, dns_->port);
@@ -703,7 +702,7 @@
if (s_wm_wakeup_id == 0)
s_wm_wakeup_id = RegisterWindowMessage(L"WM_WAKEUP");
if (!wnd_.Create(nullptr, kWindowName, 0, 0, 0, 0, 0, 0)) {
- LOG_GLE(LS_ERROR) << "Failed to create message window.";
+ RTC_LOG_GLE(LS_ERROR) << "Failed to create message window.";
}
}
@@ -754,7 +753,7 @@
// Otherwise, dispatch as usual via Translate/DispatchMessage.
b = GetMessage(&msg, nullptr, 0, 0);
if (b == -1) {
- LOG_GLE(LS_ERROR) << "GetMessage failed.";
+ RTC_LOG_GLE(LS_ERROR) << "GetMessage failed.";
return false;
} else if(b) {
if (!hdlg_ || !IsDialogMessage(hdlg_, &msg)) {
diff --git a/rtc_base/win32window.cc b/rtc_base/win32window.cc
index 9e9c839..d71c68e 100644
--- a/rtc_base/win32window.cc
+++ b/rtc_base/win32window.cc
@@ -40,7 +40,7 @@
GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
reinterpret_cast<LPCWSTR>(&Win32Window::WndProc),
&instance_)) {
- LOG_GLE(LS_ERROR) << "GetModuleHandleEx failed";
+ RTC_LOG_GLE(LS_ERROR) << "GetModuleHandleEx failed";
return false;
}
@@ -53,7 +53,7 @@
wcex.lpszClassName = kWindowBaseClassName;
window_class_ = ::RegisterClassEx(&wcex);
if (!window_class_) {
- LOG_GLE(LS_ERROR) << "RegisterClassEx failed";
+ RTC_LOG_GLE(LS_ERROR) << "RegisterClassEx failed";
return false;
}
}
@@ -113,7 +113,7 @@
if (WM_DESTROY == uMsg) {
for (HWND child = ::GetWindow(hwnd, GW_CHILD); child;
child = ::GetWindow(child, GW_HWNDNEXT)) {
- LOG(LS_INFO) << "Child window: " << static_cast<void*>(child);
+ RTC_LOG(LS_INFO) << "Child window: " << static_cast<void*>(child);
}
}
if (WM_NCDESTROY == uMsg) {
diff --git a/rtc_tools/event_log_visualizer/analyzer.cc b/rtc_tools/event_log_visualizer/analyzer.cc
index d48af60..00df006 100644
--- a/rtc_tools/event_log_visualizer/analyzer.cc
+++ b/rtc_tools/event_log_visualizer/analyzer.cc
@@ -113,10 +113,11 @@
difference += modulus;
}
if (difference > max_difference / 2 || difference < min_difference / 2) {
- LOG(LS_WARNING) << "Difference between" << later << " and " << earlier
- << " expected to be in the range (" << min_difference / 2
- << "," << max_difference / 2 << ") but is " << difference
- << ". Correct unwrapping is uncertain.";
+ RTC_LOG(LS_WARNING) << "Difference between" << later << " and " << earlier
+ << " expected to be in the range ("
+ << min_difference / 2 << "," << max_difference / 2
+ << ") but is " << difference
+ << ". Correct unwrapping is uncertain.";
}
return difference;
}
@@ -185,16 +186,17 @@
static_cast<double>(recv_time_diff) / 1000 -
static_cast<double>(send_time_diff) / kVideoSampleRate * 1000;
if (delay_change < -10000 || 10000 < delay_change) {
- LOG(LS_WARNING) << "Very large delay change. Timestamps correct?";
- LOG(LS_WARNING) << "Old capture time " << old_packet.header.timestamp
- << ", received time " << old_packet.timestamp;
- LOG(LS_WARNING) << "New capture time " << new_packet.header.timestamp
- << ", received time " << new_packet.timestamp;
- LOG(LS_WARNING) << "Receive time difference " << recv_time_diff << " = "
- << static_cast<double>(recv_time_diff) / 1000000 << "s";
- LOG(LS_WARNING) << "Send time difference " << send_time_diff << " = "
- << static_cast<double>(send_time_diff) / kVideoSampleRate
- << "s";
+ RTC_LOG(LS_WARNING) << "Very large delay change. Timestamps correct?";
+ RTC_LOG(LS_WARNING) << "Old capture time " << old_packet.header.timestamp
+ << ", received time " << old_packet.timestamp;
+ RTC_LOG(LS_WARNING) << "New capture time " << new_packet.header.timestamp
+ << ", received time " << new_packet.timestamp;
+ RTC_LOG(LS_WARNING) << "Receive time difference " << recv_time_diff << " = "
+ << static_cast<double>(recv_time_diff) / 1000000 << "s";
+ RTC_LOG(LS_WARNING) << "Send time difference " << send_time_diff << " = "
+ << static_cast<double>(send_time_diff) /
+ kVideoSampleRate
+ << "s";
}
return rtc::Optional<double>(delay_change);
}
@@ -617,7 +619,7 @@
last_log_timestamp = packets[i].timestamp;
}
if (last_log_timestamp - first_log_timestamp < 1000000) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "Failed to estimate RTP clock frequency: Stream too short. ("
<< packets.size() << " packets, "
<< last_log_timestamp - first_log_timestamp << " us)";
@@ -632,9 +634,9 @@
return rtc::Optional<uint32_t>(f);
}
}
- LOG(LS_WARNING) << "Failed to estimate RTP clock frequency: Estimate "
- << estimated_frequency
- << "not close to any stardard RTP frequency.";
+ RTC_LOG(LS_WARNING) << "Failed to estimate RTP clock frequency: Estimate "
+ << estimated_frequency
+ << "not close to any stardard RTP frequency.";
return rtc::Optional<uint32_t>();
}
@@ -1507,8 +1509,9 @@
StreamId stream_id = kv.first;
if (packets.size() < 2) {
- LOG(LS_WARNING) << "Can't estimate a the RTP clock frequency or the "
- "pacer delay with less than 2 packets in the stream";
+ RTC_LOG(LS_WARNING)
+ << "Can't estimate a the RTP clock frequency or the "
+ "pacer delay with less than 2 packets in the stream";
continue;
}
rtc::Optional<uint32_t> estimated_frequency =
@@ -1516,7 +1519,7 @@
if (!estimated_frequency)
continue;
if (IsVideoSsrc(stream_id) && *estimated_frequency != 90000) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "Video stream should use a 90 kHz clock but appears to use "
<< *estimated_frequency / 1000 << ". Discarding.";
continue;
diff --git a/sdk/android/src/jni/androidmediacodeccommon.h b/sdk/android/src/jni/androidmediacodeccommon.h
index 62d4862..40f7f13 100644
--- a/sdk/android/src/jni/androidmediacodeccommon.h
+++ b/sdk/android/src/jni/androidmediacodeccommon.h
@@ -75,7 +75,7 @@
// currently thrown exception.
static inline bool CheckException(JNIEnv* jni) {
if (jni->ExceptionCheck()) {
- LOG_TAG(rtc::LS_ERROR, TAG_COMMON) << "Java JNI exception.";
+ RTC_LOG_TAG(rtc::LS_ERROR, TAG_COMMON) << "Java JNI exception.";
jni->ExceptionDescribe();
jni->ExceptionClear();
return true;
diff --git a/sdk/android/src/jni/androidmediadecoder_jni.cc b/sdk/android/src/jni/androidmediadecoder_jni.cc
index 4c14e32..344a4ca 100644
--- a/sdk/android/src/jni/androidmediadecoder_jni.cc
+++ b/sdk/android/src/jni/androidmediadecoder_jni.cc
@@ -50,9 +50,9 @@
#else
#define ALOGV(...)
#endif
-#define ALOGD LOG_TAG(rtc::LS_INFO, TAG_DECODER)
-#define ALOGW LOG_TAG(rtc::LS_WARNING, TAG_DECODER)
-#define ALOGE LOG_TAG(rtc::LS_ERROR, TAG_DECODER)
+#define ALOGD RTC_LOG_TAG(rtc::LS_INFO, TAG_DECODER)
+#define ALOGW RTC_LOG_TAG(rtc::LS_WARNING, TAG_DECODER)
+#define ALOGE RTC_LOG_TAG(rtc::LS_ERROR, TAG_DECODER)
enum { kMaxWarningLogFrames = 2 };
diff --git a/sdk/android/src/jni/androidmediaencoder_jni.cc b/sdk/android/src/jni/androidmediaencoder_jni.cc
index 3882c90..a7d528d 100644
--- a/sdk/android/src/jni/androidmediaencoder_jni.cc
+++ b/sdk/android/src/jni/androidmediaencoder_jni.cc
@@ -67,20 +67,20 @@
#define TAG_ENCODER "MediaCodecVideoEncoder"
#ifdef TRACK_BUFFER_TIMING
#define ALOGV(...)
- __android_log_print(ANDROID_LOG_VERBOSE, TAG_ENCODER, __VA_ARGS__)
+__android_log_print(ANDROID_LOG_VERBOSE, TAG_ENCODER, __VA_ARGS__)
#else
#define ALOGV(...)
#endif
-#define ALOGD LOG_TAG(rtc::LS_INFO, TAG_ENCODER)
-#define ALOGW LOG_TAG(rtc::LS_WARNING, TAG_ENCODER)
-#define ALOGE LOG_TAG(rtc::LS_ERROR, TAG_ENCODER)
+#define ALOGD RTC_LOG_TAG(rtc::LS_INFO, TAG_ENCODER)
+#define ALOGW RTC_LOG_TAG(rtc::LS_WARNING, TAG_ENCODER)
+#define ALOGE RTC_LOG_TAG(rtc::LS_ERROR, TAG_ENCODER)
-namespace {
-// Maximum time limit between incoming frames before requesting a key frame.
-const size_t kFrameDiffThresholdMs = 350;
-const int kMinKeyFrameInterval = 6;
-const char kH264HighProfileFieldTrial[] = "WebRTC-H264HighProfile";
-const char kCustomQPThresholdsFieldTrial[] = "WebRTC-CustomQPThresholds";
+ namespace {
+ // Maximum time limit between incoming frames before requesting a key frame.
+ const size_t kFrameDiffThresholdMs = 350;
+ const int kMinKeyFrameInterval = 6;
+ const char kH264HighProfileFieldTrial[] = "WebRTC-H264HighProfile";
+ const char kCustomQPThresholdsFieldTrial[] = "WebRTC-CustomQPThresholds";
} // namespace
// MediaCodecVideoEncoder is a VideoEncoder implementation that uses
@@ -638,7 +638,7 @@
encoder_fourcc_ = libyuv::FOURCC_NV12;
break;
default:
- LOG(LS_ERROR) << "Wrong color format.";
+ RTC_LOG(LS_ERROR) << "Wrong color format.";
ProcessHWError(false /* reset_if_fallback_unavailable */);
return WEBRTC_VIDEO_CODEC_ERROR;
}
diff --git a/sdk/android/src/jni/androidvideotracksource.cc b/sdk/android/src/jni/androidvideotracksource.cc
index 9099f01..3913ed0 100644
--- a/sdk/android/src/jni/androidvideotracksource.cc
+++ b/sdk/android/src/jni/androidvideotracksource.cc
@@ -35,7 +35,7 @@
j_surface_texture_helper)),
video_buffer_factory_(jni),
is_screencast_(is_screencast) {
- LOG(LS_INFO) << "AndroidVideoTrackSource ctor";
+ RTC_LOG(LS_INFO) << "AndroidVideoTrackSource ctor";
camera_thread_checker_.DetachFromThread();
jclass j_video_frame_buffer_class =
diff --git a/sdk/android/src/jni/androidvideotracksource_jni.cc b/sdk/android/src/jni/androidvideotracksource_jni.cc
index ae49e89..178b099 100644
--- a/sdk/android/src/jni/androidvideotracksource_jni.cc
+++ b/sdk/android/src/jni/androidvideotracksource_jni.cc
@@ -96,7 +96,7 @@
jclass,
jlong j_source,
jboolean j_success) {
- LOG(LS_INFO) << "AndroidVideoTrackSourceObserve_nativeCapturerStarted";
+ RTC_LOG(LS_INFO) << "AndroidVideoTrackSourceObserve_nativeCapturerStarted";
AndroidVideoTrackSource* source =
AndroidVideoTrackSourceFromJavaProxy(j_source);
source->SetState(j_success ? AndroidVideoTrackSource::SourceState::kLive
@@ -108,7 +108,7 @@
JNIEnv* jni,
jclass,
jlong j_source) {
- LOG(LS_INFO) << "AndroidVideoTrackSourceObserve_nativeCapturerStopped";
+ RTC_LOG(LS_INFO) << "AndroidVideoTrackSourceObserve_nativeCapturerStopped";
AndroidVideoTrackSource* source =
AndroidVideoTrackSourceFromJavaProxy(j_source);
source->SetState(AndroidVideoTrackSource::SourceState::kEnded);
@@ -122,7 +122,7 @@
jint j_width,
jint j_height,
jint j_fps) {
- LOG(LS_INFO) << "VideoSource_nativeAdaptOutputFormat";
+ RTC_LOG(LS_INFO) << "VideoSource_nativeAdaptOutputFormat";
AndroidVideoTrackSource* source =
AndroidVideoTrackSourceFromJavaProxy(j_source);
source->OnOutputFormatRequest(j_width, j_height, j_fps);
diff --git a/sdk/android/src/jni/pc/androidnetworkmonitor_jni.cc b/sdk/android/src/jni/pc/androidnetworkmonitor_jni.cc
index a48b3df..6494e72 100644
--- a/sdk/android/src/jni/pc/androidnetworkmonitor_jni.cc
+++ b/sdk/android/src/jni/pc/androidnetworkmonitor_jni.cc
@@ -239,8 +239,9 @@
CHECK_EXCEPTION(jni())
<< "Error during NetworkMonitor.networkBindingSupported";
if (!network_binding_supported) {
- LOG(LS_WARNING) << "BindSocketToNetwork is not supported on this platform "
- << "(Android SDK: " << android_sdk_int_ << ")";
+ RTC_LOG(LS_WARNING)
+ << "BindSocketToNetwork is not supported on this platform "
+ << "(Android SDK: " << android_sdk_int_ << ")";
return rtc::NetworkBindingResult::NOT_IMPLEMENTED;
}
@@ -269,7 +270,8 @@
const std::string android_native_lib_path = "libandroid.so";
void* lib = dlopen(android_native_lib_path.c_str(), RTLD_NOW);
if (lib == nullptr) {
- LOG(LS_ERROR) << "Library " << android_native_lib_path << " not found!";
+ RTC_LOG(LS_ERROR) << "Library " << android_native_lib_path
+ << " not found!";
return rtc::NetworkBindingResult::NOT_IMPLEMENTED;
}
marshmallowSetNetworkForSocket =
@@ -277,7 +279,7 @@
dlsym(lib, "android_setsocknetwork"));
}
if (!marshmallowSetNetworkForSocket) {
- LOG(LS_ERROR) << "Symbol marshmallowSetNetworkForSocket is not found";
+ RTC_LOG(LS_ERROR) << "Symbol marshmallowSetNetworkForSocket is not found";
return rtc::NetworkBindingResult::NOT_IMPLEMENTED;
}
rv = marshmallowSetNetworkForSocket(network_handle, socket_fd);
@@ -298,7 +300,7 @@
// avoid doing any disk IO.
void* lib = dlopen(net_library_path.c_str(), RTLD_NOW | RTLD_NOLOAD);
if (lib == nullptr) {
- LOG(LS_ERROR) << "Library " << net_library_path << " not found!";
+ RTC_LOG(LS_ERROR) << "Library " << net_library_path << " not found!";
return rtc::NetworkBindingResult::NOT_IMPLEMENTED;
}
lollipopSetNetworkForSocket =
@@ -306,7 +308,7 @@
dlsym(lib, "setNetworkForSocket"));
}
if (!lollipopSetNetworkForSocket) {
- LOG(LS_ERROR) << "Symbol lollipopSetNetworkForSocket is not found ";
+ RTC_LOG(LS_ERROR) << "Symbol lollipopSetNetworkForSocket is not found ";
return rtc::NetworkBindingResult::NOT_IMPLEMENTED;
}
rv = lollipopSetNetworkForSocket(network_handle, socket_fd);
@@ -335,7 +337,7 @@
void AndroidNetworkMonitor::OnNetworkConnected_w(
const NetworkInformation& network_info) {
- LOG(LS_INFO) << "Network connected: " << network_info.ToString();
+ RTC_LOG(LS_INFO) << "Network connected: " << network_info.ToString();
adapter_type_by_name_[network_info.interface_name] =
AdapterTypeFromNetworkType(network_info.type);
network_info_by_handle_[network_info.handle] = network_info;
@@ -345,7 +347,7 @@
}
void AndroidNetworkMonitor::OnNetworkDisconnected(NetworkHandle handle) {
- LOG(LS_INFO) << "Network disconnected for handle " << handle;
+ RTC_LOG(LS_INFO) << "Network disconnected for handle " << handle;
worker_thread()->Invoke<void>(
RTC_FROM_HERE,
rtc::Bind(&AndroidNetworkMonitor::OnNetworkDisconnected_w, this, handle));
@@ -366,8 +368,8 @@
RTC_CHECK(thread_checker_.CalledOnValidThread());
network_handle_by_address_.clear();
network_info_by_handle_.clear();
- LOG(LS_INFO) << "Android network monitor found " << network_infos.size()
- << " networks";
+ RTC_LOG(LS_INFO) << "Android network monitor found " << network_infos.size()
+ << " networks";
for (NetworkInformation network : network_infos) {
OnNetworkConnected_w(network);
}
@@ -380,7 +382,7 @@
? rtc::ADAPTER_TYPE_UNKNOWN
: iter->second;
if (type == rtc::ADAPTER_TYPE_UNKNOWN) {
- LOG(LS_WARNING) << "Get an unknown type for the interface " << if_name;
+ RTC_LOG(LS_WARNING) << "Get an unknown type for the interface " << if_name;
}
return type;
}
diff --git a/sdk/android/src/jni/pc/callsessionfilerotatinglogsink_jni.cc b/sdk/android/src/jni/pc/callsessionfilerotatinglogsink_jni.cc
index 868e4a8..af142ae 100644
--- a/sdk/android/src/jni/pc/callsessionfilerotatinglogsink_jni.cc
+++ b/sdk/android/src/jni/pc/callsessionfilerotatinglogsink_jni.cc
@@ -25,7 +25,7 @@
rtc::CallSessionFileRotatingLogSink* sink =
new rtc::CallSessionFileRotatingLogSink(dir_path, j_maxFileSize);
if (!sink->Init()) {
- LOG_V(rtc::LoggingSeverity::LS_WARNING)
+ RTC_LOG_V(rtc::LoggingSeverity::LS_WARNING)
<< "Failed to init CallSessionFileRotatingLogSink for path "
<< dir_path;
delete sink;
@@ -56,13 +56,13 @@
std::unique_ptr<rtc::CallSessionFileRotatingStream> stream(
new rtc::CallSessionFileRotatingStream(dir_path));
if (!stream->Open()) {
- LOG_V(rtc::LoggingSeverity::LS_WARNING)
+ RTC_LOG_V(rtc::LoggingSeverity::LS_WARNING)
<< "Failed to open CallSessionFileRotatingStream for path " << dir_path;
return jni->NewByteArray(0);
}
size_t log_size = 0;
if (!stream->GetSize(&log_size) || log_size == 0) {
- LOG_V(rtc::LoggingSeverity::LS_WARNING)
+ RTC_LOG_V(rtc::LoggingSeverity::LS_WARNING)
<< "CallSessionFileRotatingStream returns 0 size for path " << dir_path;
return jni->NewByteArray(0);
}
diff --git a/sdk/android/src/jni/pc/java_native_conversion.cc b/sdk/android/src/jni/pc/java_native_conversion.cc
index 3caa438..b20d06f 100644
--- a/sdk/android/src/jni/pc/java_native_conversion.cc
+++ b/sdk/android/src/jni/pc/java_native_conversion.cc
@@ -94,7 +94,7 @@
JavaToStdString(jni, GetStringField(jni, j_candidate, j_sdp_id));
cricket::Candidate candidate;
if (!SdpDeserializeCandidate(sdp_mid, sdp, &candidate, NULL)) {
- LOG(LS_ERROR) << "SdpDescrializeCandidate failed with sdp " << sdp;
+ RTC_LOG(LS_ERROR) << "SdpDescrializeCandidate failed with sdp " << sdp;
}
return candidate;
}
diff --git a/sdk/android/src/jni/pc/logging_jni.cc b/sdk/android/src/jni/pc/logging_jni.cc
index 7e3e1d3..7525643 100644
--- a/sdk/android/src/jni/pc/logging_jni.cc
+++ b/sdk/android/src/jni/pc/logging_jni.cc
@@ -50,7 +50,7 @@
jstring j_message) {
std::string message = JavaToStdString(jni, j_message);
std::string tag = JavaToStdString(jni, j_tag);
- LOG_TAG(static_cast<rtc::LoggingSeverity>(j_severity), tag) << message;
+ RTC_LOG_TAG(static_cast<rtc::LoggingSeverity>(j_severity), tag) << message;
}
} // namespace jni
diff --git a/sdk/android/src/jni/pc/ownedfactoryandthreads.cc b/sdk/android/src/jni/pc/ownedfactoryandthreads.cc
index 39e2bd9..abbc036 100644
--- a/sdk/android/src/jni/pc/ownedfactoryandthreads.cc
+++ b/sdk/android/src/jni/pc/ownedfactoryandthreads.cc
@@ -34,15 +34,15 @@
jclass j_factory_class = FindClass(jni, "org/webrtc/PeerConnectionFactory");
jmethodID m = nullptr;
if (network_thread_->IsCurrent()) {
- LOG(LS_INFO) << "Network thread JavaCallback";
+ RTC_LOG(LS_INFO) << "Network thread JavaCallback";
m = GetStaticMethodID(jni, j_factory_class, "onNetworkThreadReady", "()V");
}
if (worker_thread_->IsCurrent()) {
- LOG(LS_INFO) << "Worker thread JavaCallback";
+ RTC_LOG(LS_INFO) << "Worker thread JavaCallback";
m = GetStaticMethodID(jni, j_factory_class, "onWorkerThreadReady", "()V");
}
if (signaling_thread_->IsCurrent()) {
- LOG(LS_INFO) << "Signaling thread JavaCallback";
+ RTC_LOG(LS_INFO) << "Signaling thread JavaCallback";
m = GetStaticMethodID(jni, j_factory_class, "onSignalingThreadReady",
"()V");
}
@@ -53,7 +53,7 @@
}
void OwnedFactoryAndThreads::InvokeJavaCallbacksOnFactoryThreads() {
- LOG(LS_INFO) << "InvokeJavaCallbacksOnFactoryThreads.";
+ RTC_LOG(LS_INFO) << "InvokeJavaCallbacksOnFactoryThreads.";
network_thread_->Invoke<void>(RTC_FROM_HERE,
[this] { JavaCallbackOnFactoryThreads(); });
worker_thread_->Invoke<void>(RTC_FROM_HERE,
diff --git a/sdk/android/src/jni/pc/peerconnection_jni.cc b/sdk/android/src/jni/pc/peerconnection_jni.cc
index 3c6bf76..9c09634 100644
--- a/sdk/android/src/jni/pc/peerconnection_jni.cc
+++ b/sdk/android/src/jni/pc/peerconnection_jni.cc
@@ -100,7 +100,7 @@
// 32-bit parameter.
jlong nativeChannelPtr = jlongFromPointer(channel.get());
if (!nativeChannelPtr) {
- LOG(LS_ERROR) << "Failed to create DataChannel";
+ RTC_LOG(LS_ERROR) << "Failed to create DataChannel";
return nullptr;
}
jclass j_data_channel_class = FindClass(jni, "org/webrtc/DataChannel");
diff --git a/sdk/android/src/jni/pc/peerconnectionfactory_jni.cc b/sdk/android/src/jni/pc/peerconnectionfactory_jni.cc
index 78a1630..b335cff 100644
--- a/sdk/android/src/jni/pc/peerconnectionfactory_jni.cc
+++ b/sdk/android/src/jni/pc/peerconnectionfactory_jni.cc
@@ -84,7 +84,7 @@
field_trials_init_string = new char[init_string_length + 1];
rtc::strcpyn(field_trials_init_string, init_string_length + 1, init_string);
jni->ReleaseStringUTFChars(j_trials_init_string, init_string);
- LOG(LS_INFO) << "initializeFieldTrials: " << field_trials_init_string;
+ RTC_LOG(LS_INFO) << "initializeFieldTrials: " << field_trials_init_string;
}
field_trial::InitFieldTrialsFromString(field_trials_init_string);
}
@@ -115,7 +115,7 @@
const char* init_string =
jni->GetStringUTFChars(j_event_tracing_filename, NULL);
- LOG(LS_INFO) << "Starting internal tracing to: " << init_string;
+ RTC_LOG(LS_INFO) << "Starting internal tracing to: " << init_string;
bool ret = rtc::tracing::StartInternalCapture(init_string);
jni->ReleaseStringUTFChars(j_event_tracing_filename, init_string);
return ret;
@@ -383,7 +383,8 @@
rtc::RTCCertificateGenerator::GenerateCertificate(
rtc::KeyParams(key_type), rtc::Optional<uint64_t>());
if (!certificate) {
- LOG(LS_ERROR) << "Failed to generate certificate. KeyType: " << key_type;
+ RTC_LOG(LS_ERROR) << "Failed to generate certificate. KeyType: "
+ << key_type;
return 0;
}
rtc_config.certificates.push_back(certificate);
diff --git a/sdk/android/src/jni/pc/video_jni.cc b/sdk/android/src/jni/pc/video_jni.cc
index c7eb352..96ee339 100644
--- a/sdk/android/src/jni/pc/video_jni.cc
+++ b/sdk/android/src/jni/pc/video_jni.cc
@@ -119,7 +119,7 @@
owned_factory->encoder_factory());
if (use_media_codec_encoder_factory && encoder_factory &&
jni->IsInstanceOf(local_egl_context, j_eglbase14_context_class)) {
- LOG(LS_INFO) << "Set EGL context for HW encoding.";
+ RTC_LOG(LS_INFO) << "Set EGL context for HW encoding.";
encoder_factory->SetEGLContext(jni, local_egl_context);
}
@@ -127,7 +127,7 @@
static_cast<MediaCodecVideoDecoderFactory*>(
owned_factory->decoder_factory());
if (use_media_codec_decoder_factory && decoder_factory) {
- LOG(LS_INFO) << "Set EGL context for HW decoding.";
+ RTC_LOG(LS_INFO) << "Set EGL context for HW decoding.";
decoder_factory->SetEGLContext(jni, remote_egl_context);
}
}
diff --git a/sdk/android/src/jni/surfacetexturehelper_jni.cc b/sdk/android/src/jni/surfacetexturehelper_jni.cc
index 9a97adc..4f53b9f 100644
--- a/sdk/android/src/jni/surfacetexturehelper_jni.cc
+++ b/sdk/android/src/jni/surfacetexturehelper_jni.cc
@@ -50,7 +50,7 @@
}
SurfaceTextureHelper::~SurfaceTextureHelper() {
- LOG(LS_INFO) << "SurfaceTextureHelper dtor";
+ RTC_LOG(LS_INFO) << "SurfaceTextureHelper dtor";
JNIEnv* jni = AttachCurrentThreadIfNeeded();
jni->CallVoidMethod(
*j_surface_texture_helper_,
diff --git a/sdk/android/src/jni/videodecoderwrapper.cc b/sdk/android/src/jni/videodecoderwrapper.cc
index 762025a..69b5c2d 100644
--- a/sdk/android/src/jni/videodecoderwrapper.cc
+++ b/sdk/android/src/jni/videodecoderwrapper.cc
@@ -177,7 +177,7 @@
FrameExtraInfo frame_extra_info;
do {
if (frame_extra_infos_.empty()) {
- LOG(LS_WARNING) << "Java decoder produced an unexpected frame.";
+ RTC_LOG(LS_WARNING) << "Java decoder produced an unexpected frame.";
return;
}
@@ -252,7 +252,7 @@
InitDecodeInternal(jni);
}
- LOG(LS_WARNING) << "Falling back to software decoder.";
+ RTC_LOG(LS_WARNING) << "Falling back to software decoder.";
return WEBRTC_VIDEO_CODEC_FALLBACK_SOFTWARE;
} else {
return value;
diff --git a/sdk/android/src/jni/videoencoderwrapper.cc b/sdk/android/src/jni/videoencoderwrapper.cc
index 43b242d..d8e1546 100644
--- a/sdk/android/src/jni/videoencoderwrapper.cc
+++ b/sdk/android/src/jni/videoencoderwrapper.cc
@@ -220,7 +220,7 @@
FrameExtraInfo frame_extra_info;
do {
if (frame_extra_infos_.empty()) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "Java encoder produced an unexpected frame with timestamp: "
<< capture_time_ns;
return;
@@ -259,11 +259,11 @@
// Try resetting the codec.
if (++num_resets_ <= kMaxJavaEncoderResets &&
Release() == WEBRTC_VIDEO_CODEC_OK) {
- LOG(LS_WARNING) << "Reset Java encoder: " << num_resets_;
+ RTC_LOG(LS_WARNING) << "Reset Java encoder: " << num_resets_;
return InitEncodeInternal(jni);
}
- LOG(LS_WARNING) << "Falling back to software decoder.";
+ RTC_LOG(LS_WARNING) << "Falling back to software decoder.";
return WEBRTC_VIDEO_CODEC_FALLBACK_SOFTWARE;
} else {
return value;
@@ -280,10 +280,10 @@
const std::vector<H264::NaluIndex> nalu_idxs =
H264::FindNaluIndices(buffer.data(), buffer.size());
if (nalu_idxs.empty()) {
- LOG(LS_ERROR) << "Start code is not found!";
- LOG(LS_ERROR) << "Data:" << buffer[0] << " " << buffer[1] << " "
- << buffer[2] << " " << buffer[3] << " " << buffer[4] << " "
- << buffer[5];
+ RTC_LOG(LS_ERROR) << "Start code is not found!";
+ RTC_LOG(LS_ERROR) << "Data:" << buffer[0] << " " << buffer[1] << " "
+ << buffer[2] << " " << buffer[3] << " " << buffer[4]
+ << " " << buffer[5];
}
header.VerifyAndAllocateFragmentationHeader(nalu_idxs.size());
for (size_t i = 0; i < nalu_idxs.size(); i++) {
diff --git a/sdk/android/src/jni/videofilerenderer_jni.cc b/sdk/android/src/jni/videofilerenderer_jni.cc
index 4cdf0ad..09623f3 100644
--- a/sdk/android/src/jni/videofilerenderer_jni.cc
+++ b/sdk/android/src/jni/videofilerenderer_jni.cc
@@ -61,7 +61,7 @@
width, height, dst_y, dst_stride_y, dst_u, dst_stride_u, dst_v,
dst_stride_v, dstWidth, dstHeight, libyuv::kFilterBilinear);
if (ret) {
- LOG(LS_ERROR) << "Error scaling I420 frame: " << ret;
+ RTC_LOG(LS_ERROR) << "Error scaling I420 frame: " << ret;
}
}
diff --git a/sdk/objc/Framework/Classes/Common/RTCFileLogger.mm b/sdk/objc/Framework/Classes/Common/RTCFileLogger.mm
index afe61a8..15461f4 100644
--- a/sdk/objc/Framework/Classes/Common/RTCFileLogger.mm
+++ b/sdk/objc/Framework/Classes/Common/RTCFileLogger.mm
@@ -101,8 +101,7 @@
break;
}
if (!_logSink->Init()) {
- LOG(LS_ERROR) << "Failed to open log files at path: "
- << _dirPath.UTF8String;
+ RTC_LOG(LS_ERROR) << "Failed to open log files at path: " << _dirPath.UTF8String;
_logSink.reset();
return;
}
diff --git a/sdk/objc/Framework/Classes/Common/RTCLogging.mm b/sdk/objc/Framework/Classes/Common/RTCLogging.mm
index cdb6b18..ab76a1d 100644
--- a/sdk/objc/Framework/Classes/Common/RTCLogging.mm
+++ b/sdk/objc/Framework/Classes/Common/RTCLogging.mm
@@ -28,7 +28,7 @@
void RTCLogEx(RTCLoggingSeverity severity, NSString* log_string) {
if (log_string.length) {
const char* utf8_string = log_string.UTF8String;
- LOG_V(RTCGetNativeLoggingSeverity(severity)) << utf8_string;
+ RTC_LOG_V(RTCGetNativeLoggingSeverity(severity)) << utf8_string;
}
}
diff --git a/sdk/objc/Framework/Classes/Common/helpers.mm b/sdk/objc/Framework/Classes/Common/helpers.mm
index 4afa15d..4409845 100644
--- a/sdk/objc/Framework/Classes/Common/helpers.mm
+++ b/sdk/objc/Framework/Classes/Common/helpers.mm
@@ -50,7 +50,7 @@
[NSString stringWithFormat:@"Error: %ld, %@, %@", (long)error.code,
error.localizedDescription,
error.localizedFailureReason];
- LOG(LS_ERROR) << StdStringFromNSString(msg);
+ RTC_LOG(LS_ERROR) << StdStringFromNSString(msg);
return false;
}
return true;
@@ -124,8 +124,8 @@
// lowPoweredModeEnabled is only available on iOS9+.
return [NSProcessInfo processInfo].lowPowerModeEnabled;
}
- LOG(LS_WARNING) << "webrtc::ios::GetLowPowerModeEnabled() is not "
- "supported. Requires at least iOS 9.0";
+ RTC_LOG(LS_WARNING) << "webrtc::ios::GetLowPowerModeEnabled() is not "
+ "supported. Requires at least iOS 9.0";
return false;
}
#endif
diff --git a/sdk/objc/Framework/Classes/Video/RTCCVPixelBuffer.mm b/sdk/objc/Framework/Classes/Video/RTCCVPixelBuffer.mm
index 454f655..223f112 100644
--- a/sdk/objc/Framework/Classes/Video/RTCCVPixelBuffer.mm
+++ b/sdk/objc/Framework/Classes/Video/RTCCVPixelBuffer.mm
@@ -213,7 +213,7 @@
// Prepare output pointers.
CVReturn cvRet = CVPixelBufferLockBaseAddress(outputPixelBuffer, 0);
if (cvRet != kCVReturnSuccess) {
- LOG(LS_ERROR) << "Failed to lock base address: " << cvRet;
+ RTC_LOG(LS_ERROR) << "Failed to lock base address: " << cvRet;
}
const int dstWidth = CVPixelBufferGetWidth(outputPixelBuffer);
const int dstHeight = CVPixelBufferGetHeight(outputPixelBuffer);
@@ -259,7 +259,7 @@
// Prepare output pointers.
CVReturn cvRet = CVPixelBufferLockBaseAddress(outputPixelBuffer, 0);
if (cvRet != kCVReturnSuccess) {
- LOG(LS_ERROR) << "Failed to lock base address: " << cvRet;
+ RTC_LOG(LS_ERROR) << "Failed to lock base address: " << cvRet;
}
const int dstWidth = CVPixelBufferGetWidth(outputPixelBuffer);
const int dstHeight = CVPixelBufferGetHeight(outputPixelBuffer);
diff --git a/sdk/objc/Framework/Classes/Video/RTCShader.mm b/sdk/objc/Framework/Classes/Video/RTCShader.mm
index e8fecda..ea4228e 100644
--- a/sdk/objc/Framework/Classes/Video/RTCShader.mm
+++ b/sdk/objc/Framework/Classes/Video/RTCShader.mm
@@ -55,7 +55,7 @@
std::unique_ptr<char[]> compileLog(new char[logLength]);
// The returned string is null terminated.
glGetShaderInfoLog(shader, logLength, NULL, compileLog.get());
- LOG(LS_ERROR) << "Shader compile error: " << compileLog.get();
+ RTC_LOG(LS_ERROR) << "Shader compile error: " << compileLog.get();
}
glDeleteShader(shader);
shader = 0;
diff --git a/sdk/objc/Framework/Classes/Video/avfoundationvideocapturer.mm b/sdk/objc/Framework/Classes/Video/avfoundationvideocapturer.mm
index 74cb61e..77cb88b 100644
--- a/sdk/objc/Framework/Classes/Video/avfoundationvideocapturer.mm
+++ b/sdk/objc/Framework/Classes/Video/avfoundationvideocapturer.mm
@@ -64,11 +64,11 @@
cricket::CaptureState AVFoundationVideoCapturer::Start(
const cricket::VideoFormat& format) {
if (!_capturer) {
- LOG(LS_ERROR) << "Failed to create AVFoundation capturer.";
+ RTC_LOG(LS_ERROR) << "Failed to create AVFoundation capturer.";
return cricket::CaptureState::CS_FAILED;
}
if (_capturer.isRunning) {
- LOG(LS_ERROR) << "The capturer is already running.";
+ RTC_LOG(LS_ERROR) << "The capturer is already running.";
return cricket::CaptureState::CS_FAILED;
}
diff --git a/sdk/objc/Framework/Classes/Video/corevideo_frame_buffer.cc b/sdk/objc/Framework/Classes/Video/corevideo_frame_buffer.cc
index 24b9868..f08e037 100644
--- a/sdk/objc/Framework/Classes/Video/corevideo_frame_buffer.cc
+++ b/sdk/objc/Framework/Classes/Video/corevideo_frame_buffer.cc
@@ -115,7 +115,7 @@
kCVPixelFormatType_420YpCbCr8BiPlanarFullRange);
CVReturn cv_ret = CVPixelBufferLockBaseAddress(output_pixel_buffer, 0);
if (cv_ret != kCVReturnSuccess) {
- LOG(LS_ERROR) << "Failed to lock base address: " << cv_ret;
+ RTC_LOG(LS_ERROR) << "Failed to lock base address: " << cv_ret;
return false;
}
const int dst_width = CVPixelBufferGetWidth(output_pixel_buffer);
diff --git a/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoDecoderH264.mm b/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoDecoderH264.mm
index 4cf48bd..261b945 100644
--- a/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoDecoderH264.mm
+++ b/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoDecoderH264.mm
@@ -48,7 +48,7 @@
std::unique_ptr<RTCFrameDecodeParams> decodeParams(
reinterpret_cast<RTCFrameDecodeParams *>(params));
if (status != noErr) {
- LOG(LS_ERROR) << "Failed to decode frame. Status: " << status;
+ RTC_LOG(LS_ERROR) << "Failed to decode frame. Status: " << status;
return;
}
// TODO(tkchin): Handle CVO properly.
@@ -126,7 +126,7 @@
// This can happen after backgrounding. We need to wait for the next
// sps/pps before we can resume so we request a keyframe by returning an
// error.
- LOG(LS_WARNING) << "Missing video format. Frame with sps/pps required.";
+ RTC_LOG(LS_WARNING) << "Missing video format. Frame with sps/pps required.";
return WEBRTC_VIDEO_CODEC_ERROR;
}
CMSampleBufferRef sampleBuffer = nullptr;
@@ -153,7 +153,7 @@
#endif
CFRelease(sampleBuffer);
if (status != noErr) {
- LOG(LS_ERROR) << "Failed to decode frame with code: " << status;
+ RTC_LOG(LS_ERROR) << "Failed to decode frame with code: " << status;
return WEBRTC_VIDEO_CODEC_ERROR;
}
return WEBRTC_VIDEO_CODEC_OK;
diff --git a/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm b/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm
index 3eca55b..a72ce09 100644
--- a/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm
+++ b/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm
@@ -100,7 +100,7 @@
CVReturn cvRet = CVPixelBufferLockBaseAddress(pixelBuffer, 0);
if (cvRet != kCVReturnSuccess) {
- LOG(LS_ERROR) << "Failed to lock base address: " << cvRet;
+ RTC_LOG(LS_ERROR) << "Failed to lock base address: " << cvRet;
return false;
}
uint8_t *dstY = reinterpret_cast<uint8_t *>(CVPixelBufferGetBaseAddressOfPlane(pixelBuffer, 0));
@@ -122,7 +122,7 @@
frameBuffer.height);
CVPixelBufferUnlockBaseAddress(pixelBuffer, 0);
if (ret) {
- LOG(LS_ERROR) << "Error converting I420 VideoFrame to NV12 :" << ret;
+ RTC_LOG(LS_ERROR) << "Error converting I420 VideoFrame to NV12 :" << ret;
return false;
}
return true;
@@ -130,13 +130,13 @@
CVPixelBufferRef CreatePixelBuffer(CVPixelBufferPoolRef pixel_buffer_pool) {
if (!pixel_buffer_pool) {
- LOG(LS_ERROR) << "Failed to get pixel buffer pool.";
+ RTC_LOG(LS_ERROR) << "Failed to get pixel buffer pool.";
return nullptr;
}
CVPixelBufferRef pixel_buffer;
CVReturn ret = CVPixelBufferPoolCreatePixelBuffer(nullptr, pixel_buffer_pool, &pixel_buffer);
if (ret != kCVReturnSuccess) {
- LOG(LS_ERROR) << "Failed to create pixel buffer: " << ret;
+ RTC_LOG(LS_ERROR) << "Failed to create pixel buffer: " << ret;
// We probably want to drop frames here, since failure probably means
// that the pool is empty.
return nullptr;
@@ -306,7 +306,7 @@
webrtc::Clock::GetRealTimeClock(), .5, .95));
_packetizationMode = RTCH264PacketizationModeNonInterleaved;
_profile = ExtractProfile([codecInfo nativeSdpVideoFormat]);
- LOG(LS_INFO) << "Using profile " << CFStringToString(_profile);
+ RTC_LOG(LS_INFO) << "Using profile " << CFStringToString(_profile);
RTC_CHECK([codecInfo.name isEqualToString:kRTCVideoCodecH264Name]);
#if defined(WEBRTC_IOS)
@@ -405,7 +405,7 @@
}
RTC_DCHECK(pixelBuffer);
if (!CopyVideoFrameToNV12PixelBuffer([frame.buffer toI420], pixelBuffer)) {
- LOG(LS_ERROR) << "Failed to copy frame data.";
+ RTC_LOG(LS_ERROR) << "Failed to copy frame data.";
CVBufferRelease(pixelBuffer);
return WEBRTC_VIDEO_CODEC_ERROR;
}
@@ -456,7 +456,7 @@
CVBufferRelease(pixelBuffer);
}
if (status != noErr) {
- LOG(LS_ERROR) << "Failed to encode frame with code: " << status;
+ RTC_LOG(LS_ERROR) << "Failed to encode frame with code: " << status;
return WEBRTC_VIDEO_CODEC_ERROR;
}
return WEBRTC_VIDEO_CODEC_OK;
@@ -496,7 +496,7 @@
// Resetting the session when this happens fixes the issue.
// In addition we request a keyframe so video can recover quickly.
resetCompressionSession = YES;
- LOG(LS_INFO) << "Resetting compression session due to invalid pool.";
+ RTC_LOG(LS_INFO) << "Resetting compression session due to invalid pool.";
}
#endif
@@ -523,7 +523,7 @@
if (![compressionSessionPixelFormats
containsObject:[NSNumber numberWithLong:framePixelFormat]]) {
resetCompressionSession = YES;
- LOG(LS_INFO) << "Resetting compression session due to non-matching pixel format.";
+ RTC_LOG(LS_INFO) << "Resetting compression session due to non-matching pixel format.";
}
}
@@ -591,7 +591,7 @@
encoder_specs = nullptr;
}
if (status != noErr) {
- LOG(LS_ERROR) << "Failed to create compression session: " << status;
+ RTC_LOG(LS_ERROR) << "Failed to create compression session: " << status;
return WEBRTC_VIDEO_CODEC_ERROR;
}
#if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS)
@@ -601,9 +601,9 @@
nullptr,
&hwaccl_enabled);
if (status == noErr && (CFBooleanGetValue(hwaccl_enabled))) {
- LOG(LS_INFO) << "Compression session created with hw accl enabled";
+ RTC_LOG(LS_INFO) << "Compression session created with hw accl enabled";
} else {
- LOG(LS_INFO) << "Compression session created with hw accl disabled";
+ RTC_LOG(LS_INFO) << "Compression session created with hw accl disabled";
}
#endif
[self configureCompressionSession];
@@ -674,7 +674,7 @@
CFRelease(dataRateLimits);
}
if (status != noErr) {
- LOG(LS_ERROR) << "Failed to set data rate limit";
+ RTC_LOG(LS_ERROR) << "Failed to set data rate limit";
}
_encoderBitrateBps = bitrateBps;
@@ -691,11 +691,11 @@
timestamp:(uint32_t)timestamp
rotation:(RTCVideoRotation)rotation {
if (status != noErr) {
- LOG(LS_ERROR) << "H264 encode failed.";
+ RTC_LOG(LS_ERROR) << "H264 encode failed.";
return;
}
if (infoFlags & kVTEncodeInfo_FrameDropped) {
- LOG(LS_INFO) << "H264 encode dropped frame.";
+ RTC_LOG(LS_INFO) << "H264 encode dropped frame.";
return;
}
@@ -708,7 +708,7 @@
}
if (isKeyframe) {
- LOG(LS_INFO) << "Generated keyframe";
+ RTC_LOG(LS_INFO) << "Generated keyframe";
}
// Convert the sample buffer into a buffer suitable for RTP packetization.
@@ -745,7 +745,7 @@
BOOL res = _callback(frame, codecSpecificInfo, header);
if (!res) {
- LOG(LS_ERROR) << "Encode callback failed";
+ RTC_LOG(LS_ERROR) << "Encode callback failed";
return;
}
_bitrateAdjuster->Update(frame.buffer.length);
diff --git a/sdk/objc/Framework/Classes/VideoToolbox/helpers.cc b/sdk/objc/Framework/Classes/VideoToolbox/helpers.cc
index 1e4a53f..ac957f1 100644
--- a/sdk/objc/Framework/Classes/VideoToolbox/helpers.cc
+++ b/sdk/objc/Framework/Classes/VideoToolbox/helpers.cc
@@ -44,8 +44,8 @@
CFRelease(cfNum);
if (status != noErr) {
std::string key_string = CFStringToString(key);
- LOG(LS_ERROR) << "VTSessionSetProperty failed to set: " << key_string
- << " to " << value << ": " << status;
+ RTC_LOG(LS_ERROR) << "VTSessionSetProperty failed to set: " << key_string
+ << " to " << value << ": " << status;
}
}
@@ -60,8 +60,8 @@
CFRelease(cfNum);
if (status != noErr) {
std::string key_string = CFStringToString(key);
- LOG(LS_ERROR) << "VTSessionSetProperty failed to set: " << key_string
- << " to " << value << ": " << status;
+ RTC_LOG(LS_ERROR) << "VTSessionSetProperty failed to set: " << key_string
+ << " to " << value << ": " << status;
}
}
@@ -71,8 +71,8 @@
OSStatus status = VTSessionSetProperty(session, key, cf_bool);
if (status != noErr) {
std::string key_string = CFStringToString(key);
- LOG(LS_ERROR) << "VTSessionSetProperty failed to set: " << key_string
- << " to " << value << ": " << status;
+ RTC_LOG(LS_ERROR) << "VTSessionSetProperty failed to set: " << key_string
+ << " to " << value << ": " << status;
}
}
@@ -84,7 +84,7 @@
if (status != noErr) {
std::string key_string = CFStringToString(key);
std::string val_string = CFStringToString(value);
- LOG(LS_ERROR) << "VTSessionSetProperty failed to set: " << key_string
- << " to " << val_string << ": " << status;
+ RTC_LOG(LS_ERROR) << "VTSessionSetProperty failed to set: " << key_string
+ << " to " << val_string << ": " << status;
}
}
diff --git a/sdk/objc/Framework/Classes/VideoToolbox/nalu_rewriter.cc b/sdk/objc/Framework/Classes/VideoToolbox/nalu_rewriter.cc
index 1ba18e8..f6ee106 100644
--- a/sdk/objc/Framework/Classes/VideoToolbox/nalu_rewriter.cc
+++ b/sdk/objc/Framework/Classes/VideoToolbox/nalu_rewriter.cc
@@ -42,7 +42,7 @@
CMVideoFormatDescriptionRef description =
CMSampleBufferGetFormatDescription(avcc_sample_buffer);
if (description == nullptr) {
- LOG(LS_ERROR) << "Failed to get sample buffer's description.";
+ RTC_LOG(LS_ERROR) << "Failed to get sample buffer's description.";
return false;
}
@@ -52,7 +52,7 @@
OSStatus status = CMVideoFormatDescriptionGetH264ParameterSetAtIndex(
description, 0, nullptr, nullptr, ¶m_set_count, &nalu_header_size);
if (status != noErr) {
- LOG(LS_ERROR) << "Failed to get parameter set.";
+ RTC_LOG(LS_ERROR) << "Failed to get parameter set.";
return false;
}
RTC_CHECK_EQ(nalu_header_size, kAvccHeaderByteSize);
@@ -73,7 +73,7 @@
status = CMVideoFormatDescriptionGetH264ParameterSetAtIndex(
description, i, ¶m_set, ¶m_set_size, nullptr, nullptr);
if (status != noErr) {
- LOG(LS_ERROR) << "Failed to get parameter set.";
+ RTC_LOG(LS_ERROR) << "Failed to get parameter set.";
return false;
}
// Update buffer.
@@ -91,7 +91,7 @@
CMBlockBufferRef block_buffer =
CMSampleBufferGetDataBuffer(avcc_sample_buffer);
if (block_buffer == nullptr) {
- LOG(LS_ERROR) << "Failed to get sample buffer's block buffer.";
+ RTC_LOG(LS_ERROR) << "Failed to get sample buffer's block buffer.";
return false;
}
CMBlockBufferRef contiguous_buffer = nullptr;
@@ -100,8 +100,8 @@
status = CMBlockBufferCreateContiguous(
nullptr, block_buffer, nullptr, nullptr, 0, 0, 0, &contiguous_buffer);
if (status != noErr) {
- LOG(LS_ERROR) << "Failed to flatten non-contiguous block buffer: "
- << status;
+ RTC_LOG(LS_ERROR) << "Failed to flatten non-contiguous block buffer: "
+ << status;
return false;
}
} else {
@@ -117,7 +117,7 @@
status = CMBlockBufferGetDataPointer(contiguous_buffer, 0, nullptr, nullptr,
&data_ptr);
if (status != noErr) {
- LOG(LS_ERROR) << "Failed to get block buffer data.";
+ RTC_LOG(LS_ERROR) << "Failed to get block buffer data.";
CFRelease(contiguous_buffer);
return false;
}
@@ -173,11 +173,11 @@
const uint8_t* data = nullptr;
size_t data_len = 0;
if (!reader.ReadNalu(&data, &data_len)) {
- LOG(LS_ERROR) << "Failed to read SPS";
+ RTC_LOG(LS_ERROR) << "Failed to read SPS";
return false;
}
if (!reader.ReadNalu(&data, &data_len)) {
- LOG(LS_ERROR) << "Failed to read PPS";
+ RTC_LOG(LS_ERROR) << "Failed to read PPS";
return false;
}
}
@@ -190,7 +190,7 @@
reader.BytesRemaining(), kCMBlockBufferAssureMemoryNowFlag,
&block_buffer);
if (status != kCMBlockBufferNoErr) {
- LOG(LS_ERROR) << "Failed to create block buffer.";
+ RTC_LOG(LS_ERROR) << "Failed to create block buffer.";
return false;
}
@@ -200,8 +200,8 @@
status = CMBlockBufferCreateContiguous(
nullptr, block_buffer, nullptr, nullptr, 0, 0, 0, &contiguous_buffer);
if (status != noErr) {
- LOG(LS_ERROR) << "Failed to flatten non-contiguous block buffer: "
- << status;
+ RTC_LOG(LS_ERROR) << "Failed to flatten non-contiguous block buffer: "
+ << status;
CFRelease(block_buffer);
return false;
}
@@ -216,7 +216,7 @@
status = CMBlockBufferGetDataPointer(contiguous_buffer, 0, nullptr,
&block_buffer_size, &data_ptr);
if (status != kCMBlockBufferNoErr) {
- LOG(LS_ERROR) << "Failed to get block buffer data pointer.";
+ RTC_LOG(LS_ERROR) << "Failed to get block buffer data pointer.";
CFRelease(contiguous_buffer);
return false;
}
@@ -238,7 +238,7 @@
nullptr, video_format, 1, 0, nullptr, 0,
nullptr, out_sample_buffer);
if (status != noErr) {
- LOG(LS_ERROR) << "Failed to create sample buffer.";
+ RTC_LOG(LS_ERROR) << "Failed to create sample buffer.";
CFRelease(contiguous_buffer);
return false;
}
@@ -284,23 +284,23 @@
// Skip AUD.
if (ParseNaluType(annexb_buffer[4]) == kAud) {
if (!reader.ReadNalu(¶m_set_ptrs[0], ¶m_set_sizes[0])) {
- LOG(LS_ERROR) << "Failed to read AUD";
+ RTC_LOG(LS_ERROR) << "Failed to read AUD";
return nullptr;
}
}
if (!reader.ReadNalu(¶m_set_ptrs[0], ¶m_set_sizes[0])) {
- LOG(LS_ERROR) << "Failed to read SPS";
+ RTC_LOG(LS_ERROR) << "Failed to read SPS";
return nullptr;
}
if (!reader.ReadNalu(¶m_set_ptrs[1], ¶m_set_sizes[1])) {
- LOG(LS_ERROR) << "Failed to read PPS";
+ RTC_LOG(LS_ERROR) << "Failed to read PPS";
return nullptr;
}
status = CMVideoFormatDescriptionCreateFromH264ParameterSets(
kCFAllocatorDefault, 2, param_set_ptrs, param_set_sizes, 4,
&description);
if (status != noErr) {
- LOG(LS_ERROR) << "Failed to create video format description.";
+ RTC_LOG(LS_ERROR) << "Failed to create video format description.";
return nullptr;
}
return description;
diff --git a/sdk/objc/Framework/Headers/WebRTC/RTCLogging.h b/sdk/objc/Framework/Headers/WebRTC/RTCLogging.h
index e4f1920..a65dcad 100644
--- a/sdk/objc/Framework/Headers/WebRTC/RTCLogging.h
+++ b/sdk/objc/Framework/Headers/WebRTC/RTCLogging.h
@@ -20,7 +20,7 @@
RTCLoggingSeverityError,
};
-// Wrapper for C++ LOG(sev) macros.
+// Wrapper for C++ RTC_LOG(sev) macros.
// Logs the log string to the webrtc logstream for the given severity.
RTC_EXTERN void RTCLogEx(RTCLoggingSeverity severity, NSString* log_string);
diff --git a/system_wrappers/source/cpu_info.cc b/system_wrappers/source/cpu_info.cc
index fa70ced..0bfe015 100644
--- a/system_wrappers/source/cpu_info.cc
+++ b/system_wrappers/source/cpu_info.cc
@@ -40,14 +40,14 @@
int name[] = {CTL_HW, HW_AVAILCPU};
size_t size = sizeof(number_of_cores);
if (0 != sysctl(name, 2, &number_of_cores, &size, NULL, 0)) {
- LOG(LS_ERROR) << "Failed to get number of cores";
+ RTC_LOG(LS_ERROR) << "Failed to get number of cores";
number_of_cores = 1;
}
#else
- LOG(LS_ERROR) << "No function to get number of cores";
+ RTC_LOG(LS_ERROR) << "No function to get number of cores";
#endif
- LOG(LS_INFO) << "Available number of cores: " << number_of_cores;
+ RTC_LOG(LS_INFO) << "Available number of cores: " << number_of_cores;
return number_of_cores;
}
diff --git a/system_wrappers/source/rtp_to_ntp_estimator.cc b/system_wrappers/source/rtp_to_ntp_estimator.cc
index 3496fc0..3728481 100644
--- a/system_wrappers/source/rtp_to_ntp_estimator.cc
+++ b/system_wrappers/source/rtp_to_ntp_estimator.cc
@@ -122,7 +122,7 @@
break;
}
if (timestamp_new <= measurement.rtp_timestamp) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "Newer RTCP SR report with older RTP timestamp, dropping";
invalid_sample = true;
break;
@@ -133,8 +133,8 @@
if (consecutive_invalid_samples_ < kMaxInvalidSamples) {
return false;
}
- LOG(LS_WARNING) << "Multiple consecutively invalid RTCP SR reports, "
- "clearing measurements.";
+ RTC_LOG(LS_WARNING) << "Multiple consecutively invalid RTCP SR reports, "
+ "clearing measurements.";
measurements_.clear();
}
consecutive_invalid_samples_ = 0;
diff --git a/system_wrappers/source/rw_lock_win.cc b/system_wrappers/source/rw_lock_win.cc
index e81e9d7..23df15a 100644
--- a/system_wrappers/source/rw_lock_win.cc
+++ b/system_wrappers/source/rw_lock_win.cc
@@ -69,7 +69,7 @@
if (!library) {
return false;
}
- LOG(LS_VERBOSE) << "Loaded Kernel.dll";
+ RTC_LOG(LS_VERBOSE) << "Loaded Kernel.dll";
initialize_srw_lock =
(InitializeSRWLock)GetProcAddress(library, "InitializeSRWLock");
@@ -86,7 +86,7 @@
if (initialize_srw_lock && acquire_srw_lock_exclusive &&
release_srw_lock_exclusive && acquire_srw_lock_shared &&
release_srw_lock_shared) {
- LOG(LS_VERBOSE) << "Loaded Native RW Lock";
+ RTC_LOG(LS_VERBOSE) << "Loaded Native RW Lock";
native_rw_locks_supported = true;
}
return native_rw_locks_supported;
diff --git a/test/fake_network_pipe.cc b/test/fake_network_pipe.cc
index 66e8997..6678f1c 100644
--- a/test/fake_network_pipe.cc
+++ b/test/fake_network_pipe.cc
@@ -184,7 +184,7 @@
if (!capacity_link_.empty()) {
queueing_delay_ms = time_now - capacity_link_.front()->send_time();
}
- LOG(LS_INFO) << "Network queue: " << queueing_delay_ms << " ms.";
+ RTC_LOG(LS_INFO) << "Network queue: " << queueing_delay_ms << " ms.";
last_log_time_ = time_now;
}
// Check the capacity link first.
diff --git a/test/field_trial.cc b/test/field_trial.cc
index 57c18f7..00e5b69 100644
--- a/test/field_trial.cc
+++ b/test/field_trial.cc
@@ -67,7 +67,7 @@
return;
}
}
- // Using fprintf as LOG does not print when this is called early in main.
+ // Using fprintf as RTC_LOG does not print when this is called early in main.
fprintf(stderr, "Invalid field trials string.\n");
// Using abort so it crashes in both debug and release mode.
diff --git a/test/frame_generator_capturer.cc b/test/frame_generator_capturer.cc
index 9c83579..a8983b7 100644
--- a/test/frame_generator_capturer.cc
+++ b/test/frame_generator_capturer.cc
@@ -68,7 +68,7 @@
} else {
rtc::TaskQueue::Current()->PostDelayedTask(
std::unique_ptr<rtc::QueuedTask>(this), 0);
- LOG(LS_ERROR)
+ RTC_LOG(LS_ERROR)
<< "Frame Generator Capturer can't keep up with requested fps";
}
// Repost of this instance, make sure it is not deleted.
diff --git a/test/rtcp_packet_parser.cc b/test/rtcp_packet_parser.cc
index f156608..2f9658a 100644
--- a/test/rtcp_packet_parser.cc
+++ b/test/rtcp_packet_parser.cc
@@ -26,7 +26,7 @@
next_packet = header.NextPacket()) {
RTC_DCHECK_GT(buffer_end - next_packet, 0);
if (!header.Parse(next_packet, buffer_end - next_packet)) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "Invalid rtcp header or unaligned rtcp packet at position "
<< (next_packet - buffer);
return false;
@@ -56,8 +56,9 @@
remb_.Parse(header, &sender_ssrc_);
break;
default:
- LOG(LS_WARNING) << "Unknown rtcp payload specific feedback type "
- << header.fmt();
+ RTC_LOG(LS_WARNING)
+ << "Unknown rtcp payload specific feedback type "
+ << header.fmt();
break;
}
break;
@@ -82,8 +83,8 @@
transport_feedback_.Parse(header, &sender_ssrc_);
break;
default:
- LOG(LS_WARNING) << "Unknown rtcp transport feedback type "
- << header.fmt();
+ RTC_LOG(LS_WARNING)
+ << "Unknown rtcp transport feedback type " << header.fmt();
break;
}
break;
@@ -94,7 +95,7 @@
sender_report_.Parse(header, &sender_ssrc_);
break;
default:
- LOG(LS_WARNING) << "Unknown rtcp packet type " << header.type();
+ RTC_LOG(LS_WARNING) << "Unknown rtcp packet type " << header.type();
break;
}
}
diff --git a/test/rtp_file_reader.cc b/test/rtp_file_reader.cc
index b1fab07..0367487 100644
--- a/test/rtp_file_reader.cc
+++ b/test/rtp_file_reader.cc
@@ -28,12 +28,12 @@
static const size_t kFirstLineLength = 40;
static uint16_t kPacketHeaderSize = 8;
-#define TRY(expr) \
- do { \
- if (!(expr)) { \
- LOG(LS_INFO) << "Failed to read"; \
- return false; \
- } \
+#define TRY(expr) \
+ do { \
+ if (!(expr)) { \
+ RTC_LOG(LS_INFO) << "Failed to read"; \
+ return false; \
+ } \
} while (0)
bool ReadUint32(uint32_t* out, FILE* file) {
@@ -132,21 +132,21 @@
char firstline[kFirstLineLength + 1] = {0};
if (fgets(firstline, kFirstLineLength, file_) == NULL) {
- LOG(LS_INFO) << "Can't read from file";
+ RTC_LOG(LS_INFO) << "Can't read from file";
return false;
}
if (strncmp(firstline, "#!rtpplay", 9) == 0) {
if (strncmp(firstline, "#!rtpplay1.0", 12) != 0) {
- LOG(LS_INFO) << "Wrong rtpplay version, must be 1.0";
+ RTC_LOG(LS_INFO) << "Wrong rtpplay version, must be 1.0";
return false;
}
} else if (strncmp(firstline, "#!RTPencode", 11) == 0) {
if (strncmp(firstline, "#!RTPencode1.0", 14) != 0) {
- LOG(LS_INFO) << "Wrong RTPencode version, must be 1.0";
+ RTC_LOG(LS_INFO) << "Wrong RTPencode version, must be 1.0";
return false;
}
} else {
- LOG(LS_INFO) << "Wrong file format of input file";
+ RTC_LOG(LS_INFO) << "Wrong file format of input file";
return false;
}
@@ -225,15 +225,15 @@
const uint32_t kPcapBOMSwapOrder = 0xd4c3b2a1UL;
const uint32_t kPcapBOMNoSwapOrder = 0xa1b2c3d4UL;
-#define TRY_PCAP(expr) \
- do { \
- int r = (expr); \
- if (r == kResultFail) { \
- LOG(LS_INFO) << "FAIL at " << __FILE__ << ":" << __LINE__; \
- return kResultFail; \
- } else if (r == kResultSkip) { \
- return kResultSkip; \
- } \
+#define TRY_PCAP(expr) \
+ do { \
+ int r = (expr); \
+ if (r == kResultFail) { \
+ RTC_LOG(LS_INFO) << "FAIL at " << __FILE__ << ":" << __LINE__; \
+ return kResultFail; \
+ } else if (r == kResultSkip) { \
+ return kResultSkip; \
+ } \
} while (0)
// Read RTP packets from file in tcpdump/libpcap format, as documented at:
@@ -452,7 +452,7 @@
packets_.push_back(marker);
} else {
if (!rtp_parser.Parse(&marker.rtp_header, nullptr)) {
- LOG(LS_INFO) << "Not recognized as RTP/RTCP";
+ RTC_LOG(LS_INFO) << "Not recognized as RTP/RTCP";
return kResultSkip;
}
@@ -480,7 +480,7 @@
TRY_PCAP(Read(&protocol, true));
if (protocol == kBsdNullLoopback1 || protocol == kBsdNullLoopback2) {
int result = ReadXxpIpHeader(marker);
- LOG(LS_INFO) << "Recognized loopback frame";
+ RTC_LOG(LS_INFO) << "Recognized loopback frame";
if (result != kResultSkip) {
return result;
}
@@ -494,7 +494,7 @@
TRY_PCAP(Read(&type, true));
if (type == kEthertypeIp) {
int result = ReadXxpIpHeader(marker);
- LOG(LS_INFO) << "Recognized ethernet 2 frame";
+ RTC_LOG(LS_INFO) << "Recognized ethernet 2 frame";
if (result != kResultSkip) {
return result;
}
@@ -534,13 +534,13 @@
TRY_PCAP(Read(&marker->dest_ip, true));
if (((version >> 12) & 0x000f) != kIpVersion4) {
- LOG(LS_INFO) << "IP header is not IPv4";
+ RTC_LOG(LS_INFO) << "IP header is not IPv4";
return kResultSkip;
}
if (fragment != kFragmentOffsetClear &&
fragment != kFragmentOffsetDoNotFragment) {
- LOG(LS_INFO) << "IP fragments cannot be handled";
+ RTC_LOG(LS_INFO) << "IP fragments cannot be handled";
return kResultSkip;
}
@@ -551,7 +551,7 @@
protocol = protocol & 0x00ff;
if (protocol == kProtocolTcp) {
- LOG(LS_INFO) << "TCP packets are not handled";
+ RTC_LOG(LS_INFO) << "TCP packets are not handled";
return kResultSkip;
} else if (protocol == kProtocolUdp) {
uint16_t length;
@@ -562,7 +562,7 @@
TRY_PCAP(Read(&checksum, true));
marker->payload_length = length - kUdpHeaderLength;
} else {
- LOG(LS_INFO) << "Unknown transport (expected UDP or TCP)";
+ RTC_LOG(LS_INFO) << "Unknown transport (expected UDP or TCP)";
return kResultSkip;
}
diff --git a/test/testsupport/jpeg_frame_writer.cc b/test/testsupport/jpeg_frame_writer.cc
index 17fb0a1..4888f65 100644
--- a/test/testsupport/jpeg_frame_writer.cc
+++ b/test/testsupport/jpeg_frame_writer.cc
@@ -36,7 +36,7 @@
bool JpegFrameWriter::WriteFrame(const VideoFrame& input_frame, int quality) {
if (frame_written_) {
- LOG(LS_ERROR) << "Only a single frame can be saved to Jpeg.";
+ RTC_LOG(LS_ERROR) << "Only a single frame can be saved to Jpeg.";
return false;
}
const int kColorPlanes = 3; // R, G and B.
@@ -45,13 +45,13 @@
// kRGB24 actually corresponds to FourCC 24BG which is 24-bit BGR.
if (ConvertFromI420(input_frame, VideoType::kRGB24, 0, rgb_buf.get()) < 0) {
- LOG(LS_ERROR) << "Could not convert input frame to RGB.";
+ RTC_LOG(LS_ERROR) << "Could not convert input frame to RGB.";
return false;
}
output_file_ = fopen(output_filename_.c_str(), "wb");
if (!output_file_) {
- LOG(LS_ERROR) << "Couldn't open file to write jpeg frame to:" <<
- output_filename_;
+ RTC_LOG(LS_ERROR) << "Couldn't open file to write jpeg frame to:"
+ << output_filename_;
return false;
}
diff --git a/test/testsupport/jpeg_frame_writer_ios.cc b/test/testsupport/jpeg_frame_writer_ios.cc
index b87d7d1..567e75e 100644
--- a/test/testsupport/jpeg_frame_writer_ios.cc
+++ b/test/testsupport/jpeg_frame_writer_ios.cc
@@ -20,8 +20,9 @@
bool JpegFrameWriter::WriteFrame(const VideoFrame& /*input_frame*/,
int /*quality*/) {
- LOG(LS_WARNING) << "Libjpeg isn't available on IOS. Jpeg frame writer is not "
- "supported. No frame will be saved.";
+ RTC_LOG(LS_WARNING)
+ << "Libjpeg isn't available on IOS. Jpeg frame writer is not "
+ "supported. No frame will be saved.";
// Don't fail.
return true;
}
diff --git a/test/testsupport/test_artifacts.cc b/test/testsupport/test_artifacts.cc
index ee28f0f..3d97a94 100644
--- a/test/testsupport/test_artifacts.cc
+++ b/test/testsupport/test_artifacts.cc
@@ -34,7 +34,7 @@
bool GetTestArtifactsDir(std::string* out_dir) {
if (strlen(FLAG_test_artifacts_dir) == 0) {
- LOG(LS_WARNING) << "No test_out_dir defined.";
+ RTC_LOG(LS_WARNING) << "No test_out_dir defined.";
return false;
}
*out_dir = FLAG_test_artifacts_dir;
@@ -45,12 +45,12 @@
const uint8_t* buffer,
size_t length) {
if (strlen(FLAG_test_artifacts_dir) == 0) {
- LOG(LS_WARNING) << "No test_out_dir defined.";
+ RTC_LOG(LS_WARNING) << "No test_out_dir defined.";
return false;
}
if (filename == nullptr || strlen(filename) == 0) {
- LOG(LS_WARNING) << "filename must be provided.";
+ RTC_LOG(LS_WARNING) << "filename must be provided.";
return false;
}
diff --git a/test/vcm_capturer.cc b/test/vcm_capturer.cc
index e04dbc0..82b5cbc 100644
--- a/test/vcm_capturer.cc
+++ b/test/vcm_capturer.cc
@@ -60,8 +60,9 @@
size_t capture_device_index) {
std::unique_ptr<VcmCapturer> vcm_capturer(new VcmCapturer());
if (!vcm_capturer->Init(width, height, target_fps, capture_device_index)) {
- LOG(LS_WARNING) << "Failed to create VcmCapturer(w = " << width
- << ", h = " << height << ", fps = " << target_fps << ")";
+ RTC_LOG(LS_WARNING) << "Failed to create VcmCapturer(w = " << width
+ << ", h = " << height << ", fps = " << target_fps
+ << ")";
return nullptr;
}
return vcm_capturer.release();
diff --git a/video/overuse_frame_detector.cc b/video/overuse_frame_detector.cc
index f110e1c..7b64c10 100644
--- a/video/overuse_frame_detector.cc
+++ b/video/overuse_frame_detector.cc
@@ -91,10 +91,11 @@
if (kr != KERN_SUCCESS) {
// If we couldn't get # of physical CPUs, don't panic. Assume we have 1.
n_physical_cores = 1;
- LOG(LS_ERROR) << "Failed to determine number of physical cores, assuming 1";
+ RTC_LOG(LS_ERROR)
+ << "Failed to determine number of physical cores, assuming 1";
} else {
n_physical_cores = hbi.physical_cpu;
- LOG(LS_INFO) << "Number of physical cores:" << n_physical_cores;
+ RTC_LOG(LS_INFO) << "Number of physical cores:" << n_physical_cores;
}
// Change init list default for few core systems. The assumption here is that
@@ -206,9 +207,9 @@
last_toggling_ms_(-1) {
RTC_DCHECK_GT(overuse_period_ms, 0);
RTC_DCHECK_GT(normal_period_ms, 0);
- LOG(LS_INFO) << "Simulating overuse with intervals " << normal_period_ms
- << "ms normal mode, " << overuse_period_ms
- << "ms overuse mode.";
+ RTC_LOG(LS_INFO) << "Simulating overuse with intervals " << normal_period_ms
+ << "ms normal mode, " << overuse_period_ms
+ << "ms overuse mode.";
}
~OverdoseInjector() override {}
@@ -223,21 +224,21 @@
if (now_ms > last_toggling_ms_ + normal_period_ms_) {
state_ = State::kOveruse;
last_toggling_ms_ = now_ms;
- LOG(LS_INFO) << "Simulating CPU overuse.";
+ RTC_LOG(LS_INFO) << "Simulating CPU overuse.";
}
break;
case State::kOveruse:
if (now_ms > last_toggling_ms_ + overuse_period_ms_) {
state_ = State::kUnderuse;
last_toggling_ms_ = now_ms;
- LOG(LS_INFO) << "Simulating CPU underuse.";
+ RTC_LOG(LS_INFO) << "Simulating CPU underuse.";
}
break;
case State::kUnderuse:
if (now_ms > last_toggling_ms_ + underuse_period_ms_) {
state_ = State::kNormal;
last_toggling_ms_ = now_ms;
- LOG(LS_INFO) << "Actual CPU overuse measurements in effect.";
+ RTC_LOG(LS_INFO) << "Actual CPU overuse measurements in effect.";
}
break;
}
@@ -283,13 +284,14 @@
instance.reset(new OverdoseInjector(
options, normal_period_ms, overuse_period_ms, underuse_period_ms));
} else {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "Invalid (non-positive) normal/overuse/underuse periods: "
<< normal_period_ms << " / " << overuse_period_ms << " / "
<< underuse_period_ms;
}
} else {
- LOG(LS_WARNING) << "Malformed toggling interval: " << toggling_interval;
+ RTC_LOG(LS_WARNING) << "Malformed toggling interval: "
+ << toggling_interval;
}
}
@@ -531,10 +533,10 @@
int rampup_delay =
in_quick_rampup_ ? kQuickRampUpDelayMs : current_rampup_delay_ms_;
- LOG(LS_VERBOSE) << " Frame stats: "
- << " encode usage " << metrics_->encode_usage_percent
- << " overuse detections " << num_overuse_detections_
- << " rampup delay " << rampup_delay;
+ RTC_LOG(LS_VERBOSE) << " Frame stats: "
+ << " encode usage " << metrics_->encode_usage_percent
+ << " overuse detections " << num_overuse_detections_
+ << " rampup delay " << rampup_delay;
}
bool OveruseFrameDetector::IsOverusing(const CpuOveruseMetrics& metrics) {
diff --git a/video/receive_statistics_proxy.cc b/video/receive_statistics_proxy.cc
index 10b200b..0fc298a 100644
--- a/video/receive_statistics_proxy.cc
+++ b/video/receive_statistics_proxy.cc
@@ -131,8 +131,8 @@
stats_.frame_counts.delta_frames > 0) {
RTC_HISTOGRAM_COUNTS_100000("WebRTC.Video.ReceiveStreamLifetimeInSeconds",
stream_duration_sec);
- LOG(LS_INFO) << "WebRTC.Video.ReceiveStreamLifetimeInSeconds "
- << stream_duration_sec;
+ RTC_LOG(LS_INFO) << "WebRTC.Video.ReceiveStreamLifetimeInSeconds "
+ << stream_duration_sec;
}
if (first_report_block_time_ms_ != -1 &&
@@ -142,8 +142,8 @@
if (fraction_lost != -1) {
RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.ReceivedPacketsLostInPercent",
fraction_lost);
- LOG(LS_INFO) << "WebRTC.Video.ReceivedPacketsLostInPercent "
- << fraction_lost;
+ RTC_LOG(LS_INFO) << "WebRTC.Video.ReceivedPacketsLostInPercent "
+ << fraction_lost;
}
}
@@ -160,14 +160,14 @@
int sync_offset_ms = sync_offset_counter_.Avg(kMinRequiredSamples);
if (sync_offset_ms != -1) {
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.AVSyncOffsetInMs", sync_offset_ms);
- LOG(LS_INFO) << "WebRTC.Video.AVSyncOffsetInMs " << sync_offset_ms;
+ RTC_LOG(LS_INFO) << "WebRTC.Video.AVSyncOffsetInMs " << sync_offset_ms;
}
AggregatedStats freq_offset_stats = freq_offset_counter_.GetStats();
if (freq_offset_stats.num_samples > 0) {
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.RtpToNtpFreqOffsetInKhz",
freq_offset_stats.average);
- LOG(LS_INFO) << "WebRTC.Video.RtpToNtpFreqOffsetInKhz, "
- << freq_offset_stats.ToString();
+ RTC_LOG(LS_INFO) << "WebRTC.Video.RtpToNtpFreqOffsetInKhz, "
+ << freq_offset_stats.ToString();
}
int num_total_frames =
@@ -178,37 +178,37 @@
(num_key_frames * 1000 + num_total_frames / 2) / num_total_frames;
RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.KeyFramesReceivedInPermille",
key_frames_permille);
- LOG(LS_INFO) << "WebRTC.Video.KeyFramesReceivedInPermille "
- << key_frames_permille;
+ RTC_LOG(LS_INFO) << "WebRTC.Video.KeyFramesReceivedInPermille "
+ << key_frames_permille;
}
int qp = qp_counters_.vp8.Avg(kMinRequiredSamples);
if (qp != -1) {
RTC_HISTOGRAM_COUNTS_200("WebRTC.Video.Decoded.Vp8.Qp", qp);
- LOG(LS_INFO) << "WebRTC.Video.Decoded.Vp8.Qp " << qp;
+ RTC_LOG(LS_INFO) << "WebRTC.Video.Decoded.Vp8.Qp " << qp;
}
int decode_ms = decode_time_counter_.Avg(kMinRequiredSamples);
if (decode_ms != -1) {
RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.DecodeTimeInMs", decode_ms);
- LOG(LS_INFO) << "WebRTC.Video.DecodeTimeInMs " << decode_ms;
+ RTC_LOG(LS_INFO) << "WebRTC.Video.DecodeTimeInMs " << decode_ms;
}
int jb_delay_ms = jitter_buffer_delay_counter_.Avg(kMinRequiredSamples);
if (jb_delay_ms != -1) {
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.JitterBufferDelayInMs",
jb_delay_ms);
- LOG(LS_INFO) << "WebRTC.Video.JitterBufferDelayInMs " << jb_delay_ms;
+ RTC_LOG(LS_INFO) << "WebRTC.Video.JitterBufferDelayInMs " << jb_delay_ms;
}
int target_delay_ms = target_delay_counter_.Avg(kMinRequiredSamples);
if (target_delay_ms != -1) {
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.TargetDelayInMs", target_delay_ms);
- LOG(LS_INFO) << "WebRTC.Video.TargetDelayInMs " << target_delay_ms;
+ RTC_LOG(LS_INFO) << "WebRTC.Video.TargetDelayInMs " << target_delay_ms;
}
int current_delay_ms = current_delay_counter_.Avg(kMinRequiredSamples);
if (current_delay_ms != -1) {
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.CurrentDelayInMs",
current_delay_ms);
- LOG(LS_INFO) << "WebRTC.Video.CurrentDelayInMs " << current_delay_ms;
+ RTC_LOG(LS_INFO) << "WebRTC.Video.CurrentDelayInMs " << current_delay_ms;
}
int delay_ms = delay_counter_.Avg(kMinRequiredSamples);
if (delay_ms != -1)
@@ -260,15 +260,15 @@
if (e2e_delay_ms != -1) {
RTC_HISTOGRAM_COUNTS_SPARSE_10000(
uma_prefix + ".EndToEndDelayInMs" + uma_suffix, e2e_delay_ms);
- LOG(LS_INFO) << uma_prefix << ".EndToEndDelayInMs" << uma_suffix << " "
- << e2e_delay_ms;
+ RTC_LOG(LS_INFO) << uma_prefix << ".EndToEndDelayInMs" << uma_suffix
+ << " " << e2e_delay_ms;
}
int e2e_delay_max_ms = stats.e2e_delay_counter.Max();
if (e2e_delay_max_ms != -1 && e2e_delay_ms != -1) {
RTC_HISTOGRAM_COUNTS_SPARSE_100000(
uma_prefix + ".EndToEndDelayMaxInMs" + uma_suffix, e2e_delay_max_ms);
- LOG(LS_INFO) << uma_prefix << ".EndToEndDelayMaxInMs" << uma_suffix << " "
- << e2e_delay_max_ms;
+ RTC_LOG(LS_INFO) << uma_prefix << ".EndToEndDelayMaxInMs" << uma_suffix
+ << " " << e2e_delay_max_ms;
}
int interframe_delay_ms =
stats.interframe_delay_counter.Avg(kMinRequiredSamples);
@@ -276,16 +276,16 @@
RTC_HISTOGRAM_COUNTS_SPARSE_10000(
uma_prefix + ".InterframeDelayInMs" + uma_suffix,
interframe_delay_ms);
- LOG(LS_INFO) << uma_prefix << ".InterframeDelayInMs" << uma_suffix << " "
- << interframe_delay_ms;
+ RTC_LOG(LS_INFO) << uma_prefix << ".InterframeDelayInMs" << uma_suffix
+ << " " << interframe_delay_ms;
}
int interframe_delay_max_ms = stats.interframe_delay_counter.Max();
if (interframe_delay_max_ms != -1 && interframe_delay_ms != -1) {
RTC_HISTOGRAM_COUNTS_SPARSE_10000(
uma_prefix + ".InterframeDelayMaxInMs" + uma_suffix,
interframe_delay_max_ms);
- LOG(LS_INFO) << uma_prefix << ".InterframeDelayMaxInMs" << uma_suffix
- << " " << interframe_delay_max_ms;
+ RTC_LOG(LS_INFO) << uma_prefix << ".InterframeDelayMaxInMs" << uma_suffix
+ << " " << interframe_delay_max_ms;
}
rtc::Optional<uint32_t> interframe_delay_95p_ms =
@@ -294,24 +294,24 @@
RTC_HISTOGRAM_COUNTS_SPARSE_10000(
uma_prefix + ".InterframeDelay95PercentileInMs" + uma_suffix,
*interframe_delay_95p_ms);
- LOG(LS_INFO) << uma_prefix << ".InterframeDelay95PercentileInMs"
- << uma_suffix << " " << *interframe_delay_95p_ms;
+ RTC_LOG(LS_INFO) << uma_prefix << ".InterframeDelay95PercentileInMs"
+ << uma_suffix << " " << *interframe_delay_95p_ms;
}
int width = stats.received_width.Avg(kMinRequiredSamples);
if (width != -1) {
RTC_HISTOGRAM_COUNTS_SPARSE_10000(
uma_prefix + ".ReceivedWidthInPixels" + uma_suffix, width);
- LOG(LS_INFO) << uma_prefix << ".ReceivedWidthInPixels" << uma_suffix
- << " " << width;
+ RTC_LOG(LS_INFO) << uma_prefix << ".ReceivedWidthInPixels" << uma_suffix
+ << " " << width;
}
int height = stats.received_height.Avg(kMinRequiredSamples);
if (height != -1) {
RTC_HISTOGRAM_COUNTS_SPARSE_10000(
uma_prefix + ".ReceivedHeightInPixels" + uma_suffix, height);
- LOG(LS_INFO) << uma_prefix << ".ReceivedHeightInPixels" << uma_suffix
- << " " << height;
+ RTC_LOG(LS_INFO) << uma_prefix << ".ReceivedHeightInPixels" << uma_suffix
+ << " " << height;
}
if (content_type != VideoContentType::UNSPECIFIED) {
@@ -324,8 +324,8 @@
RTC_HISTOGRAM_COUNTS_SPARSE_10000(
uma_prefix + ".MediaBitrateReceivedInKbps" + uma_suffix,
media_bitrate_kbps);
- LOG(LS_INFO) << uma_prefix << ".MediaBitrateReceivedInKbps"
- << uma_suffix << " " << media_bitrate_kbps;
+ RTC_LOG(LS_INFO) << uma_prefix << ".MediaBitrateReceivedInKbps"
+ << uma_suffix << " " << media_bitrate_kbps;
}
int num_total_frames =
@@ -337,16 +337,16 @@
RTC_HISTOGRAM_COUNTS_SPARSE_1000(
uma_prefix + ".KeyFramesReceivedInPermille" + uma_suffix,
key_frames_permille);
- LOG(LS_INFO) << uma_prefix << ".KeyFramesReceivedInPermille"
- << uma_suffix << " " << key_frames_permille;
+ RTC_LOG(LS_INFO) << uma_prefix << ".KeyFramesReceivedInPermille"
+ << uma_suffix << " " << key_frames_permille;
}
int qp = stats.qp_counter.Avg(kMinRequiredSamples);
if (qp != -1) {
RTC_HISTOGRAM_COUNTS_SPARSE_200(
uma_prefix + ".Decoded.Vp8.Qp" + uma_suffix, qp);
- LOG(LS_INFO) << uma_prefix << ".Decoded.Vp8.Qp" << uma_suffix << " "
- << qp;
+ RTC_LOG(LS_INFO) << uma_prefix << ".Decoded.Vp8.Qp" << uma_suffix << " "
+ << qp;
}
}
}
@@ -368,8 +368,8 @@
static_cast<int>(rtp.MediaPayloadBytes() * 8 / elapsed_sec / 1000);
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.MediaBitrateReceivedInKbps",
media_bitrate_kbs);
- LOG(LS_INFO) << "WebRTC.Video.MediaBitrateReceivedInKbps "
- << media_bitrate_kbs;
+ RTC_LOG(LS_INFO) << "WebRTC.Video.MediaBitrateReceivedInKbps "
+ << media_bitrate_kbs;
RTC_HISTOGRAM_COUNTS_10000(
"WebRTC.Video.PaddingBitrateReceivedInKbps",
static_cast<int>(rtp_rtx.transmitted.padding_bytes * 8 / elapsed_sec /
@@ -454,33 +454,34 @@
bool any_bad = fps_bad || qp_bad || variance_bad;
if (!prev_any_bad && any_bad) {
- LOG(LS_INFO) << "Bad call (any) start: " << now;
+ RTC_LOG(LS_INFO) << "Bad call (any) start: " << now;
} else if (prev_any_bad && !any_bad) {
- LOG(LS_INFO) << "Bad call (any) end: " << now;
+ RTC_LOG(LS_INFO) << "Bad call (any) end: " << now;
}
if (!prev_fps_bad && fps_bad) {
- LOG(LS_INFO) << "Bad call (fps) start: " << now;
+ RTC_LOG(LS_INFO) << "Bad call (fps) start: " << now;
} else if (prev_fps_bad && !fps_bad) {
- LOG(LS_INFO) << "Bad call (fps) end: " << now;
+ RTC_LOG(LS_INFO) << "Bad call (fps) end: " << now;
}
if (!prev_qp_bad && qp_bad) {
- LOG(LS_INFO) << "Bad call (qp) start: " << now;
+ RTC_LOG(LS_INFO) << "Bad call (qp) start: " << now;
} else if (prev_qp_bad && !qp_bad) {
- LOG(LS_INFO) << "Bad call (qp) end: " << now;
+ RTC_LOG(LS_INFO) << "Bad call (qp) end: " << now;
}
if (!prev_variance_bad && variance_bad) {
- LOG(LS_INFO) << "Bad call (variance) start: " << now;
+ RTC_LOG(LS_INFO) << "Bad call (variance) start: " << now;
} else if (prev_variance_bad && !variance_bad) {
- LOG(LS_INFO) << "Bad call (variance) end: " << now;
+ RTC_LOG(LS_INFO) << "Bad call (variance) end: " << now;
}
- LOG(LS_VERBOSE) << "SAMPLE: sample_length: " << (now - last_sample_time_)
- << " fps: " << fps << " fps_bad: " << fps_bad << " qp: " << qp
- << " qp_bad: " << qp_bad << " variance_bad: " << variance_bad
- << " fps_variance: " << fps_variance;
+ RTC_LOG(LS_VERBOSE) << "SAMPLE: sample_length: " << (now - last_sample_time_)
+ << " fps: " << fps << " fps_bad: " << fps_bad
+ << " qp: " << qp << " qp_bad: " << qp_bad
+ << " variance_bad: " << variance_bad
+ << " fps_variance: " << fps_variance;
last_sample_time_ = now;
qp_sample_.Reset();
@@ -640,7 +641,7 @@
if (qp) {
if (!stats_.qp_sum) {
if (stats_.frames_decoded != 1) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "Frames decoded was not 1 when first qp value was received.";
stats_.frames_decoded = 1;
}
@@ -649,7 +650,7 @@
*stats_.qp_sum += *qp;
content_specific_stats->qp_counter.Add(*qp);
} else if (stats_.qp_sum) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "QP sum was already set and no QP was given for a frame.";
stats_.qp_sum = rtc::Optional<uint64_t>();
}
diff --git a/video/rtp_video_stream_receiver.cc b/video/rtp_video_stream_receiver.cc
index 5778682..238eaf3 100644
--- a/video/rtp_video_stream_receiver.cc
+++ b/video/rtp_video_stream_receiver.cc
@@ -321,7 +321,7 @@
if (packet.GetExtension<AbsoluteSendTime>(&send_time)) {
ss << ", abs send time: " << send_time;
}
- LOG(LS_INFO) << ss.str();
+ RTC_LOG(LS_INFO) << ss.str();
last_packet_log_ms_ = now_ms;
}
}
@@ -434,7 +434,7 @@
// We might be rolling-back a call whose setup failed mid-way. In such a
// case, it's simpler to remove "everything" rather than remember what
// has already been added.
- LOG(LS_WARNING) << "Removal of unknown sink.";
+ RTC_LOG(LS_WARNING) << "Removal of unknown sink.";
return;
}
secondary_sinks_.erase(it);
@@ -482,7 +482,7 @@
int8_t last_media_payload_type =
rtp_payload_registry_.last_received_media_payload_type();
if (last_media_payload_type < 0) {
- LOG(LS_WARNING) << "Failed to get last media payload type.";
+ RTC_LOG(LS_WARNING) << "Failed to get last media payload type.";
return;
}
// Fake an empty media packet.
@@ -493,7 +493,7 @@
const auto pl =
rtp_payload_registry_.PayloadTypeToPayload(last_media_payload_type);
if (!pl) {
- LOG(LS_WARNING) << "Failed to get payload specifics.";
+ RTC_LOG(LS_WARNING) << "Failed to get payload specifics.";
return;
}
rtp_header.type.Video.codec = pl->typeSpecific.video_payload().videoCodecType;
@@ -649,8 +649,8 @@
if (codec_params_it == pt_codec_params_.end())
return;
- LOG(LS_INFO) << "Found out of band supplied codec parameters for"
- << " payload type: " << static_cast<int>(payload_type);
+ RTC_LOG(LS_INFO) << "Found out of band supplied codec parameters for"
+ << " payload type: " << static_cast<int>(payload_type);
H264SpropParameterSets sprop_decoder;
auto sprop_base64_it =
diff --git a/video/send_delay_stats.cc b/video/send_delay_stats.cc
index 09b60cd..a243eda 100644
--- a/video/send_delay_stats.cc
+++ b/video/send_delay_stats.cc
@@ -32,9 +32,10 @@
SendDelayStats::~SendDelayStats() {
if (num_old_packets_ > 0 || num_skipped_packets_ > 0) {
- LOG(LS_WARNING) << "Delay stats: number of old packets " << num_old_packets_
- << ", skipped packets " << num_skipped_packets_
- << ". Number of streams " << send_delay_counters_.size();
+ RTC_LOG(LS_WARNING) << "Delay stats: number of old packets "
+ << num_old_packets_ << ", skipped packets "
+ << num_skipped_packets_ << ". Number of streams "
+ << send_delay_counters_.size();
}
UpdateHistograms();
}
@@ -45,7 +46,7 @@
AggregatedStats stats = it.second->GetStats();
if (stats.num_samples >= kMinRequiredPeriodicSamples) {
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.SendDelayInMs", stats.average);
- LOG(LS_INFO) << "WebRTC.Video.SendDelayInMs, " << stats.ToString();
+ RTC_LOG(LS_INFO) << "WebRTC.Video.SendDelayInMs, " << stats.ToString();
}
}
}
diff --git a/video/send_statistics_proxy.cc b/video/send_statistics_proxy.cc
index cf277e3..233cbb6 100644
--- a/video/send_statistics_proxy.cc
+++ b/video/send_statistics_proxy.cc
@@ -240,14 +240,15 @@
in_width);
RTC_HISTOGRAMS_COUNTS_10000(kIndex, uma_prefix_ + "InputHeightInPixels",
in_height);
- LOG(LS_INFO) << uma_prefix_ << "InputWidthInPixels " << in_width;
- LOG(LS_INFO) << uma_prefix_ << "InputHeightInPixels " << in_height;
+ RTC_LOG(LS_INFO) << uma_prefix_ << "InputWidthInPixels " << in_width;
+ RTC_LOG(LS_INFO) << uma_prefix_ << "InputHeightInPixels " << in_height;
}
AggregatedStats in_fps = input_fps_counter_.GetStats();
if (in_fps.num_samples >= kMinRequiredPeriodicSamples) {
RTC_HISTOGRAMS_COUNTS_100(kIndex, uma_prefix_ + "InputFramesPerSecond",
in_fps.average);
- LOG(LS_INFO) << uma_prefix_ + "InputFramesPerSecond, " << in_fps.ToString();
+ RTC_LOG(LS_INFO) << uma_prefix_ + "InputFramesPerSecond, "
+ << in_fps.ToString();
}
int sent_width = sent_width_counter_.Avg(kMinRequiredMetricsSamples);
@@ -257,15 +258,15 @@
sent_width);
RTC_HISTOGRAMS_COUNTS_10000(kIndex, uma_prefix_ + "SentHeightInPixels",
sent_height);
- LOG(LS_INFO) << uma_prefix_ << "SentWidthInPixels " << sent_width;
- LOG(LS_INFO) << uma_prefix_ << "SentHeightInPixels " << sent_height;
+ RTC_LOG(LS_INFO) << uma_prefix_ << "SentWidthInPixels " << sent_width;
+ RTC_LOG(LS_INFO) << uma_prefix_ << "SentHeightInPixels " << sent_height;
}
AggregatedStats sent_fps = sent_fps_counter_.GetStats();
if (sent_fps.num_samples >= kMinRequiredPeriodicSamples) {
RTC_HISTOGRAMS_COUNTS_100(kIndex, uma_prefix_ + "SentFramesPerSecond",
sent_fps.average);
- LOG(LS_INFO) << uma_prefix_ + "SentFramesPerSecond, "
- << sent_fps.ToString();
+ RTC_LOG(LS_INFO) << uma_prefix_ + "SentFramesPerSecond, "
+ << sent_fps.ToString();
}
if (in_fps.num_samples > kMinRequiredPeriodicSamples &&
@@ -283,8 +284,8 @@
RTC_HISTOGRAMS_PERCENTAGE(kIndex,
uma_prefix_ + "SentToInputFpsRatioPercent",
sent_to_in_fps_ratio_percent);
- LOG(LS_INFO) << uma_prefix_ << "SentToInputFpsRatioPercent "
- << sent_to_in_fps_ratio_percent;
+ RTC_LOG(LS_INFO) << uma_prefix_ << "SentToInputFpsRatioPercent "
+ << sent_to_in_fps_ratio_percent;
}
}
@@ -292,15 +293,15 @@
if (encode_ms != -1) {
RTC_HISTOGRAMS_COUNTS_1000(kIndex, uma_prefix_ + "EncodeTimeInMs",
encode_ms);
- LOG(LS_INFO) << uma_prefix_ << "EncodeTimeInMs " << encode_ms;
+ RTC_LOG(LS_INFO) << uma_prefix_ << "EncodeTimeInMs " << encode_ms;
}
int key_frames_permille =
key_frame_counter_.Permille(kMinRequiredMetricsSamples);
if (key_frames_permille != -1) {
RTC_HISTOGRAMS_COUNTS_1000(kIndex, uma_prefix_ + "KeyFramesSentInPermille",
key_frames_permille);
- LOG(LS_INFO) << uma_prefix_ << "KeyFramesSentInPermille "
- << key_frames_permille;
+ RTC_LOG(LS_INFO) << uma_prefix_ << "KeyFramesSentInPermille "
+ << key_frames_permille;
}
int quality_limited =
quality_limited_frame_counter_.Percent(kMinRequiredMetricsSamples);
@@ -308,8 +309,8 @@
RTC_HISTOGRAMS_PERCENTAGE(kIndex,
uma_prefix_ + "QualityLimitedResolutionInPercent",
quality_limited);
- LOG(LS_INFO) << uma_prefix_ << "QualityLimitedResolutionInPercent "
- << quality_limited;
+ RTC_LOG(LS_INFO) << uma_prefix_ << "QualityLimitedResolutionInPercent "
+ << quality_limited;
}
int downscales = quality_downscales_counter_.Avg(kMinRequiredMetricsSamples);
if (downscales != -1) {
@@ -365,8 +366,8 @@
RTC_HISTOGRAMS_COUNTS_200(kIndex, uma_prefix_ + "Encoded.Qp.Vp8.S2",
qp_vp8);
} else {
- LOG(LS_WARNING) << "QP stats not recorded for VP8 spatial idx "
- << spatial_idx;
+ RTC_LOG(LS_WARNING)
+ << "QP stats not recorded for VP8 spatial idx " << spatial_idx;
}
}
int qp_vp9 = it.second.vp9.Avg(kMinRequiredMetricsSamples);
@@ -385,8 +386,8 @@
RTC_HISTOGRAMS_COUNTS_500(kIndex, uma_prefix_ + "Encoded.Qp.Vp9.S2",
qp_vp9);
} else {
- LOG(LS_WARNING) << "QP stats not recorded for VP9 spatial layer "
- << spatial_idx;
+ RTC_LOG(LS_WARNING)
+ << "QP stats not recorded for VP9 spatial layer " << spatial_idx;
}
}
int qp_h264 = it.second.h264.Avg(kMinRequiredMetricsSamples);
@@ -427,8 +428,8 @@
if (fraction_lost != -1) {
RTC_HISTOGRAMS_PERCENTAGE(
kIndex, uma_prefix_ + "SentPacketsLostInPercent", fraction_lost);
- LOG(LS_INFO) << uma_prefix_ << "SentPacketsLostInPercent "
- << fraction_lost;
+ RTC_LOG(LS_INFO) << uma_prefix_ << "SentPacketsLostInPercent "
+ << fraction_lost;
}
// The RTCP packet type counters, delivered via the
@@ -475,16 +476,16 @@
if (elapsed_sec >= metrics::kMinRunTimeInSeconds) {
RTC_HISTOGRAMS_COUNTS_100(kIndex, uma_prefix_ + "NumberOfPauseEvents",
target_rate_updates_.pause_resume_events);
- LOG(LS_INFO) << uma_prefix_ << "NumberOfPauseEvents "
- << target_rate_updates_.pause_resume_events;
+ RTC_LOG(LS_INFO) << uma_prefix_ << "NumberOfPauseEvents "
+ << target_rate_updates_.pause_resume_events;
int paused_time_percent =
paused_time_counter_.Percent(metrics::kMinRunTimeInSeconds * 1000);
if (paused_time_percent != -1) {
RTC_HISTOGRAMS_PERCENTAGE(kIndex, uma_prefix_ + "PausedTimeInPercent",
paused_time_percent);
- LOG(LS_INFO) << uma_prefix_ << "PausedTimeInPercent "
- << paused_time_percent;
+ RTC_LOG(LS_INFO) << uma_prefix_ << "PausedTimeInPercent "
+ << paused_time_percent;
}
}
}
@@ -508,23 +509,23 @@
if (total_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) {
RTC_HISTOGRAMS_COUNTS_10000(kIndex, uma_prefix_ + "BitrateSentInKbps",
total_bytes_per_sec.average * 8 / 1000);
- LOG(LS_INFO) << uma_prefix_ << "BitrateSentInBps, "
- << total_bytes_per_sec.ToStringWithMultiplier(8);
+ RTC_LOG(LS_INFO) << uma_prefix_ << "BitrateSentInBps, "
+ << total_bytes_per_sec.ToStringWithMultiplier(8);
}
AggregatedStats media_bytes_per_sec = media_byte_counter_.GetStats();
if (media_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) {
RTC_HISTOGRAMS_COUNTS_10000(kIndex, uma_prefix_ + "MediaBitrateSentInKbps",
media_bytes_per_sec.average * 8 / 1000);
- LOG(LS_INFO) << uma_prefix_ << "MediaBitrateSentInBps, "
- << media_bytes_per_sec.ToStringWithMultiplier(8);
+ RTC_LOG(LS_INFO) << uma_prefix_ << "MediaBitrateSentInBps, "
+ << media_bytes_per_sec.ToStringWithMultiplier(8);
}
AggregatedStats padding_bytes_per_sec = padding_byte_counter_.GetStats();
if (padding_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) {
RTC_HISTOGRAMS_COUNTS_10000(kIndex,
uma_prefix_ + "PaddingBitrateSentInKbps",
padding_bytes_per_sec.average * 8 / 1000);
- LOG(LS_INFO) << uma_prefix_ << "PaddingBitrateSentInBps, "
- << padding_bytes_per_sec.ToStringWithMultiplier(8);
+ RTC_LOG(LS_INFO) << uma_prefix_ << "PaddingBitrateSentInBps, "
+ << padding_bytes_per_sec.ToStringWithMultiplier(8);
}
AggregatedStats retransmit_bytes_per_sec =
retransmit_byte_counter_.GetStats();
@@ -532,16 +533,16 @@
RTC_HISTOGRAMS_COUNTS_10000(kIndex,
uma_prefix_ + "RetransmittedBitrateSentInKbps",
retransmit_bytes_per_sec.average * 8 / 1000);
- LOG(LS_INFO) << uma_prefix_ << "RetransmittedBitrateSentInBps, "
- << retransmit_bytes_per_sec.ToStringWithMultiplier(8);
+ RTC_LOG(LS_INFO) << uma_prefix_ << "RetransmittedBitrateSentInBps, "
+ << retransmit_bytes_per_sec.ToStringWithMultiplier(8);
}
if (!rtp_config.rtx.ssrcs.empty()) {
AggregatedStats rtx_bytes_per_sec = rtx_byte_counter_.GetStats();
int rtx_bytes_per_sec_avg = -1;
if (rtx_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) {
rtx_bytes_per_sec_avg = rtx_bytes_per_sec.average;
- LOG(LS_INFO) << uma_prefix_ << "RtxBitrateSentInBps, "
- << rtx_bytes_per_sec.ToStringWithMultiplier(8);
+ RTC_LOG(LS_INFO) << uma_prefix_ << "RtxBitrateSentInBps, "
+ << rtx_bytes_per_sec.ToStringWithMultiplier(8);
} else if (total_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) {
rtx_bytes_per_sec_avg = 0; // RTX enabled but no RTX data sent, record 0.
}
@@ -556,25 +557,25 @@
if (fec_bytes_per_sec.num_samples > kMinRequiredPeriodicSamples) {
RTC_HISTOGRAMS_COUNTS_10000(kIndex, uma_prefix_ + "FecBitrateSentInKbps",
fec_bytes_per_sec.average * 8 / 1000);
- LOG(LS_INFO) << uma_prefix_ << "FecBitrateSentInBps, "
- << fec_bytes_per_sec.ToStringWithMultiplier(8);
+ RTC_LOG(LS_INFO) << uma_prefix_ << "FecBitrateSentInBps, "
+ << fec_bytes_per_sec.ToStringWithMultiplier(8);
}
}
- LOG(LS_INFO) << "Frames encoded " << current_stats.frames_encoded;
- LOG(LS_INFO) << uma_prefix_ << "DroppedFrames.Capturer "
- << current_stats.frames_dropped_by_capturer;
+ RTC_LOG(LS_INFO) << "Frames encoded " << current_stats.frames_encoded;
+ RTC_LOG(LS_INFO) << uma_prefix_ << "DroppedFrames.Capturer "
+ << current_stats.frames_dropped_by_capturer;
RTC_HISTOGRAMS_COUNTS_1000(kIndex, uma_prefix_ + "DroppedFrames.Capturer",
current_stats.frames_dropped_by_capturer);
- LOG(LS_INFO) << uma_prefix_ << "DroppedFrames.EncoderQueue "
- << current_stats.frames_dropped_by_encoder_queue;
+ RTC_LOG(LS_INFO) << uma_prefix_ << "DroppedFrames.EncoderQueue "
+ << current_stats.frames_dropped_by_encoder_queue;
RTC_HISTOGRAMS_COUNTS_1000(kIndex, uma_prefix_ + "DroppedFrames.EncoderQueue",
current_stats.frames_dropped_by_encoder_queue);
- LOG(LS_INFO) << uma_prefix_ << "DroppedFrames.Encoder "
- << current_stats.frames_dropped_by_encoder;
+ RTC_LOG(LS_INFO) << uma_prefix_ << "DroppedFrames.Encoder "
+ << current_stats.frames_dropped_by_encoder;
RTC_HISTOGRAMS_COUNTS_1000(kIndex, uma_prefix_ + "DroppedFrames.Encoder",
current_stats.frames_dropped_by_encoder);
- LOG(LS_INFO) << uma_prefix_ << "DroppedFrames.Ratelimiter "
- << current_stats.frames_dropped_by_rate_limiter;
+ RTC_LOG(LS_INFO) << uma_prefix_ << "DroppedFrames.Ratelimiter "
+ << current_stats.frames_dropped_by_rate_limiter;
RTC_HISTOGRAMS_COUNTS_1000(kIndex, uma_prefix_ + "DroppedFrames.Ratelimiter",
current_stats.frames_dropped_by_rate_limiter);
}
@@ -797,8 +798,9 @@
}
if (simulcast_idx >= rtp_config_.ssrcs.size()) {
- LOG(LS_ERROR) << "Encoded image outside simulcast range (" << simulcast_idx
- << " >= " << rtp_config_.ssrcs.size() << ").";
+ RTC_LOG(LS_ERROR) << "Encoded image outside simulcast range ("
+ << simulcast_idx << " >= " << rtp_config_.ssrcs.size()
+ << ").";
return;
}
uint32_t ssrc = rtp_config_.ssrcs[simulcast_idx];
diff --git a/video/stream_synchronization.cc b/video/stream_synchronization.cc
index f47037d..6b800d1 100644
--- a/video/stream_synchronization.cc
+++ b/video/stream_synchronization.cc
@@ -70,9 +70,9 @@
assert(total_audio_delay_target_ms && total_video_delay_target_ms);
int current_video_delay_ms = *total_video_delay_target_ms;
- LOG(LS_VERBOSE) << "Audio delay: " << current_audio_delay_ms
- << " current diff: " << relative_delay_ms
- << " for stream " << audio_stream_id_;
+ RTC_LOG(LS_VERBOSE) << "Audio delay: " << current_audio_delay_ms
+ << " current diff: " << relative_delay_ms
+ << " for stream " << audio_stream_id_;
// Calculate the difference between the lowest possible video delay and
// the current audio delay.
int current_diff_ms = current_video_delay_ms - current_audio_delay_ms +
@@ -165,10 +165,11 @@
channel_delay_.last_video_delay_ms = new_video_delay_ms;
channel_delay_.last_audio_delay_ms = new_audio_delay_ms;
- LOG(LS_VERBOSE) << "Sync video delay " << new_video_delay_ms
- << " for video stream " << video_stream_id_
- << " and audio delay " << channel_delay_.extra_audio_delay_ms
- << " for audio stream " << audio_stream_id_;
+ RTC_LOG(LS_VERBOSE) << "Sync video delay " << new_video_delay_ms
+ << " for video stream " << video_stream_id_
+ << " and audio delay "
+ << channel_delay_.extra_audio_delay_ms
+ << " for audio stream " << audio_stream_id_;
// Return values.
*total_video_delay_target_ms = new_video_delay_ms;
diff --git a/video/video_quality_test.cc b/video/video_quality_test.cc
index 6428dc2..d300d11 100644
--- a/video/video_quality_test.cc
+++ b/video/video_quality_test.cc
@@ -844,7 +844,7 @@
test::GetTestArtifactsDir(&output_dir);
std::string output_path =
rtc::Pathname(output_dir, test_label_ + ".jpg").pathname();
- LOG(LS_INFO) << "Saving worst frame to " << output_path;
+ RTC_LOG(LS_INFO) << "Saving worst frame to " << output_path;
test::JpegFrameWriter frame_writer(output_path);
RTC_CHECK(frame_writer.WriteFrame(worst_frame_->frame,
100 /*best quality*/));
diff --git a/video/video_receive_stream.cc b/video/video_receive_stream.cc
index cca0511..5f6b5cf 100644
--- a/video/video_receive_stream.cc
+++ b/video/video_receive_stream.cc
@@ -106,7 +106,7 @@
this, // OnCompleteFrameCallback
timing_.get()),
rtp_stream_sync_(this) {
- LOG(LS_INFO) << "VideoReceiveStream: " << config_.ToString();
+ RTC_LOG(LS_INFO) << "VideoReceiveStream: " << config_.ToString();
RTC_DCHECK(process_thread_);
RTC_DCHECK(call_stats_);
@@ -146,7 +146,7 @@
VideoReceiveStream::~VideoReceiveStream() {
RTC_DCHECK_CALLED_SEQUENTIALLY(&worker_sequence_checker_);
- LOG(LS_INFO) << "~VideoReceiveStream: " << config_.ToString();
+ RTC_LOG(LS_INFO) << "~VideoReceiveStream: " << config_.ToString();
Stop();
process_thread_->DeRegisterModule(&rtp_stream_sync_);
@@ -451,8 +451,8 @@
now_ms - *last_keyframe_packet_ms < kMaxWaitForKeyFrameMs;
if (stream_is_active && !receiving_keyframe) {
- LOG(LS_WARNING) << "No decodable frame in " << wait_ms
- << " ms, requesting keyframe.";
+ RTC_LOG(LS_WARNING) << "No decodable frame in " << wait_ms
+ << " ms, requesting keyframe.";
RequestKeyFrame();
}
}
diff --git a/video/video_send_stream.cc b/video/video_send_stream.cc
index 982cd53..d161025 100644
--- a/video/video_send_stream.cc
+++ b/video/video_send_stream.cc
@@ -104,25 +104,27 @@
RTC_DCHECK_GE(config.rtp.flexfec.payload_type, 0);
RTC_DCHECK_LE(config.rtp.flexfec.payload_type, 127);
if (config.rtp.flexfec.ssrc == 0) {
- LOG(LS_WARNING) << "FlexFEC is enabled, but no FlexFEC SSRC given. "
- "Therefore disabling FlexFEC.";
+ RTC_LOG(LS_WARNING) << "FlexFEC is enabled, but no FlexFEC SSRC given. "
+ "Therefore disabling FlexFEC.";
return nullptr;
}
if (config.rtp.flexfec.protected_media_ssrcs.empty()) {
- LOG(LS_WARNING) << "FlexFEC is enabled, but no protected media SSRC given. "
- "Therefore disabling FlexFEC.";
+ RTC_LOG(LS_WARNING)
+ << "FlexFEC is enabled, but no protected media SSRC given. "
+ "Therefore disabling FlexFEC.";
return nullptr;
}
if (config.rtp.ssrcs.size() > 1) {
- LOG(LS_WARNING) << "Both FlexFEC and simulcast are enabled. This "
- "combination is however not supported by our current "
- "FlexFEC implementation. Therefore disabling FlexFEC.";
+ RTC_LOG(LS_WARNING)
+ << "Both FlexFEC and simulcast are enabled. This "
+ "combination is however not supported by our current "
+ "FlexFEC implementation. Therefore disabling FlexFEC.";
return nullptr;
}
if (config.rtp.flexfec.protected_media_ssrcs.size() > 1) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "The supplied FlexfecConfig contained multiple protected "
"media streams, but our implementation currently only "
"supports protecting a single media stream. "
@@ -563,7 +565,7 @@
void VideoSendStream::Start() {
RTC_DCHECK_RUN_ON(&thread_checker_);
- LOG(LS_INFO) << "VideoSendStream::Start";
+ RTC_LOG(LS_INFO) << "VideoSendStream::Start";
VideoSendStreamImpl* send_stream = send_stream_.get();
worker_queue_->PostTask([this, send_stream] {
send_stream->Start();
@@ -578,7 +580,7 @@
void VideoSendStream::Stop() {
RTC_DCHECK_RUN_ON(&thread_checker_);
- LOG(LS_INFO) << "VideoSendStream::Stop";
+ RTC_LOG(LS_INFO) << "VideoSendStream::Stop";
VideoSendStreamImpl* send_stream = send_stream_.get();
worker_queue_->PostTask([send_stream] { send_stream->Stop(); });
}
@@ -707,7 +709,7 @@
overhead_bytes_per_packet_(0),
transport_overhead_bytes_per_packet_(0) {
RTC_DCHECK_RUN_ON(worker_queue_);
- LOG(LS_INFO) << "VideoSendStreamInternal: " << config_->ToString();
+ RTC_LOG(LS_INFO) << "VideoSendStreamInternal: " << config_->ToString();
weak_ptr_ = weak_ptr_factory_.GetWeakPtr();
module_process_thread_checker_.DetachFromThread();
@@ -822,7 +824,7 @@
RTC_DCHECK_RUN_ON(worker_queue_);
RTC_DCHECK(!payload_router_.IsActive())
<< "VideoSendStreamImpl::Stop not called";
- LOG(LS_INFO) << "~VideoSendStreamInternal: " << config_->ToString();
+ RTC_LOG(LS_INFO) << "~VideoSendStreamInternal: " << config_->ToString();
for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) {
transport_->packet_router()->RemoveSendRtpModule(rtp_rtcp);
@@ -840,7 +842,7 @@
void VideoSendStreamImpl::Start() {
RTC_DCHECK_RUN_ON(worker_queue_);
- LOG(LS_INFO) << "VideoSendStream::Start";
+ RTC_LOG(LS_INFO) << "VideoSendStream::Start";
if (payload_router_.IsActive())
return;
TRACE_EVENT_INSTANT0("webrtc", "VideoSendStream::Start");
@@ -866,7 +868,7 @@
void VideoSendStreamImpl::Stop() {
RTC_DCHECK_RUN_ON(worker_queue_);
- LOG(LS_INFO) << "VideoSendStream::Stop";
+ RTC_LOG(LS_INFO) << "VideoSendStream::Stop";
if (!payload_router_.IsActive())
return;
TRACE_EVENT_INSTANT0("webrtc", "VideoSendStream::Stop");
@@ -887,7 +889,7 @@
// is supposed to, deregister as BitrateAllocatorObserver. This can happen
// if a camera stops producing frames.
if (encoder_target_rate_bps_ > 0) {
- LOG(LS_INFO) << "SignalEncoderTimedOut, Encoder timed out.";
+ RTC_LOG(LS_INFO) << "SignalEncoderTimedOut, Encoder timed out.";
bitrate_allocator_->RemoveObserver(this);
}
}
@@ -899,7 +901,7 @@
void VideoSendStreamImpl::SignalEncoderActive() {
RTC_DCHECK_RUN_ON(worker_queue_);
- LOG(LS_INFO) << "SignalEncoderActive, Encoder is active.";
+ RTC_LOG(LS_INFO) << "SignalEncoderActive, Encoder is active.";
bitrate_allocator_->AddObserver(
this, encoder_min_bitrate_bps_, encoder_max_bitrate_bps_,
max_padding_bitrate_, !config_->suspend_below_min_bitrate,
@@ -1011,7 +1013,7 @@
auto DisableUlpfec = [&]() { ulpfec_payload_type = -1; };
if (webrtc::field_trial::IsEnabled("WebRTC-DisableUlpFecExperiment")) {
- LOG(LS_INFO) << "Experiment to disable sending ULPFEC is enabled.";
+ RTC_LOG(LS_INFO) << "Experiment to disable sending ULPFEC is enabled.";
DisableUlpfec();
}
@@ -1021,11 +1023,11 @@
// we know that it has a receiver without the RED/RTX workaround.
// See http://crbug.com/webrtc/6650 for more information.
if (IsRedEnabled()) {
- LOG(LS_INFO) << "Both FlexFEC and RED are configured. Disabling RED.";
+ RTC_LOG(LS_INFO) << "Both FlexFEC and RED are configured. Disabling RED.";
DisableRed();
}
if (IsUlpfecEnabled()) {
- LOG(LS_INFO)
+ RTC_LOG(LS_INFO)
<< "Both FlexFEC and ULPFEC are configured. Disabling ULPFEC.";
DisableUlpfec();
}
@@ -1038,7 +1040,7 @@
if (nack_enabled && IsUlpfecEnabled() &&
!PayloadTypeSupportsSkippingFecPackets(
config_->encoder_settings.payload_name)) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "Transmitting payload type without picture ID using "
"NACK+ULPFEC is a waste of bandwidth since ULPFEC packets "
"also have to be retransmitted. Disabling ULPFEC.";
@@ -1061,7 +1063,7 @@
RTC_DCHECK_GE(ulpfec_payload_type, 0);
RTC_DCHECK_LE(ulpfec_payload_type, 127);
if (!IsRedEnabled()) {
- LOG(LS_WARNING)
+ RTC_LOG(LS_WARNING)
<< "ULPFEC is enabled but RED is disabled. Disabling ULPFEC.";
DisableUlpfec();
}
@@ -1269,7 +1271,7 @@
void VideoSendStreamImpl::SetTransportOverhead(
size_t transport_overhead_bytes_per_packet) {
if (transport_overhead_bytes_per_packet >= static_cast<int>(kPathMTU)) {
- LOG(LS_ERROR) << "Transport overhead exceeds size of ethernet frame";
+ RTC_LOG(LS_ERROR) << "Transport overhead exceeds size of ethernet frame";
return;
}
diff --git a/video/video_send_stream_tests.cc b/video/video_send_stream_tests.cc
index 93df93f..52699db 100644
--- a/video/video_send_stream_tests.cc
+++ b/video/video_send_stream_tests.cc
@@ -152,8 +152,9 @@
// unpopulated value we'll wait for a packet with non-zero send time.
observation_complete_.Set();
} else {
- LOG(LS_WARNING) << "Got a packet with zero absoluteSendTime, waiting"
- " for another packet...";
+ RTC_LOG(LS_WARNING)
+ << "Got a packet with zero absoluteSendTime, waiting"
+ " for another packet...";
}
return SEND_PACKET;
diff --git a/video/video_stream_encoder.cc b/video/video_stream_encoder.cc
index 4b67304..6c59670 100644
--- a/video/video_stream_encoder.cc
+++ b/video/video_stream_encoder.cc
@@ -147,18 +147,17 @@
video_stream_encoder_->EncodeVideoFrame(frame_, time_when_posted_us_);
} else {
// There is a newer frame in flight. Do not encode this frame.
- LOG(LS_VERBOSE)
+ RTC_LOG(LS_VERBOSE)
<< "Incoming frame dropped due to that the encoder is blocked.";
++video_stream_encoder_->dropped_frame_count_;
video_stream_encoder_->stats_proxy_->OnFrameDroppedInEncoderQueue();
}
if (log_stats_) {
- LOG(LS_INFO) << "Number of frames: captured "
- << video_stream_encoder_->captured_frame_count_
- << ", dropped (due to encoder blocked) "
- << video_stream_encoder_->dropped_frame_count_
- << ", interval_ms "
- << kFrameLogIntervalMs;
+ RTC_LOG(LS_INFO) << "Number of frames: captured "
+ << video_stream_encoder_->captured_frame_count_
+ << ", dropped (due to encoder blocked) "
+ << video_stream_encoder_->dropped_frame_count_
+ << ", interval_ms " << kFrameLogIntervalMs;
video_stream_encoder_->captured_frame_count_ = 0;
video_stream_encoder_->dropped_frame_count_ = 0;
}
@@ -244,7 +243,8 @@
pixels_wanted >= sink_wants_.max_pixel_count) {
return false;
}
- LOG(LS_INFO) << "Scaling down resolution, max pixels: " << pixels_wanted;
+ RTC_LOG(LS_INFO) << "Scaling down resolution, max pixels: "
+ << pixels_wanted;
sink_wants_.max_pixel_count = pixels_wanted;
sink_wants_.target_pixel_count = rtc::Optional<int>();
source_->AddOrUpdateSink(video_stream_encoder_,
@@ -288,7 +288,8 @@
sink_wants_.target_pixel_count =
rtc::Optional<int>((pixel_count * 5) / 3);
}
- LOG(LS_INFO) << "Scaling up resolution, max pixels: " << max_pixels_wanted;
+ RTC_LOG(LS_INFO) << "Scaling up resolution, max pixels: "
+ << max_pixels_wanted;
source_->AddOrUpdateSink(video_stream_encoder_,
GetActiveSinkWantsInternal());
return true;
@@ -318,7 +319,7 @@
if (fps_wanted >= sink_wants_.max_framerate_fps)
return false;
- LOG(LS_INFO) << "Scaling down framerate: " << fps_wanted;
+ RTC_LOG(LS_INFO) << "Scaling down framerate: " << fps_wanted;
sink_wants_.max_framerate_fps = fps_wanted;
source_->AddOrUpdateSink(video_stream_encoder_,
GetActiveSinkWantsInternal());
@@ -335,7 +336,7 @@
if (fps_wanted <= sink_wants_.max_framerate_fps)
return false;
- LOG(LS_INFO) << "Scaling up framerate: " << fps_wanted;
+ RTC_LOG(LS_INFO) << "Scaling up framerate: " << fps_wanted;
sink_wants_.max_framerate_fps = fps_wanted;
source_->AddOrUpdateSink(video_stream_encoder_,
GetActiveSinkWantsInternal());
@@ -540,7 +541,7 @@
bool nack_enabled) {
RTC_DCHECK_RUN_ON(&encoder_queue_);
RTC_DCHECK(sink_);
- LOG(LS_INFO) << "ConfigureEncoder requested.";
+ RTC_LOG(LS_INFO) << "ConfigureEncoder requested.";
max_data_payload_length_ = max_data_payload_length;
nack_enabled_ = nack_enabled;
@@ -585,7 +586,7 @@
if (!VideoCodecInitializer::SetupCodec(encoder_config_, settings_, streams,
nack_enabled_, &codec,
&rate_allocator_)) {
- LOG(LS_ERROR) << "Failed to create encoder configuration.";
+ RTC_LOG(LS_ERROR) << "Failed to create encoder configuration.";
}
codec.startBitrate =
@@ -599,7 +600,7 @@
&codec, number_of_cores_,
static_cast<uint32_t>(max_data_payload_length_)) == VCM_OK;
if (!success) {
- LOG(LS_ERROR) << "Failed to configure encoder.";
+ RTC_LOG(LS_ERROR) << "Failed to configure encoder.";
rate_allocator_.reset();
}
@@ -693,10 +694,10 @@
if (incoming_frame.ntp_time_ms() <= last_captured_timestamp_) {
// We don't allow the same capture time for two frames, drop this one.
- LOG(LS_WARNING) << "Same/old NTP timestamp ("
- << incoming_frame.ntp_time_ms()
- << " <= " << last_captured_timestamp_
- << ") for incoming frame. Dropping.";
+ RTC_LOG(LS_WARNING) << "Same/old NTP timestamp ("
+ << incoming_frame.ntp_time_ms()
+ << " <= " << last_captured_timestamp_
+ << ") for incoming frame. Dropping.";
return;
}
@@ -755,15 +756,16 @@
pending_encoder_reconfiguration_ = true;
last_frame_info_ = rtc::Optional<VideoFrameInfo>(VideoFrameInfo(
video_frame.width(), video_frame.height(), video_frame.is_texture()));
- LOG(LS_INFO) << "Video frame parameters changed: dimensions="
- << last_frame_info_->width << "x" << last_frame_info_->height
- << ", texture=" << last_frame_info_->is_texture << ".";
+ RTC_LOG(LS_INFO) << "Video frame parameters changed: dimensions="
+ << last_frame_info_->width << "x"
+ << last_frame_info_->height
+ << ", texture=" << last_frame_info_->is_texture << ".";
}
if (initial_rampup_ < kMaxInitialFramedrop &&
video_frame.size() >
MaximumFrameSizeForBitrate(encoder_start_bitrate_bps_ / 1000)) {
- LOG(LS_INFO) << "Dropping frame. Too large for target bitrate.";
+ RTC_LOG(LS_INFO) << "Dropping frame. Too large for target bitrate.";
AdaptDown(kQuality);
++initial_rampup_;
return;
@@ -894,9 +896,9 @@
RTC_DCHECK_RUN_ON(&encoder_queue_);
RTC_DCHECK(sink_) << "sink_ must be set before the encoder is active.";
- LOG(LS_VERBOSE) << "OnBitrateUpdated, bitrate " << bitrate_bps
- << " packet loss " << static_cast<int>(fraction_lost)
- << " rtt " << round_trip_time_ms;
+ RTC_LOG(LS_VERBOSE) << "OnBitrateUpdated, bitrate " << bitrate_bps
+ << " packet loss " << static_cast<int>(fraction_lost)
+ << " rtt " << round_trip_time_ms;
video_sender_.SetChannelParameters(bitrate_bps, fraction_lost,
round_trip_time_ms, rate_allocator_.get(),
@@ -909,8 +911,8 @@
last_observed_bitrate_bps_ = bitrate_bps;
if (video_suspension_changed) {
- LOG(LS_INFO) << "Video suspend state changed to: "
- << (video_is_suspended ? "suspended" : "not suspended");
+ RTC_LOG(LS_INFO) << "Video suspend state changed to: "
+ << (video_is_suspended ? "suspended" : "not suspended");
stats_proxy_->OnSuspendChange(video_is_suspended);
}
}
@@ -1004,7 +1006,7 @@
UpdateAdaptationStats(reason);
- LOG(LS_INFO) << GetConstAdaptCounter().ToString();
+ RTC_LOG(LS_INFO) << GetConstAdaptCounter().ToString();
}
void VideoStreamEncoder::AdaptUp(AdaptReason reason) {
@@ -1045,7 +1047,7 @@
// Reset framerate in case of fewer fps steps down than up.
if (adapt_counter.FramerateCount() == 0 &&
fps != std::numeric_limits<int>::max()) {
- LOG(LS_INFO) << "Removing framerate down-scaling setting.";
+ RTC_LOG(LS_INFO) << "Removing framerate down-scaling setting.";
source_proxy_->IncreaseFramerate(std::numeric_limits<int>::max());
}
break;
@@ -1057,7 +1059,7 @@
// Scale up resolution.
int pixel_count = adaptation_request.input_pixel_count_;
if (adapt_counter.ResolutionCount() == 1) {
- LOG(LS_INFO) << "Removing resolution down-scaling setting.";
+ RTC_LOG(LS_INFO) << "Removing resolution down-scaling setting.";
pixel_count = std::numeric_limits<int>::max();
}
if (!source_proxy_->RequestHigherResolutionThan(pixel_count))
@@ -1069,7 +1071,7 @@
// Scale up framerate.
int fps = adaptation_request.framerate_fps_;
if (adapt_counter.FramerateCount() == 1) {
- LOG(LS_INFO) << "Removing framerate down-scaling setting.";
+ RTC_LOG(LS_INFO) << "Removing framerate down-scaling setting.";
fps = std::numeric_limits<int>::max();
}
@@ -1092,7 +1094,7 @@
UpdateAdaptationStats(reason);
- LOG(LS_INFO) << adapt_counter.ToString();
+ RTC_LOG(LS_INFO) << adapt_counter.ToString();
}
void VideoStreamEncoder::UpdateAdaptationStats(AdaptReason reason) {
diff --git a/voice_engine/channel.cc b/voice_engine/channel.cc
index d978c45..c870ece 100644
--- a/voice_engine/channel.cc
+++ b/voice_engine/channel.cc
@@ -341,8 +341,8 @@
// received from the capture device as
// undefined for voice for now.
-1, payloadData, payloadSize, fragmentation, nullptr, nullptr)) {
- LOG(LS_ERROR) <<
- "Channel::SendData() failed to send data to RTP/RTCP module";
+ RTC_LOG(LS_ERROR)
+ << "Channel::SendData() failed to send data to RTP/RTCP module";
return -1;
}
@@ -355,8 +355,9 @@
rtc::CritScope cs(&_callbackCritSect);
if (_transportPtr == NULL) {
- LOG(LS_ERROR) << "Channel::SendPacket() failed to send RTP packet due to"
- << " invalid transport object";
+ RTC_LOG(LS_ERROR)
+ << "Channel::SendPacket() failed to send RTP packet due to"
+ << " invalid transport object";
return false;
}
@@ -364,7 +365,7 @@
size_t bufferLength = len;
if (!_transportPtr->SendRtp(bufferToSendPtr, bufferLength, options)) {
- LOG(LS_ERROR) << "Channel::SendPacket() RTP transmission failed";
+ RTC_LOG(LS_ERROR) << "Channel::SendPacket() RTP transmission failed";
return false;
}
return true;
@@ -373,8 +374,8 @@
bool Channel::SendRtcp(const uint8_t* data, size_t len) {
rtc::CritScope cs(&_callbackCritSect);
if (_transportPtr == NULL) {
- LOG(LS_ERROR) << "Channel::SendRtcp() failed to send RTCP packet due to"
- << " invalid transport object";
+ RTC_LOG(LS_ERROR) << "Channel::SendRtcp() failed to send RTCP packet due to"
+ << " invalid transport object";
return false;
}
@@ -383,7 +384,7 @@
int n = _transportPtr->SendRtcp(bufferToSendPtr, bufferLength);
if (n < 0) {
- LOG(LS_ERROR) << "Channel::SendRtcp() transmission failed";
+ RTC_LOG(LS_ERROR) << "Channel::SendRtcp() transmission failed";
return false;
}
return true;
@@ -402,8 +403,9 @@
const SdpAudioFormat& audio_format,
uint32_t rate) {
if (!audio_coding_->RegisterReceiveCodec(payload_type, audio_format)) {
- LOG(LS_WARNING) << "Channel::OnInitializeDecoder() invalid codec (pt="
- << payload_type << ", " << audio_format << ") received -1";
+ RTC_LOG(LS_WARNING) << "Channel::OnInitializeDecoder() invalid codec (pt="
+ << payload_type << ", " << audio_format
+ << ") received -1";
return -1;
}
@@ -422,8 +424,8 @@
// Push the incoming payload (parsed and ready for decoding) into the ACM
if (audio_coding_->IncomingPacket(payloadData, payloadSize, *rtpHeader) !=
0) {
- LOG(LS_ERROR) <<
- "Channel::OnReceivedPayloadData() unable to push data to the ACM";
+ RTC_LOG(LS_ERROR)
+ << "Channel::OnReceivedPayloadData() unable to push data to the ACM";
return -1;
}
@@ -444,7 +446,7 @@
size_t rtp_packet_length) {
RTPHeader header;
if (!rtp_header_parser_->Parse(rtp_packet, rtp_packet_length, &header)) {
- LOG(LS_WARNING) << "IncomingPacket invalid RTP header";
+ RTC_LOG(LS_WARNING) << "IncomingPacket invalid RTP header";
return false;
}
header.payload_type_frequency =
@@ -467,7 +469,7 @@
bool muted;
if (audio_coding_->PlayoutData10Ms(audio_frame->sample_rate_hz_, audio_frame,
&muted) == -1) {
- LOG(LS_ERROR) << "Channel::GetAudioFrame() PlayoutData10Ms() failed!";
+ RTC_LOG(LS_ERROR) << "Channel::GetAudioFrame() PlayoutData10Ms() failed!";
// In all likelihood, the audio in this frame is garbage. We return an
// error so that the audio mixer module doesn't add it to the mix. As
// a result, it won't be played out and the actions skipped here are
@@ -575,7 +577,7 @@
const VoEBase::ChannelConfig& config) {
channel = new Channel(channelId, instanceId, config);
if (channel == NULL) {
- LOG(LS_ERROR) << "unable to allocate memory for new channel";
+ RTC_LOG(LS_ERROR) << "unable to allocate memory for new channel";
return -1;
}
return 0;
@@ -669,7 +671,8 @@
// --- Initial sanity
if (_moduleProcessThreadPtr == NULL) {
- LOG(LS_ERROR) << "Channel::Init() must call SetEngineInformation() first";
+ RTC_LOG(LS_ERROR)
+ << "Channel::Init() must call SetEngineInformation() first";
return -1;
}
@@ -680,7 +683,7 @@
// --- ACM initialization
if (audio_coding_->InitializeReceiver() == -1) {
- LOG(LS_ERROR) << "Channel::Init() unable to initialize the ACM - 1";
+ RTC_LOG(LS_ERROR) << "Channel::Init() unable to initialize the ACM - 1";
return -1;
}
@@ -696,7 +699,7 @@
_rtpRtcpModule->SetRTCPStatus(RtcpMode::kCompound);
// --- Register all permanent callbacks
if (audio_coding_->RegisterTransportCallback(this) == -1) {
- LOG(LS_ERROR) << "Channel::Init() callbacks not registered";
+ RTC_LOG(LS_ERROR) << "Channel::Init() callbacks not registered";
return -1;
}
@@ -716,8 +719,9 @@
// 2. De-register modules in process thread
// 3. Destroy modules
if (audio_coding_->RegisterTransportCallback(NULL) == -1) {
- LOG(LS_WARNING) << "Terminate() failed to de-register transport callback"
- << " (Audio coding module)";
+ RTC_LOG(LS_WARNING)
+ << "Terminate() failed to de-register transport callback"
+ << " (Audio coding module)";
}
// De-register modules in process thread
@@ -786,7 +790,7 @@
}
_rtpRtcpModule->SetSendingMediaStatus(true);
if (_rtpRtcpModule->SetSendingStatus(true) != 0) {
- LOG(LS_ERROR) << "StartSend() RTP/RTCP failed to start sending";
+ RTC_LOG(LS_ERROR) << "StartSend() RTP/RTCP failed to start sending";
_rtpRtcpModule->SetSendingMediaStatus(false);
rtc::CritScope cs(&_callbackCritSect);
channel_state_.SetSending(false);
@@ -831,7 +835,7 @@
// Reset sending SSRC and sequence number and triggers direct transmission
// of RTCP BYE
if (_rtpRtcpModule->SetSendingStatus(false) == -1) {
- LOG(LS_ERROR) << "StartSend() RTP/RTCP failed to stop sending";
+ RTC_LOG(LS_ERROR) << "StartSend() RTP/RTCP failed to stop sending";
}
_rtpRtcpModule->SetSendingMediaStatus(false);
}
@@ -865,7 +869,7 @@
if (_rtpRtcpModule->RegisterSendPayload(rtp_codec) != 0) {
_rtpRtcpModule->DeRegisterSendPayload(payload_type);
if (_rtpRtcpModule->RegisterSendPayload(rtp_codec) != 0) {
- LOG(LS_ERROR)
+ RTC_LOG(LS_ERROR)
<< "SetEncoder() failed to register codec to RTP/RTCP module";
return false;
}
@@ -1105,7 +1109,7 @@
}
if (_rtpRtcpModule->SendTelephoneEventOutband(
event, duration_ms, kTelephoneEventAttenuationdB) != 0) {
- LOG(LS_ERROR) << "SendTelephoneEventOutband() failed to send event";
+ RTC_LOG(LS_ERROR) << "SendTelephoneEventOutband() failed to send event";
return -1;
}
return 0;
@@ -1122,8 +1126,9 @@
if (_rtpRtcpModule->RegisterSendPayload(codec) != 0) {
_rtpRtcpModule->DeRegisterSendPayload(codec.pltype);
if (_rtpRtcpModule->RegisterSendPayload(codec) != 0) {
- LOG(LS_ERROR) << "SetSendTelephoneEventPayloadType() failed to register "
- "send payload type";
+ RTC_LOG(LS_ERROR)
+ << "SetSendTelephoneEventPayloadType() failed to register "
+ "send payload type";
return -1;
}
}
@@ -1132,7 +1137,7 @@
int Channel::SetLocalSSRC(unsigned int ssrc) {
if (channel_state_.Get().sending) {
- LOG(LS_ERROR) << "SetLocalSSRC() already sending";
+ RTC_LOG(LS_ERROR) << "SetLocalSSRC() already sending";
return -1;
}
_rtpRtcpModule->SetSSRC(ssrc);
@@ -1229,7 +1234,7 @@
int Channel::SetRTCP_CNAME(const char cName[256]) {
if (_rtpRtcpModule->SetCNAME(cName) != 0) {
- LOG(LS_ERROR) << "SetRTCP_CNAME() failed to set RTCP CNAME";
+ RTC_LOG(LS_ERROR) << "SetRTCP_CNAME() failed to set RTCP CNAME";
return -1;
}
return 0;
@@ -1238,7 +1243,7 @@
int Channel::GetRemoteRTCPReportBlocks(
std::vector<ReportBlock>* report_blocks) {
if (report_blocks == NULL) {
- LOG(LS_ERROR) << "GetRemoteRTCPReportBlock()s invalid report_blocks.";
+ RTC_LOG(LS_ERROR) << "GetRemoteRTCPReportBlock()s invalid report_blocks.";
return -1;
}
@@ -1303,8 +1308,9 @@
}
if (_rtpRtcpModule->DataCountersRTP(&bytesSent, &packetsSent) != 0) {
- LOG(LS_WARNING) << "GetRTPStatistics() failed to retrieve RTP datacounters"
- << " => output will not be complete";
+ RTC_LOG(LS_WARNING)
+ << "GetRTPStatistics() failed to retrieve RTP datacounters"
+ << " => output will not be complete";
}
stats.bytesSent = bytesSent;
@@ -1410,7 +1416,7 @@
// is done and payload is ready for packetization and transmission.
// Otherwise, it will return without invoking the callback.
if (audio_coding_->Add10MsData(*audio_input) < 0) {
- LOG(LS_ERROR) << "ACM::Add10MsData() failed for channel " << _channelId;
+ RTC_LOG(LS_ERROR) << "ACM::Add10MsData() failed for channel " << _channelId;
return;
}
@@ -1486,11 +1492,12 @@
int Channel::SetMinimumPlayoutDelay(int delayMs) {
if ((delayMs < kVoiceEngineMinMinPlayoutDelayMs) ||
(delayMs > kVoiceEngineMaxMinPlayoutDelayMs)) {
- LOG(LS_ERROR) << "SetMinimumPlayoutDelay() invalid min delay";
+ RTC_LOG(LS_ERROR) << "SetMinimumPlayoutDelay() invalid min delay";
return -1;
}
if (audio_coding_->SetMinimumPlayoutDelay(delayMs) != 0) {
- LOG(LS_ERROR) << "SetMinimumPlayoutDelay() failed to set min playout delay";
+ RTC_LOG(LS_ERROR)
+ << "SetMinimumPlayoutDelay() failed to set min playout delay";
return -1;
}
return 0;
@@ -1503,7 +1510,7 @@
playout_timestamp_rtp = playout_timestamp_rtp_;
}
if (playout_timestamp_rtp == 0) {
- LOG(LS_ERROR) << "GetPlayoutTimestamp() failed to retrieve timestamp";
+ RTC_LOG(LS_ERROR) << "GetPlayoutTimestamp() failed to retrieve timestamp";
return -1;
}
timestamp = playout_timestamp_rtp;
@@ -1528,8 +1535,8 @@
uint16_t delay_ms = 0;
if (_audioDeviceModulePtr->PlayoutDelay(&delay_ms) == -1) {
- LOG(LS_WARNING) << "Channel::UpdatePlayoutTimestamp() failed to read"
- << " playout delay from the ADM";
+ RTC_LOG(LS_WARNING) << "Channel::UpdatePlayoutTimestamp() failed to read"
+ << " playout delay from the ADM";
return;
}
@@ -1554,15 +1561,15 @@
for (int idx = 0; idx < nSupportedCodecs; idx++) {
CodecInst codec;
if (audio_coding_->Codec(idx, &codec) == -1) {
- LOG(LS_WARNING) << "Unable to register codec #" << idx
- << " for RTP/RTCP receiver.";
+ RTC_LOG(LS_WARNING) << "Unable to register codec #" << idx
+ << " for RTP/RTCP receiver.";
continue;
}
const SdpAudioFormat format = CodecInstToSdp(codec);
if (!decoder_factory_->IsSupportedDecoder(format) ||
rtp_receiver_->RegisterReceivePayload(codec.pltype, format) == -1) {
- LOG(LS_WARNING) << "Unable to register " << format
- << " for RTP/RTCP receiver.";
+ RTC_LOG(LS_WARNING) << "Unable to register " << format
+ << " for RTP/RTCP receiver.";
}
}
}
diff --git a/voice_engine/channel_proxy.cc b/voice_engine/channel_proxy.cc
index bea4c06..aff9883 100644
--- a/voice_engine/channel_proxy.cc
+++ b/voice_engine/channel_proxy.cc
@@ -296,7 +296,7 @@
delay_ms = rtc::SafeClamp(delay_ms, 0, 10000);
int error = channel()->SetMinimumPlayoutDelay(delay_ms);
if (0 != error) {
- LOG(LS_WARNING) << "Error setting minimum playout delay.";
+ RTC_LOG(LS_WARNING) << "Error setting minimum playout delay.";
}
}
diff --git a/voice_engine/transmit_mixer.cc b/voice_engine/transmit_mixer.cc
index f8ae8e5..bfee66e 100644
--- a/voice_engine/transmit_mixer.cc
+++ b/voice_engine/transmit_mixer.cc
@@ -32,9 +32,9 @@
mixer = new TransmitMixer();
if (mixer == NULL)
{
- LOG(LS_ERROR) << "TransmitMixer::Create() unable to allocate memory "
- "for mixer";
- return -1;
+ RTC_LOG(LS_ERROR) << "TransmitMixer::Create() unable to allocate memory "
+ "for mixer";
+ return -1;
}
return 0;
}
@@ -187,8 +187,8 @@
GainControl* agc = audioproc_->gain_control();
if (agc->set_stream_analog_level(current_mic_level) != 0) {
- LOG(LS_ERROR) << "set_stream_analog_level failed: current_mic_level = "
- << current_mic_level;
+ RTC_LOG(LS_ERROR) << "set_stream_analog_level failed: current_mic_level = "
+ << current_mic_level;
assert(false);
}
@@ -201,7 +201,7 @@
int err = audioproc_->ProcessStream(&_audioFrame);
if (err != 0) {
- LOG(LS_ERROR) << "ProcessStream() error: " << err;
+ RTC_LOG(LS_ERROR) << "ProcessStream() error: " << err;
assert(false);
}
diff --git a/voice_engine/voe_base_impl.cc b/voice_engine/voe_base_impl.cc
index 585ce44..6901bf5 100644
--- a/voice_engine/voe_base_impl.cc
+++ b/voice_engine/voe_base_impl.cc
@@ -163,14 +163,14 @@
VoEId(shared_->instance_id(), -1),
AudioDeviceModule::kPlatformDefaultAudio));
if (shared_->audio_device() == nullptr) {
- LOG(LS_ERROR) << "Init() failed to create the ADM";
+ RTC_LOG(LS_ERROR) << "Init() failed to create the ADM";
return -1;
}
#endif // WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE
} else {
// Use the already existing external ADM implementation.
shared_->set_audio_device(external_adm);
- LOG_F(LS_INFO)
+ RTC_LOG_F(LS_INFO)
<< "An external ADM implementation will be used in VoiceEngine";
}
@@ -181,39 +181,39 @@
// Register the AudioTransport implementation
if (shared_->audio_device()->RegisterAudioCallback(this) != 0) {
- LOG(LS_ERROR) << "Init() failed to register audio callback for the ADM";
+ RTC_LOG(LS_ERROR) << "Init() failed to register audio callback for the ADM";
}
// ADM initialization
if (shared_->audio_device()->Init() != 0) {
- LOG(LS_ERROR) << "Init() failed to initialize the ADM";
+ RTC_LOG(LS_ERROR) << "Init() failed to initialize the ADM";
return -1;
}
// Initialize the default speaker
if (shared_->audio_device()->SetPlayoutDevice(
WEBRTC_VOICE_ENGINE_DEFAULT_DEVICE) != 0) {
- LOG(LS_ERROR) << "Init() failed to set the default output device";
+ RTC_LOG(LS_ERROR) << "Init() failed to set the default output device";
}
if (shared_->audio_device()->InitSpeaker() != 0) {
- LOG(LS_ERROR) << "Init() failed to initialize the speaker";
+ RTC_LOG(LS_ERROR) << "Init() failed to initialize the speaker";
}
// Initialize the default microphone
if (shared_->audio_device()->SetRecordingDevice(
WEBRTC_VOICE_ENGINE_DEFAULT_DEVICE) != 0) {
- LOG(LS_ERROR) << "Init() failed to set the default input device";
+ RTC_LOG(LS_ERROR) << "Init() failed to set the default input device";
}
if (shared_->audio_device()->InitMicrophone() != 0) {
- LOG(LS_ERROR) << "Init() failed to initialize the microphone";
+ RTC_LOG(LS_ERROR) << "Init() failed to initialize the microphone";
}
// Set number of channels
if (shared_->audio_device()->StereoPlayoutIsAvailable(&available) != 0) {
- LOG(LS_ERROR) << "Init() failed to query stereo playout mode";
+ RTC_LOG(LS_ERROR) << "Init() failed to query stereo playout mode";
}
if (shared_->audio_device()->SetStereoPlayout(available) != 0) {
- LOG(LS_ERROR) << "Init() failed to set mono/stereo playout mode";
+ RTC_LOG(LS_ERROR) << "Init() failed to set mono/stereo playout mode";
}
// TODO(andrew): These functions don't tell us whether stereo recording
@@ -225,7 +225,7 @@
// http://code.google.com/p/webrtc/issues/detail?id=204
shared_->audio_device()->StereoRecordingIsAvailable(&available);
if (shared_->audio_device()->SetStereoRecording(available) != 0) {
- LOG(LS_ERROR) << "Init() failed to set mono/stereo recording mode";
+ RTC_LOG(LS_ERROR) << "Init() failed to set mono/stereo recording mode";
}
shared_->set_audio_processing(audio_processing);
@@ -233,31 +233,32 @@
// Configure AudioProcessing components.
// TODO(peah): Move this initialization to webrtcvoiceengine.cc.
if (audio_processing->high_pass_filter()->Enable(true) != 0) {
- LOG_F(LS_ERROR) << "Failed to enable high pass filter.";
+ RTC_LOG_F(LS_ERROR) << "Failed to enable high pass filter.";
return -1;
}
if (audio_processing->echo_cancellation()->enable_drift_compensation(false) !=
0) {
- LOG_F(LS_ERROR) << "Failed to disable drift compensation.";
+ RTC_LOG_F(LS_ERROR) << "Failed to disable drift compensation.";
return -1;
}
if (audio_processing->noise_suppression()->set_level(kDefaultNsMode) != 0) {
- LOG_F(LS_ERROR) << "Failed to set noise suppression level: "
- << kDefaultNsMode;
+ RTC_LOG_F(LS_ERROR) << "Failed to set noise suppression level: "
+ << kDefaultNsMode;
return -1;
}
GainControl* agc = audio_processing->gain_control();
if (agc->set_analog_level_limits(kMinVolumeLevel, kMaxVolumeLevel) != 0) {
- LOG_F(LS_ERROR) << "Failed to set analog level limits with minimum: "
- << kMinVolumeLevel << " and maximum: " << kMaxVolumeLevel;
+ RTC_LOG_F(LS_ERROR) << "Failed to set analog level limits with minimum: "
+ << kMinVolumeLevel
+ << " and maximum: " << kMaxVolumeLevel;
return -1;
}
if (agc->set_mode(kDefaultAgcMode) != 0) {
- LOG_F(LS_ERROR) << "Failed to set mode: " << kDefaultAgcMode;
+ RTC_LOG_F(LS_ERROR) << "Failed to set mode: " << kDefaultAgcMode;
return -1;
}
if (agc->Enable(kDefaultAgcState) != 0) {
- LOG_F(LS_ERROR) << "Failed to set agc state: " << kDefaultAgcState;
+ RTC_LOG_F(LS_ERROR) << "Failed to set agc state: " << kDefaultAgcState;
return -1;
}
@@ -265,7 +266,7 @@
bool agc_enabled =
agc->mode() == GainControl::kAdaptiveAnalog && agc->is_enabled();
if (shared_->audio_device()->SetAGC(agc_enabled) != 0) {
- LOG_F(LS_ERROR) << "Failed to set agc to enabled: " << agc_enabled;
+ RTC_LOG_F(LS_ERROR) << "Failed to set agc to enabled: " << agc_enabled;
// TODO(ajm): No error return here due to
// https://code.google.com/p/webrtc/issues/detail?id=1464
}
@@ -299,14 +300,16 @@
if (channel_owner->channel()->SetEngineInformation(
*shared_->process_thread(), *shared_->audio_device(),
shared_->encoder_queue()) != 0) {
- LOG(LS_ERROR) << "CreateChannel() failed to associate engine and channel."
- " Destroying channel.";
+ RTC_LOG(LS_ERROR)
+ << "CreateChannel() failed to associate engine and channel."
+ " Destroying channel.";
shared_->channel_manager().DestroyChannel(
channel_owner->channel()->ChannelId());
return -1;
} else if (channel_owner->channel()->Init() != 0) {
- LOG(LS_ERROR) << "CreateChannel() failed to initialize channel. Destroying"
- " channel.";
+ RTC_LOG(LS_ERROR)
+ << "CreateChannel() failed to initialize channel. Destroying"
+ " channel.";
shared_->channel_manager().DestroyChannel(
channel_owner->channel()->ChannelId());
return -1;
@@ -320,7 +323,7 @@
voe::ChannelOwner ch = shared_->channel_manager().GetChannel(channel);
voe::Channel* channelPtr = ch.channel();
if (channelPtr == nullptr) {
- LOG(LS_ERROR) << "DeleteChannel() failed to locate channel";
+ RTC_LOG(LS_ERROR) << "DeleteChannel() failed to locate channel";
return -1;
}
}
@@ -340,14 +343,14 @@
voe::ChannelOwner ch = shared_->channel_manager().GetChannel(channel);
voe::Channel* channelPtr = ch.channel();
if (channelPtr == nullptr) {
- LOG(LS_ERROR) << "StartPlayout() failed to locate channel";
+ RTC_LOG(LS_ERROR) << "StartPlayout() failed to locate channel";
return -1;
}
if (channelPtr->Playing()) {
return 0;
}
if (StartPlayout() != 0) {
- LOG(LS_ERROR) << "StartPlayout() failed to start playout";
+ RTC_LOG(LS_ERROR) << "StartPlayout() failed to start playout";
return -1;
}
return channelPtr->StartPlayout();
@@ -358,12 +361,12 @@
voe::ChannelOwner ch = shared_->channel_manager().GetChannel(channel);
voe::Channel* channelPtr = ch.channel();
if (channelPtr == nullptr) {
- LOG(LS_ERROR) << "StopPlayout() failed to locate channel";
+ RTC_LOG(LS_ERROR) << "StopPlayout() failed to locate channel";
return -1;
}
if (channelPtr->StopPlayout() != 0) {
- LOG_F(LS_WARNING) << "StopPlayout() failed to stop playout for channel "
- << channel;
+ RTC_LOG_F(LS_WARNING) << "StopPlayout() failed to stop playout for channel "
+ << channel;
}
return StopPlayout();
}
@@ -373,14 +376,14 @@
voe::ChannelOwner ch = shared_->channel_manager().GetChannel(channel);
voe::Channel* channelPtr = ch.channel();
if (channelPtr == nullptr) {
- LOG(LS_ERROR) << "StartSend() failed to locate channel";
+ RTC_LOG(LS_ERROR) << "StartSend() failed to locate channel";
return -1;
}
if (channelPtr->Sending()) {
return 0;
}
if (StartSend() != 0) {
- LOG(LS_ERROR) << "StartSend() failed to start recording";
+ RTC_LOG(LS_ERROR) << "StartSend() failed to start recording";
return -1;
}
return channelPtr->StartSend();
@@ -391,7 +394,7 @@
voe::ChannelOwner ch = shared_->channel_manager().GetChannel(channel);
voe::Channel* channelPtr = ch.channel();
if (channelPtr == nullptr) {
- LOG(LS_ERROR) << "StopSend() failed to locate channel";
+ RTC_LOG(LS_ERROR) << "StopSend() failed to locate channel";
return -1;
}
channelPtr->StopSend();
@@ -401,11 +404,11 @@
int32_t VoEBaseImpl::StartPlayout() {
if (!shared_->audio_device()->Playing()) {
if (shared_->audio_device()->InitPlayout() != 0) {
- LOG_F(LS_ERROR) << "Failed to initialize playout";
+ RTC_LOG_F(LS_ERROR) << "Failed to initialize playout";
return -1;
}
if (playout_enabled_ && shared_->audio_device()->StartPlayout() != 0) {
- LOG_F(LS_ERROR) << "Failed to start playout";
+ RTC_LOG_F(LS_ERROR) << "Failed to start playout";
return -1;
}
}
@@ -419,7 +422,7 @@
// Stop audio-device playing if no channel is playing out.
if (shared_->NumOfPlayingChannels() == 0) {
if (shared_->audio_device()->StopPlayout() != 0) {
- LOG(LS_ERROR) << "StopPlayout() failed to stop playout";
+ RTC_LOG(LS_ERROR) << "StopPlayout() failed to stop playout";
return -1;
}
}
@@ -429,11 +432,11 @@
int32_t VoEBaseImpl::StartSend() {
if (!shared_->audio_device()->Recording()) {
if (shared_->audio_device()->InitRecording() != 0) {
- LOG_F(LS_ERROR) << "Failed to initialize recording";
+ RTC_LOG_F(LS_ERROR) << "Failed to initialize recording";
return -1;
}
if (recording_enabled_ && shared_->audio_device()->StartRecording() != 0) {
- LOG_F(LS_ERROR) << "Failed to start recording";
+ RTC_LOG_F(LS_ERROR) << "Failed to start recording";
return -1;
}
}
@@ -447,7 +450,7 @@
// Stop audio-device recording if no channel is recording.
if (shared_->NumOfSendingChannels() == 0) {
if (shared_->audio_device()->StopRecording() != 0) {
- LOG(LS_ERROR) << "StopSend() failed to stop recording";
+ RTC_LOG(LS_ERROR) << "StopSend() failed to stop recording";
return -1;
}
shared_->transmit_mixer()->StopSend();
@@ -457,7 +460,7 @@
}
int32_t VoEBaseImpl::SetPlayout(bool enabled) {
- LOG(INFO) << "SetPlayout(" << enabled << ")";
+ RTC_LOG(INFO) << "SetPlayout(" << enabled << ")";
if (playout_enabled_ == enabled) {
return 0;
}
@@ -471,19 +474,19 @@
if (enabled) {
ret = shared_->audio_device()->StartPlayout();
if (ret != 0) {
- LOG(LS_ERROR) << "SetPlayout(true) failed to start playout";
+ RTC_LOG(LS_ERROR) << "SetPlayout(true) failed to start playout";
}
} else {
ret = shared_->audio_device()->StopPlayout();
if (ret != 0) {
- LOG(LS_ERROR) << "SetPlayout(false) failed to stop playout";
+ RTC_LOG(LS_ERROR) << "SetPlayout(false) failed to stop playout";
}
}
return ret;
}
int32_t VoEBaseImpl::SetRecording(bool enabled) {
- LOG(INFO) << "SetRecording(" << enabled << ")";
+ RTC_LOG(INFO) << "SetRecording(" << enabled << ")";
if (recording_enabled_ == enabled) {
return 0;
}
@@ -497,12 +500,12 @@
if (enabled) {
ret = shared_->audio_device()->StartRecording();
if (ret != 0) {
- LOG(LS_ERROR) << "SetRecording(true) failed to start recording";
+ RTC_LOG(LS_ERROR) << "SetRecording(true) failed to start recording";
}
} else {
ret = shared_->audio_device()->StopRecording();
if (ret != 0) {
- LOG(LS_ERROR) << "SetRecording(false) failed to stop recording";
+ RTC_LOG(LS_ERROR) << "SetRecording(false) failed to stop recording";
}
}
return ret;
@@ -518,17 +521,17 @@
if (shared_->audio_device()) {
if (shared_->audio_device()->StopPlayout() != 0) {
- LOG(LS_ERROR) << "TerminateInternal() failed to stop playout";
+ RTC_LOG(LS_ERROR) << "TerminateInternal() failed to stop playout";
}
if (shared_->audio_device()->StopRecording() != 0) {
- LOG(LS_ERROR) << "TerminateInternal() failed to stop recording";
+ RTC_LOG(LS_ERROR) << "TerminateInternal() failed to stop recording";
}
if (shared_->audio_device()->RegisterAudioCallback(nullptr) != 0) {
- LOG(LS_ERROR) << "TerminateInternal() failed to de-register audio "
- "callback for the ADM";
+ RTC_LOG(LS_ERROR) << "TerminateInternal() failed to de-register audio "
+ "callback for the ADM";
}
if (shared_->audio_device()->Terminate() != 0) {
- LOG(LS_ERROR) << "TerminateInternal() failed to terminate the ADM";
+ RTC_LOG(LS_ERROR) << "TerminateInternal() failed to terminate the ADM";
}
shared_->set_audio_device(nullptr);
}