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

@ -95,12 +95,12 @@ class WindowsAudioDeviceModule : public AudioDeviceModuleForTest {
task_queue_factory_(task_queue_factory) {
RTC_CHECK(input_);
RTC_CHECK(output_);
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK_RUN_ON(&thread_checker_);
}
~WindowsAudioDeviceModule() override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK_RUN_ON(&thread_checker_);
Terminate();
}
@ -110,7 +110,7 @@ class WindowsAudioDeviceModule : public AudioDeviceModuleForTest {
int32_t ActiveAudioLayer(
AudioDeviceModule::AudioLayer* audioLayer) const override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK_RUN_ON(&thread_checker_);
// TODO(henrika): it might be possible to remove this unique signature.
*audioLayer = AudioDeviceModule::kWindowsCoreAudio2;
@ -118,14 +118,14 @@ class WindowsAudioDeviceModule : public AudioDeviceModuleForTest {
}
int32_t RegisterAudioCallback(AudioTransport* audioCallback) override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK(audio_device_buffer_);
RTC_DCHECK_RUN_ON(&thread_checker_);
return audio_device_buffer_->RegisterAudioCallback(audioCallback);
}
int32_t Init() override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK_RUN_ON(&thread_checker_);
RETURN_IF_OUTPUT_RESTARTS(0);
RETURN_IF_INPUT_RESTARTS(0);
@ -153,7 +153,7 @@ class WindowsAudioDeviceModule : public AudioDeviceModuleForTest {
}
int32_t Terminate() override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK_RUN_ON(&thread_checker_);
RETURN_IF_OUTPUT_RESTARTS(0);
RETURN_IF_INPUT_RESTARTS(0);
@ -172,14 +172,14 @@ class WindowsAudioDeviceModule : public AudioDeviceModuleForTest {
}
int16_t PlayoutDevices() override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK_RUN_ON(&thread_checker_);
RETURN_IF_OUTPUT_RESTARTS(0);
return output_->NumDevices();
}
int16_t RecordingDevices() override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK_RUN_ON(&thread_checker_);
RETURN_IF_INPUT_RESTARTS(0);
return input_->NumDevices();
@ -188,7 +188,7 @@ class WindowsAudioDeviceModule : public AudioDeviceModuleForTest {
int32_t PlayoutDeviceName(uint16_t index,
char name[kAdmMaxDeviceNameSize],
char guid[kAdmMaxGuidSize]) override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK_RUN_ON(&thread_checker_);
RETURN_IF_OUTPUT_RESTARTS(0);
std::string name_str, guid_str;
@ -205,7 +205,7 @@ class WindowsAudioDeviceModule : public AudioDeviceModuleForTest {
int32_t RecordingDeviceName(uint16_t index,
char name[kAdmMaxDeviceNameSize],
char guid[kAdmMaxGuidSize]) override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK_RUN_ON(&thread_checker_);
RETURN_IF_INPUT_RESTARTS(0);
std::string name_str, guid_str;
@ -221,7 +221,7 @@ class WindowsAudioDeviceModule : public AudioDeviceModuleForTest {
}
int32_t SetPlayoutDevice(uint16_t index) override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK_RUN_ON(&thread_checker_);
RETURN_IF_OUTPUT_RESTARTS(0);
return output_->SetDevice(index);
@ -229,33 +229,33 @@ class WindowsAudioDeviceModule : public AudioDeviceModuleForTest {
int32_t SetPlayoutDevice(
AudioDeviceModule::WindowsDeviceType device) override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK_RUN_ON(&thread_checker_);
RETURN_IF_OUTPUT_RESTARTS(0);
return output_->SetDevice(device);
}
int32_t SetRecordingDevice(uint16_t index) override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK_RUN_ON(&thread_checker_);
return input_->SetDevice(index);
}
int32_t SetRecordingDevice(
AudioDeviceModule::WindowsDeviceType device) override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK_RUN_ON(&thread_checker_);
return input_->SetDevice(device);
}
int32_t PlayoutIsAvailable(bool* available) override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK_RUN_ON(&thread_checker_);
*available = true;
return 0;
}
int32_t InitPlayout() override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK_RUN_ON(&thread_checker_);
RETURN_IF_OUTPUT_RESTARTS(0);
RETURN_IF_OUTPUT_IS_INITIALIZED(0);
@ -263,21 +263,21 @@ class WindowsAudioDeviceModule : public AudioDeviceModuleForTest {
}
bool PlayoutIsInitialized() const override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK_RUN_ON(&thread_checker_);
RETURN_IF_OUTPUT_RESTARTS(true);
return output_->PlayoutIsInitialized();
}
int32_t RecordingIsAvailable(bool* available) override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK_RUN_ON(&thread_checker_);
*available = true;
return 0;
}
int32_t InitRecording() override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK_RUN_ON(&thread_checker_);
RETURN_IF_INPUT_RESTARTS(0);
RETURN_IF_INPUT_IS_INITIALIZED(0);
@ -285,14 +285,14 @@ class WindowsAudioDeviceModule : public AudioDeviceModuleForTest {
}
bool RecordingIsInitialized() const override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK_RUN_ON(&thread_checker_);
RETURN_IF_INPUT_RESTARTS(true);
return input_->RecordingIsInitialized();
}
int32_t StartPlayout() override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK_RUN_ON(&thread_checker_);
RETURN_IF_OUTPUT_RESTARTS(0);
RETURN_IF_OUTPUT_IS_ACTIVE(0);
@ -300,21 +300,21 @@ class WindowsAudioDeviceModule : public AudioDeviceModuleForTest {
}
int32_t StopPlayout() override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK_RUN_ON(&thread_checker_);
RETURN_IF_OUTPUT_RESTARTS(-1);
return output_->StopPlayout();
}
bool Playing() const override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK_RUN_ON(&thread_checker_);
RETURN_IF_OUTPUT_RESTARTS(true);
return output_->Playing();
}
int32_t StartRecording() override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK_RUN_ON(&thread_checker_);
RETURN_IF_INPUT_RESTARTS(0);
RETURN_IF_INPUT_IS_ACTIVE(0);
@ -322,41 +322,41 @@ class WindowsAudioDeviceModule : public AudioDeviceModuleForTest {
}
int32_t StopRecording() override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK_RUN_ON(&thread_checker_);
RETURN_IF_INPUT_RESTARTS(-1);
return input_->StopRecording();
}
bool Recording() const override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RETURN_IF_INPUT_RESTARTS(true);
return input_->Recording();
}
int32_t InitSpeaker() override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK_RUN_ON(&thread_checker_);
RTC_DLOG(LS_WARNING) << "This method has no effect";
return initialized_ ? 0 : -1;
}
bool SpeakerIsInitialized() const override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK_RUN_ON(&thread_checker_);
RTC_DLOG(LS_WARNING) << "This method has no effect";
return initialized_;
}
int32_t InitMicrophone() override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK_RUN_ON(&thread_checker_);
RTC_DLOG(LS_WARNING) << "This method has no effect";
return initialized_ ? 0 : -1;
}
bool MicrophoneIsInitialized() const override {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK_RUN_ON(&thread_checker_);
RTC_DLOG(LS_WARNING) << "This method has no effect";
return initialized_;
@ -364,7 +364,7 @@ class WindowsAudioDeviceModule : public AudioDeviceModuleForTest {
int32_t SpeakerVolumeIsAvailable(bool* available) override {
// TODO(henrika): improve support.
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK_RUN_ON(&thread_checker_);
*available = false;
return 0;
@ -377,7 +377,7 @@ class WindowsAudioDeviceModule : public AudioDeviceModuleForTest {
int32_t MicrophoneVolumeIsAvailable(bool* available) override {
// TODO(henrika): improve support.
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK_RUN_ON(&thread_checker_);
*available = false;
return 0;
@ -398,7 +398,7 @@ class WindowsAudioDeviceModule : public AudioDeviceModuleForTest {
int32_t StereoPlayoutIsAvailable(bool* available) const override {
// TODO(henrika): improve support.
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK_RUN_ON(&thread_checker_);
*available = true;
return 0;
@ -406,14 +406,14 @@ class WindowsAudioDeviceModule : public AudioDeviceModuleForTest {
int32_t SetStereoPlayout(bool enable) override {
// TODO(henrika): improve support.
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK_RUN_ON(&thread_checker_);
return 0;
}
int32_t StereoPlayout(bool* enabled) const override {
// TODO(henrika): improve support.
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK_RUN_ON(&thread_checker_);
*enabled = true;
return 0;
@ -421,7 +421,7 @@ class WindowsAudioDeviceModule : public AudioDeviceModuleForTest {
int32_t StereoRecordingIsAvailable(bool* available) const override {
// TODO(henrika): improve support.
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK_RUN_ON(&thread_checker_);
*available = true;
return 0;
@ -429,14 +429,14 @@ class WindowsAudioDeviceModule : public AudioDeviceModuleForTest {
int32_t SetStereoRecording(bool enable) override {
// TODO(henrika): improve support.
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK_RUN_ON(&thread_checker_);
return 0;
}
int32_t StereoRecording(bool* enabled) const override {
// TODO(henrika): improve support.
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK_RUN_ON(&thread_checker_);
*enabled = true;
return 0;
@ -513,7 +513,7 @@ CreateWindowsCoreAudioAudioDeviceModuleFromInputAndOutput(
std::unique_ptr<AudioInput> audio_input,
std::unique_ptr<AudioOutput> audio_output,
TaskQueueFactory* task_queue_factory) {
RTC_LOG(INFO) << __FUNCTION__;
RTC_DLOG(INFO) << __FUNCTION__;
return new rtc::RefCountedObject<WindowsAudioDeviceModule>(
std::move(audio_input), std::move(audio_output), task_queue_factory);
}