diff --git a/webrtc/modules/audio_device/android/audio_device_template.h b/webrtc/modules/audio_device/android/audio_device_template.h index 719b4bdd36..fa7b15e0f7 100644 --- a/webrtc/modules/audio_device/android/audio_device_template.h +++ b/webrtc/modules/audio_device/android/audio_device_template.h @@ -11,16 +11,11 @@ #ifndef WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_AUDIO_DEVICE_TEMPLATE_H_ #define WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_AUDIO_DEVICE_TEMPLATE_H_ -#include - #include "webrtc/base/checks.h" +#include "webrtc/base/logging.h" #include "webrtc/base/thread_checker.h" #include "webrtc/modules/audio_device/android/audio_manager.h" #include "webrtc/modules/audio_device/audio_device_generic.h" -#include "webrtc/system_wrappers/include/trace.h" - -#define TAG "AudioDeviceTemplate" -#define ALOGW(...) __android_log_print(ANDROID_LOG_WARN, TAG, __VA_ARGS__) namespace webrtc { @@ -44,20 +39,22 @@ class AudioDeviceTemplate : public AudioDeviceGeneric { output_(audio_manager_), input_(audio_manager_), initialized_(false) { + LOG(INFO) << __FUNCTION__; RTC_CHECK(audio_manager); audio_manager_->SetActiveAudioLayer(audio_layer); } - virtual ~AudioDeviceTemplate() { - } + virtual ~AudioDeviceTemplate() { LOG(INFO) << __FUNCTION__; } int32_t ActiveAudioLayer( AudioDeviceModule::AudioLayer& audioLayer) const override { + LOG(INFO) << __FUNCTION__; audioLayer = audio_layer_; return 0; } int32_t Init() override { + LOG(INFO) << __FUNCTION__; RTC_DCHECK(thread_checker_.CalledOnValidThread()); RTC_DCHECK(!initialized_); if (!audio_manager_->Init()) @@ -76,6 +73,7 @@ class AudioDeviceTemplate : public AudioDeviceGeneric { } int32_t Terminate() override { + LOG(INFO) << __FUNCTION__; RTC_DCHECK(thread_checker_.CalledOnValidThread()); int32_t err = input_.Terminate(); err |= output_.Terminate(); @@ -86,15 +84,18 @@ class AudioDeviceTemplate : public AudioDeviceGeneric { } bool Initialized() const override { + LOG(INFO) << __FUNCTION__; RTC_DCHECK(thread_checker_.CalledOnValidThread()); return initialized_; } int16_t PlayoutDevices() override { + LOG(INFO) << __FUNCTION__; return 1; } int16_t RecordingDevices() override { + LOG(INFO) << __FUNCTION__; return 1; } @@ -117,6 +118,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. + LOG(INFO) << __FUNCTION__; return 0; } @@ -129,6 +131,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. + LOG(INFO) << __FUNCTION__; return 0; } @@ -139,34 +142,42 @@ class AudioDeviceTemplate : public AudioDeviceGeneric { } int32_t PlayoutIsAvailable(bool& available) override { + LOG(INFO) << __FUNCTION__; available = true; return 0; } int32_t InitPlayout() override { + LOG(INFO) << __FUNCTION__; return output_.InitPlayout(); } bool PlayoutIsInitialized() const override { + LOG(INFO) << __FUNCTION__; return output_.PlayoutIsInitialized(); } int32_t RecordingIsAvailable(bool& available) override { + LOG(INFO) << __FUNCTION__; available = true; return 0; } int32_t InitRecording() override { + LOG(INFO) << __FUNCTION__; return input_.InitRecording(); } bool RecordingIsInitialized() const override { + LOG(INFO) << __FUNCTION__; return input_.RecordingIsInitialized(); } int32_t StartPlayout() override { + LOG(INFO) << __FUNCTION__; if (!audio_manager_->IsCommunicationModeEnabled()) { - ALOGW("The application should use MODE_IN_COMMUNICATION audio mode!"); + LOG(WARNING) + << "The application should use MODE_IN_COMMUNICATION audio mode!"; } return output_.StartPlayout(); } @@ -175,23 +186,28 @@ class AudioDeviceTemplate : public AudioDeviceGeneric { // Avoid using audio manger (JNI/Java cost) if playout was inactive. if (!Playing()) return 0; + LOG(INFO) << __FUNCTION__; int32_t err = output_.StopPlayout(); return err; } bool Playing() const override { + LOG(INFO) << __FUNCTION__; return output_.Playing(); } int32_t StartRecording() override { + LOG(INFO) << __FUNCTION__; if (!audio_manager_->IsCommunicationModeEnabled()) { - ALOGW("The application should use MODE_IN_COMMUNICATION audio mode!"); + LOG(WARNING) + << "The application should use MODE_IN_COMMUNICATION audio mode!"; } return input_.StartRecording(); } int32_t StopRecording() override { // Avoid using audio manger (JNI/Java cost) if recording was inactive. + LOG(INFO) << __FUNCTION__; if (!Recording()) return 0; int32_t err = input_.StopRecording(); @@ -199,6 +215,7 @@ class AudioDeviceTemplate : public AudioDeviceGeneric { } bool Recording() const override { + LOG(LS_VERBOSE) << __FUNCTION__; return input_.Recording() ; } @@ -210,6 +227,7 @@ class AudioDeviceTemplate : public AudioDeviceGeneric { } bool AGC() const override { + LOG(INFO) << __FUNCTION__; return false; } @@ -226,38 +244,47 @@ class AudioDeviceTemplate : public AudioDeviceGeneric { } int32_t InitSpeaker() override { + LOG(INFO) << __FUNCTION__; return 0; } bool SpeakerIsInitialized() const override { + LOG(INFO) << __FUNCTION__; return true; } int32_t InitMicrophone() override { + LOG(INFO) << __FUNCTION__; return 0; } bool MicrophoneIsInitialized() const override { + LOG(INFO) << __FUNCTION__; return true; } int32_t SpeakerVolumeIsAvailable(bool& available) override { + LOG(INFO) << __FUNCTION__; return output_.SpeakerVolumeIsAvailable(available); } int32_t SetSpeakerVolume(uint32_t volume) override { + LOG(INFO) << __FUNCTION__; return output_.SetSpeakerVolume(volume); } int32_t SpeakerVolume(uint32_t& volume) const override { + LOG(INFO) << __FUNCTION__; return output_.SpeakerVolume(volume); } int32_t MaxSpeakerVolume(uint32_t& maxVolume) const override { + LOG(INFO) << __FUNCTION__; return output_.MaxSpeakerVolume(maxVolume); } int32_t MinSpeakerVolume(uint32_t& minVolume) const override { + LOG(INFO) << __FUNCTION__; return output_.MinSpeakerVolume(minVolume); } @@ -343,12 +370,14 @@ class AudioDeviceTemplate : public AudioDeviceGeneric { } int32_t StereoPlayoutIsAvailable(bool& available) override { + LOG(INFO) << __FUNCTION__; available = false; return 0; } // TODO(henrika): add support. int32_t SetStereoPlayout(bool enable) override { + LOG(INFO) << __FUNCTION__; return -1; } @@ -360,15 +389,18 @@ class AudioDeviceTemplate : public AudioDeviceGeneric { } int32_t StereoRecordingIsAvailable(bool& available) override { + LOG(INFO) << __FUNCTION__; available = false; return 0; } int32_t SetStereoRecording(bool enable) override { + LOG(INFO) << __FUNCTION__; return -1; } int32_t StereoRecording(bool& enabled) const override { + LOG(INFO) << __FUNCTION__; enabled = false; return 0; } @@ -388,12 +420,14 @@ class AudioDeviceTemplate : public AudioDeviceGeneric { int32_t PlayoutDelay(uint16_t& delay_ms) const override { // Best guess we can do is to use half of the estimated total delay. delay_ms = audio_manager_->GetDelayEstimateInMilliseconds() / 2; + LOG(LS_VERBOSE) << __FUNCTION__ << " delay = " << delay_ms; RTC_DCHECK_GT(delay_ms, 0); return 0; } int32_t RecordingDelay(uint16_t& delay_ms) const override { // Best guess we can do is to use half of the estimated total delay. + LOG(INFO) << __FUNCTION__; delay_ms = audio_manager_->GetDelayEstimateInMilliseconds() / 2; RTC_DCHECK_GT(delay_ms, 0); return 0; @@ -405,30 +439,35 @@ class AudioDeviceTemplate : public AudioDeviceGeneric { } bool PlayoutWarning() const override { + LOG(LS_VERBOSE) << __FUNCTION__; return false; } bool PlayoutError() const override { + LOG(LS_VERBOSE) << __FUNCTION__; return false; } bool RecordingWarning() const override { + LOG(LS_VERBOSE) << __FUNCTION__; return false; } bool RecordingError() const override { + LOG(LS_VERBOSE) << __FUNCTION__; return false; } - void ClearPlayoutWarning() override {} + void ClearPlayoutWarning() override { LOG(INFO) << __FUNCTION__; } - void ClearPlayoutError() override {} + void ClearPlayoutError() override { LOG(INFO) << __FUNCTION__; } - void ClearRecordingWarning() override {} + void ClearRecordingWarning() override { LOG(INFO) << __FUNCTION__; } - void ClearRecordingError() override {} + void ClearRecordingError() override { LOG(INFO) << __FUNCTION__; } void AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) override { + LOG(INFO) << __FUNCTION__; output_.AttachAudioBuffer(audioBuffer); input_.AttachAudioBuffer(audioBuffer); } @@ -452,10 +491,16 @@ class AudioDeviceTemplate : public AudioDeviceGeneric { // Returns true if the device both supports built in AEC and the device // is not blacklisted. bool BuiltInAECIsAvailable() const override { + LOG(INFO) << __FUNCTION__; return audio_manager_->IsAcousticEchoCancelerSupported(); } int32_t EnableBuiltInAEC(bool enable) override { + if (enable) { + LOG(INFO) << __FUNCTION__ << ": enabling built in AEC"; + } else { + LOG(INFO) << __FUNCTION__ << ": disabling built in AEC"; + } RTC_CHECK(BuiltInAECIsAvailable()) << "HW AEC is not available"; return input_.EnableBuiltInAEC(enable); } @@ -463,10 +508,16 @@ class AudioDeviceTemplate : public AudioDeviceGeneric { // Returns true if the device both supports built in AGC and the device // is not blacklisted. bool BuiltInAGCIsAvailable() const override { + LOG(INFO) << __FUNCTION__; return audio_manager_->IsAutomaticGainControlSupported(); } int32_t EnableBuiltInAGC(bool enable) override { + if (enable) { + LOG(INFO) << __FUNCTION__ << ": enabling built in AGC"; + } else { + LOG(INFO) << __FUNCTION__ << ": disabling built in AGC"; + } RTC_CHECK(BuiltInAGCIsAvailable()) << "HW AGC is not available"; return input_.EnableBuiltInAGC(enable); } @@ -474,10 +525,16 @@ class AudioDeviceTemplate : public AudioDeviceGeneric { // Returns true if the device both supports built in NS and the device // is not blacklisted. bool BuiltInNSIsAvailable() const override { + LOG(INFO) << __FUNCTION__; return audio_manager_->IsNoiseSuppressorSupported(); } int32_t EnableBuiltInNS(bool enable) override { + if (enable) { + LOG(INFO) << __FUNCTION__ << ": enabling built in NS"; + } else { + LOG(INFO) << __FUNCTION__ << ": disabling built in NS"; + } RTC_CHECK(BuiltInNSIsAvailable()) << "HW NS is not available"; return input_.EnableBuiltInNS(enable); } diff --git a/webrtc/modules/audio_device/audio_device_impl.cc b/webrtc/modules/audio_device/audio_device_impl.cc index 37ed5b2113..b2a33ef72f 100644 --- a/webrtc/modules/audio_device/audio_device_impl.cc +++ b/webrtc/modules/audio_device/audio_device_impl.cc @@ -8,9 +8,9 @@ * be found in the AUTHORS file in the root of the source tree. */ +#include "webrtc/base/logging.h" #include "webrtc/base/refcount.h" #include "webrtc/base/timeutils.h" -#include "webrtc/base/trace_event.h" #include "webrtc/common_audio/signal_processing/include/signal_processing_library.h" #include "webrtc/modules/audio_device/audio_device_config.h" #include "webrtc/modules/audio_device/audio_device_impl.h" @@ -50,7 +50,6 @@ #include "webrtc/modules/audio_device/dummy/audio_device_dummy.h" #include "webrtc/modules/audio_device/dummy/file_audio_device.h" #include "webrtc/system_wrappers/include/critical_section_wrapper.h" -#include "webrtc/system_wrappers/include/trace.h" #define CHECK_INITIALIZED() \ { \ @@ -79,6 +78,7 @@ namespace webrtc { rtc::scoped_refptr AudioDeviceModule::Create( const int32_t id, const AudioLayer audio_layer) { + LOG(INFO) << __FUNCTION__; // Create the generic ref counted (platform independent) implementation. rtc::scoped_refptr audioDevice( new rtc::RefCountedObject(id, audio_layer)); @@ -125,7 +125,7 @@ AudioDeviceModuleImpl::AudioDeviceModuleImpl(const int32_t id, _platformType(kPlatformNotSupported), _initialized(false), _lastError(kAdmErrNone) { - WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, id, "%s created", __FUNCTION__); + LOG(INFO) << __FUNCTION__; } // ---------------------------------------------------------------------------- @@ -133,7 +133,7 @@ AudioDeviceModuleImpl::AudioDeviceModuleImpl(const int32_t id, // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::CheckPlatform() { - WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s", __FUNCTION__); + LOG(INFO) << __FUNCTION__; // Ensure that the current platform is supported // @@ -141,26 +141,24 @@ int32_t AudioDeviceModuleImpl::CheckPlatform() { #if defined(_WIN32) platform = kPlatformWin32; - WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "current platform is WIN32"); + LOG(INFO) << "current platform is Win32"; #elif defined(WEBRTC_ANDROID) platform = kPlatformAndroid; - WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, - "current platform is ANDROID"); + LOG(INFO) << "current platform is Android"; #elif defined(WEBRTC_LINUX) platform = kPlatformLinux; - WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "current platform is LINUX"); + LOG(INFO) << "current platform is Linux"; #elif defined(WEBRTC_IOS) platform = kPlatformIOS; - WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "current platform is IOS"); + LOG(INFO) << "current platform is IOS"; #elif defined(WEBRTC_MAC) platform = kPlatformMac; - WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "current platform is MAC"); + LOG(INFO) << "current platform is Mac"; #endif if (platform == kPlatformNotSupported) { - WEBRTC_TRACE( - kTraceCritical, kTraceAudioDevice, _id, - "current platform is not supported => this module will self destruct!"); + LOG(LERROR) << "current platform is not supported => this module will self " + "destruct!"; return -1; } @@ -176,18 +174,16 @@ int32_t AudioDeviceModuleImpl::CheckPlatform() { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::CreatePlatformSpecificObjects() { - WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s", __FUNCTION__); + LOG(INFO) << __FUNCTION__; AudioDeviceGeneric* ptrAudioDevice(NULL); #if defined(WEBRTC_DUMMY_AUDIO_BUILD) ptrAudioDevice = new AudioDeviceDummy(Id()); - WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, - "Dummy Audio APIs will be utilized"); + LOG(INFO) << "Dummy Audio APIs will be utilized"; #elif defined(WEBRTC_DUMMY_FILE_DEVICES) ptrAudioDevice = FileAudioDeviceFactory::CreateFileAudioDevice(Id()); - WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, - "Will use file-playing dummy device."); + LOG(INFO) << "Will use file-playing dummy device."; #else AudioLayer audioLayer(PlatformAudioLayer()); @@ -202,20 +198,17 @@ int32_t AudioDeviceModuleImpl::CreatePlatformSpecificObjects() { ) { // create *Windows Wave Audio* implementation ptrAudioDevice = new AudioDeviceWindowsWave(Id()); - WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, - "Windows Wave APIs will be utilized"); + LOG(INFO) << "Windows Wave APIs will be utilized"; } #if defined(WEBRTC_WINDOWS_CORE_AUDIO_BUILD) if ((audioLayer == kWindowsCoreAudio) || (audioLayer == kPlatformDefaultAudio)) { - WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, - "attempting to use the Windows Core Audio APIs..."); + LOG(INFO) << "attempting to use the Windows Core Audio APIs..."; if (AudioDeviceWindowsCore::CoreAudioIsSupported()) { // create *Windows Core Audio* implementation ptrAudioDevice = new AudioDeviceWindowsCore(Id()); - WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, - "Windows Core Audio APIs will be utilized"); + LOG(INFO) << "Windows Core Audio APIs will be utilized"; } else { // create *Windows Wave Audio* implementation ptrAudioDevice = new AudioDeviceWindowsWave(Id()); @@ -223,9 +216,8 @@ int32_t AudioDeviceModuleImpl::CreatePlatformSpecificObjects() { // Core Audio was not supported => revert to Windows Wave instead _platformAudioLayer = kWindowsWaveAudio; // modify the state set at construction - WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, - "Windows Core Audio is *not* supported => Wave APIs will " - "be utilized instead"); + LOG(WARNING) << "Windows Core Audio is *not* supported => Wave APIs " + "will be utilized instead"; } } } @@ -270,15 +262,13 @@ int32_t AudioDeviceModuleImpl::CreatePlatformSpecificObjects() { if ((audioLayer == kLinuxPulseAudio) || (audioLayer == kPlatformDefaultAudio)) { #if defined(LINUX_PULSE) - WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, - "attempting to use the Linux PulseAudio APIs..."); + LOG(INFO) << "attempting to use the Linux PulseAudio APIs..."; // create *Linux PulseAudio* implementation AudioDeviceLinuxPulse* pulseDevice = new AudioDeviceLinuxPulse(Id()); if (pulseDevice->Init() != -1) { ptrAudioDevice = pulseDevice; - WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, - "Linux PulseAudio APIs will be utilized"); + LOG(INFO) << "Linux PulseAudio APIs will be utilized"; } else { delete pulseDevice; #endif @@ -289,9 +279,8 @@ int32_t AudioDeviceModuleImpl::CreatePlatformSpecificObjects() { // Pulse Audio was not supported => revert to ALSA instead _platformAudioLayer = kLinuxAlsaAudio; // modify the state set at construction - WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, - "Linux PulseAudio is *not* supported => ALSA APIs will be " - "utilized instead"); + LOG(WARNING) << "Linux PulseAudio is *not* supported => ALSA APIs will " + "be utilized instead"; } #endif #if defined(LINUX_PULSE) @@ -301,8 +290,7 @@ int32_t AudioDeviceModuleImpl::CreatePlatformSpecificObjects() { #if defined(LINUX_ALSA) // create *Linux ALSA Audio* implementation ptrAudioDevice = new AudioDeviceLinuxALSA(Id()); - WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, - "Linux ALSA APIs will be utilized"); + LOG(INFO) << "Linux ALSA APIs will be utilized"; #endif } #endif // #if defined(WEBRTC_LINUX) @@ -313,8 +301,7 @@ int32_t AudioDeviceModuleImpl::CreatePlatformSpecificObjects() { if (audioLayer == kPlatformDefaultAudio) { // Create iOS Audio Device implementation. ptrAudioDevice = new AudioDeviceIOS(); - WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, - "iPhone Audio APIs will be utilized"); + LOG(INFO) << "iPhone Audio APIs will be utilized"; } // END #if defined(WEBRTC_IOS) @@ -324,8 +311,7 @@ int32_t AudioDeviceModuleImpl::CreatePlatformSpecificObjects() { if (audioLayer == kPlatformDefaultAudio) { // Create *Mac Audio* implementation ptrAudioDevice = new AudioDeviceMac(Id()); - WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, - "Mac OS X Audio APIs will be utilized"); + LOG(INFO) << "Mac OS X Audio APIs will be utilized"; } #endif // WEBRTC_MAC @@ -336,15 +322,13 @@ int32_t AudioDeviceModuleImpl::CreatePlatformSpecificObjects() { // Create *Dummy Audio* implementation assert(!ptrAudioDevice); ptrAudioDevice = new AudioDeviceDummy(Id()); - WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, - "Dummy Audio APIs will be utilized"); + LOG(INFO) << "Dummy Audio APIs will be utilized"; } #endif // if defined(WEBRTC_DUMMY_AUDIO_BUILD) if (ptrAudioDevice == NULL) { - WEBRTC_TRACE( - kTraceCritical, kTraceAudioDevice, _id, - "unable to create the platform specific audio device implementation"); + LOG(LERROR) + << "unable to create the platform specific audio device implementation"; return -1; } @@ -364,7 +348,7 @@ int32_t AudioDeviceModuleImpl::CreatePlatformSpecificObjects() { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::AttachAudioBuffer() { - WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "%s", __FUNCTION__); + LOG(INFO) << __FUNCTION__; _audioDeviceBuffer.SetId(_id); _ptrAudioDevice->AttachAudioBuffer(&_audioDeviceBuffer); @@ -376,8 +360,7 @@ int32_t AudioDeviceModuleImpl::AttachAudioBuffer() { // ---------------------------------------------------------------------------- AudioDeviceModuleImpl::~AudioDeviceModuleImpl() { - WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, _id, "%s destroyed", - __FUNCTION__); + LOG(INFO) << __FUNCTION__; if (_ptrAudioDevice) { delete _ptrAudioDevice; @@ -401,6 +384,7 @@ AudioDeviceModuleImpl::~AudioDeviceModuleImpl() { // ---------------------------------------------------------------------------- int64_t AudioDeviceModuleImpl::TimeUntilNextProcess() { + LOG(LS_VERBOSE) << __FUNCTION__; int64_t now = rtc::TimeMillis(); int64_t deltaProcess = kAdmMaxIdleTimeProcess - (now - _lastProcessTime); return deltaProcess; @@ -414,14 +398,14 @@ int64_t AudioDeviceModuleImpl::TimeUntilNextProcess() { // ---------------------------------------------------------------------------- void AudioDeviceModuleImpl::Process() { + LOG(LS_VERBOSE) << __FUNCTION__; _lastProcessTime = rtc::TimeMillis(); // kPlayoutWarning if (_ptrAudioDevice->PlayoutWarning()) { CriticalSectionScoped lock(&_critSectEventCb); if (_ptrCbAudioDeviceObserver) { - WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, - "=> OnWarningIsReported(kPlayoutWarning)"); + LOG(WARNING) << "=> OnWarningIsReported(kPlayoutWarning)"; _ptrCbAudioDeviceObserver->OnWarningIsReported( AudioDeviceObserver::kPlayoutWarning); } @@ -432,8 +416,7 @@ void AudioDeviceModuleImpl::Process() { if (_ptrAudioDevice->PlayoutError()) { CriticalSectionScoped lock(&_critSectEventCb); if (_ptrCbAudioDeviceObserver) { - WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, - "=> OnErrorIsReported(kPlayoutError)"); + LOG(LERROR) << "=> OnErrorIsReported(kPlayoutError)"; _ptrCbAudioDeviceObserver->OnErrorIsReported( AudioDeviceObserver::kPlayoutError); } @@ -444,8 +427,7 @@ void AudioDeviceModuleImpl::Process() { if (_ptrAudioDevice->RecordingWarning()) { CriticalSectionScoped lock(&_critSectEventCb); if (_ptrCbAudioDeviceObserver) { - WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, - "=> OnWarningIsReported(kRecordingWarning)"); + LOG(WARNING) << "=> OnWarningIsReported(kRecordingWarning)"; _ptrCbAudioDeviceObserver->OnWarningIsReported( AudioDeviceObserver::kRecordingWarning); } @@ -456,8 +438,7 @@ void AudioDeviceModuleImpl::Process() { if (_ptrAudioDevice->RecordingError()) { CriticalSectionScoped lock(&_critSectEventCb); if (_ptrCbAudioDeviceObserver) { - WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, - "=> OnErrorIsReported(kRecordingError)"); + LOG(LERROR) << "=> OnErrorIsReported(kRecordingError)"; _ptrCbAudioDeviceObserver->OnErrorIsReported( AudioDeviceObserver::kRecordingError); } @@ -474,6 +455,7 @@ void AudioDeviceModuleImpl::Process() { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::ActiveAudioLayer(AudioLayer* audioLayer) const { + LOG(INFO) << __FUNCTION__; AudioLayer activeAudio; if (_ptrAudioDevice->ActiveAudioLayer(activeAudio) == -1) { return -1; @@ -487,6 +469,7 @@ int32_t AudioDeviceModuleImpl::ActiveAudioLayer(AudioLayer* audioLayer) const { // ---------------------------------------------------------------------------- AudioDeviceModule::ErrorCode AudioDeviceModuleImpl::LastError() const { + LOG(INFO) << __FUNCTION__; return _lastError; } @@ -495,6 +478,7 @@ AudioDeviceModule::ErrorCode AudioDeviceModuleImpl::LastError() const { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::Init() { + LOG(INFO) << __FUNCTION__; if (_initialized) return 0; @@ -514,6 +498,7 @@ int32_t AudioDeviceModuleImpl::Init() { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::Terminate() { + LOG(INFO) << __FUNCTION__; if (!_initialized) return 0; @@ -530,8 +515,7 @@ int32_t AudioDeviceModuleImpl::Terminate() { // ---------------------------------------------------------------------------- bool AudioDeviceModuleImpl::Initialized() const { - WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: %d", - _initialized); + LOG(INFO) << __FUNCTION__ << ": " << _initialized; return (_initialized); } @@ -540,6 +524,7 @@ bool AudioDeviceModuleImpl::Initialized() const { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::InitSpeaker() { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); return (_ptrAudioDevice->InitSpeaker()); } @@ -549,6 +534,7 @@ int32_t AudioDeviceModuleImpl::InitSpeaker() { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::InitMicrophone() { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); return (_ptrAudioDevice->InitMicrophone()); } @@ -558,6 +544,7 @@ int32_t AudioDeviceModuleImpl::InitMicrophone() { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::SpeakerVolumeIsAvailable(bool* available) { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); bool isAvailable(0); @@ -568,8 +555,11 @@ int32_t AudioDeviceModuleImpl::SpeakerVolumeIsAvailable(bool* available) { *available = isAvailable; - WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: available=%d", - *available); + if (isAvailable) { + LOG(INFO) << __FUNCTION__ << " output: available"; + } else { + LOG(INFO) << __FUNCTION__ << " output: not available"; + } return (0); } @@ -578,6 +568,7 @@ int32_t AudioDeviceModuleImpl::SpeakerVolumeIsAvailable(bool* available) { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::SetSpeakerVolume(uint32_t volume) { + LOG(INFO) << __FUNCTION__ << "(" << volume << ")"; CHECK_INITIALIZED(); return (_ptrAudioDevice->SetSpeakerVolume(volume)); } @@ -587,6 +578,7 @@ int32_t AudioDeviceModuleImpl::SetSpeakerVolume(uint32_t volume) { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::SpeakerVolume(uint32_t* volume) const { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); uint32_t level(0); @@ -597,8 +589,7 @@ int32_t AudioDeviceModuleImpl::SpeakerVolume(uint32_t* volume) const { *volume = level; - WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: volume=%u", - *volume); + LOG(INFO) << __FUNCTION__ << " output: " << *volume; return (0); } @@ -608,6 +599,7 @@ int32_t AudioDeviceModuleImpl::SpeakerVolume(uint32_t* volume) const { int32_t AudioDeviceModuleImpl::SetWaveOutVolume(uint16_t volumeLeft, uint16_t volumeRight) { + LOG(INFO) << __FUNCTION__ << "(" << volumeLeft << ", " << volumeRight << ")"; CHECK_INITIALIZED(); return (_ptrAudioDevice->SetWaveOutVolume(volumeLeft, volumeRight)); } @@ -618,6 +610,7 @@ int32_t AudioDeviceModuleImpl::SetWaveOutVolume(uint16_t volumeLeft, int32_t AudioDeviceModuleImpl::WaveOutVolume(uint16_t* volumeLeft, uint16_t* volumeRight) const { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); uint16_t volLeft(0); @@ -630,9 +623,8 @@ int32_t AudioDeviceModuleImpl::WaveOutVolume(uint16_t* volumeLeft, *volumeLeft = volLeft; *volumeRight = volRight; - WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, - "outputs: volumeLeft=%u, volumeRight=%u", *volumeLeft, - *volumeRight); + LOG(INFO) << __FUNCTION__ << " output: volumeLeft = " << *volumeLeft + << ", volumeRight = " << *volumeRight; return (0); } @@ -642,12 +634,16 @@ int32_t AudioDeviceModuleImpl::WaveOutVolume(uint16_t* volumeLeft, // ---------------------------------------------------------------------------- bool AudioDeviceModuleImpl::SpeakerIsInitialized() const { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED_BOOL(); bool isInitialized = _ptrAudioDevice->SpeakerIsInitialized(); - WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: %d", - isInitialized); + if (isInitialized) { + LOG(INFO) << __FUNCTION__ << " output: initialized"; + } else { + LOG(INFO) << __FUNCTION__ << " output: not initialized"; + } return (isInitialized); } @@ -656,12 +652,16 @@ bool AudioDeviceModuleImpl::SpeakerIsInitialized() const { // ---------------------------------------------------------------------------- bool AudioDeviceModuleImpl::MicrophoneIsInitialized() const { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED_BOOL(); bool isInitialized = _ptrAudioDevice->MicrophoneIsInitialized(); - WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: %d", - isInitialized); + if (isInitialized) { + LOG(INFO) << __FUNCTION__ << " output: initialized"; + } else { + LOG(INFO) << __FUNCTION__ << " output: not initialized"; + } return (isInitialized); } @@ -670,6 +670,7 @@ bool AudioDeviceModuleImpl::MicrophoneIsInitialized() const { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::MaxSpeakerVolume(uint32_t* maxVolume) const { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); uint32_t maxVol(0); @@ -680,8 +681,7 @@ int32_t AudioDeviceModuleImpl::MaxSpeakerVolume(uint32_t* maxVolume) const { *maxVolume = maxVol; - WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: maxVolume=%d", - *maxVolume); + LOG(INFO) << __FUNCTION__ << " output: maxVolume = " << *maxVolume; return (0); } @@ -690,6 +690,7 @@ int32_t AudioDeviceModuleImpl::MaxSpeakerVolume(uint32_t* maxVolume) const { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::MinSpeakerVolume(uint32_t* minVolume) const { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); uint32_t minVol(0); @@ -700,8 +701,7 @@ int32_t AudioDeviceModuleImpl::MinSpeakerVolume(uint32_t* minVolume) const { *minVolume = minVol; - WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: minVolume=%u", - *minVolume); + LOG(INFO) << __FUNCTION__ << " output: " << *minVolume; return (0); } @@ -710,20 +710,19 @@ int32_t AudioDeviceModuleImpl::MinSpeakerVolume(uint32_t* minVolume) const { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::SpeakerVolumeStepSize(uint16_t* stepSize) const { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); uint16_t delta(0); if (_ptrAudioDevice->SpeakerVolumeStepSize(delta) == -1) { - WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, - "failed to retrieve the speaker-volume step size"); + LOG(LERROR) << "failed to retrieve the speaker-volume step size"; return -1; } *stepSize = delta; - WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: stepSize=%u", - *stepSize); + LOG(INFO) << __FUNCTION__ << " output: " << *stepSize; return (0); } @@ -732,6 +731,7 @@ int32_t AudioDeviceModuleImpl::SpeakerVolumeStepSize(uint16_t* stepSize) const { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::SpeakerMuteIsAvailable(bool* available) { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); bool isAvailable(0); @@ -742,8 +742,11 @@ int32_t AudioDeviceModuleImpl::SpeakerMuteIsAvailable(bool* available) { *available = isAvailable; - WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: available=%d", - *available); + if (isAvailable) { + LOG(INFO) << __FUNCTION__ << " output: available"; + } else { + LOG(INFO) << __FUNCTION__ << " output: not available"; + } return (0); } @@ -752,6 +755,7 @@ int32_t AudioDeviceModuleImpl::SpeakerMuteIsAvailable(bool* available) { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::SetSpeakerMute(bool enable) { + LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; CHECK_INITIALIZED(); return (_ptrAudioDevice->SetSpeakerMute(enable)); } @@ -761,6 +765,7 @@ int32_t AudioDeviceModuleImpl::SetSpeakerMute(bool enable) { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::SpeakerMute(bool* enabled) const { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); bool muted(false); @@ -771,8 +776,11 @@ int32_t AudioDeviceModuleImpl::SpeakerMute(bool* enabled) const { *enabled = muted; - WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: enabled=%u", - *enabled); + if (muted) { + LOG(INFO) << __FUNCTION__ << " output: muted"; + } else { + LOG(INFO) << __FUNCTION__ << " output: not muted"; + } return (0); } @@ -781,6 +789,7 @@ int32_t AudioDeviceModuleImpl::SpeakerMute(bool* enabled) const { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::MicrophoneMuteIsAvailable(bool* available) { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); bool isAvailable(0); @@ -791,8 +800,11 @@ int32_t AudioDeviceModuleImpl::MicrophoneMuteIsAvailable(bool* available) { *available = isAvailable; - WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: available=%d", - *available); + if (isAvailable) { + LOG(INFO) << __FUNCTION__ << " output: available"; + } else { + LOG(INFO) << __FUNCTION__ << " output: not available"; + } return (0); } @@ -801,6 +813,7 @@ int32_t AudioDeviceModuleImpl::MicrophoneMuteIsAvailable(bool* available) { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::SetMicrophoneMute(bool enable) { + LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; CHECK_INITIALIZED(); return (_ptrAudioDevice->SetMicrophoneMute(enable)); } @@ -810,6 +823,7 @@ int32_t AudioDeviceModuleImpl::SetMicrophoneMute(bool enable) { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::MicrophoneMute(bool* enabled) const { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); bool muted(false); @@ -820,8 +834,11 @@ int32_t AudioDeviceModuleImpl::MicrophoneMute(bool* enabled) const { *enabled = muted; - WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: enabled=%u", - *enabled); + if (muted) { + LOG(INFO) << __FUNCTION__ << " output: muted"; + } else { + LOG(INFO) << __FUNCTION__ << " output: not muted"; + } return (0); } @@ -830,6 +847,7 @@ int32_t AudioDeviceModuleImpl::MicrophoneMute(bool* enabled) const { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::MicrophoneBoostIsAvailable(bool* available) { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); bool isAvailable(0); @@ -840,8 +858,11 @@ int32_t AudioDeviceModuleImpl::MicrophoneBoostIsAvailable(bool* available) { *available = isAvailable; - WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: available=%d", - *available); + if (isAvailable) { + LOG(INFO) << __FUNCTION__ << " output: available"; + } else { + LOG(INFO) << __FUNCTION__ << " output: not available"; + } return (0); } @@ -850,6 +871,7 @@ int32_t AudioDeviceModuleImpl::MicrophoneBoostIsAvailable(bool* available) { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::SetMicrophoneBoost(bool enable) { + LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; CHECK_INITIALIZED(); return (_ptrAudioDevice->SetMicrophoneBoost(enable)); } @@ -859,6 +881,7 @@ int32_t AudioDeviceModuleImpl::SetMicrophoneBoost(bool enable) { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::MicrophoneBoost(bool* enabled) const { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); bool onOff(false); @@ -869,8 +892,11 @@ int32_t AudioDeviceModuleImpl::MicrophoneBoost(bool* enabled) const { *enabled = onOff; - WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: enabled=%u", - *enabled); + if (onOff) { + LOG(INFO) << __FUNCTION__ << " output: enabled"; + } else { + LOG(INFO) << __FUNCTION__ << " output: not enabled"; + } return (0); } @@ -879,6 +905,7 @@ int32_t AudioDeviceModuleImpl::MicrophoneBoost(bool* enabled) const { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::MicrophoneVolumeIsAvailable(bool* available) { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); bool isAvailable(0); @@ -889,8 +916,11 @@ int32_t AudioDeviceModuleImpl::MicrophoneVolumeIsAvailable(bool* available) { *available = isAvailable; - WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: available=%d", - *available); + if (isAvailable) { + LOG(INFO) << __FUNCTION__ << " output: available"; + } else { + LOG(INFO) << __FUNCTION__ << " output: not available"; + } return (0); } @@ -899,6 +929,7 @@ int32_t AudioDeviceModuleImpl::MicrophoneVolumeIsAvailable(bool* available) { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::SetMicrophoneVolume(uint32_t volume) { + LOG(INFO) << __FUNCTION__ << "(" << volume << ")"; CHECK_INITIALIZED(); return (_ptrAudioDevice->SetMicrophoneVolume(volume)); } @@ -908,7 +939,7 @@ int32_t AudioDeviceModuleImpl::SetMicrophoneVolume(uint32_t volume) { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::MicrophoneVolume(uint32_t* volume) const { - WEBRTC_TRACE(kTraceStream, kTraceAudioDevice, _id, "%s", __FUNCTION__); + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); uint32_t level(0); @@ -919,8 +950,7 @@ int32_t AudioDeviceModuleImpl::MicrophoneVolume(uint32_t* volume) const { *volume = level; - WEBRTC_TRACE(kTraceStream, kTraceAudioDevice, _id, "output: volume=%u", - *volume); + LOG(INFO) << __FUNCTION__ << " output: volume = " << *volume; return (0); } @@ -930,6 +960,7 @@ int32_t AudioDeviceModuleImpl::MicrophoneVolume(uint32_t* volume) const { int32_t AudioDeviceModuleImpl::StereoRecordingIsAvailable( bool* available) const { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); bool isAvailable(0); @@ -940,8 +971,11 @@ int32_t AudioDeviceModuleImpl::StereoRecordingIsAvailable( *available = isAvailable; - WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: available=%d", - *available); + if (isAvailable) { + LOG(INFO) << __FUNCTION__ << " output: available"; + } else { + LOG(INFO) << __FUNCTION__ << " output: not available"; + } return (0); } @@ -950,17 +984,20 @@ int32_t AudioDeviceModuleImpl::StereoRecordingIsAvailable( // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::SetStereoRecording(bool enable) { + LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; CHECK_INITIALIZED(); if (_ptrAudioDevice->RecordingIsInitialized()) { - WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, - "recording in stereo is not supported"); + LOG(WARNING) << "recording in stereo is not supported"; return -1; } if (_ptrAudioDevice->SetStereoRecording(enable) == -1) { - WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, - "failed to enable stereo recording"); + if (enable) { + LOG(WARNING) << "failed to enable stereo recording"; + } else { + LOG(WARNING) << "failed to disable stereo recording"; + } return -1; } @@ -978,6 +1015,7 @@ int32_t AudioDeviceModuleImpl::SetStereoRecording(bool enable) { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::StereoRecording(bool* enabled) const { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); bool stereo(false); @@ -988,8 +1026,11 @@ int32_t AudioDeviceModuleImpl::StereoRecording(bool* enabled) const { *enabled = stereo; - WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: enabled=%u", - *enabled); + if (stereo) { + LOG(INFO) << __FUNCTION__ << " output: enabled"; + } else { + LOG(INFO) << __FUNCTION__ << " output: not enabled"; + } return (0); } @@ -999,16 +1040,18 @@ int32_t AudioDeviceModuleImpl::StereoRecording(bool* enabled) const { int32_t AudioDeviceModuleImpl::SetRecordingChannel(const ChannelType channel) { if (channel == kChannelBoth) { + LOG(INFO) << __FUNCTION__ << "(both)"; } else if (channel == kChannelLeft) { + LOG(INFO) << __FUNCTION__ << "(left)"; } else { + LOG(INFO) << __FUNCTION__ << "(right)"; } CHECK_INITIALIZED(); bool stereo(false); if (_ptrAudioDevice->StereoRecording(stereo) == -1) { - WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, - "recording in stereo is not supported"); + LOG(WARNING) << "recording in stereo is not supported"; return -1; } @@ -1020,6 +1063,7 @@ int32_t AudioDeviceModuleImpl::SetRecordingChannel(const ChannelType channel) { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::RecordingChannel(ChannelType* channel) const { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); ChannelType chType; @@ -1031,8 +1075,11 @@ int32_t AudioDeviceModuleImpl::RecordingChannel(ChannelType* channel) const { *channel = chType; if (*channel == kChannelBoth) { + LOG(INFO) << __FUNCTION__ << " output: both"; } else if (*channel == kChannelLeft) { + LOG(INFO) << __FUNCTION__ << " output: left"; } else { + LOG(INFO) << __FUNCTION__ << " output: right"; } return (0); @@ -1043,6 +1090,7 @@ int32_t AudioDeviceModuleImpl::RecordingChannel(ChannelType* channel) const { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::StereoPlayoutIsAvailable(bool* available) const { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); bool isAvailable(0); @@ -1053,8 +1101,11 @@ int32_t AudioDeviceModuleImpl::StereoPlayoutIsAvailable(bool* available) const { *available = isAvailable; - WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: available=%d", - *available); + if (isAvailable) { + LOG(INFO) << __FUNCTION__ << " output: available"; + } else { + LOG(INFO) << __FUNCTION__ << " output: not available"; + } return (0); } @@ -1063,17 +1114,17 @@ int32_t AudioDeviceModuleImpl::StereoPlayoutIsAvailable(bool* available) const { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::SetStereoPlayout(bool enable) { + LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; CHECK_INITIALIZED(); if (_ptrAudioDevice->PlayoutIsInitialized()) { - WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, - "unable to set stereo mode while playing side is initialized"); + LOG(LERROR) + << "unable to set stereo mode while playing side is initialized"; return -1; } if (_ptrAudioDevice->SetStereoPlayout(enable)) { - WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, - "stereo playout is not supported"); + LOG(WARNING) << "stereo playout is not supported"; return -1; } @@ -1091,6 +1142,7 @@ int32_t AudioDeviceModuleImpl::SetStereoPlayout(bool enable) { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::StereoPlayout(bool* enabled) const { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); bool stereo(false); @@ -1101,8 +1153,11 @@ int32_t AudioDeviceModuleImpl::StereoPlayout(bool* enabled) const { *enabled = stereo; - WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: enabled=%u", - *enabled); + if (stereo) { + LOG(INFO) << __FUNCTION__ << " output: enabled"; + } else { + LOG(INFO) << __FUNCTION__ << " output: not enabled"; + } return (0); } @@ -1111,6 +1166,7 @@ int32_t AudioDeviceModuleImpl::StereoPlayout(bool* enabled) const { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::SetAGC(bool enable) { + LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; CHECK_INITIALIZED(); return (_ptrAudioDevice->SetAGC(enable)); } @@ -1120,6 +1176,7 @@ int32_t AudioDeviceModuleImpl::SetAGC(bool enable) { // ---------------------------------------------------------------------------- bool AudioDeviceModuleImpl::AGC() const { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED_BOOL(); return (_ptrAudioDevice->AGC()); } @@ -1129,6 +1186,7 @@ bool AudioDeviceModuleImpl::AGC() const { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::PlayoutIsAvailable(bool* available) { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); bool isAvailable(0); @@ -1139,8 +1197,11 @@ int32_t AudioDeviceModuleImpl::PlayoutIsAvailable(bool* available) { *available = isAvailable; - WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: available=%d", - *available); + if (isAvailable) { + LOG(INFO) << __FUNCTION__ << " output: available"; + } else { + LOG(INFO) << __FUNCTION__ << " output: not available"; + } return (0); } @@ -1149,6 +1210,7 @@ int32_t AudioDeviceModuleImpl::PlayoutIsAvailable(bool* available) { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::RecordingIsAvailable(bool* available) { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); bool isAvailable(0); @@ -1159,8 +1221,11 @@ int32_t AudioDeviceModuleImpl::RecordingIsAvailable(bool* available) { *available = isAvailable; - WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: available=%d", - *available); + if (isAvailable) { + LOG(INFO) << __FUNCTION__ << " output: available"; + } else { + LOG(INFO) << __FUNCTION__ << " output: not available"; + } return (0); } @@ -1169,7 +1234,7 @@ int32_t AudioDeviceModuleImpl::RecordingIsAvailable(bool* available) { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::MaxMicrophoneVolume(uint32_t* maxVolume) const { - WEBRTC_TRACE(kTraceStream, kTraceAudioDevice, _id, "%s", __FUNCTION__); + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); uint32_t maxVol(0); @@ -1180,8 +1245,7 @@ int32_t AudioDeviceModuleImpl::MaxMicrophoneVolume(uint32_t* maxVolume) const { *maxVolume = maxVol; - WEBRTC_TRACE(kTraceStream, kTraceAudioDevice, _id, "output: maxVolume=%d", - *maxVolume); + LOG(INFO) << __FUNCTION__ << " output: = " << *maxVolume; return (0); } @@ -1190,6 +1254,7 @@ int32_t AudioDeviceModuleImpl::MaxMicrophoneVolume(uint32_t* maxVolume) const { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::MinMicrophoneVolume(uint32_t* minVolume) const { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); uint32_t minVol(0); @@ -1200,8 +1265,7 @@ int32_t AudioDeviceModuleImpl::MinMicrophoneVolume(uint32_t* minVolume) const { *minVolume = minVol; - WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: minVolume=%u", - *minVolume); + LOG(INFO) << __FUNCTION__ << " output: = " << *minVolume; return (0); } @@ -1211,6 +1275,7 @@ int32_t AudioDeviceModuleImpl::MinMicrophoneVolume(uint32_t* minVolume) const { int32_t AudioDeviceModuleImpl::MicrophoneVolumeStepSize( uint16_t* stepSize) const { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); uint16_t delta(0); @@ -1221,8 +1286,7 @@ int32_t AudioDeviceModuleImpl::MicrophoneVolumeStepSize( *stepSize = delta; - WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: stepSize=%u", - *stepSize); + LOG(INFO) << __FUNCTION__ << " output: " << *stepSize; return (0); } @@ -1231,12 +1295,12 @@ int32_t AudioDeviceModuleImpl::MicrophoneVolumeStepSize( // ---------------------------------------------------------------------------- int16_t AudioDeviceModuleImpl::PlayoutDevices() { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); uint16_t nPlayoutDevices = _ptrAudioDevice->PlayoutDevices(); - WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, - "output: #playout devices=%d", nPlayoutDevices); + LOG(INFO) << __FUNCTION__ << " output: " << nPlayoutDevices; return ((int16_t)(nPlayoutDevices)); } @@ -1245,6 +1309,7 @@ int16_t AudioDeviceModuleImpl::PlayoutDevices() { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::SetPlayoutDevice(uint16_t index) { + LOG(INFO) << __FUNCTION__ << "(" << index << ")"; CHECK_INITIALIZED(); return (_ptrAudioDevice->SetPlayoutDevice(index)); } @@ -1257,6 +1322,7 @@ int32_t AudioDeviceModuleImpl::SetPlayoutDevice(WindowsDeviceType device) { if (device == kDefaultDevice) { } else { } + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); return (_ptrAudioDevice->SetPlayoutDevice(device)); @@ -1270,6 +1336,7 @@ int32_t AudioDeviceModuleImpl::PlayoutDeviceName( uint16_t index, char name[kAdmMaxDeviceNameSize], char guid[kAdmMaxGuidSize]) { + LOG(INFO) << __FUNCTION__ << "(" << index << ", ...)"; CHECK_INITIALIZED(); if (name == NULL) { @@ -1282,12 +1349,10 @@ int32_t AudioDeviceModuleImpl::PlayoutDeviceName( } if (name != NULL) { - WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: name=%s", - name); + LOG(INFO) << __FUNCTION__ << " output: name = " << name; } if (guid != NULL) { - WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: guid=%s", - guid); + LOG(INFO) << __FUNCTION__ << " output: guid = " << guid; } return (0); @@ -1301,6 +1366,7 @@ int32_t AudioDeviceModuleImpl::RecordingDeviceName( uint16_t index, char name[kAdmMaxDeviceNameSize], char guid[kAdmMaxGuidSize]) { + LOG(INFO) << __FUNCTION__ << "(" << index << ", ...)"; CHECK_INITIALIZED(); if (name == NULL) { @@ -1313,12 +1379,10 @@ int32_t AudioDeviceModuleImpl::RecordingDeviceName( } if (name != NULL) { - WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: name=%s", - name); + LOG(INFO) << __FUNCTION__ << " output: name = " << name; } if (guid != NULL) { - WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: guid=%s", - guid); + LOG(INFO) << __FUNCTION__ << " output: guid = " << guid; } return (0); @@ -1329,12 +1393,12 @@ int32_t AudioDeviceModuleImpl::RecordingDeviceName( // ---------------------------------------------------------------------------- int16_t AudioDeviceModuleImpl::RecordingDevices() { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); uint16_t nRecordingDevices = _ptrAudioDevice->RecordingDevices(); - WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, - "output: #recording devices=%d", nRecordingDevices); + LOG(INFO) << __FUNCTION__ << " output: " << nRecordingDevices; return ((int16_t)nRecordingDevices); } @@ -1343,6 +1407,7 @@ int16_t AudioDeviceModuleImpl::RecordingDevices() { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::SetRecordingDevice(uint16_t index) { + LOG(INFO) << __FUNCTION__ << "(" << index << ")"; CHECK_INITIALIZED(); return (_ptrAudioDevice->SetRecordingDevice(index)); } @@ -1355,6 +1420,7 @@ int32_t AudioDeviceModuleImpl::SetRecordingDevice(WindowsDeviceType device) { if (device == kDefaultDevice) { } else { } + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); return (_ptrAudioDevice->SetRecordingDevice(device)); @@ -1365,6 +1431,7 @@ int32_t AudioDeviceModuleImpl::SetRecordingDevice(WindowsDeviceType device) { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::InitPlayout() { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); _audioDeviceBuffer.InitPlayout(); return (_ptrAudioDevice->InitPlayout()); @@ -1375,7 +1442,7 @@ int32_t AudioDeviceModuleImpl::InitPlayout() { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::InitRecording() { - TRACE_EVENT0("webrtc", "AudioDeviceModuleImpl::InitRecording"); + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); _audioDeviceBuffer.InitRecording(); return (_ptrAudioDevice->InitRecording()); @@ -1386,6 +1453,7 @@ int32_t AudioDeviceModuleImpl::InitRecording() { // ---------------------------------------------------------------------------- bool AudioDeviceModuleImpl::PlayoutIsInitialized() const { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED_BOOL(); return (_ptrAudioDevice->PlayoutIsInitialized()); } @@ -1395,6 +1463,7 @@ bool AudioDeviceModuleImpl::PlayoutIsInitialized() const { // ---------------------------------------------------------------------------- bool AudioDeviceModuleImpl::RecordingIsInitialized() const { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED_BOOL(); return (_ptrAudioDevice->RecordingIsInitialized()); } @@ -1404,6 +1473,7 @@ bool AudioDeviceModuleImpl::RecordingIsInitialized() const { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::StartPlayout() { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); return (_ptrAudioDevice->StartPlayout()); } @@ -1413,6 +1483,7 @@ int32_t AudioDeviceModuleImpl::StartPlayout() { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::StopPlayout() { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); return (_ptrAudioDevice->StopPlayout()); } @@ -1422,6 +1493,7 @@ int32_t AudioDeviceModuleImpl::StopPlayout() { // ---------------------------------------------------------------------------- bool AudioDeviceModuleImpl::Playing() const { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED_BOOL(); return (_ptrAudioDevice->Playing()); } @@ -1431,7 +1503,7 @@ bool AudioDeviceModuleImpl::Playing() const { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::StartRecording() { - TRACE_EVENT0("webrtc", "AudioDeviceModuleImpl::StartRecording"); + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); return (_ptrAudioDevice->StartRecording()); } @@ -1440,6 +1512,7 @@ int32_t AudioDeviceModuleImpl::StartRecording() { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::StopRecording() { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); return (_ptrAudioDevice->StopRecording()); } @@ -1449,6 +1522,7 @@ int32_t AudioDeviceModuleImpl::StopRecording() { // ---------------------------------------------------------------------------- bool AudioDeviceModuleImpl::Recording() const { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED_BOOL(); return (_ptrAudioDevice->Recording()); } @@ -1459,6 +1533,7 @@ bool AudioDeviceModuleImpl::Recording() const { int32_t AudioDeviceModuleImpl::RegisterEventObserver( AudioDeviceObserver* eventCallback) { + LOG(INFO) << __FUNCTION__; CriticalSectionScoped lock(&_critSectEventCb); _ptrCbAudioDeviceObserver = eventCallback; @@ -1471,6 +1546,7 @@ int32_t AudioDeviceModuleImpl::RegisterEventObserver( int32_t AudioDeviceModuleImpl::RegisterAudioCallback( AudioTransport* audioCallback) { + LOG(INFO) << __FUNCTION__; CriticalSectionScoped lock(&_critSectAudioCb); _audioDeviceBuffer.RegisterAudioCallback(audioCallback); @@ -1483,6 +1559,7 @@ int32_t AudioDeviceModuleImpl::RegisterAudioCallback( int32_t AudioDeviceModuleImpl::StartRawInputFileRecording( const char pcmFileNameUTF8[kAdmMaxFileNameSize]) { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); if (NULL == pcmFileNameUTF8) { @@ -1497,6 +1574,7 @@ int32_t AudioDeviceModuleImpl::StartRawInputFileRecording( // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::StopRawInputFileRecording() { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); return (_audioDeviceBuffer.StopInputFileRecording()); @@ -1508,6 +1586,7 @@ int32_t AudioDeviceModuleImpl::StopRawInputFileRecording() { int32_t AudioDeviceModuleImpl::StartRawOutputFileRecording( const char pcmFileNameUTF8[kAdmMaxFileNameSize]) { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); if (NULL == pcmFileNameUTF8) { @@ -1522,6 +1601,7 @@ int32_t AudioDeviceModuleImpl::StartRawOutputFileRecording( // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::StopRawOutputFileRecording() { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); return (_audioDeviceBuffer.StopOutputFileRecording()); @@ -1533,12 +1613,24 @@ int32_t AudioDeviceModuleImpl::StopRawOutputFileRecording() { int32_t AudioDeviceModuleImpl::SetPlayoutBuffer(const BufferType type, uint16_t sizeMS) { + if (type == kFixedBufferSize) { + LOG(INFO) << __FUNCTION__ << "(" + << "fixed buffer, " << sizeMS << "ms" + << ")"; + } else if (type == kAdaptiveBufferSize) { + LOG(INFO) << __FUNCTION__ << "(" + << "adaptive buffer, " << sizeMS << "ms" + << ")"; + } else { + LOG(INFO) << __FUNCTION__ << "(" + << "?, " << sizeMS << "ms" + << ")"; + } CHECK_INITIALIZED(); if (_ptrAudioDevice->PlayoutIsInitialized()) { - WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, - "unable to modify the playout buffer while playing side is " - "initialized"); + LOG(LERROR) << "unable to modify the playout buffer while playing side is " + "initialized"; return -1; } @@ -1547,15 +1639,14 @@ int32_t AudioDeviceModuleImpl::SetPlayoutBuffer(const BufferType type, if (kFixedBufferSize == type) { if (sizeMS < kAdmMinPlayoutBufferSizeMs || sizeMS > kAdmMaxPlayoutBufferSizeMs) { - WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, - "size parameter is out of range"); + LOG(LERROR) << "size parameter is out of range"; return -1; } } if ((ret = _ptrAudioDevice->SetPlayoutBuffer(type, sizeMS)) == -1) { - WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, - "failed to set the playout buffer (error: %d)", LastError()); + LOG(LERROR) << "failed to set the playout buffer (error: " << LastError() + << ")"; } return ret; @@ -1567,22 +1658,22 @@ int32_t AudioDeviceModuleImpl::SetPlayoutBuffer(const BufferType type, int32_t AudioDeviceModuleImpl::PlayoutBuffer(BufferType* type, uint16_t* sizeMS) const { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); BufferType bufType; uint16_t size(0); if (_ptrAudioDevice->PlayoutBuffer(bufType, size) == -1) { - WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, - "failed to retrieve the buffer type and size"); + LOG(LERROR) << "failed to retrieve the buffer type and size"; return -1; } *type = bufType; *sizeMS = size; - WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, - "output: type=%u, sizeMS=%u", *type, *sizeMS); + LOG(INFO) << __FUNCTION__ << " output: type = " << *type + << ", sizeMS = " << *sizeMS; return (0); } @@ -1591,21 +1682,19 @@ int32_t AudioDeviceModuleImpl::PlayoutBuffer(BufferType* type, // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::PlayoutDelay(uint16_t* delayMS) const { - WEBRTC_TRACE(kTraceStream, kTraceAudioDevice, _id, "%s", __FUNCTION__); + LOG(LS_VERBOSE) << __FUNCTION__; CHECK_INITIALIZED(); uint16_t delay(0); if (_ptrAudioDevice->PlayoutDelay(delay) == -1) { - WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, - "failed to retrieve the playout delay"); + LOG(LERROR) << "failed to retrieve the playout delay"; return -1; } *delayMS = delay; - WEBRTC_TRACE(kTraceStream, kTraceAudioDevice, _id, "output: delayMS=%u", - *delayMS); + LOG(LS_VERBOSE) << __FUNCTION__ << " output: delayMS = " << *delayMS; return (0); } @@ -1614,21 +1703,19 @@ int32_t AudioDeviceModuleImpl::PlayoutDelay(uint16_t* delayMS) const { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::RecordingDelay(uint16_t* delayMS) const { - WEBRTC_TRACE(kTraceStream, kTraceAudioDevice, _id, "%s", __FUNCTION__); + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); uint16_t delay(0); if (_ptrAudioDevice->RecordingDelay(delay) == -1) { - WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, - "failed to retrieve the recording delay"); + LOG(LERROR) << "failed to retrieve the recording delay"; return -1; } *delayMS = delay; - WEBRTC_TRACE(kTraceStream, kTraceAudioDevice, _id, "output: delayMS=%u", - *delayMS); + LOG(INFO) << __FUNCTION__ << " output: delayMS = " << *delayMS; return (0); } @@ -1637,20 +1724,19 @@ int32_t AudioDeviceModuleImpl::RecordingDelay(uint16_t* delayMS) const { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::CPULoad(uint16_t* load) const { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); uint16_t cpuLoad(0); if (_ptrAudioDevice->CPULoad(cpuLoad) == -1) { - WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, - "failed to retrieve the CPU load"); + LOG(LERROR) << "failed to retrieve the CPU load"; return -1; } *load = cpuLoad; - WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: load=%u", - *load); + LOG(INFO) << __FUNCTION__ << " output: load = " << *load; return (0); } @@ -1660,6 +1746,7 @@ int32_t AudioDeviceModuleImpl::CPULoad(uint16_t* load) const { int32_t AudioDeviceModuleImpl::SetRecordingSampleRate( const uint32_t samplesPerSec) { + LOG(INFO) << __FUNCTION__ << "(" << samplesPerSec << ")"; CHECK_INITIALIZED(); if (_ptrAudioDevice->SetRecordingSampleRate(samplesPerSec) != 0) { @@ -1675,20 +1762,19 @@ int32_t AudioDeviceModuleImpl::SetRecordingSampleRate( int32_t AudioDeviceModuleImpl::RecordingSampleRate( uint32_t* samplesPerSec) const { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); int32_t sampleRate = _audioDeviceBuffer.RecordingSampleRate(); if (sampleRate == -1) { - WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, - "failed to retrieve the sample rate"); + LOG(LERROR) << "failed to retrieve the sample rate"; return -1; } *samplesPerSec = sampleRate; - WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, - "output: samplesPerSec=%u", *samplesPerSec); + LOG(INFO) << __FUNCTION__ << " output: samplesPerSec = " << *samplesPerSec; return (0); } @@ -1698,6 +1784,7 @@ int32_t AudioDeviceModuleImpl::RecordingSampleRate( int32_t AudioDeviceModuleImpl::SetPlayoutSampleRate( const uint32_t samplesPerSec) { + LOG(INFO) << __FUNCTION__ << "(" << samplesPerSec << ")"; CHECK_INITIALIZED(); if (_ptrAudioDevice->SetPlayoutSampleRate(samplesPerSec) != 0) { @@ -1713,20 +1800,19 @@ int32_t AudioDeviceModuleImpl::SetPlayoutSampleRate( int32_t AudioDeviceModuleImpl::PlayoutSampleRate( uint32_t* samplesPerSec) const { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); int32_t sampleRate = _audioDeviceBuffer.PlayoutSampleRate(); if (sampleRate == -1) { - WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, - "failed to retrieve the sample rate"); + LOG(LERROR) << "failed to retrieve the sample rate"; return -1; } *samplesPerSec = sampleRate; - WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, - "output: samplesPerSec=%u", *samplesPerSec); + LOG(INFO) << __FUNCTION__ << " output: samplesPerSec = " << *samplesPerSec; return (0); } @@ -1735,6 +1821,7 @@ int32_t AudioDeviceModuleImpl::PlayoutSampleRate( // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::ResetAudioDevice() { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); if (_ptrAudioDevice->ResetAudioDevice() == -1) { @@ -1749,6 +1836,7 @@ int32_t AudioDeviceModuleImpl::ResetAudioDevice() { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::SetLoudspeakerStatus(bool enable) { + LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; CHECK_INITIALIZED(); if (_ptrAudioDevice->SetLoudspeakerStatus(enable) != 0) { @@ -1763,56 +1851,102 @@ int32_t AudioDeviceModuleImpl::SetLoudspeakerStatus(bool enable) { // ---------------------------------------------------------------------------- int32_t AudioDeviceModuleImpl::GetLoudspeakerStatus(bool* enabled) const { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED(); + int32_t ok = 0; if (_ptrAudioDevice->GetLoudspeakerStatus(*enabled) != 0) { - return -1; + ok = -1; } - return 0; + LOG(INFO) << __FUNCTION__ << " output: " << ok; + return ok; } bool AudioDeviceModuleImpl::BuiltInAECIsEnabled() const { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED_BOOL(); - return _ptrAudioDevice->BuiltInAECIsEnabled(); + bool isEnabled = _ptrAudioDevice->BuiltInAECIsEnabled(); + if (isEnabled) { + LOG(INFO) << __FUNCTION__ << " output: enabled"; + } else { + LOG(INFO) << __FUNCTION__ << " output: not enabled"; + } + return isEnabled; } bool AudioDeviceModuleImpl::BuiltInAECIsAvailable() const { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED_BOOL(); - return _ptrAudioDevice->BuiltInAECIsAvailable(); + bool isAvailable = _ptrAudioDevice->BuiltInAECIsAvailable(); + if (isAvailable) { + LOG(INFO) << __FUNCTION__ << " output: available"; + } else { + LOG(INFO) << __FUNCTION__ << " output: not available"; + } + return isAvailable; } int32_t AudioDeviceModuleImpl::EnableBuiltInAEC(bool enable) { + LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; CHECK_INITIALIZED(); - return _ptrAudioDevice->EnableBuiltInAEC(enable); + int32_t ok = _ptrAudioDevice->EnableBuiltInAEC(enable); + LOG(INFO) << __FUNCTION__ << " output: " << ok; + return ok; } bool AudioDeviceModuleImpl::BuiltInAGCIsAvailable() const { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED_BOOL(); - return _ptrAudioDevice->BuiltInAGCIsAvailable(); + bool isAvailable = _ptrAudioDevice->BuiltInAGCIsAvailable(); + if (isAvailable) { + LOG(INFO) << __FUNCTION__ << " output: available"; + } else { + LOG(INFO) << __FUNCTION__ << " output: not available"; + } + return isAvailable; } int32_t AudioDeviceModuleImpl::EnableBuiltInAGC(bool enable) { + LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; CHECK_INITIALIZED(); - return _ptrAudioDevice->EnableBuiltInAGC(enable); + int32_t ok = _ptrAudioDevice->EnableBuiltInAGC(enable); + LOG(INFO) << __FUNCTION__ << " output: " << ok; + return ok; } bool AudioDeviceModuleImpl::BuiltInNSIsAvailable() const { + LOG(INFO) << __FUNCTION__; CHECK_INITIALIZED_BOOL(); - return _ptrAudioDevice->BuiltInNSIsAvailable(); + bool isAvailable = _ptrAudioDevice->BuiltInNSIsAvailable(); + if (isAvailable) { + LOG(INFO) << __FUNCTION__ << " output: available"; + } else { + LOG(INFO) << __FUNCTION__ << " output: not available"; + } + return isAvailable; } int32_t AudioDeviceModuleImpl::EnableBuiltInNS(bool enable) { + LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; CHECK_INITIALIZED(); - return _ptrAudioDevice->EnableBuiltInNS(enable); + int32_t ok = _ptrAudioDevice->EnableBuiltInNS(enable); + LOG(INFO) << __FUNCTION__ << " output: " << ok; + return ok; } int AudioDeviceModuleImpl::GetPlayoutAudioParameters( AudioParameters* params) const { - return _ptrAudioDevice->GetPlayoutAudioParameters(params); + LOG(INFO) << __FUNCTION__; + int r = _ptrAudioDevice->GetPlayoutAudioParameters(params); + LOG(INFO) << __FUNCTION__ << " output: " << r; + return r; } int AudioDeviceModuleImpl::GetRecordAudioParameters( AudioParameters* params) const { - return _ptrAudioDevice->GetRecordAudioParameters(params); + LOG(INFO) << __FUNCTION__; + int r = _ptrAudioDevice->GetRecordAudioParameters(params); + LOG(INFO) << __FUNCTION__ << " output: " << r; + return r; } // ============================================================================ @@ -1824,6 +1958,7 @@ int AudioDeviceModuleImpl::GetRecordAudioParameters( // ---------------------------------------------------------------------------- AudioDeviceModuleImpl::PlatformType AudioDeviceModuleImpl::Platform() const { + LOG(INFO) << __FUNCTION__; return _platformType; } @@ -1833,6 +1968,7 @@ AudioDeviceModuleImpl::PlatformType AudioDeviceModuleImpl::Platform() const { AudioDeviceModule::AudioLayer AudioDeviceModuleImpl::PlatformAudioLayer() const { + LOG(INFO) << __FUNCTION__; return _platformAudioLayer; }