Stop using LOG macros in favor of RTC_ prefixed macros.
This CL has been generated with the following script:
for m in PLOG \
LOG_TAG \
LOG_GLEM \
LOG_GLE_EX \
LOG_GLE \
LAST_SYSTEM_ERROR \
LOG_ERRNO_EX \
LOG_ERRNO \
LOG_ERR_EX \
LOG_ERR \
LOG_V \
LOG_F \
LOG_T_F \
LOG_E \
LOG_T \
LOG_CHECK_LEVEL_V \
LOG_CHECK_LEVEL \
LOG
do
git grep -l $m | xargs sed -i "s,\b$m\b,RTC_$m,g"
done
git checkout rtc_base/logging.h
git cl format
Bug: webrtc:8452
Change-Id: I1a53ef3e0a5ef6e244e62b2e012b864914784600
Reviewed-on: https://webrtc-review.googlesource.com/21325
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20617}
diff --git a/modules/audio_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);
}
// ----------------------------------------------------------------------------