Move some RTC_LOG to RTC_DLOG.

Some locations in the WebRTC codebase RTC_LOG the value of the
__FUNCTION__ macro which probably is useful in debug mode. Moving
these instances to RTC_DLOG saves ~10 KiB on arm64.

Bug: webrtc:11986
Change-Id: I5d81cc459d2850657a712b9aed80c187edf49a3a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/203981
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33086}
This commit is contained in:
Mirko Bonadei
2021-01-28 09:21:06 +01:00
committed by Commit Bot
parent 70f9e249d5
commit 3b68aa346a
18 changed files with 313 additions and 317 deletions

View File

@ -39,7 +39,7 @@ class AudioDeviceTemplate : public AudioDeviceGeneric {
output_(audio_manager_),
input_(audio_manager_),
initialized_(false) {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_CHECK(audio_manager);
audio_manager_->SetActiveAudioLayer(audio_layer);
}
@ -48,13 +48,13 @@ class AudioDeviceTemplate : public AudioDeviceGeneric {
int32_t ActiveAudioLayer(
AudioDeviceModule::AudioLayer& audioLayer) const override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
audioLayer = audio_layer_;
return 0;
}
InitStatus Init() override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK(thread_checker_.IsCurrent());
RTC_DCHECK(!initialized_);
if (!audio_manager_->Init()) {
@ -74,7 +74,7 @@ class AudioDeviceTemplate : public AudioDeviceGeneric {
}
int32_t Terminate() override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK(thread_checker_.IsCurrent());
int32_t err = input_.Terminate();
err |= output_.Terminate();
@ -85,18 +85,18 @@ class AudioDeviceTemplate : public AudioDeviceGeneric {
}
bool Initialized() const override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK(thread_checker_.IsCurrent());
return initialized_;
}
int16_t PlayoutDevices() override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
return 1;
}
int16_t RecordingDevices() override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
return 1;
}
@ -115,7 +115,7 @@ class AudioDeviceTemplate : public AudioDeviceGeneric {
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.
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
return 0;
}
@ -127,7 +127,7 @@ class AudioDeviceTemplate : public AudioDeviceGeneric {
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.
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
return 0;
}
@ -137,39 +137,39 @@ class AudioDeviceTemplate : public AudioDeviceGeneric {
}
int32_t PlayoutIsAvailable(bool& available) override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
available = true;
return 0;
}
int32_t InitPlayout() override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
return output_.InitPlayout();
}
bool PlayoutIsInitialized() const override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
return output_.PlayoutIsInitialized();
}
int32_t RecordingIsAvailable(bool& available) override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
available = true;
return 0;
}
int32_t InitRecording() override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
return input_.InitRecording();
}
bool RecordingIsInitialized() const override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
return input_.RecordingIsInitialized();
}
int32_t StartPlayout() override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
if (!audio_manager_->IsCommunicationModeEnabled()) {
RTC_LOG(WARNING)
<< "The application should use MODE_IN_COMMUNICATION audio mode!";
@ -181,7 +181,7 @@ class AudioDeviceTemplate : public AudioDeviceGeneric {
// Avoid using audio manger (JNI/Java cost) if playout was inactive.
if (!Playing())
return 0;
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
int32_t err = output_.StopPlayout();
return err;
}
@ -192,7 +192,7 @@ class AudioDeviceTemplate : public AudioDeviceGeneric {
}
int32_t StartRecording() override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
if (!audio_manager_->IsCommunicationModeEnabled()) {
RTC_LOG(WARNING)
<< "The application should use MODE_IN_COMMUNICATION audio mode!";
@ -202,7 +202,7 @@ class AudioDeviceTemplate : public AudioDeviceGeneric {
int32_t StopRecording() override {
// Avoid using audio manger (JNI/Java cost) if recording was inactive.
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
if (!Recording())
return 0;
int32_t err = input_.StopRecording();
@ -212,47 +212,47 @@ class AudioDeviceTemplate : public AudioDeviceGeneric {
bool Recording() const override { return input_.Recording(); }
int32_t InitSpeaker() override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
return 0;
}
bool SpeakerIsInitialized() const override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
return true;
}
int32_t InitMicrophone() override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
return 0;
}
bool MicrophoneIsInitialized() const override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
return true;
}
int32_t SpeakerVolumeIsAvailable(bool& available) override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
return output_.SpeakerVolumeIsAvailable(available);
}
int32_t SetSpeakerVolume(uint32_t volume) override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
return output_.SetSpeakerVolume(volume);
}
int32_t SpeakerVolume(uint32_t& volume) const override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
return output_.SpeakerVolume(volume);
}
int32_t MaxSpeakerVolume(uint32_t& maxVolume) const override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
return output_.MaxSpeakerVolume(maxVolume);
}
int32_t MinSpeakerVolume(uint32_t& minVolume) const override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
return output_.MinSpeakerVolume(minVolume);
}
@ -299,13 +299,13 @@ class AudioDeviceTemplate : public AudioDeviceGeneric {
// Returns true if the audio manager has been configured to support stereo
// and false otherwised. Default is mono.
int32_t StereoPlayoutIsAvailable(bool& available) override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
available = audio_manager_->IsStereoPlayoutSupported();
return 0;
}
int32_t SetStereoPlayout(bool enable) override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(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
@ -320,13 +320,13 @@ class AudioDeviceTemplate : public AudioDeviceGeneric {
}
int32_t StereoRecordingIsAvailable(bool& available) override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
available = audio_manager_->IsStereoRecordSupported();
return 0;
}
int32_t SetStereoRecording(bool enable) override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(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
@ -336,7 +336,7 @@ class AudioDeviceTemplate : public AudioDeviceGeneric {
}
int32_t StereoRecording(bool& enabled) const override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
enabled = audio_manager_->IsStereoRecordSupported();
return 0;
}
@ -349,7 +349,7 @@ class AudioDeviceTemplate : public AudioDeviceGeneric {
}
void AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
output_.AttachAudioBuffer(audioBuffer);
input_.AttachAudioBuffer(audioBuffer);
}
@ -367,13 +367,13 @@ class AudioDeviceTemplate : public AudioDeviceGeneric {
// 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 {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
return audio_manager_->IsAcousticEchoCancelerSupported();
}
// TODO(henrika): add implementation for OpenSL ES based audio as well.
int32_t EnableBuiltInAEC(bool enable) override {
RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
RTC_DLOG(INFO) << __FUNCTION__ << "(" << enable << ")";
RTC_CHECK(BuiltInAECIsAvailable()) << "HW AEC is not available";
return input_.EnableBuiltInAEC(enable);
}
@ -383,13 +383,13 @@ class AudioDeviceTemplate : public AudioDeviceGeneric {
// TODO(henrika): add implementation for OpenSL ES based audio as well.
// In addition, see comments for BuiltInAECIsAvailable().
bool BuiltInAGCIsAvailable() const override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
return audio_manager_->IsAutomaticGainControlSupported();
}
// TODO(henrika): add implementation for OpenSL ES based audio as well.
int32_t EnableBuiltInAGC(bool enable) override {
RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
RTC_DLOG(INFO) << __FUNCTION__ << "(" << enable << ")";
RTC_CHECK(BuiltInAGCIsAvailable()) << "HW AGC is not available";
return input_.EnableBuiltInAGC(enable);
}
@ -399,13 +399,13 @@ class AudioDeviceTemplate : public AudioDeviceGeneric {
// TODO(henrika): add implementation for OpenSL ES based audio as well.
// In addition, see comments for BuiltInAECIsAvailable().
bool BuiltInNSIsAvailable() const override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
return audio_manager_->IsNoiseSuppressorSupported();
}
// TODO(henrika): add implementation for OpenSL ES based audio as well.
int32_t EnableBuiltInNS(bool enable) override {
RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
RTC_DLOG(INFO) << __FUNCTION__ << "(" << enable << ")";
RTC_CHECK(BuiltInNSIsAvailable()) << "HW NS is not available";
return input_.EnableBuiltInNS(enable);
}