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

View File

@ -78,7 +78,7 @@ AudioDeviceBuffer::~AudioDeviceBuffer() {
int32_t AudioDeviceBuffer::RegisterAudioCallback( int32_t AudioDeviceBuffer::RegisterAudioCallback(
AudioTransport* audio_callback) { AudioTransport* audio_callback) {
RTC_DCHECK_RUN_ON(&main_thread_checker_); RTC_DCHECK_RUN_ON(&main_thread_checker_);
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
if (playing_ || recording_) { if (playing_ || recording_) {
RTC_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; return -1;
@ -95,7 +95,7 @@ void AudioDeviceBuffer::StartPlayout() {
if (playing_) { if (playing_) {
return; return;
} }
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
// Clear members tracking playout stats and do it on the task queue. // Clear members tracking playout stats and do it on the task queue.
task_queue_.PostTask([this] { ResetPlayStats(); }); task_queue_.PostTask([this] { ResetPlayStats(); });
// Start a periodic timer based on task queue if not already done by the // Start a periodic timer based on task queue if not already done by the
@ -114,7 +114,7 @@ void AudioDeviceBuffer::StartRecording() {
if (recording_) { if (recording_) {
return; return;
} }
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
// Clear members tracking recording stats and do it on the task queue. // Clear members tracking recording stats and do it on the task queue.
task_queue_.PostTask([this] { ResetRecStats(); }); task_queue_.PostTask([this] { ResetRecStats(); });
// Start a periodic timer based on task queue if not already done by the // Start a periodic timer based on task queue if not already done by the
@ -136,7 +136,7 @@ void AudioDeviceBuffer::StopPlayout() {
if (!playing_) { if (!playing_) {
return; return;
} }
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
playing_ = false; playing_ = false;
// Stop periodic logging if no more media is active. // Stop periodic logging if no more media is active.
if (!recording_) { if (!recording_) {
@ -150,7 +150,7 @@ void AudioDeviceBuffer::StopRecording() {
if (!recording_) { if (!recording_) {
return; return;
} }
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
recording_ = false; recording_ = false;
// Stop periodic logging if no more media is active. // Stop periodic logging if no more media is active.
if (!playing_) { if (!playing_) {

View File

@ -73,7 +73,7 @@ namespace webrtc {
rtc::scoped_refptr<AudioDeviceModule> AudioDeviceModule::Create( rtc::scoped_refptr<AudioDeviceModule> AudioDeviceModule::Create(
AudioLayer audio_layer, AudioLayer audio_layer,
TaskQueueFactory* task_queue_factory) { TaskQueueFactory* task_queue_factory) {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
return AudioDeviceModule::CreateForTest(audio_layer, task_queue_factory); return AudioDeviceModule::CreateForTest(audio_layer, task_queue_factory);
} }
@ -81,7 +81,7 @@ rtc::scoped_refptr<AudioDeviceModule> AudioDeviceModule::Create(
rtc::scoped_refptr<AudioDeviceModuleForTest> AudioDeviceModule::CreateForTest( rtc::scoped_refptr<AudioDeviceModuleForTest> AudioDeviceModule::CreateForTest(
AudioLayer audio_layer, AudioLayer audio_layer,
TaskQueueFactory* task_queue_factory) { TaskQueueFactory* task_queue_factory) {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
// The "AudioDeviceModule::kWindowsCoreAudio2" audio layer has its own // The "AudioDeviceModule::kWindowsCoreAudio2" audio layer has its own
// dedicated factory method which should be used instead. // dedicated factory method which should be used instead.
@ -119,11 +119,11 @@ AudioDeviceModuleImpl::AudioDeviceModuleImpl(
AudioLayer audio_layer, AudioLayer audio_layer,
TaskQueueFactory* task_queue_factory) TaskQueueFactory* task_queue_factory)
: audio_layer_(audio_layer), audio_device_buffer_(task_queue_factory) { : audio_layer_(audio_layer), audio_device_buffer_(task_queue_factory) {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
} }
int32_t AudioDeviceModuleImpl::CheckPlatform() { int32_t AudioDeviceModuleImpl::CheckPlatform() {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
// Ensure that the current platform is supported // Ensure that the current platform is supported
PlatformType platform(kPlatformNotSupported); PlatformType platform(kPlatformNotSupported);
#if defined(_WIN32) #if defined(_WIN32)

View File

@ -98,7 +98,7 @@ AudioDeviceLinuxALSA::AudioDeviceLinuxALSA()
_recordingDelay(0), _recordingDelay(0),
_playoutDelay(0) { _playoutDelay(0) {
memset(_oldKeyState, 0, sizeof(_oldKeyState)); memset(_oldKeyState, 0, sizeof(_oldKeyState));
RTC_LOG(LS_INFO) << __FUNCTION__ << " created"; RTC_DLOG(LS_INFO) << __FUNCTION__ << " created";
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@ -106,7 +106,7 @@ AudioDeviceLinuxALSA::AudioDeviceLinuxALSA()
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
AudioDeviceLinuxALSA::~AudioDeviceLinuxALSA() { AudioDeviceLinuxALSA::~AudioDeviceLinuxALSA() {
RTC_LOG(LS_INFO) << __FUNCTION__ << " destroyed"; RTC_DLOG(LS_INFO) << __FUNCTION__ << " destroyed";
Terminate(); Terminate();

View File

@ -78,7 +78,7 @@ AudioDeviceLinuxPulse::AudioDeviceLinuxPulse()
_playStream(NULL), _playStream(NULL),
_recStreamFlags(0), _recStreamFlags(0),
_playStreamFlags(0) { _playStreamFlags(0) {
RTC_LOG(LS_INFO) << __FUNCTION__ << " created"; RTC_DLOG(LS_INFO) << __FUNCTION__ << " created";
memset(_paServerVersion, 0, sizeof(_paServerVersion)); memset(_paServerVersion, 0, sizeof(_paServerVersion));
memset(&_playBufferAttr, 0, sizeof(_playBufferAttr)); memset(&_playBufferAttr, 0, sizeof(_playBufferAttr));
@ -87,7 +87,7 @@ AudioDeviceLinuxPulse::AudioDeviceLinuxPulse()
} }
AudioDeviceLinuxPulse::~AudioDeviceLinuxPulse() { AudioDeviceLinuxPulse::~AudioDeviceLinuxPulse() {
RTC_LOG(LS_INFO) << __FUNCTION__ << " destroyed"; RTC_DLOG(LS_INFO) << __FUNCTION__ << " destroyed";
RTC_DCHECK(thread_checker_.IsCurrent()); RTC_DCHECK(thread_checker_.IsCurrent());
Terminate(); Terminate();

View File

@ -27,14 +27,14 @@ AudioMixerManagerLinuxALSA::AudioMixerManagerLinuxALSA()
_inputMixerHandle(NULL), _inputMixerHandle(NULL),
_outputMixerElement(NULL), _outputMixerElement(NULL),
_inputMixerElement(NULL) { _inputMixerElement(NULL) {
RTC_LOG(LS_INFO) << __FUNCTION__ << " created"; RTC_DLOG(LS_INFO) << __FUNCTION__ << " created";
memset(_outputMixerStr, 0, kAdmMaxDeviceNameSize); memset(_outputMixerStr, 0, kAdmMaxDeviceNameSize);
memset(_inputMixerStr, 0, kAdmMaxDeviceNameSize); memset(_inputMixerStr, 0, kAdmMaxDeviceNameSize);
} }
AudioMixerManagerLinuxALSA::~AudioMixerManagerLinuxALSA() { AudioMixerManagerLinuxALSA::~AudioMixerManagerLinuxALSA() {
RTC_LOG(LS_INFO) << __FUNCTION__ << " destroyed"; RTC_DLOG(LS_INFO) << __FUNCTION__ << " destroyed";
Close(); Close();
} }
@ -43,7 +43,7 @@ AudioMixerManagerLinuxALSA::~AudioMixerManagerLinuxALSA() {
// ============================================================================ // ============================================================================
int32_t AudioMixerManagerLinuxALSA::Close() { int32_t AudioMixerManagerLinuxALSA::Close() {
RTC_LOG(LS_VERBOSE) << __FUNCTION__; RTC_DLOG(LS_VERBOSE) << __FUNCTION__;
MutexLock lock(&mutex_); MutexLock lock(&mutex_);
@ -59,7 +59,7 @@ int32_t AudioMixerManagerLinuxALSA::CloseSpeaker() {
} }
int32_t AudioMixerManagerLinuxALSA::CloseSpeakerLocked() { int32_t AudioMixerManagerLinuxALSA::CloseSpeakerLocked() {
RTC_LOG(LS_VERBOSE) << __FUNCTION__; RTC_DLOG(LS_VERBOSE) << __FUNCTION__;
int errVal = 0; int errVal = 0;
@ -94,7 +94,7 @@ int32_t AudioMixerManagerLinuxALSA::CloseMicrophone() {
} }
int32_t AudioMixerManagerLinuxALSA::CloseMicrophoneLocked() { int32_t AudioMixerManagerLinuxALSA::CloseMicrophoneLocked() {
RTC_LOG(LS_VERBOSE) << __FUNCTION__; RTC_DLOG(LS_VERBOSE) << __FUNCTION__;
int errVal = 0; int errVal = 0;
@ -289,13 +289,13 @@ int32_t AudioMixerManagerLinuxALSA::OpenMicrophone(char* deviceName) {
} }
bool AudioMixerManagerLinuxALSA::SpeakerIsInitialized() const { bool AudioMixerManagerLinuxALSA::SpeakerIsInitialized() const {
RTC_LOG(LS_INFO) << __FUNCTION__; RTC_DLOG(LS_INFO) << __FUNCTION__;
return (_outputMixerHandle != NULL); return (_outputMixerHandle != NULL);
} }
bool AudioMixerManagerLinuxALSA::MicrophoneIsInitialized() const { bool AudioMixerManagerLinuxALSA::MicrophoneIsInitialized() const {
RTC_LOG(LS_INFO) << __FUNCTION__; RTC_DLOG(LS_INFO) << __FUNCTION__;
return (_inputMixerHandle != NULL); return (_inputMixerHandle != NULL);
} }

View File

@ -54,12 +54,12 @@ AudioMixerManagerLinuxPulse::AudioMixerManagerLinuxPulse()
_paSpeakerVolume(PA_VOLUME_NORM), _paSpeakerVolume(PA_VOLUME_NORM),
_paChannels(0), _paChannels(0),
_paObjectsSet(false) { _paObjectsSet(false) {
RTC_LOG(LS_INFO) << __FUNCTION__ << " created"; RTC_DLOG(LS_INFO) << __FUNCTION__ << " created";
} }
AudioMixerManagerLinuxPulse::~AudioMixerManagerLinuxPulse() { AudioMixerManagerLinuxPulse::~AudioMixerManagerLinuxPulse() {
RTC_DCHECK(thread_checker_.IsCurrent()); RTC_DCHECK(thread_checker_.IsCurrent());
RTC_LOG(LS_INFO) << __FUNCTION__ << " destroyed"; RTC_DLOG(LS_INFO) << __FUNCTION__ << " destroyed";
Close(); Close();
} }
@ -72,7 +72,7 @@ int32_t AudioMixerManagerLinuxPulse::SetPulseAudioObjects(
pa_threaded_mainloop* mainloop, pa_threaded_mainloop* mainloop,
pa_context* context) { pa_context* context) {
RTC_DCHECK(thread_checker_.IsCurrent()); RTC_DCHECK(thread_checker_.IsCurrent());
RTC_LOG(LS_VERBOSE) << __FUNCTION__; RTC_DLOG(LS_VERBOSE) << __FUNCTION__;
if (!mainloop || !context) { if (!mainloop || !context) {
RTC_LOG(LS_ERROR) << "could not set PulseAudio objects for mixer"; RTC_LOG(LS_ERROR) << "could not set PulseAudio objects for mixer";
@ -90,7 +90,7 @@ int32_t AudioMixerManagerLinuxPulse::SetPulseAudioObjects(
int32_t AudioMixerManagerLinuxPulse::Close() { int32_t AudioMixerManagerLinuxPulse::Close() {
RTC_DCHECK(thread_checker_.IsCurrent()); RTC_DCHECK(thread_checker_.IsCurrent());
RTC_LOG(LS_VERBOSE) << __FUNCTION__; RTC_DLOG(LS_VERBOSE) << __FUNCTION__;
CloseSpeaker(); CloseSpeaker();
CloseMicrophone(); CloseMicrophone();
@ -104,7 +104,7 @@ int32_t AudioMixerManagerLinuxPulse::Close() {
int32_t AudioMixerManagerLinuxPulse::CloseSpeaker() { int32_t AudioMixerManagerLinuxPulse::CloseSpeaker() {
RTC_DCHECK(thread_checker_.IsCurrent()); RTC_DCHECK(thread_checker_.IsCurrent());
RTC_LOG(LS_VERBOSE) << __FUNCTION__; RTC_DLOG(LS_VERBOSE) << __FUNCTION__;
// Reset the index to -1 // Reset the index to -1
_paOutputDeviceIndex = -1; _paOutputDeviceIndex = -1;
@ -115,7 +115,7 @@ int32_t AudioMixerManagerLinuxPulse::CloseSpeaker() {
int32_t AudioMixerManagerLinuxPulse::CloseMicrophone() { int32_t AudioMixerManagerLinuxPulse::CloseMicrophone() {
RTC_DCHECK(thread_checker_.IsCurrent()); RTC_DCHECK(thread_checker_.IsCurrent());
RTC_LOG(LS_VERBOSE) << __FUNCTION__; RTC_DLOG(LS_VERBOSE) << __FUNCTION__;
// Reset the index to -1 // Reset the index to -1
_paInputDeviceIndex = -1; _paInputDeviceIndex = -1;
@ -186,14 +186,14 @@ int32_t AudioMixerManagerLinuxPulse::OpenMicrophone(uint16_t deviceIndex) {
bool AudioMixerManagerLinuxPulse::SpeakerIsInitialized() const { bool AudioMixerManagerLinuxPulse::SpeakerIsInitialized() const {
RTC_DCHECK(thread_checker_.IsCurrent()); RTC_DCHECK(thread_checker_.IsCurrent());
RTC_LOG(LS_INFO) << __FUNCTION__; RTC_DLOG(LS_INFO) << __FUNCTION__;
return (_paOutputDeviceIndex != -1); return (_paOutputDeviceIndex != -1);
} }
bool AudioMixerManagerLinuxPulse::MicrophoneIsInitialized() const { bool AudioMixerManagerLinuxPulse::MicrophoneIsInitialized() const {
RTC_DCHECK(thread_checker_.IsCurrent()); RTC_DCHECK(thread_checker_.IsCurrent());
RTC_LOG(LS_INFO) << __FUNCTION__; RTC_DLOG(LS_INFO) << __FUNCTION__;
return (_paInputDeviceIndex != -1); return (_paInputDeviceIndex != -1);
} }

View File

@ -150,7 +150,7 @@ AudioDeviceMac::AudioDeviceMac()
_captureBufSizeSamples(0), _captureBufSizeSamples(0),
_renderBufSizeSamples(0), _renderBufSizeSamples(0),
prev_key_state_() { prev_key_state_() {
RTC_LOG(LS_INFO) << __FUNCTION__ << " created"; RTC_DLOG(LS_INFO) << __FUNCTION__ << " created";
memset(_renderConvertData, 0, sizeof(_renderConvertData)); memset(_renderConvertData, 0, sizeof(_renderConvertData));
memset(&_outStreamFormat, 0, sizeof(AudioStreamBasicDescription)); memset(&_outStreamFormat, 0, sizeof(AudioStreamBasicDescription));
@ -160,7 +160,7 @@ AudioDeviceMac::AudioDeviceMac()
} }
AudioDeviceMac::~AudioDeviceMac() { AudioDeviceMac::~AudioDeviceMac() {
RTC_LOG(LS_INFO) << __FUNCTION__ << " destroyed"; RTC_DLOG(LS_INFO) << __FUNCTION__ << " destroyed";
if (!_isShutDown) { if (!_isShutDown) {
Terminate(); Terminate();

View File

@ -46,11 +46,11 @@ AudioMixerManagerMac::AudioMixerManagerMac()
_outputDeviceID(kAudioObjectUnknown), _outputDeviceID(kAudioObjectUnknown),
_noInputChannels(0), _noInputChannels(0),
_noOutputChannels(0) { _noOutputChannels(0) {
RTC_LOG(LS_INFO) << __FUNCTION__ << " created"; RTC_DLOG(LS_INFO) << __FUNCTION__ << " created";
} }
AudioMixerManagerMac::~AudioMixerManagerMac() { AudioMixerManagerMac::~AudioMixerManagerMac() {
RTC_LOG(LS_INFO) << __FUNCTION__ << " destroyed"; RTC_DLOG(LS_INFO) << __FUNCTION__ << " destroyed";
Close(); Close();
} }
@ -59,7 +59,7 @@ AudioMixerManagerMac::~AudioMixerManagerMac() {
// ============================================================================ // ============================================================================
int32_t AudioMixerManagerMac::Close() { int32_t AudioMixerManagerMac::Close() {
RTC_LOG(LS_VERBOSE) << __FUNCTION__; RTC_DLOG(LS_VERBOSE) << __FUNCTION__;
MutexLock lock(&mutex_); MutexLock lock(&mutex_);
@ -75,7 +75,7 @@ int32_t AudioMixerManagerMac::CloseSpeaker() {
} }
int32_t AudioMixerManagerMac::CloseSpeakerLocked() { int32_t AudioMixerManagerMac::CloseSpeakerLocked() {
RTC_LOG(LS_VERBOSE) << __FUNCTION__; RTC_DLOG(LS_VERBOSE) << __FUNCTION__;
_outputDeviceID = kAudioObjectUnknown; _outputDeviceID = kAudioObjectUnknown;
_noOutputChannels = 0; _noOutputChannels = 0;
@ -89,7 +89,7 @@ int32_t AudioMixerManagerMac::CloseMicrophone() {
} }
int32_t AudioMixerManagerMac::CloseMicrophoneLocked() { int32_t AudioMixerManagerMac::CloseMicrophoneLocked() {
RTC_LOG(LS_VERBOSE) << __FUNCTION__; RTC_DLOG(LS_VERBOSE) << __FUNCTION__;
_inputDeviceID = kAudioObjectUnknown; _inputDeviceID = kAudioObjectUnknown;
_noInputChannels = 0; _noInputChannels = 0;
@ -196,13 +196,13 @@ int32_t AudioMixerManagerMac::OpenMicrophone(AudioDeviceID deviceID) {
} }
bool AudioMixerManagerMac::SpeakerIsInitialized() const { bool AudioMixerManagerMac::SpeakerIsInitialized() const {
RTC_LOG(LS_INFO) << __FUNCTION__; RTC_DLOG(LS_INFO) << __FUNCTION__;
return (_outputDeviceID != kAudioObjectUnknown); return (_outputDeviceID != kAudioObjectUnknown);
} }
bool AudioMixerManagerMac::MicrophoneIsInitialized() const { bool AudioMixerManagerMac::MicrophoneIsInitialized() const {
RTC_LOG(LS_INFO) << __FUNCTION__; RTC_DLOG(LS_INFO) << __FUNCTION__;
return (_inputDeviceID != kAudioObjectUnknown); return (_inputDeviceID != kAudioObjectUnknown);
} }

View File

@ -174,7 +174,7 @@ class MediaBufferImpl final : public IMediaBuffer {
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
bool AudioDeviceWindowsCore::CoreAudioIsSupported() { bool AudioDeviceWindowsCore::CoreAudioIsSupported() {
RTC_LOG(LS_VERBOSE) << __FUNCTION__; RTC_DLOG(LS_VERBOSE) << __FUNCTION__;
bool MMDeviceIsAvailable(false); bool MMDeviceIsAvailable(false);
bool coreAudioIsSupported(false); bool coreAudioIsSupported(false);
@ -395,7 +395,7 @@ AudioDeviceWindowsCore::AudioDeviceWindowsCore()
_outputDevice(AudioDeviceModule::kDefaultCommunicationDevice), _outputDevice(AudioDeviceModule::kDefaultCommunicationDevice),
_inputDeviceIndex(0), _inputDeviceIndex(0),
_outputDeviceIndex(0) { _outputDeviceIndex(0) {
RTC_LOG(LS_INFO) << __FUNCTION__ << " created"; RTC_DLOG(LS_INFO) << __FUNCTION__ << " created";
RTC_DCHECK(_comInit.Succeeded()); RTC_DCHECK(_comInit.Succeeded());
// Try to load the Avrt DLL // Try to load the Avrt DLL
@ -492,7 +492,7 @@ AudioDeviceWindowsCore::AudioDeviceWindowsCore()
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
AudioDeviceWindowsCore::~AudioDeviceWindowsCore() { AudioDeviceWindowsCore::~AudioDeviceWindowsCore() {
RTC_LOG(LS_INFO) << __FUNCTION__ << " destroyed"; RTC_DLOG(LS_INFO) << __FUNCTION__ << " destroyed";
Terminate(); Terminate();
@ -1347,7 +1347,7 @@ Exit:
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
int32_t AudioDeviceWindowsCore::MaxMicrophoneVolume(uint32_t& maxVolume) const { int32_t AudioDeviceWindowsCore::MaxMicrophoneVolume(uint32_t& maxVolume) const {
RTC_LOG(LS_VERBOSE) << __FUNCTION__; RTC_DLOG(LS_VERBOSE) << __FUNCTION__;
if (!_microphoneIsInitialized) { if (!_microphoneIsInitialized) {
return -1; return -1;
@ -3512,7 +3512,7 @@ int AudioDeviceWindowsCore::SetVtI4Property(IPropertyStore* ptrPS,
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
int32_t AudioDeviceWindowsCore::_RefreshDeviceList(EDataFlow dir) { int32_t AudioDeviceWindowsCore::_RefreshDeviceList(EDataFlow dir) {
RTC_LOG(LS_VERBOSE) << __FUNCTION__; RTC_DLOG(LS_VERBOSE) << __FUNCTION__;
HRESULT hr = S_OK; HRESULT hr = S_OK;
IMMDeviceCollection* pCollection = NULL; IMMDeviceCollection* pCollection = NULL;
@ -3548,7 +3548,7 @@ int32_t AudioDeviceWindowsCore::_RefreshDeviceList(EDataFlow dir) {
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
int16_t AudioDeviceWindowsCore::_DeviceListCount(EDataFlow dir) { int16_t AudioDeviceWindowsCore::_DeviceListCount(EDataFlow dir) {
RTC_LOG(LS_VERBOSE) << __FUNCTION__; RTC_DLOG(LS_VERBOSE) << __FUNCTION__;
HRESULT hr = S_OK; HRESULT hr = S_OK;
UINT count = 0; UINT count = 0;
@ -3584,7 +3584,7 @@ int32_t AudioDeviceWindowsCore::_GetListDeviceName(EDataFlow dir,
int index, int index,
LPWSTR szBuffer, LPWSTR szBuffer,
int bufferLen) { int bufferLen) {
RTC_LOG(LS_VERBOSE) << __FUNCTION__; RTC_DLOG(LS_VERBOSE) << __FUNCTION__;
HRESULT hr = S_OK; HRESULT hr = S_OK;
IMMDevice* pDevice = NULL; IMMDevice* pDevice = NULL;
@ -3621,7 +3621,7 @@ int32_t AudioDeviceWindowsCore::_GetDefaultDeviceName(EDataFlow dir,
ERole role, ERole role,
LPWSTR szBuffer, LPWSTR szBuffer,
int bufferLen) { int bufferLen) {
RTC_LOG(LS_VERBOSE) << __FUNCTION__; RTC_DLOG(LS_VERBOSE) << __FUNCTION__;
HRESULT hr = S_OK; HRESULT hr = S_OK;
IMMDevice* pDevice = NULL; IMMDevice* pDevice = NULL;
@ -3658,7 +3658,7 @@ int32_t AudioDeviceWindowsCore::_GetListDeviceID(EDataFlow dir,
int index, int index,
LPWSTR szBuffer, LPWSTR szBuffer,
int bufferLen) { int bufferLen) {
RTC_LOG(LS_VERBOSE) << __FUNCTION__; RTC_DLOG(LS_VERBOSE) << __FUNCTION__;
HRESULT hr = S_OK; HRESULT hr = S_OK;
IMMDevice* pDevice = NULL; IMMDevice* pDevice = NULL;
@ -3695,7 +3695,7 @@ int32_t AudioDeviceWindowsCore::_GetDefaultDeviceID(EDataFlow dir,
ERole role, ERole role,
LPWSTR szBuffer, LPWSTR szBuffer,
int bufferLen) { int bufferLen) {
RTC_LOG(LS_VERBOSE) << __FUNCTION__; RTC_DLOG(LS_VERBOSE) << __FUNCTION__;
HRESULT hr = S_OK; HRESULT hr = S_OK;
IMMDevice* pDevice = NULL; IMMDevice* pDevice = NULL;
@ -3720,7 +3720,7 @@ int32_t AudioDeviceWindowsCore::_GetDefaultDeviceID(EDataFlow dir,
int32_t AudioDeviceWindowsCore::_GetDefaultDeviceIndex(EDataFlow dir, int32_t AudioDeviceWindowsCore::_GetDefaultDeviceIndex(EDataFlow dir,
ERole role, ERole role,
int* index) { int* index) {
RTC_LOG(LS_VERBOSE) << __FUNCTION__; RTC_DLOG(LS_VERBOSE) << __FUNCTION__;
HRESULT hr = S_OK; HRESULT hr = S_OK;
WCHAR szDefaultDeviceID[MAX_PATH] = {0}; WCHAR szDefaultDeviceID[MAX_PATH] = {0};
@ -3793,7 +3793,7 @@ int32_t AudioDeviceWindowsCore::_GetDefaultDeviceIndex(EDataFlow dir,
int32_t AudioDeviceWindowsCore::_GetDeviceName(IMMDevice* pDevice, int32_t AudioDeviceWindowsCore::_GetDeviceName(IMMDevice* pDevice,
LPWSTR pszBuffer, LPWSTR pszBuffer,
int bufferLen) { int bufferLen) {
RTC_LOG(LS_VERBOSE) << __FUNCTION__; RTC_DLOG(LS_VERBOSE) << __FUNCTION__;
static const WCHAR szDefault[] = L"<Device not available>"; static const WCHAR szDefault[] = L"<Device not available>";
@ -3860,7 +3860,7 @@ int32_t AudioDeviceWindowsCore::_GetDeviceName(IMMDevice* pDevice,
int32_t AudioDeviceWindowsCore::_GetDeviceID(IMMDevice* pDevice, int32_t AudioDeviceWindowsCore::_GetDeviceID(IMMDevice* pDevice,
LPWSTR pszBuffer, LPWSTR pszBuffer,
int bufferLen) { int bufferLen) {
RTC_LOG(LS_VERBOSE) << __FUNCTION__; RTC_DLOG(LS_VERBOSE) << __FUNCTION__;
static const WCHAR szDefault[] = L"<Device not available>"; static const WCHAR szDefault[] = L"<Device not available>";
@ -3893,7 +3893,7 @@ int32_t AudioDeviceWindowsCore::_GetDeviceID(IMMDevice* pDevice,
int32_t AudioDeviceWindowsCore::_GetDefaultDevice(EDataFlow dir, int32_t AudioDeviceWindowsCore::_GetDefaultDevice(EDataFlow dir,
ERole role, ERole role,
IMMDevice** ppDevice) { IMMDevice** ppDevice) {
RTC_LOG(LS_VERBOSE) << __FUNCTION__; RTC_DLOG(LS_VERBOSE) << __FUNCTION__;
HRESULT hr(S_OK); HRESULT hr(S_OK);
@ -3947,7 +3947,7 @@ int32_t AudioDeviceWindowsCore::_GetListDevice(EDataFlow dir,
int32_t AudioDeviceWindowsCore::_EnumerateEndpointDevicesAll( int32_t AudioDeviceWindowsCore::_EnumerateEndpointDevicesAll(
EDataFlow dataFlow) const { EDataFlow dataFlow) const {
RTC_LOG(LS_VERBOSE) << __FUNCTION__; RTC_DLOG(LS_VERBOSE) << __FUNCTION__;
assert(_ptrEnumerator != NULL); assert(_ptrEnumerator != NULL);

View File

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

View File

@ -42,8 +42,6 @@ int32_t DeviceInfoLinux::Init() {
DeviceInfoLinux::~DeviceInfoLinux() {} DeviceInfoLinux::~DeviceInfoLinux() {}
uint32_t DeviceInfoLinux::NumberOfDevices() { uint32_t DeviceInfoLinux::NumberOfDevices() {
RTC_LOG(LS_INFO) << __FUNCTION__;
uint32_t count = 0; uint32_t count = 0;
char device[20]; char device[20];
int fd = -1; int fd = -1;
@ -75,8 +73,6 @@ int32_t DeviceInfoLinux::GetDeviceName(uint32_t deviceNumber,
uint32_t deviceUniqueIdUTF8Length, uint32_t deviceUniqueIdUTF8Length,
char* /*productUniqueIdUTF8*/, char* /*productUniqueIdUTF8*/,
uint32_t /*productUniqueIdUTF8Length*/) { uint32_t /*productUniqueIdUTF8Length*/) {
RTC_LOG(LS_INFO) << __FUNCTION__;
// Travel through /dev/video [0-63] // Travel through /dev/video [0-63]
uint32_t count = 0; uint32_t count = 0;
char device[20]; char device[20];

View File

@ -72,7 +72,7 @@ DeviceInfoDS::DeviceInfoDS()
// Details: hr = 0x80010106 <=> "Cannot change thread mode after it is // Details: hr = 0x80010106 <=> "Cannot change thread mode after it is
// set". // set".
// //
RTC_LOG(LS_INFO) << __FUNCTION__ RTC_DLOG(LS_INFO) << __FUNCTION__
<< ": CoInitializeEx(NULL, COINIT_APARTMENTTHREADED)" << ": CoInitializeEx(NULL, COINIT_APARTMENTTHREADED)"
" => RPC_E_CHANGED_MODE, error 0x" " => RPC_E_CHANGED_MODE, error 0x"
<< rtc::ToHex(hr); << rtc::ToHex(hr);
@ -203,7 +203,7 @@ int32_t DeviceInfoDS::GetDeviceInfo(uint32_t deviceNumber,
} }
} }
if (deviceNameLength) { if (deviceNameLength) {
RTC_LOG(LS_INFO) << __FUNCTION__ << " " << deviceNameUTF8; RTC_DLOG(LS_INFO) << __FUNCTION__ << " " << deviceNameUTF8;
} }
return index; return index;
} }

View File

@ -57,7 +57,7 @@ void GetDefaultAudioParameters(JNIEnv* env,
rtc::scoped_refptr<AudioDeviceModule> CreateAAudioAudioDeviceModule( rtc::scoped_refptr<AudioDeviceModule> CreateAAudioAudioDeviceModule(
JNIEnv* env, JNIEnv* env,
jobject application_context) { jobject application_context) {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
// Get default audio input/output parameters. // Get default audio input/output parameters.
AudioParameters input_parameters; AudioParameters input_parameters;
AudioParameters output_parameters; AudioParameters output_parameters;
@ -76,7 +76,7 @@ rtc::scoped_refptr<AudioDeviceModule> CreateAAudioAudioDeviceModule(
rtc::scoped_refptr<AudioDeviceModule> CreateJavaAudioDeviceModule( rtc::scoped_refptr<AudioDeviceModule> CreateJavaAudioDeviceModule(
JNIEnv* env, JNIEnv* env,
jobject application_context) { jobject application_context) {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
// Get default audio input/output parameters. // Get default audio input/output parameters.
const JavaParamRef<jobject> j_context(application_context); const JavaParamRef<jobject> j_context(application_context);
const ScopedJavaLocalRef<jobject> j_audio_manager = const ScopedJavaLocalRef<jobject> j_audio_manager =
@ -104,7 +104,7 @@ rtc::scoped_refptr<AudioDeviceModule> CreateJavaAudioDeviceModule(
rtc::scoped_refptr<AudioDeviceModule> CreateOpenSLESAudioDeviceModule( rtc::scoped_refptr<AudioDeviceModule> CreateOpenSLESAudioDeviceModule(
JNIEnv* env, JNIEnv* env,
jobject application_context) { jobject application_context) {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
// Get default audio input/output parameters. // Get default audio input/output parameters.
AudioParameters input_parameters; AudioParameters input_parameters;
AudioParameters output_parameters; AudioParameters output_parameters;
@ -127,7 +127,7 @@ rtc::scoped_refptr<AudioDeviceModule> CreateOpenSLESAudioDeviceModule(
rtc::scoped_refptr<AudioDeviceModule> rtc::scoped_refptr<AudioDeviceModule>
CreateJavaInputAndOpenSLESOutputAudioDeviceModule(JNIEnv* env, CreateJavaInputAndOpenSLESOutputAudioDeviceModule(JNIEnv* env,
jobject application_context) { jobject application_context) {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
// Get default audio input/output parameters. // Get default audio input/output parameters.
const JavaParamRef<jobject> j_context(application_context); const JavaParamRef<jobject> j_context(application_context);
const ScopedJavaLocalRef<jobject> j_audio_manager = const ScopedJavaLocalRef<jobject> j_audio_manager =

View File

@ -70,26 +70,26 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
initialized_(false) { initialized_(false) {
RTC_CHECK(input_); RTC_CHECK(input_);
RTC_CHECK(output_); RTC_CHECK(output_);
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
thread_checker_.Detach(); thread_checker_.Detach();
} }
~AndroidAudioDeviceModule() override { RTC_LOG(INFO) << __FUNCTION__; } ~AndroidAudioDeviceModule() override { RTC_DLOG(INFO) << __FUNCTION__; }
int32_t ActiveAudioLayer( int32_t ActiveAudioLayer(
AudioDeviceModule::AudioLayer* audioLayer) const override { AudioDeviceModule::AudioLayer* audioLayer) const override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
*audioLayer = audio_layer_; *audioLayer = audio_layer_;
return 0; return 0;
} }
int32_t RegisterAudioCallback(AudioTransport* audioCallback) override { int32_t RegisterAudioCallback(AudioTransport* audioCallback) override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
return audio_device_buffer_->RegisterAudioCallback(audioCallback); return audio_device_buffer_->RegisterAudioCallback(audioCallback);
} }
int32_t Init() override { int32_t Init() override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
RTC_DCHECK(thread_checker_.IsCurrent()); RTC_DCHECK(thread_checker_.IsCurrent());
audio_device_buffer_ = audio_device_buffer_ =
std::make_unique<AudioDeviceBuffer>(task_queue_factory_.get()); std::make_unique<AudioDeviceBuffer>(task_queue_factory_.get());
@ -118,7 +118,7 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
} }
int32_t Terminate() override { int32_t Terminate() override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
if (!initialized_) if (!initialized_)
return 0; return 0;
RTC_DCHECK(thread_checker_.IsCurrent()); RTC_DCHECK(thread_checker_.IsCurrent());
@ -132,19 +132,19 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
} }
bool Initialized() const override { bool Initialized() const override {
RTC_LOG(INFO) << __FUNCTION__ << ":" << initialized_; RTC_DLOG(INFO) << __FUNCTION__ << ":" << initialized_;
return initialized_; return initialized_;
} }
int16_t PlayoutDevices() override { int16_t PlayoutDevices() override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
RTC_LOG(INFO) << "output: " << 1; RTC_LOG(INFO) << "output: " << 1;
return 1; return 1;
} }
int16_t RecordingDevices() override { int16_t RecordingDevices() override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
RTC_LOG(INFO) << "output: " << 1; RTC_DLOG(INFO) << "output: " << 1;
return 1; return 1;
} }
@ -163,7 +163,7 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
int32_t SetPlayoutDevice(uint16_t index) override { int32_t SetPlayoutDevice(uint16_t index) override {
// OK to use but it has no effect currently since device selection is // OK to use but it has no effect currently since device selection is
// done using Andoid APIs instead. // done using Andoid APIs instead.
RTC_LOG(INFO) << __FUNCTION__ << "(" << index << ")"; RTC_DLOG(INFO) << __FUNCTION__ << "(" << index << ")";
return 0; return 0;
} }
@ -175,7 +175,7 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
int32_t SetRecordingDevice(uint16_t index) override { int32_t SetRecordingDevice(uint16_t index) override {
// OK to use but it has no effect currently since device selection is // OK to use but it has no effect currently since device selection is
// done using Andoid APIs instead. // done using Andoid APIs instead.
RTC_LOG(INFO) << __FUNCTION__ << "(" << index << ")"; RTC_DLOG(INFO) << __FUNCTION__ << "(" << index << ")";
return 0; return 0;
} }
@ -185,66 +185,66 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
} }
int32_t PlayoutIsAvailable(bool* available) override { int32_t PlayoutIsAvailable(bool* available) override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
*available = true; *available = true;
RTC_LOG(INFO) << "output: " << *available; RTC_DLOG(INFO) << "output: " << *available;
return 0; return 0;
} }
int32_t InitPlayout() override { int32_t InitPlayout() override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
if (!initialized_) if (!initialized_)
return -1; return -1;
if (PlayoutIsInitialized()) { if (PlayoutIsInitialized()) {
return 0; return 0;
} }
int32_t result = output_->InitPlayout(); int32_t result = output_->InitPlayout();
RTC_LOG(INFO) << "output: " << result; RTC_DLOG(INFO) << "output: " << result;
RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.InitPlayoutSuccess", RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.InitPlayoutSuccess",
static_cast<int>(result == 0)); static_cast<int>(result == 0));
return result; return result;
} }
bool PlayoutIsInitialized() const override { bool PlayoutIsInitialized() const override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
return output_->PlayoutIsInitialized(); return output_->PlayoutIsInitialized();
} }
int32_t RecordingIsAvailable(bool* available) override { int32_t RecordingIsAvailable(bool* available) override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
*available = true; *available = true;
RTC_LOG(INFO) << "output: " << *available; RTC_DLOG(INFO) << "output: " << *available;
return 0; return 0;
} }
int32_t InitRecording() override { int32_t InitRecording() override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
if (!initialized_) if (!initialized_)
return -1; return -1;
if (RecordingIsInitialized()) { if (RecordingIsInitialized()) {
return 0; return 0;
} }
int32_t result = input_->InitRecording(); int32_t result = input_->InitRecording();
RTC_LOG(INFO) << "output: " << result; RTC_DLOG(INFO) << "output: " << result;
RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.InitRecordingSuccess", RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.InitRecordingSuccess",
static_cast<int>(result == 0)); static_cast<int>(result == 0));
return result; return result;
} }
bool RecordingIsInitialized() const override { bool RecordingIsInitialized() const override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
return input_->RecordingIsInitialized(); return input_->RecordingIsInitialized();
} }
int32_t StartPlayout() override { int32_t StartPlayout() override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
if (!initialized_) if (!initialized_)
return -1; return -1;
if (Playing()) { if (Playing()) {
return 0; return 0;
} }
int32_t result = output_->StartPlayout(); int32_t result = output_->StartPlayout();
RTC_LOG(INFO) << "output: " << result; RTC_DLOG(INFO) << "output: " << result;
RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StartPlayoutSuccess", RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StartPlayoutSuccess",
static_cast<int>(result == 0)); static_cast<int>(result == 0));
if (result == 0) { if (result == 0) {
@ -256,7 +256,7 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
} }
int32_t StopPlayout() override { int32_t StopPlayout() override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
if (!initialized_) if (!initialized_)
return -1; return -1;
if (!Playing()) if (!Playing())
@ -264,26 +264,26 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
RTC_LOG(INFO) << __FUNCTION__; RTC_LOG(INFO) << __FUNCTION__;
audio_device_buffer_->StopPlayout(); audio_device_buffer_->StopPlayout();
int32_t result = output_->StopPlayout(); int32_t result = output_->StopPlayout();
RTC_LOG(INFO) << "output: " << result; RTC_DLOG(INFO) << "output: " << result;
RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StopPlayoutSuccess", RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StopPlayoutSuccess",
static_cast<int>(result == 0)); static_cast<int>(result == 0));
return result; return result;
} }
bool Playing() const override { bool Playing() const override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
return output_->Playing(); return output_->Playing();
} }
int32_t StartRecording() override { int32_t StartRecording() override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
if (!initialized_) if (!initialized_)
return -1; return -1;
if (Recording()) { if (Recording()) {
return 0; return 0;
} }
int32_t result = input_->StartRecording(); int32_t result = input_->StartRecording();
RTC_LOG(INFO) << "output: " << result; RTC_DLOG(INFO) << "output: " << result;
RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StartRecordingSuccess", RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StartRecordingSuccess",
static_cast<int>(result == 0)); static_cast<int>(result == 0));
if (result == 0) { if (result == 0) {
@ -295,74 +295,74 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
} }
int32_t StopRecording() override { int32_t StopRecording() override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
if (!initialized_) if (!initialized_)
return -1; return -1;
if (!Recording()) if (!Recording())
return 0; return 0;
audio_device_buffer_->StopRecording(); audio_device_buffer_->StopRecording();
int32_t result = input_->StopRecording(); int32_t result = input_->StopRecording();
RTC_LOG(INFO) << "output: " << result; RTC_DLOG(INFO) << "output: " << result;
RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StopRecordingSuccess", RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StopRecordingSuccess",
static_cast<int>(result == 0)); static_cast<int>(result == 0));
return result; return result;
} }
bool Recording() const override { bool Recording() const override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
return input_->Recording(); return input_->Recording();
} }
int32_t InitSpeaker() override { int32_t InitSpeaker() override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
return initialized_ ? 0 : -1; return initialized_ ? 0 : -1;
} }
bool SpeakerIsInitialized() const override { bool SpeakerIsInitialized() const override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
return initialized_; return initialized_;
} }
int32_t InitMicrophone() override { int32_t InitMicrophone() override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
return initialized_ ? 0 : -1; return initialized_ ? 0 : -1;
} }
bool MicrophoneIsInitialized() const override { bool MicrophoneIsInitialized() const override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
return initialized_; return initialized_;
} }
int32_t SpeakerVolumeIsAvailable(bool* available) override { int32_t SpeakerVolumeIsAvailable(bool* available) override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
if (!initialized_) if (!initialized_)
return -1; return -1;
*available = output_->SpeakerVolumeIsAvailable(); *available = output_->SpeakerVolumeIsAvailable();
RTC_LOG(INFO) << "output: " << *available; RTC_DLOG(INFO) << "output: " << *available;
return 0; return 0;
} }
int32_t SetSpeakerVolume(uint32_t volume) override { int32_t SetSpeakerVolume(uint32_t volume) override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
if (!initialized_) if (!initialized_)
return -1; return -1;
return output_->SetSpeakerVolume(volume); return output_->SetSpeakerVolume(volume);
} }
int32_t SpeakerVolume(uint32_t* output_volume) const override { int32_t SpeakerVolume(uint32_t* output_volume) const override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
if (!initialized_) if (!initialized_)
return -1; return -1;
absl::optional<uint32_t> volume = output_->SpeakerVolume(); absl::optional<uint32_t> volume = output_->SpeakerVolume();
if (!volume) if (!volume)
return -1; return -1;
*output_volume = *volume; *output_volume = *volume;
RTC_LOG(INFO) << "output: " << *volume; RTC_DLOG(INFO) << "output: " << *volume;
return 0; return 0;
} }
int32_t MaxSpeakerVolume(uint32_t* output_max_volume) const override { int32_t MaxSpeakerVolume(uint32_t* output_max_volume) const override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
if (!initialized_) if (!initialized_)
return -1; return -1;
absl::optional<uint32_t> max_volume = output_->MaxSpeakerVolume(); absl::optional<uint32_t> max_volume = output_->MaxSpeakerVolume();
@ -373,7 +373,7 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
} }
int32_t MinSpeakerVolume(uint32_t* output_min_volume) const override { int32_t MinSpeakerVolume(uint32_t* output_min_volume) const override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
if (!initialized_) if (!initialized_)
return -1; return -1;
absl::optional<uint32_t> min_volume = output_->MinSpeakerVolume(); absl::optional<uint32_t> min_volume = output_->MinSpeakerVolume();
@ -384,71 +384,71 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
} }
int32_t MicrophoneVolumeIsAvailable(bool* available) override { int32_t MicrophoneVolumeIsAvailable(bool* available) override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
*available = false; *available = false;
RTC_LOG(INFO) << "output: " << *available; RTC_DLOG(INFO) << "output: " << *available;
return -1; return -1;
} }
int32_t SetMicrophoneVolume(uint32_t volume) override { int32_t SetMicrophoneVolume(uint32_t volume) override {
RTC_LOG(INFO) << __FUNCTION__ << "(" << volume << ")"; RTC_DLOG(INFO) << __FUNCTION__ << "(" << volume << ")";
RTC_CHECK_NOTREACHED(); RTC_CHECK_NOTREACHED();
} }
int32_t MicrophoneVolume(uint32_t* volume) const override { int32_t MicrophoneVolume(uint32_t* volume) const override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
RTC_CHECK_NOTREACHED(); RTC_CHECK_NOTREACHED();
} }
int32_t MaxMicrophoneVolume(uint32_t* maxVolume) const override { int32_t MaxMicrophoneVolume(uint32_t* maxVolume) const override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
RTC_CHECK_NOTREACHED(); RTC_CHECK_NOTREACHED();
} }
int32_t MinMicrophoneVolume(uint32_t* minVolume) const override { int32_t MinMicrophoneVolume(uint32_t* minVolume) const override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
RTC_CHECK_NOTREACHED(); RTC_CHECK_NOTREACHED();
} }
int32_t SpeakerMuteIsAvailable(bool* available) override { int32_t SpeakerMuteIsAvailable(bool* available) override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
RTC_CHECK_NOTREACHED(); RTC_CHECK_NOTREACHED();
} }
int32_t SetSpeakerMute(bool enable) override { int32_t SetSpeakerMute(bool enable) override {
RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; RTC_DLOG(INFO) << __FUNCTION__ << "(" << enable << ")";
RTC_CHECK_NOTREACHED(); RTC_CHECK_NOTREACHED();
} }
int32_t SpeakerMute(bool* enabled) const override { int32_t SpeakerMute(bool* enabled) const override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
RTC_CHECK_NOTREACHED(); RTC_CHECK_NOTREACHED();
} }
int32_t MicrophoneMuteIsAvailable(bool* available) override { int32_t MicrophoneMuteIsAvailable(bool* available) override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
RTC_CHECK_NOTREACHED(); RTC_CHECK_NOTREACHED();
} }
int32_t SetMicrophoneMute(bool enable) override { int32_t SetMicrophoneMute(bool enable) override {
RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; RTC_DLOG(INFO) << __FUNCTION__ << "(" << enable << ")";
RTC_CHECK_NOTREACHED(); RTC_CHECK_NOTREACHED();
} }
int32_t MicrophoneMute(bool* enabled) const override { int32_t MicrophoneMute(bool* enabled) const override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
RTC_CHECK_NOTREACHED(); RTC_CHECK_NOTREACHED();
} }
int32_t StereoPlayoutIsAvailable(bool* available) const override { int32_t StereoPlayoutIsAvailable(bool* available) const override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
*available = is_stereo_playout_supported_; *available = is_stereo_playout_supported_;
RTC_LOG(INFO) << "output: " << *available; RTC_DLOG(INFO) << "output: " << *available;
return 0; return 0;
} }
int32_t SetStereoPlayout(bool enable) override { int32_t SetStereoPlayout(bool enable) override {
RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; RTC_DLOG(INFO) << __FUNCTION__ << "(" << enable << ")";
// Android does not support changes between mono and stero on the fly. The // Android does not support changes between mono and stero on the fly. The
// use of stereo or mono is determined by the audio layer. It is allowed // use of stereo or mono is determined by the audio layer. It is allowed
// to call this method if that same state is not modified. // to call this method if that same state is not modified.
@ -461,21 +461,21 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
} }
int32_t StereoPlayout(bool* enabled) const override { int32_t StereoPlayout(bool* enabled) const override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
*enabled = is_stereo_playout_supported_; *enabled = is_stereo_playout_supported_;
RTC_LOG(INFO) << "output: " << *enabled; RTC_DLOG(INFO) << "output: " << *enabled;
return 0; return 0;
} }
int32_t StereoRecordingIsAvailable(bool* available) const override { int32_t StereoRecordingIsAvailable(bool* available) const override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
*available = is_stereo_record_supported_; *available = is_stereo_record_supported_;
RTC_LOG(INFO) << "output: " << *available; RTC_DLOG(INFO) << "output: " << *available;
return 0; return 0;
} }
int32_t SetStereoRecording(bool enable) override { int32_t SetStereoRecording(bool enable) override {
RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; RTC_DLOG(INFO) << __FUNCTION__ << "(" << enable << ")";
// Android does not support changes between mono and stero on the fly. The // Android does not support changes between mono and stero on the fly. The
// use of stereo or mono is determined by the audio layer. It is allowed // use of stereo or mono is determined by the audio layer. It is allowed
// to call this method if that same state is not modified. // to call this method if that same state is not modified.
@ -488,9 +488,9 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
} }
int32_t StereoRecording(bool* enabled) const override { int32_t StereoRecording(bool* enabled) const override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
*enabled = is_stereo_record_supported_; *enabled = is_stereo_record_supported_;
RTC_LOG(INFO) << "output: " << *enabled; RTC_DLOG(INFO) << "output: " << *enabled;
return 0; return 0;
} }
@ -514,18 +514,18 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
// a "Not Implemented" log will be filed. This non-perfect state will remain // 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. // until I have added full support for audio effects based on OpenSL ES APIs.
bool BuiltInAECIsAvailable() const override { bool BuiltInAECIsAvailable() const override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
if (!initialized_) if (!initialized_)
return false; return false;
bool isAvailable = input_->IsAcousticEchoCancelerSupported(); bool isAvailable = input_->IsAcousticEchoCancelerSupported();
RTC_LOG(INFO) << "output: " << isAvailable; RTC_DLOG(INFO) << "output: " << isAvailable;
return isAvailable; return isAvailable;
} }
// Not implemented for any input device on Android. // Not implemented for any input device on Android.
bool BuiltInAGCIsAvailable() const override { bool BuiltInAGCIsAvailable() const override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
RTC_LOG(INFO) << "output: " << false; RTC_DLOG(INFO) << "output: " << false;
return false; return false;
} }
@ -534,38 +534,38 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
// TODO(henrika): add implementation for OpenSL ES based audio as well. // TODO(henrika): add implementation for OpenSL ES based audio as well.
// In addition, see comments for BuiltInAECIsAvailable(). // In addition, see comments for BuiltInAECIsAvailable().
bool BuiltInNSIsAvailable() const override { bool BuiltInNSIsAvailable() const override {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
if (!initialized_) if (!initialized_)
return false; return false;
bool isAvailable = input_->IsNoiseSuppressorSupported(); bool isAvailable = input_->IsNoiseSuppressorSupported();
RTC_LOG(INFO) << "output: " << isAvailable; RTC_DLOG(INFO) << "output: " << isAvailable;
return isAvailable; return isAvailable;
} }
// TODO(henrika): add implementation for OpenSL ES based audio as well. // TODO(henrika): add implementation for OpenSL ES based audio as well.
int32_t EnableBuiltInAEC(bool enable) override { int32_t EnableBuiltInAEC(bool enable) override {
RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; RTC_DLOG(INFO) << __FUNCTION__ << "(" << enable << ")";
if (!initialized_) if (!initialized_)
return -1; return -1;
RTC_CHECK(BuiltInAECIsAvailable()) << "HW AEC is not available"; RTC_CHECK(BuiltInAECIsAvailable()) << "HW AEC is not available";
int32_t result = input_->EnableBuiltInAEC(enable); int32_t result = input_->EnableBuiltInAEC(enable);
RTC_LOG(INFO) << "output: " << result; RTC_DLOG(INFO) << "output: " << result;
return result; return result;
} }
int32_t EnableBuiltInAGC(bool enable) override { int32_t EnableBuiltInAGC(bool enable) override {
RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; RTC_DLOG(INFO) << __FUNCTION__ << "(" << enable << ")";
RTC_CHECK_NOTREACHED(); RTC_CHECK_NOTREACHED();
} }
// TODO(henrika): add implementation for OpenSL ES based audio as well. // TODO(henrika): add implementation for OpenSL ES based audio as well.
int32_t EnableBuiltInNS(bool enable) override { int32_t EnableBuiltInNS(bool enable) override {
RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; RTC_DLOG(INFO) << __FUNCTION__ << "(" << enable << ")";
if (!initialized_) if (!initialized_)
return -1; return -1;
RTC_CHECK(BuiltInNSIsAvailable()) << "HW NS is not available"; RTC_CHECK(BuiltInNSIsAvailable()) << "HW NS is not available";
int32_t result = input_->EnableBuiltInNS(enable); int32_t result = input_->EnableBuiltInNS(enable);
RTC_LOG(INFO) << "output: " << result; RTC_DLOG(INFO) << "output: " << result;
return result; return result;
} }
@ -576,7 +576,7 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
} }
int32_t AttachAudioBuffer() { int32_t AttachAudioBuffer() {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
output_->AttachAudioBuffer(audio_device_buffer_.get()); output_->AttachAudioBuffer(audio_device_buffer_.get());
input_->AttachAudioBuffer(audio_device_buffer_.get()); input_->AttachAudioBuffer(audio_device_buffer_.get());
return 0; return 0;
@ -640,7 +640,7 @@ rtc::scoped_refptr<AudioDeviceModule> CreateAudioDeviceModuleFromInputAndOutput(
uint16_t playout_delay_ms, uint16_t playout_delay_ms,
std::unique_ptr<AudioInput> audio_input, std::unique_ptr<AudioInput> audio_input,
std::unique_ptr<AudioOutput> audio_output) { std::unique_ptr<AudioOutput> audio_output) {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
return new rtc::RefCountedObject<AndroidAudioDeviceModule>( return new rtc::RefCountedObject<AndroidAudioDeviceModule>(
audio_layer, is_stereo_playout_supported, is_stereo_record_supported, audio_layer, is_stereo_playout_supported, is_stereo_record_supported,
playout_delay_ms, std::move(audio_input), std::move(audio_output)); playout_delay_ms, std::move(audio_input), std::move(audio_output));

View File

@ -18,7 +18,7 @@
namespace webrtc { namespace webrtc {
rtc::scoped_refptr<AudioDeviceModule> CreateAudioDeviceModule(bool bypass_voice_processing) { rtc::scoped_refptr<AudioDeviceModule> CreateAudioDeviceModule(bool bypass_voice_processing) {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
#if defined(WEBRTC_IOS) #if defined(WEBRTC_IOS)
return new rtc::RefCountedObject<ios_adm::AudioDeviceModuleIOS>(bypass_voice_processing); return new rtc::RefCountedObject<ios_adm::AudioDeviceModuleIOS>(bypass_voice_processing);
#else #else

View File

@ -19,7 +19,7 @@
namespace webrtc { namespace webrtc {
std::unique_ptr<rtc::NetworkMonitorFactory> CreateNetworkMonitorFactory() { std::unique_ptr<rtc::NetworkMonitorFactory> CreateNetworkMonitorFactory() {
RTC_LOG(LS_INFO) << __FUNCTION__; RTC_DLOG(LS_INFO) << __FUNCTION__;
#if defined(WEBRTC_IOS) #if defined(WEBRTC_IOS)
return std::make_unique<ObjCNetworkMonitorFactory>(); return std::make_unique<ObjCNetworkMonitorFactory>();
#else #else

View File

@ -48,17 +48,17 @@ AudioDeviceModuleIOS::AudioDeviceModuleIOS(bool bypass_voice_processing)
} }
int32_t AudioDeviceModuleIOS::AttachAudioBuffer() { int32_t AudioDeviceModuleIOS::AttachAudioBuffer() {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
audio_device_->AttachAudioBuffer(audio_device_buffer_.get()); audio_device_->AttachAudioBuffer(audio_device_buffer_.get());
return 0; return 0;
} }
AudioDeviceModuleIOS::~AudioDeviceModuleIOS() { AudioDeviceModuleIOS::~AudioDeviceModuleIOS() {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
} }
int32_t AudioDeviceModuleIOS::ActiveAudioLayer(AudioLayer* audioLayer) const { int32_t AudioDeviceModuleIOS::ActiveAudioLayer(AudioLayer* audioLayer) const {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
AudioLayer activeAudio; AudioLayer activeAudio;
if (audio_device_->ActiveAudioLayer(activeAudio) == -1) { if (audio_device_->ActiveAudioLayer(activeAudio) == -1) {
return -1; return -1;
@ -68,7 +68,7 @@ AudioDeviceModuleIOS::AudioDeviceModuleIOS(bool bypass_voice_processing)
} }
int32_t AudioDeviceModuleIOS::Init() { int32_t AudioDeviceModuleIOS::Init() {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
if (initialized_) if (initialized_)
return 0; return 0;
@ -91,7 +91,7 @@ AudioDeviceModuleIOS::AudioDeviceModuleIOS(bool bypass_voice_processing)
} }
int32_t AudioDeviceModuleIOS::Terminate() { int32_t AudioDeviceModuleIOS::Terminate() {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
if (!initialized_) if (!initialized_)
return 0; return 0;
if (audio_device_->Terminate() == -1) { if (audio_device_->Terminate() == -1) {
@ -102,65 +102,65 @@ AudioDeviceModuleIOS::AudioDeviceModuleIOS(bool bypass_voice_processing)
} }
bool AudioDeviceModuleIOS::Initialized() const { bool AudioDeviceModuleIOS::Initialized() const {
RTC_LOG(INFO) << __FUNCTION__ << ": " << initialized_; RTC_DLOG(INFO) << __FUNCTION__ << ": " << initialized_;
return initialized_; return initialized_;
} }
int32_t AudioDeviceModuleIOS::InitSpeaker() { int32_t AudioDeviceModuleIOS::InitSpeaker() {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
CHECKinitialized_(); CHECKinitialized_();
return audio_device_->InitSpeaker(); return audio_device_->InitSpeaker();
} }
int32_t AudioDeviceModuleIOS::InitMicrophone() { int32_t AudioDeviceModuleIOS::InitMicrophone() {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
CHECKinitialized_(); CHECKinitialized_();
return audio_device_->InitMicrophone(); return audio_device_->InitMicrophone();
} }
int32_t AudioDeviceModuleIOS::SpeakerVolumeIsAvailable(bool* available) { int32_t AudioDeviceModuleIOS::SpeakerVolumeIsAvailable(bool* available) {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
CHECKinitialized_(); CHECKinitialized_();
bool isAvailable = false; bool isAvailable = false;
if (audio_device_->SpeakerVolumeIsAvailable(isAvailable) == -1) { if (audio_device_->SpeakerVolumeIsAvailable(isAvailable) == -1) {
return -1; return -1;
} }
*available = isAvailable; *available = isAvailable;
RTC_LOG(INFO) << "output: " << isAvailable; RTC_DLOG(INFO) << "output: " << isAvailable;
return 0; return 0;
} }
int32_t AudioDeviceModuleIOS::SetSpeakerVolume(uint32_t volume) { int32_t AudioDeviceModuleIOS::SetSpeakerVolume(uint32_t volume) {
RTC_LOG(INFO) << __FUNCTION__ << "(" << volume << ")"; RTC_DLOG(INFO) << __FUNCTION__ << "(" << volume << ")";
CHECKinitialized_(); CHECKinitialized_();
return audio_device_->SetSpeakerVolume(volume); return audio_device_->SetSpeakerVolume(volume);
} }
int32_t AudioDeviceModuleIOS::SpeakerVolume(uint32_t* volume) const { int32_t AudioDeviceModuleIOS::SpeakerVolume(uint32_t* volume) const {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
CHECKinitialized_(); CHECKinitialized_();
uint32_t level = 0; uint32_t level = 0;
if (audio_device_->SpeakerVolume(level) == -1) { if (audio_device_->SpeakerVolume(level) == -1) {
return -1; return -1;
} }
*volume = level; *volume = level;
RTC_LOG(INFO) << "output: " << *volume; RTC_DLOG(INFO) << "output: " << *volume;
return 0; return 0;
} }
bool AudioDeviceModuleIOS::SpeakerIsInitialized() const { bool AudioDeviceModuleIOS::SpeakerIsInitialized() const {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
CHECKinitialized__BOOL(); CHECKinitialized__BOOL();
bool isInitialized = audio_device_->SpeakerIsInitialized(); bool isInitialized = audio_device_->SpeakerIsInitialized();
RTC_LOG(INFO) << "output: " << isInitialized; RTC_DLOG(INFO) << "output: " << isInitialized;
return isInitialized; return isInitialized;
} }
bool AudioDeviceModuleIOS::MicrophoneIsInitialized() const { bool AudioDeviceModuleIOS::MicrophoneIsInitialized() const {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
CHECKinitialized__BOOL(); CHECKinitialized__BOOL();
bool isInitialized = audio_device_->MicrophoneIsInitialized(); bool isInitialized = audio_device_->MicrophoneIsInitialized();
RTC_LOG(INFO) << "output: " << isInitialized; RTC_DLOG(INFO) << "output: " << isInitialized;
return isInitialized; return isInitialized;
} }
@ -185,110 +185,110 @@ AudioDeviceModuleIOS::AudioDeviceModuleIOS(bool bypass_voice_processing)
} }
int32_t AudioDeviceModuleIOS::SpeakerMuteIsAvailable(bool* available) { int32_t AudioDeviceModuleIOS::SpeakerMuteIsAvailable(bool* available) {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
CHECKinitialized_(); CHECKinitialized_();
bool isAvailable = false; bool isAvailable = false;
if (audio_device_->SpeakerMuteIsAvailable(isAvailable) == -1) { if (audio_device_->SpeakerMuteIsAvailable(isAvailable) == -1) {
return -1; return -1;
} }
*available = isAvailable; *available = isAvailable;
RTC_LOG(INFO) << "output: " << isAvailable; RTC_DLOG(INFO) << "output: " << isAvailable;
return 0; return 0;
} }
int32_t AudioDeviceModuleIOS::SetSpeakerMute(bool enable) { int32_t AudioDeviceModuleIOS::SetSpeakerMute(bool enable) {
RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; RTC_DLOG(INFO) << __FUNCTION__ << "(" << enable << ")";
CHECKinitialized_(); CHECKinitialized_();
return audio_device_->SetSpeakerMute(enable); return audio_device_->SetSpeakerMute(enable);
} }
int32_t AudioDeviceModuleIOS::SpeakerMute(bool* enabled) const { int32_t AudioDeviceModuleIOS::SpeakerMute(bool* enabled) const {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
CHECKinitialized_(); CHECKinitialized_();
bool muted = false; bool muted = false;
if (audio_device_->SpeakerMute(muted) == -1) { if (audio_device_->SpeakerMute(muted) == -1) {
return -1; return -1;
} }
*enabled = muted; *enabled = muted;
RTC_LOG(INFO) << "output: " << muted; RTC_DLOG(INFO) << "output: " << muted;
return 0; return 0;
} }
int32_t AudioDeviceModuleIOS::MicrophoneMuteIsAvailable(bool* available) { int32_t AudioDeviceModuleIOS::MicrophoneMuteIsAvailable(bool* available) {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
CHECKinitialized_(); CHECKinitialized_();
bool isAvailable = false; bool isAvailable = false;
if (audio_device_->MicrophoneMuteIsAvailable(isAvailable) == -1) { if (audio_device_->MicrophoneMuteIsAvailable(isAvailable) == -1) {
return -1; return -1;
} }
*available = isAvailable; *available = isAvailable;
RTC_LOG(INFO) << "output: " << isAvailable; RTC_DLOG(INFO) << "output: " << isAvailable;
return 0; return 0;
} }
int32_t AudioDeviceModuleIOS::SetMicrophoneMute(bool enable) { int32_t AudioDeviceModuleIOS::SetMicrophoneMute(bool enable) {
RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; RTC_DLOG(INFO) << __FUNCTION__ << "(" << enable << ")";
CHECKinitialized_(); CHECKinitialized_();
return (audio_device_->SetMicrophoneMute(enable)); return (audio_device_->SetMicrophoneMute(enable));
} }
int32_t AudioDeviceModuleIOS::MicrophoneMute(bool* enabled) const { int32_t AudioDeviceModuleIOS::MicrophoneMute(bool* enabled) const {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
CHECKinitialized_(); CHECKinitialized_();
bool muted = false; bool muted = false;
if (audio_device_->MicrophoneMute(muted) == -1) { if (audio_device_->MicrophoneMute(muted) == -1) {
return -1; return -1;
} }
*enabled = muted; *enabled = muted;
RTC_LOG(INFO) << "output: " << muted; RTC_DLOG(INFO) << "output: " << muted;
return 0; return 0;
} }
int32_t AudioDeviceModuleIOS::MicrophoneVolumeIsAvailable(bool* available) { int32_t AudioDeviceModuleIOS::MicrophoneVolumeIsAvailable(bool* available) {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
CHECKinitialized_(); CHECKinitialized_();
bool isAvailable = false; bool isAvailable = false;
if (audio_device_->MicrophoneVolumeIsAvailable(isAvailable) == -1) { if (audio_device_->MicrophoneVolumeIsAvailable(isAvailable) == -1) {
return -1; return -1;
} }
*available = isAvailable; *available = isAvailable;
RTC_LOG(INFO) << "output: " << isAvailable; RTC_DLOG(INFO) << "output: " << isAvailable;
return 0; return 0;
} }
int32_t AudioDeviceModuleIOS::SetMicrophoneVolume(uint32_t volume) { int32_t AudioDeviceModuleIOS::SetMicrophoneVolume(uint32_t volume) {
RTC_LOG(INFO) << __FUNCTION__ << "(" << volume << ")"; RTC_DLOG(INFO) << __FUNCTION__ << "(" << volume << ")";
CHECKinitialized_(); CHECKinitialized_();
return (audio_device_->SetMicrophoneVolume(volume)); return (audio_device_->SetMicrophoneVolume(volume));
} }
int32_t AudioDeviceModuleIOS::MicrophoneVolume(uint32_t* volume) const { int32_t AudioDeviceModuleIOS::MicrophoneVolume(uint32_t* volume) const {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
CHECKinitialized_(); CHECKinitialized_();
uint32_t level = 0; uint32_t level = 0;
if (audio_device_->MicrophoneVolume(level) == -1) { if (audio_device_->MicrophoneVolume(level) == -1) {
return -1; return -1;
} }
*volume = level; *volume = level;
RTC_LOG(INFO) << "output: " << *volume; RTC_DLOG(INFO) << "output: " << *volume;
return 0; return 0;
} }
int32_t AudioDeviceModuleIOS::StereoRecordingIsAvailable( int32_t AudioDeviceModuleIOS::StereoRecordingIsAvailable(
bool* available) const { bool* available) const {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
CHECKinitialized_(); CHECKinitialized_();
bool isAvailable = false; bool isAvailable = false;
if (audio_device_->StereoRecordingIsAvailable(isAvailable) == -1) { if (audio_device_->StereoRecordingIsAvailable(isAvailable) == -1) {
return -1; return -1;
} }
*available = isAvailable; *available = isAvailable;
RTC_LOG(INFO) << "output: " << isAvailable; RTC_DLOG(INFO) << "output: " << isAvailable;
return 0; return 0;
} }
int32_t AudioDeviceModuleIOS::SetStereoRecording(bool enable) { int32_t AudioDeviceModuleIOS::SetStereoRecording(bool enable) {
RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; RTC_DLOG(INFO) << __FUNCTION__ << "(" << enable << ")";
CHECKinitialized_(); CHECKinitialized_();
if (enable) { if (enable) {
RTC_LOG(WARNING) << "recording in stereo is not supported"; RTC_LOG(WARNING) << "recording in stereo is not supported";
@ -297,31 +297,31 @@ AudioDeviceModuleIOS::AudioDeviceModuleIOS(bool bypass_voice_processing)
} }
int32_t AudioDeviceModuleIOS::StereoRecording(bool* enabled) const { int32_t AudioDeviceModuleIOS::StereoRecording(bool* enabled) const {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
CHECKinitialized_(); CHECKinitialized_();
bool stereo = false; bool stereo = false;
if (audio_device_->StereoRecording(stereo) == -1) { if (audio_device_->StereoRecording(stereo) == -1) {
return -1; return -1;
} }
*enabled = stereo; *enabled = stereo;
RTC_LOG(INFO) << "output: " << stereo; RTC_DLOG(INFO) << "output: " << stereo;
return 0; return 0;
} }
int32_t AudioDeviceModuleIOS::StereoPlayoutIsAvailable(bool* available) const { int32_t AudioDeviceModuleIOS::StereoPlayoutIsAvailable(bool* available) const {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
CHECKinitialized_(); CHECKinitialized_();
bool isAvailable = false; bool isAvailable = false;
if (audio_device_->StereoPlayoutIsAvailable(isAvailable) == -1) { if (audio_device_->StereoPlayoutIsAvailable(isAvailable) == -1) {
return -1; return -1;
} }
*available = isAvailable; *available = isAvailable;
RTC_LOG(INFO) << "output: " << isAvailable; RTC_DLOG(INFO) << "output: " << isAvailable;
return 0; return 0;
} }
int32_t AudioDeviceModuleIOS::SetStereoPlayout(bool enable) { int32_t AudioDeviceModuleIOS::SetStereoPlayout(bool enable) {
RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; RTC_DLOG(INFO) << __FUNCTION__ << "(" << enable << ")";
CHECKinitialized_(); CHECKinitialized_();
if (audio_device_->PlayoutIsInitialized()) { if (audio_device_->PlayoutIsInitialized()) {
RTC_LOG(LERROR) RTC_LOG(LERROR)
@ -341,38 +341,38 @@ AudioDeviceModuleIOS::AudioDeviceModuleIOS(bool bypass_voice_processing)
} }
int32_t AudioDeviceModuleIOS::StereoPlayout(bool* enabled) const { int32_t AudioDeviceModuleIOS::StereoPlayout(bool* enabled) const {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
CHECKinitialized_(); CHECKinitialized_();
bool stereo = false; bool stereo = false;
if (audio_device_->StereoPlayout(stereo) == -1) { if (audio_device_->StereoPlayout(stereo) == -1) {
return -1; return -1;
} }
*enabled = stereo; *enabled = stereo;
RTC_LOG(INFO) << "output: " << stereo; RTC_DLOG(INFO) << "output: " << stereo;
return 0; return 0;
} }
int32_t AudioDeviceModuleIOS::PlayoutIsAvailable(bool* available) { int32_t AudioDeviceModuleIOS::PlayoutIsAvailable(bool* available) {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
CHECKinitialized_(); CHECKinitialized_();
bool isAvailable = false; bool isAvailable = false;
if (audio_device_->PlayoutIsAvailable(isAvailable) == -1) { if (audio_device_->PlayoutIsAvailable(isAvailable) == -1) {
return -1; return -1;
} }
*available = isAvailable; *available = isAvailable;
RTC_LOG(INFO) << "output: " << isAvailable; RTC_DLOG(INFO) << "output: " << isAvailable;
return 0; return 0;
} }
int32_t AudioDeviceModuleIOS::RecordingIsAvailable(bool* available) { int32_t AudioDeviceModuleIOS::RecordingIsAvailable(bool* available) {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
CHECKinitialized_(); CHECKinitialized_();
bool isAvailable = false; bool isAvailable = false;
if (audio_device_->RecordingIsAvailable(isAvailable) == -1) { if (audio_device_->RecordingIsAvailable(isAvailable) == -1) {
return -1; return -1;
} }
*available = isAvailable; *available = isAvailable;
RTC_LOG(INFO) << "output: " << isAvailable; RTC_DLOG(INFO) << "output: " << isAvailable;
return 0; return 0;
} }
@ -397,21 +397,21 @@ AudioDeviceModuleIOS::AudioDeviceModuleIOS(bool bypass_voice_processing)
} }
int16_t AudioDeviceModuleIOS::PlayoutDevices() { int16_t AudioDeviceModuleIOS::PlayoutDevices() {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
CHECKinitialized_(); CHECKinitialized_();
uint16_t nPlayoutDevices = audio_device_->PlayoutDevices(); uint16_t nPlayoutDevices = audio_device_->PlayoutDevices();
RTC_LOG(INFO) << "output: " << nPlayoutDevices; RTC_DLOG(INFO) << "output: " << nPlayoutDevices;
return (int16_t)(nPlayoutDevices); return (int16_t)(nPlayoutDevices);
} }
int32_t AudioDeviceModuleIOS::SetPlayoutDevice(uint16_t index) { int32_t AudioDeviceModuleIOS::SetPlayoutDevice(uint16_t index) {
RTC_LOG(INFO) << __FUNCTION__ << "(" << index << ")"; RTC_DLOG(INFO) << __FUNCTION__ << "(" << index << ")";
CHECKinitialized_(); CHECKinitialized_();
return audio_device_->SetPlayoutDevice(index); return audio_device_->SetPlayoutDevice(index);
} }
int32_t AudioDeviceModuleIOS::SetPlayoutDevice(WindowsDeviceType device) { int32_t AudioDeviceModuleIOS::SetPlayoutDevice(WindowsDeviceType device) {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
CHECKinitialized_(); CHECKinitialized_();
return audio_device_->SetPlayoutDevice(device); return audio_device_->SetPlayoutDevice(device);
} }
@ -420,7 +420,7 @@ AudioDeviceModuleIOS::AudioDeviceModuleIOS(bool bypass_voice_processing)
uint16_t index, uint16_t index,
char name[kAdmMaxDeviceNameSize], char name[kAdmMaxDeviceNameSize],
char guid[kAdmMaxGuidSize]) { char guid[kAdmMaxGuidSize]) {
RTC_LOG(INFO) << __FUNCTION__ << "(" << index << ", ...)"; RTC_DLOG(INFO) << __FUNCTION__ << "(" << index << ", ...)";
CHECKinitialized_(); CHECKinitialized_();
if (name == NULL) { if (name == NULL) {
return -1; return -1;
@ -429,10 +429,10 @@ AudioDeviceModuleIOS::AudioDeviceModuleIOS(bool bypass_voice_processing)
return -1; return -1;
} }
if (name != NULL) { if (name != NULL) {
RTC_LOG(INFO) << "output: name = " << name; RTC_DLOG(INFO) << "output: name = " << name;
} }
if (guid != NULL) { if (guid != NULL) {
RTC_LOG(INFO) << "output: guid = " << guid; RTC_DLOG(INFO) << "output: guid = " << guid;
} }
return 0; return 0;
} }
@ -441,7 +441,7 @@ AudioDeviceModuleIOS::AudioDeviceModuleIOS(bool bypass_voice_processing)
uint16_t index, uint16_t index,
char name[kAdmMaxDeviceNameSize], char name[kAdmMaxDeviceNameSize],
char guid[kAdmMaxGuidSize]) { char guid[kAdmMaxGuidSize]) {
RTC_LOG(INFO) << __FUNCTION__ << "(" << index << ", ...)"; RTC_DLOG(INFO) << __FUNCTION__ << "(" << index << ", ...)";
CHECKinitialized_(); CHECKinitialized_();
if (name == NULL) { if (name == NULL) {
return -1; return -1;
@ -450,137 +450,137 @@ AudioDeviceModuleIOS::AudioDeviceModuleIOS(bool bypass_voice_processing)
return -1; return -1;
} }
if (name != NULL) { if (name != NULL) {
RTC_LOG(INFO) << "output: name = " << name; RTC_DLOG(INFO) << "output: name = " << name;
} }
if (guid != NULL) { if (guid != NULL) {
RTC_LOG(INFO) << "output: guid = " << guid; RTC_DLOG(INFO) << "output: guid = " << guid;
} }
return 0; return 0;
} }
int16_t AudioDeviceModuleIOS::RecordingDevices() { int16_t AudioDeviceModuleIOS::RecordingDevices() {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
CHECKinitialized_(); CHECKinitialized_();
uint16_t nRecordingDevices = audio_device_->RecordingDevices(); uint16_t nRecordingDevices = audio_device_->RecordingDevices();
RTC_LOG(INFO) << "output: " << nRecordingDevices; RTC_DLOG(INFO) << "output: " << nRecordingDevices;
return (int16_t)nRecordingDevices; return (int16_t)nRecordingDevices;
} }
int32_t AudioDeviceModuleIOS::SetRecordingDevice(uint16_t index) { int32_t AudioDeviceModuleIOS::SetRecordingDevice(uint16_t index) {
RTC_LOG(INFO) << __FUNCTION__ << "(" << index << ")"; RTC_DLOG(INFO) << __FUNCTION__ << "(" << index << ")";
CHECKinitialized_(); CHECKinitialized_();
return audio_device_->SetRecordingDevice(index); return audio_device_->SetRecordingDevice(index);
} }
int32_t AudioDeviceModuleIOS::SetRecordingDevice(WindowsDeviceType device) { int32_t AudioDeviceModuleIOS::SetRecordingDevice(WindowsDeviceType device) {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
CHECKinitialized_(); CHECKinitialized_();
return audio_device_->SetRecordingDevice(device); return audio_device_->SetRecordingDevice(device);
} }
int32_t AudioDeviceModuleIOS::InitPlayout() { int32_t AudioDeviceModuleIOS::InitPlayout() {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
CHECKinitialized_(); CHECKinitialized_();
if (PlayoutIsInitialized()) { if (PlayoutIsInitialized()) {
return 0; return 0;
} }
int32_t result = audio_device_->InitPlayout(); int32_t result = audio_device_->InitPlayout();
RTC_LOG(INFO) << "output: " << result; RTC_DLOG(INFO) << "output: " << result;
RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.InitPlayoutSuccess", RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.InitPlayoutSuccess",
static_cast<int>(result == 0)); static_cast<int>(result == 0));
return result; return result;
} }
int32_t AudioDeviceModuleIOS::InitRecording() { int32_t AudioDeviceModuleIOS::InitRecording() {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
CHECKinitialized_(); CHECKinitialized_();
if (RecordingIsInitialized()) { if (RecordingIsInitialized()) {
return 0; return 0;
} }
int32_t result = audio_device_->InitRecording(); int32_t result = audio_device_->InitRecording();
RTC_LOG(INFO) << "output: " << result; RTC_DLOG(INFO) << "output: " << result;
RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.InitRecordingSuccess", RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.InitRecordingSuccess",
static_cast<int>(result == 0)); static_cast<int>(result == 0));
return result; return result;
} }
bool AudioDeviceModuleIOS::PlayoutIsInitialized() const { bool AudioDeviceModuleIOS::PlayoutIsInitialized() const {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
CHECKinitialized__BOOL(); CHECKinitialized__BOOL();
return audio_device_->PlayoutIsInitialized(); return audio_device_->PlayoutIsInitialized();
} }
bool AudioDeviceModuleIOS::RecordingIsInitialized() const { bool AudioDeviceModuleIOS::RecordingIsInitialized() const {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
CHECKinitialized__BOOL(); CHECKinitialized__BOOL();
return audio_device_->RecordingIsInitialized(); return audio_device_->RecordingIsInitialized();
} }
int32_t AudioDeviceModuleIOS::StartPlayout() { int32_t AudioDeviceModuleIOS::StartPlayout() {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
CHECKinitialized_(); CHECKinitialized_();
if (Playing()) { if (Playing()) {
return 0; return 0;
} }
audio_device_buffer_.get()->StartPlayout(); audio_device_buffer_.get()->StartPlayout();
int32_t result = audio_device_->StartPlayout(); int32_t result = audio_device_->StartPlayout();
RTC_LOG(INFO) << "output: " << result; RTC_DLOG(INFO) << "output: " << result;
RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StartPlayoutSuccess", RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StartPlayoutSuccess",
static_cast<int>(result == 0)); static_cast<int>(result == 0));
return result; return result;
} }
int32_t AudioDeviceModuleIOS::StopPlayout() { int32_t AudioDeviceModuleIOS::StopPlayout() {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
CHECKinitialized_(); CHECKinitialized_();
int32_t result = audio_device_->StopPlayout(); int32_t result = audio_device_->StopPlayout();
audio_device_buffer_.get()->StopPlayout(); audio_device_buffer_.get()->StopPlayout();
RTC_LOG(INFO) << "output: " << result; RTC_DLOG(INFO) << "output: " << result;
RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StopPlayoutSuccess", RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StopPlayoutSuccess",
static_cast<int>(result == 0)); static_cast<int>(result == 0));
return result; return result;
} }
bool AudioDeviceModuleIOS::Playing() const { bool AudioDeviceModuleIOS::Playing() const {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
CHECKinitialized__BOOL(); CHECKinitialized__BOOL();
return audio_device_->Playing(); return audio_device_->Playing();
} }
int32_t AudioDeviceModuleIOS::StartRecording() { int32_t AudioDeviceModuleIOS::StartRecording() {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
CHECKinitialized_(); CHECKinitialized_();
if (Recording()) { if (Recording()) {
return 0; return 0;
} }
audio_device_buffer_.get()->StartRecording(); audio_device_buffer_.get()->StartRecording();
int32_t result = audio_device_->StartRecording(); int32_t result = audio_device_->StartRecording();
RTC_LOG(INFO) << "output: " << result; RTC_DLOG(INFO) << "output: " << result;
RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StartRecordingSuccess", RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StartRecordingSuccess",
static_cast<int>(result == 0)); static_cast<int>(result == 0));
return result; return result;
} }
int32_t AudioDeviceModuleIOS::StopRecording() { int32_t AudioDeviceModuleIOS::StopRecording() {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
CHECKinitialized_(); CHECKinitialized_();
int32_t result = audio_device_->StopRecording(); int32_t result = audio_device_->StopRecording();
audio_device_buffer_.get()->StopRecording(); audio_device_buffer_.get()->StopRecording();
RTC_LOG(INFO) << "output: " << result; RTC_DLOG(INFO) << "output: " << result;
RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StopRecordingSuccess", RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StopRecordingSuccess",
static_cast<int>(result == 0)); static_cast<int>(result == 0));
return result; return result;
} }
bool AudioDeviceModuleIOS::Recording() const { bool AudioDeviceModuleIOS::Recording() const {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
CHECKinitialized__BOOL(); CHECKinitialized__BOOL();
return audio_device_->Recording(); return audio_device_->Recording();
} }
int32_t AudioDeviceModuleIOS::RegisterAudioCallback( int32_t AudioDeviceModuleIOS::RegisterAudioCallback(
AudioTransport* audioCallback) { AudioTransport* audioCallback) {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
return audio_device_buffer_.get()->RegisterAudioCallback(audioCallback); return audio_device_buffer_.get()->RegisterAudioCallback(audioCallback);
} }
@ -596,50 +596,50 @@ AudioDeviceModuleIOS::AudioDeviceModuleIOS(bool bypass_voice_processing)
} }
bool AudioDeviceModuleIOS::BuiltInAECIsAvailable() const { bool AudioDeviceModuleIOS::BuiltInAECIsAvailable() const {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
CHECKinitialized__BOOL(); CHECKinitialized__BOOL();
bool isAvailable = audio_device_->BuiltInAECIsAvailable(); bool isAvailable = audio_device_->BuiltInAECIsAvailable();
RTC_LOG(INFO) << "output: " << isAvailable; RTC_DLOG(INFO) << "output: " << isAvailable;
return isAvailable; return isAvailable;
} }
int32_t AudioDeviceModuleIOS::EnableBuiltInAEC(bool enable) { int32_t AudioDeviceModuleIOS::EnableBuiltInAEC(bool enable) {
RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; RTC_DLOG(INFO) << __FUNCTION__ << "(" << enable << ")";
CHECKinitialized_(); CHECKinitialized_();
int32_t ok = audio_device_->EnableBuiltInAEC(enable); int32_t ok = audio_device_->EnableBuiltInAEC(enable);
RTC_LOG(INFO) << "output: " << ok; RTC_DLOG(INFO) << "output: " << ok;
return ok; return ok;
} }
bool AudioDeviceModuleIOS::BuiltInAGCIsAvailable() const { bool AudioDeviceModuleIOS::BuiltInAGCIsAvailable() const {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
CHECKinitialized__BOOL(); CHECKinitialized__BOOL();
bool isAvailable = audio_device_->BuiltInAGCIsAvailable(); bool isAvailable = audio_device_->BuiltInAGCIsAvailable();
RTC_LOG(INFO) << "output: " << isAvailable; RTC_DLOG(INFO) << "output: " << isAvailable;
return isAvailable; return isAvailable;
} }
int32_t AudioDeviceModuleIOS::EnableBuiltInAGC(bool enable) { int32_t AudioDeviceModuleIOS::EnableBuiltInAGC(bool enable) {
RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; RTC_DLOG(INFO) << __FUNCTION__ << "(" << enable << ")";
CHECKinitialized_(); CHECKinitialized_();
int32_t ok = audio_device_->EnableBuiltInAGC(enable); int32_t ok = audio_device_->EnableBuiltInAGC(enable);
RTC_LOG(INFO) << "output: " << ok; RTC_DLOG(INFO) << "output: " << ok;
return ok; return ok;
} }
bool AudioDeviceModuleIOS::BuiltInNSIsAvailable() const { bool AudioDeviceModuleIOS::BuiltInNSIsAvailable() const {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
CHECKinitialized__BOOL(); CHECKinitialized__BOOL();
bool isAvailable = audio_device_->BuiltInNSIsAvailable(); bool isAvailable = audio_device_->BuiltInNSIsAvailable();
RTC_LOG(INFO) << "output: " << isAvailable; RTC_DLOG(INFO) << "output: " << isAvailable;
return isAvailable; return isAvailable;
} }
int32_t AudioDeviceModuleIOS::EnableBuiltInNS(bool enable) { int32_t AudioDeviceModuleIOS::EnableBuiltInNS(bool enable) {
RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")"; RTC_DLOG(INFO) << __FUNCTION__ << "(" << enable << ")";
CHECKinitialized_(); CHECKinitialized_();
int32_t ok = audio_device_->EnableBuiltInNS(enable); int32_t ok = audio_device_->EnableBuiltInNS(enable);
RTC_LOG(INFO) << "output: " << ok; RTC_DLOG(INFO) << "output: " << ok;
return ok; return ok;
} }
@ -653,17 +653,17 @@ AudioDeviceModuleIOS::AudioDeviceModuleIOS(bool bypass_voice_processing)
#if defined(WEBRTC_IOS) #if defined(WEBRTC_IOS)
int AudioDeviceModuleIOS::GetPlayoutAudioParameters( int AudioDeviceModuleIOS::GetPlayoutAudioParameters(
AudioParameters* params) const { AudioParameters* params) const {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
int r = audio_device_->GetPlayoutAudioParameters(params); int r = audio_device_->GetPlayoutAudioParameters(params);
RTC_LOG(INFO) << "output: " << r; RTC_DLOG(INFO) << "output: " << r;
return r; return r;
} }
int AudioDeviceModuleIOS::GetRecordAudioParameters( int AudioDeviceModuleIOS::GetRecordAudioParameters(
AudioParameters* params) const { AudioParameters* params) const {
RTC_LOG(INFO) << __FUNCTION__; RTC_DLOG(INFO) << __FUNCTION__;
int r = audio_device_->GetRecordAudioParameters(params); int r = audio_device_->GetRecordAudioParameters(params);
RTC_LOG(INFO) << "output: " << r; RTC_DLOG(INFO) << "output: " << r;
return r; return r;
} }
#endif // WEBRTC_IOS #endif // WEBRTC_IOS