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:
committed by
Commit Bot
parent
70f9e249d5
commit
3b68aa346a
@ -57,7 +57,7 @@ void GetDefaultAudioParameters(JNIEnv* env,
|
||||
rtc::scoped_refptr<AudioDeviceModule> CreateAAudioAudioDeviceModule(
|
||||
JNIEnv* env,
|
||||
jobject application_context) {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
// Get default audio input/output parameters.
|
||||
AudioParameters input_parameters;
|
||||
AudioParameters output_parameters;
|
||||
@ -76,7 +76,7 @@ rtc::scoped_refptr<AudioDeviceModule> CreateAAudioAudioDeviceModule(
|
||||
rtc::scoped_refptr<AudioDeviceModule> CreateJavaAudioDeviceModule(
|
||||
JNIEnv* env,
|
||||
jobject application_context) {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
// Get default audio input/output parameters.
|
||||
const JavaParamRef<jobject> j_context(application_context);
|
||||
const ScopedJavaLocalRef<jobject> j_audio_manager =
|
||||
@ -104,7 +104,7 @@ rtc::scoped_refptr<AudioDeviceModule> CreateJavaAudioDeviceModule(
|
||||
rtc::scoped_refptr<AudioDeviceModule> CreateOpenSLESAudioDeviceModule(
|
||||
JNIEnv* env,
|
||||
jobject application_context) {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
// Get default audio input/output parameters.
|
||||
AudioParameters input_parameters;
|
||||
AudioParameters output_parameters;
|
||||
@ -127,7 +127,7 @@ rtc::scoped_refptr<AudioDeviceModule> CreateOpenSLESAudioDeviceModule(
|
||||
rtc::scoped_refptr<AudioDeviceModule>
|
||||
CreateJavaInputAndOpenSLESOutputAudioDeviceModule(JNIEnv* env,
|
||||
jobject application_context) {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
// Get default audio input/output parameters.
|
||||
const JavaParamRef<jobject> j_context(application_context);
|
||||
const ScopedJavaLocalRef<jobject> j_audio_manager =
|
||||
|
||||
@ -70,26 +70,26 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
|
||||
initialized_(false) {
|
||||
RTC_CHECK(input_);
|
||||
RTC_CHECK(output_);
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
thread_checker_.Detach();
|
||||
}
|
||||
|
||||
~AndroidAudioDeviceModule() override { RTC_LOG(INFO) << __FUNCTION__; }
|
||||
~AndroidAudioDeviceModule() override { RTC_DLOG(INFO) << __FUNCTION__; }
|
||||
|
||||
int32_t ActiveAudioLayer(
|
||||
AudioDeviceModule::AudioLayer* audioLayer) const override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
*audioLayer = audio_layer_;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t RegisterAudioCallback(AudioTransport* audioCallback) override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
return audio_device_buffer_->RegisterAudioCallback(audioCallback);
|
||||
}
|
||||
|
||||
int32_t Init() override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
RTC_DCHECK(thread_checker_.IsCurrent());
|
||||
audio_device_buffer_ =
|
||||
std::make_unique<AudioDeviceBuffer>(task_queue_factory_.get());
|
||||
@ -118,7 +118,7 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
|
||||
}
|
||||
|
||||
int32_t Terminate() override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
if (!initialized_)
|
||||
return 0;
|
||||
RTC_DCHECK(thread_checker_.IsCurrent());
|
||||
@ -132,19 +132,19 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
|
||||
}
|
||||
|
||||
bool Initialized() const override {
|
||||
RTC_LOG(INFO) << __FUNCTION__ << ":" << initialized_;
|
||||
RTC_DLOG(INFO) << __FUNCTION__ << ":" << initialized_;
|
||||
return initialized_;
|
||||
}
|
||||
|
||||
int16_t PlayoutDevices() override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
RTC_LOG(INFO) << "output: " << 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int16_t RecordingDevices() override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_LOG(INFO) << "output: " << 1;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << "output: " << 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -163,7 +163,7 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
|
||||
int32_t SetPlayoutDevice(uint16_t index) override {
|
||||
// OK to use but it has no effect currently since device selection is
|
||||
// done using Andoid APIs instead.
|
||||
RTC_LOG(INFO) << __FUNCTION__ << "(" << index << ")";
|
||||
RTC_DLOG(INFO) << __FUNCTION__ << "(" << index << ")";
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -175,7 +175,7 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
|
||||
int32_t SetRecordingDevice(uint16_t index) override {
|
||||
// OK to use but it has no effect currently since device selection is
|
||||
// done using Andoid APIs instead.
|
||||
RTC_LOG(INFO) << __FUNCTION__ << "(" << index << ")";
|
||||
RTC_DLOG(INFO) << __FUNCTION__ << "(" << index << ")";
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -185,66 +185,66 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
|
||||
}
|
||||
|
||||
int32_t PlayoutIsAvailable(bool* available) override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
*available = true;
|
||||
RTC_LOG(INFO) << "output: " << *available;
|
||||
RTC_DLOG(INFO) << "output: " << *available;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t InitPlayout() override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
if (!initialized_)
|
||||
return -1;
|
||||
if (PlayoutIsInitialized()) {
|
||||
return 0;
|
||||
}
|
||||
int32_t result = output_->InitPlayout();
|
||||
RTC_LOG(INFO) << "output: " << result;
|
||||
RTC_DLOG(INFO) << "output: " << result;
|
||||
RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.InitPlayoutSuccess",
|
||||
static_cast<int>(result == 0));
|
||||
return result;
|
||||
}
|
||||
|
||||
bool PlayoutIsInitialized() const override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
return output_->PlayoutIsInitialized();
|
||||
}
|
||||
|
||||
int32_t RecordingIsAvailable(bool* available) override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
*available = true;
|
||||
RTC_LOG(INFO) << "output: " << *available;
|
||||
RTC_DLOG(INFO) << "output: " << *available;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t InitRecording() override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
if (!initialized_)
|
||||
return -1;
|
||||
if (RecordingIsInitialized()) {
|
||||
return 0;
|
||||
}
|
||||
int32_t result = input_->InitRecording();
|
||||
RTC_LOG(INFO) << "output: " << result;
|
||||
RTC_DLOG(INFO) << "output: " << result;
|
||||
RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.InitRecordingSuccess",
|
||||
static_cast<int>(result == 0));
|
||||
return result;
|
||||
}
|
||||
|
||||
bool RecordingIsInitialized() const override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
return input_->RecordingIsInitialized();
|
||||
}
|
||||
|
||||
int32_t StartPlayout() override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
if (!initialized_)
|
||||
return -1;
|
||||
if (Playing()) {
|
||||
return 0;
|
||||
}
|
||||
int32_t result = output_->StartPlayout();
|
||||
RTC_LOG(INFO) << "output: " << result;
|
||||
RTC_DLOG(INFO) << "output: " << result;
|
||||
RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StartPlayoutSuccess",
|
||||
static_cast<int>(result == 0));
|
||||
if (result == 0) {
|
||||
@ -256,7 +256,7 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
|
||||
}
|
||||
|
||||
int32_t StopPlayout() override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
if (!initialized_)
|
||||
return -1;
|
||||
if (!Playing())
|
||||
@ -264,26 +264,26 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
audio_device_buffer_->StopPlayout();
|
||||
int32_t result = output_->StopPlayout();
|
||||
RTC_LOG(INFO) << "output: " << result;
|
||||
RTC_DLOG(INFO) << "output: " << result;
|
||||
RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StopPlayoutSuccess",
|
||||
static_cast<int>(result == 0));
|
||||
return result;
|
||||
}
|
||||
|
||||
bool Playing() const override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
return output_->Playing();
|
||||
}
|
||||
|
||||
int32_t StartRecording() override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
if (!initialized_)
|
||||
return -1;
|
||||
if (Recording()) {
|
||||
return 0;
|
||||
}
|
||||
int32_t result = input_->StartRecording();
|
||||
RTC_LOG(INFO) << "output: " << result;
|
||||
RTC_DLOG(INFO) << "output: " << result;
|
||||
RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StartRecordingSuccess",
|
||||
static_cast<int>(result == 0));
|
||||
if (result == 0) {
|
||||
@ -295,74 +295,74 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
|
||||
}
|
||||
|
||||
int32_t StopRecording() override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
if (!initialized_)
|
||||
return -1;
|
||||
if (!Recording())
|
||||
return 0;
|
||||
audio_device_buffer_->StopRecording();
|
||||
int32_t result = input_->StopRecording();
|
||||
RTC_LOG(INFO) << "output: " << result;
|
||||
RTC_DLOG(INFO) << "output: " << result;
|
||||
RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StopRecordingSuccess",
|
||||
static_cast<int>(result == 0));
|
||||
return result;
|
||||
}
|
||||
|
||||
bool Recording() const override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
return input_->Recording();
|
||||
}
|
||||
|
||||
int32_t InitSpeaker() override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
return initialized_ ? 0 : -1;
|
||||
}
|
||||
|
||||
bool SpeakerIsInitialized() const override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
return initialized_;
|
||||
}
|
||||
|
||||
int32_t InitMicrophone() override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
return initialized_ ? 0 : -1;
|
||||
}
|
||||
|
||||
bool MicrophoneIsInitialized() const override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
return initialized_;
|
||||
}
|
||||
|
||||
int32_t SpeakerVolumeIsAvailable(bool* available) override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
if (!initialized_)
|
||||
return -1;
|
||||
*available = output_->SpeakerVolumeIsAvailable();
|
||||
RTC_LOG(INFO) << "output: " << *available;
|
||||
RTC_DLOG(INFO) << "output: " << *available;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t SetSpeakerVolume(uint32_t volume) override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
if (!initialized_)
|
||||
return -1;
|
||||
return output_->SetSpeakerVolume(volume);
|
||||
}
|
||||
|
||||
int32_t SpeakerVolume(uint32_t* output_volume) const override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
if (!initialized_)
|
||||
return -1;
|
||||
absl::optional<uint32_t> volume = output_->SpeakerVolume();
|
||||
if (!volume)
|
||||
return -1;
|
||||
*output_volume = *volume;
|
||||
RTC_LOG(INFO) << "output: " << *volume;
|
||||
RTC_DLOG(INFO) << "output: " << *volume;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t MaxSpeakerVolume(uint32_t* output_max_volume) const override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
if (!initialized_)
|
||||
return -1;
|
||||
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 {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
if (!initialized_)
|
||||
return -1;
|
||||
absl::optional<uint32_t> min_volume = output_->MinSpeakerVolume();
|
||||
@ -384,71 +384,71 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
|
||||
}
|
||||
|
||||
int32_t MicrophoneVolumeIsAvailable(bool* available) override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
*available = false;
|
||||
RTC_LOG(INFO) << "output: " << *available;
|
||||
RTC_DLOG(INFO) << "output: " << *available;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int32_t SetMicrophoneVolume(uint32_t volume) override {
|
||||
RTC_LOG(INFO) << __FUNCTION__ << "(" << volume << ")";
|
||||
RTC_DLOG(INFO) << __FUNCTION__ << "(" << volume << ")";
|
||||
RTC_CHECK_NOTREACHED();
|
||||
}
|
||||
|
||||
int32_t MicrophoneVolume(uint32_t* volume) const override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
RTC_CHECK_NOTREACHED();
|
||||
}
|
||||
|
||||
int32_t MaxMicrophoneVolume(uint32_t* maxVolume) const override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
RTC_CHECK_NOTREACHED();
|
||||
}
|
||||
|
||||
int32_t MinMicrophoneVolume(uint32_t* minVolume) const override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
RTC_CHECK_NOTREACHED();
|
||||
}
|
||||
|
||||
int32_t SpeakerMuteIsAvailable(bool* available) override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
RTC_CHECK_NOTREACHED();
|
||||
}
|
||||
|
||||
int32_t SetSpeakerMute(bool enable) override {
|
||||
RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
|
||||
RTC_DLOG(INFO) << __FUNCTION__ << "(" << enable << ")";
|
||||
RTC_CHECK_NOTREACHED();
|
||||
}
|
||||
|
||||
int32_t SpeakerMute(bool* enabled) const override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
RTC_CHECK_NOTREACHED();
|
||||
}
|
||||
|
||||
int32_t MicrophoneMuteIsAvailable(bool* available) override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
RTC_CHECK_NOTREACHED();
|
||||
}
|
||||
|
||||
int32_t SetMicrophoneMute(bool enable) override {
|
||||
RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
|
||||
RTC_DLOG(INFO) << __FUNCTION__ << "(" << enable << ")";
|
||||
RTC_CHECK_NOTREACHED();
|
||||
}
|
||||
|
||||
int32_t MicrophoneMute(bool* enabled) const override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
RTC_CHECK_NOTREACHED();
|
||||
}
|
||||
|
||||
int32_t StereoPlayoutIsAvailable(bool* available) const override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
*available = is_stereo_playout_supported_;
|
||||
RTC_LOG(INFO) << "output: " << *available;
|
||||
RTC_DLOG(INFO) << "output: " << *available;
|
||||
return 0;
|
||||
}
|
||||
|
||||
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
|
||||
// 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.
|
||||
@ -461,21 +461,21 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
|
||||
}
|
||||
|
||||
int32_t StereoPlayout(bool* enabled) const override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
*enabled = is_stereo_playout_supported_;
|
||||
RTC_LOG(INFO) << "output: " << *enabled;
|
||||
RTC_DLOG(INFO) << "output: " << *enabled;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t StereoRecordingIsAvailable(bool* available) const override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
*available = is_stereo_record_supported_;
|
||||
RTC_LOG(INFO) << "output: " << *available;
|
||||
RTC_DLOG(INFO) << "output: " << *available;
|
||||
return 0;
|
||||
}
|
||||
|
||||
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
|
||||
// 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.
|
||||
@ -488,9 +488,9 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
|
||||
}
|
||||
|
||||
int32_t StereoRecording(bool* enabled) const override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
*enabled = is_stereo_record_supported_;
|
||||
RTC_LOG(INFO) << "output: " << *enabled;
|
||||
RTC_DLOG(INFO) << "output: " << *enabled;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -514,18 +514,18 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
|
||||
// a "Not Implemented" log will be filed. This non-perfect state will remain
|
||||
// until I have added full support for audio effects based on OpenSL ES APIs.
|
||||
bool BuiltInAECIsAvailable() const override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
if (!initialized_)
|
||||
return false;
|
||||
bool isAvailable = input_->IsAcousticEchoCancelerSupported();
|
||||
RTC_LOG(INFO) << "output: " << isAvailable;
|
||||
RTC_DLOG(INFO) << "output: " << isAvailable;
|
||||
return isAvailable;
|
||||
}
|
||||
|
||||
// Not implemented for any input device on Android.
|
||||
bool BuiltInAGCIsAvailable() const override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_LOG(INFO) << "output: " << false;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << "output: " << false;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -534,38 +534,38 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
|
||||
// TODO(henrika): add implementation for OpenSL ES based audio as well.
|
||||
// In addition, see comments for BuiltInAECIsAvailable().
|
||||
bool BuiltInNSIsAvailable() const override {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
if (!initialized_)
|
||||
return false;
|
||||
bool isAvailable = input_->IsNoiseSuppressorSupported();
|
||||
RTC_LOG(INFO) << "output: " << isAvailable;
|
||||
RTC_DLOG(INFO) << "output: " << isAvailable;
|
||||
return isAvailable;
|
||||
}
|
||||
|
||||
// TODO(henrika): add implementation for OpenSL ES based audio as well.
|
||||
int32_t EnableBuiltInAEC(bool enable) override {
|
||||
RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
|
||||
RTC_DLOG(INFO) << __FUNCTION__ << "(" << enable << ")";
|
||||
if (!initialized_)
|
||||
return -1;
|
||||
RTC_CHECK(BuiltInAECIsAvailable()) << "HW AEC is not available";
|
||||
int32_t result = input_->EnableBuiltInAEC(enable);
|
||||
RTC_LOG(INFO) << "output: " << result;
|
||||
RTC_DLOG(INFO) << "output: " << result;
|
||||
return result;
|
||||
}
|
||||
|
||||
int32_t EnableBuiltInAGC(bool enable) override {
|
||||
RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
|
||||
RTC_DLOG(INFO) << __FUNCTION__ << "(" << enable << ")";
|
||||
RTC_CHECK_NOTREACHED();
|
||||
}
|
||||
|
||||
// TODO(henrika): add implementation for OpenSL ES based audio as well.
|
||||
int32_t EnableBuiltInNS(bool enable) override {
|
||||
RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
|
||||
RTC_DLOG(INFO) << __FUNCTION__ << "(" << enable << ")";
|
||||
if (!initialized_)
|
||||
return -1;
|
||||
RTC_CHECK(BuiltInNSIsAvailable()) << "HW NS is not available";
|
||||
int32_t result = input_->EnableBuiltInNS(enable);
|
||||
RTC_LOG(INFO) << "output: " << result;
|
||||
RTC_DLOG(INFO) << "output: " << result;
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -576,7 +576,7 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
|
||||
}
|
||||
|
||||
int32_t AttachAudioBuffer() {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
output_->AttachAudioBuffer(audio_device_buffer_.get());
|
||||
input_->AttachAudioBuffer(audio_device_buffer_.get());
|
||||
return 0;
|
||||
@ -640,7 +640,7 @@ rtc::scoped_refptr<AudioDeviceModule> CreateAudioDeviceModuleFromInputAndOutput(
|
||||
uint16_t playout_delay_ms,
|
||||
std::unique_ptr<AudioInput> audio_input,
|
||||
std::unique_ptr<AudioOutput> audio_output) {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
return new rtc::RefCountedObject<AndroidAudioDeviceModule>(
|
||||
audio_layer, is_stereo_playout_supported, is_stereo_record_supported,
|
||||
playout_delay_ms, std::move(audio_input), std::move(audio_output));
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
namespace webrtc {
|
||||
|
||||
rtc::scoped_refptr<AudioDeviceModule> CreateAudioDeviceModule(bool bypass_voice_processing) {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
#if defined(WEBRTC_IOS)
|
||||
return new rtc::RefCountedObject<ios_adm::AudioDeviceModuleIOS>(bypass_voice_processing);
|
||||
#else
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
namespace webrtc {
|
||||
|
||||
std::unique_ptr<rtc::NetworkMonitorFactory> CreateNetworkMonitorFactory() {
|
||||
RTC_LOG(LS_INFO) << __FUNCTION__;
|
||||
RTC_DLOG(LS_INFO) << __FUNCTION__;
|
||||
#if defined(WEBRTC_IOS)
|
||||
return std::make_unique<ObjCNetworkMonitorFactory>();
|
||||
#else
|
||||
|
||||
@ -48,17 +48,17 @@ AudioDeviceModuleIOS::AudioDeviceModuleIOS(bool bypass_voice_processing)
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::AttachAudioBuffer() {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
audio_device_->AttachAudioBuffer(audio_device_buffer_.get());
|
||||
return 0;
|
||||
}
|
||||
|
||||
AudioDeviceModuleIOS::~AudioDeviceModuleIOS() {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::ActiveAudioLayer(AudioLayer* audioLayer) const {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
AudioLayer activeAudio;
|
||||
if (audio_device_->ActiveAudioLayer(activeAudio) == -1) {
|
||||
return -1;
|
||||
@ -68,7 +68,7 @@ AudioDeviceModuleIOS::AudioDeviceModuleIOS(bool bypass_voice_processing)
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::Init() {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
if (initialized_)
|
||||
return 0;
|
||||
|
||||
@ -91,7 +91,7 @@ AudioDeviceModuleIOS::AudioDeviceModuleIOS(bool bypass_voice_processing)
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::Terminate() {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
if (!initialized_)
|
||||
return 0;
|
||||
if (audio_device_->Terminate() == -1) {
|
||||
@ -102,65 +102,65 @@ AudioDeviceModuleIOS::AudioDeviceModuleIOS(bool bypass_voice_processing)
|
||||
}
|
||||
|
||||
bool AudioDeviceModuleIOS::Initialized() const {
|
||||
RTC_LOG(INFO) << __FUNCTION__ << ": " << initialized_;
|
||||
RTC_DLOG(INFO) << __FUNCTION__ << ": " << initialized_;
|
||||
return initialized_;
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::InitSpeaker() {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized_();
|
||||
return audio_device_->InitSpeaker();
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::InitMicrophone() {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized_();
|
||||
return audio_device_->InitMicrophone();
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::SpeakerVolumeIsAvailable(bool* available) {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized_();
|
||||
bool isAvailable = false;
|
||||
if (audio_device_->SpeakerVolumeIsAvailable(isAvailable) == -1) {
|
||||
return -1;
|
||||
}
|
||||
*available = isAvailable;
|
||||
RTC_LOG(INFO) << "output: " << isAvailable;
|
||||
RTC_DLOG(INFO) << "output: " << isAvailable;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::SetSpeakerVolume(uint32_t volume) {
|
||||
RTC_LOG(INFO) << __FUNCTION__ << "(" << volume << ")";
|
||||
RTC_DLOG(INFO) << __FUNCTION__ << "(" << volume << ")";
|
||||
CHECKinitialized_();
|
||||
return audio_device_->SetSpeakerVolume(volume);
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::SpeakerVolume(uint32_t* volume) const {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized_();
|
||||
uint32_t level = 0;
|
||||
if (audio_device_->SpeakerVolume(level) == -1) {
|
||||
return -1;
|
||||
}
|
||||
*volume = level;
|
||||
RTC_LOG(INFO) << "output: " << *volume;
|
||||
RTC_DLOG(INFO) << "output: " << *volume;
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool AudioDeviceModuleIOS::SpeakerIsInitialized() const {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized__BOOL();
|
||||
bool isInitialized = audio_device_->SpeakerIsInitialized();
|
||||
RTC_LOG(INFO) << "output: " << isInitialized;
|
||||
RTC_DLOG(INFO) << "output: " << isInitialized;
|
||||
return isInitialized;
|
||||
}
|
||||
|
||||
bool AudioDeviceModuleIOS::MicrophoneIsInitialized() const {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized__BOOL();
|
||||
bool isInitialized = audio_device_->MicrophoneIsInitialized();
|
||||
RTC_LOG(INFO) << "output: " << isInitialized;
|
||||
RTC_DLOG(INFO) << "output: " << isInitialized;
|
||||
return isInitialized;
|
||||
}
|
||||
|
||||
@ -185,110 +185,110 @@ AudioDeviceModuleIOS::AudioDeviceModuleIOS(bool bypass_voice_processing)
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::SpeakerMuteIsAvailable(bool* available) {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized_();
|
||||
bool isAvailable = false;
|
||||
if (audio_device_->SpeakerMuteIsAvailable(isAvailable) == -1) {
|
||||
return -1;
|
||||
}
|
||||
*available = isAvailable;
|
||||
RTC_LOG(INFO) << "output: " << isAvailable;
|
||||
RTC_DLOG(INFO) << "output: " << isAvailable;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::SetSpeakerMute(bool enable) {
|
||||
RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
|
||||
RTC_DLOG(INFO) << __FUNCTION__ << "(" << enable << ")";
|
||||
CHECKinitialized_();
|
||||
return audio_device_->SetSpeakerMute(enable);
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::SpeakerMute(bool* enabled) const {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized_();
|
||||
bool muted = false;
|
||||
if (audio_device_->SpeakerMute(muted) == -1) {
|
||||
return -1;
|
||||
}
|
||||
*enabled = muted;
|
||||
RTC_LOG(INFO) << "output: " << muted;
|
||||
RTC_DLOG(INFO) << "output: " << muted;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::MicrophoneMuteIsAvailable(bool* available) {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized_();
|
||||
bool isAvailable = false;
|
||||
if (audio_device_->MicrophoneMuteIsAvailable(isAvailable) == -1) {
|
||||
return -1;
|
||||
}
|
||||
*available = isAvailable;
|
||||
RTC_LOG(INFO) << "output: " << isAvailable;
|
||||
RTC_DLOG(INFO) << "output: " << isAvailable;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::SetMicrophoneMute(bool enable) {
|
||||
RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
|
||||
RTC_DLOG(INFO) << __FUNCTION__ << "(" << enable << ")";
|
||||
CHECKinitialized_();
|
||||
return (audio_device_->SetMicrophoneMute(enable));
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::MicrophoneMute(bool* enabled) const {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized_();
|
||||
bool muted = false;
|
||||
if (audio_device_->MicrophoneMute(muted) == -1) {
|
||||
return -1;
|
||||
}
|
||||
*enabled = muted;
|
||||
RTC_LOG(INFO) << "output: " << muted;
|
||||
RTC_DLOG(INFO) << "output: " << muted;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::MicrophoneVolumeIsAvailable(bool* available) {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized_();
|
||||
bool isAvailable = false;
|
||||
if (audio_device_->MicrophoneVolumeIsAvailable(isAvailable) == -1) {
|
||||
return -1;
|
||||
}
|
||||
*available = isAvailable;
|
||||
RTC_LOG(INFO) << "output: " << isAvailable;
|
||||
RTC_DLOG(INFO) << "output: " << isAvailable;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::SetMicrophoneVolume(uint32_t volume) {
|
||||
RTC_LOG(INFO) << __FUNCTION__ << "(" << volume << ")";
|
||||
RTC_DLOG(INFO) << __FUNCTION__ << "(" << volume << ")";
|
||||
CHECKinitialized_();
|
||||
return (audio_device_->SetMicrophoneVolume(volume));
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::MicrophoneVolume(uint32_t* volume) const {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized_();
|
||||
uint32_t level = 0;
|
||||
if (audio_device_->MicrophoneVolume(level) == -1) {
|
||||
return -1;
|
||||
}
|
||||
*volume = level;
|
||||
RTC_LOG(INFO) << "output: " << *volume;
|
||||
RTC_DLOG(INFO) << "output: " << *volume;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::StereoRecordingIsAvailable(
|
||||
bool* available) const {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized_();
|
||||
bool isAvailable = false;
|
||||
if (audio_device_->StereoRecordingIsAvailable(isAvailable) == -1) {
|
||||
return -1;
|
||||
}
|
||||
*available = isAvailable;
|
||||
RTC_LOG(INFO) << "output: " << isAvailable;
|
||||
RTC_DLOG(INFO) << "output: " << isAvailable;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::SetStereoRecording(bool enable) {
|
||||
RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
|
||||
RTC_DLOG(INFO) << __FUNCTION__ << "(" << enable << ")";
|
||||
CHECKinitialized_();
|
||||
if (enable) {
|
||||
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 {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized_();
|
||||
bool stereo = false;
|
||||
if (audio_device_->StereoRecording(stereo) == -1) {
|
||||
return -1;
|
||||
}
|
||||
*enabled = stereo;
|
||||
RTC_LOG(INFO) << "output: " << stereo;
|
||||
RTC_DLOG(INFO) << "output: " << stereo;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::StereoPlayoutIsAvailable(bool* available) const {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized_();
|
||||
bool isAvailable = false;
|
||||
if (audio_device_->StereoPlayoutIsAvailable(isAvailable) == -1) {
|
||||
return -1;
|
||||
}
|
||||
*available = isAvailable;
|
||||
RTC_LOG(INFO) << "output: " << isAvailable;
|
||||
RTC_DLOG(INFO) << "output: " << isAvailable;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::SetStereoPlayout(bool enable) {
|
||||
RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
|
||||
RTC_DLOG(INFO) << __FUNCTION__ << "(" << enable << ")";
|
||||
CHECKinitialized_();
|
||||
if (audio_device_->PlayoutIsInitialized()) {
|
||||
RTC_LOG(LERROR)
|
||||
@ -341,38 +341,38 @@ AudioDeviceModuleIOS::AudioDeviceModuleIOS(bool bypass_voice_processing)
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::StereoPlayout(bool* enabled) const {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized_();
|
||||
bool stereo = false;
|
||||
if (audio_device_->StereoPlayout(stereo) == -1) {
|
||||
return -1;
|
||||
}
|
||||
*enabled = stereo;
|
||||
RTC_LOG(INFO) << "output: " << stereo;
|
||||
RTC_DLOG(INFO) << "output: " << stereo;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::PlayoutIsAvailable(bool* available) {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized_();
|
||||
bool isAvailable = false;
|
||||
if (audio_device_->PlayoutIsAvailable(isAvailable) == -1) {
|
||||
return -1;
|
||||
}
|
||||
*available = isAvailable;
|
||||
RTC_LOG(INFO) << "output: " << isAvailable;
|
||||
RTC_DLOG(INFO) << "output: " << isAvailable;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::RecordingIsAvailable(bool* available) {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized_();
|
||||
bool isAvailable = false;
|
||||
if (audio_device_->RecordingIsAvailable(isAvailable) == -1) {
|
||||
return -1;
|
||||
}
|
||||
*available = isAvailable;
|
||||
RTC_LOG(INFO) << "output: " << isAvailable;
|
||||
RTC_DLOG(INFO) << "output: " << isAvailable;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -397,21 +397,21 @@ AudioDeviceModuleIOS::AudioDeviceModuleIOS(bool bypass_voice_processing)
|
||||
}
|
||||
|
||||
int16_t AudioDeviceModuleIOS::PlayoutDevices() {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized_();
|
||||
uint16_t nPlayoutDevices = audio_device_->PlayoutDevices();
|
||||
RTC_LOG(INFO) << "output: " << nPlayoutDevices;
|
||||
RTC_DLOG(INFO) << "output: " << nPlayoutDevices;
|
||||
return (int16_t)(nPlayoutDevices);
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::SetPlayoutDevice(uint16_t index) {
|
||||
RTC_LOG(INFO) << __FUNCTION__ << "(" << index << ")";
|
||||
RTC_DLOG(INFO) << __FUNCTION__ << "(" << index << ")";
|
||||
CHECKinitialized_();
|
||||
return audio_device_->SetPlayoutDevice(index);
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::SetPlayoutDevice(WindowsDeviceType device) {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized_();
|
||||
return audio_device_->SetPlayoutDevice(device);
|
||||
}
|
||||
@ -420,7 +420,7 @@ AudioDeviceModuleIOS::AudioDeviceModuleIOS(bool bypass_voice_processing)
|
||||
uint16_t index,
|
||||
char name[kAdmMaxDeviceNameSize],
|
||||
char guid[kAdmMaxGuidSize]) {
|
||||
RTC_LOG(INFO) << __FUNCTION__ << "(" << index << ", ...)";
|
||||
RTC_DLOG(INFO) << __FUNCTION__ << "(" << index << ", ...)";
|
||||
CHECKinitialized_();
|
||||
if (name == NULL) {
|
||||
return -1;
|
||||
@ -429,10 +429,10 @@ AudioDeviceModuleIOS::AudioDeviceModuleIOS(bool bypass_voice_processing)
|
||||
return -1;
|
||||
}
|
||||
if (name != NULL) {
|
||||
RTC_LOG(INFO) << "output: name = " << name;
|
||||
RTC_DLOG(INFO) << "output: name = " << name;
|
||||
}
|
||||
if (guid != NULL) {
|
||||
RTC_LOG(INFO) << "output: guid = " << guid;
|
||||
RTC_DLOG(INFO) << "output: guid = " << guid;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -441,7 +441,7 @@ AudioDeviceModuleIOS::AudioDeviceModuleIOS(bool bypass_voice_processing)
|
||||
uint16_t index,
|
||||
char name[kAdmMaxDeviceNameSize],
|
||||
char guid[kAdmMaxGuidSize]) {
|
||||
RTC_LOG(INFO) << __FUNCTION__ << "(" << index << ", ...)";
|
||||
RTC_DLOG(INFO) << __FUNCTION__ << "(" << index << ", ...)";
|
||||
CHECKinitialized_();
|
||||
if (name == NULL) {
|
||||
return -1;
|
||||
@ -450,137 +450,137 @@ AudioDeviceModuleIOS::AudioDeviceModuleIOS(bool bypass_voice_processing)
|
||||
return -1;
|
||||
}
|
||||
if (name != NULL) {
|
||||
RTC_LOG(INFO) << "output: name = " << name;
|
||||
RTC_DLOG(INFO) << "output: name = " << name;
|
||||
}
|
||||
if (guid != NULL) {
|
||||
RTC_LOG(INFO) << "output: guid = " << guid;
|
||||
RTC_DLOG(INFO) << "output: guid = " << guid;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int16_t AudioDeviceModuleIOS::RecordingDevices() {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized_();
|
||||
uint16_t nRecordingDevices = audio_device_->RecordingDevices();
|
||||
RTC_LOG(INFO) << "output: " << nRecordingDevices;
|
||||
RTC_DLOG(INFO) << "output: " << nRecordingDevices;
|
||||
return (int16_t)nRecordingDevices;
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::SetRecordingDevice(uint16_t index) {
|
||||
RTC_LOG(INFO) << __FUNCTION__ << "(" << index << ")";
|
||||
RTC_DLOG(INFO) << __FUNCTION__ << "(" << index << ")";
|
||||
CHECKinitialized_();
|
||||
return audio_device_->SetRecordingDevice(index);
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::SetRecordingDevice(WindowsDeviceType device) {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized_();
|
||||
return audio_device_->SetRecordingDevice(device);
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::InitPlayout() {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized_();
|
||||
if (PlayoutIsInitialized()) {
|
||||
return 0;
|
||||
}
|
||||
int32_t result = audio_device_->InitPlayout();
|
||||
RTC_LOG(INFO) << "output: " << result;
|
||||
RTC_DLOG(INFO) << "output: " << result;
|
||||
RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.InitPlayoutSuccess",
|
||||
static_cast<int>(result == 0));
|
||||
return result;
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::InitRecording() {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized_();
|
||||
if (RecordingIsInitialized()) {
|
||||
return 0;
|
||||
}
|
||||
int32_t result = audio_device_->InitRecording();
|
||||
RTC_LOG(INFO) << "output: " << result;
|
||||
RTC_DLOG(INFO) << "output: " << result;
|
||||
RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.InitRecordingSuccess",
|
||||
static_cast<int>(result == 0));
|
||||
return result;
|
||||
}
|
||||
|
||||
bool AudioDeviceModuleIOS::PlayoutIsInitialized() const {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized__BOOL();
|
||||
return audio_device_->PlayoutIsInitialized();
|
||||
}
|
||||
|
||||
bool AudioDeviceModuleIOS::RecordingIsInitialized() const {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized__BOOL();
|
||||
return audio_device_->RecordingIsInitialized();
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::StartPlayout() {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized_();
|
||||
if (Playing()) {
|
||||
return 0;
|
||||
}
|
||||
audio_device_buffer_.get()->StartPlayout();
|
||||
int32_t result = audio_device_->StartPlayout();
|
||||
RTC_LOG(INFO) << "output: " << result;
|
||||
RTC_DLOG(INFO) << "output: " << result;
|
||||
RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StartPlayoutSuccess",
|
||||
static_cast<int>(result == 0));
|
||||
return result;
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::StopPlayout() {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized_();
|
||||
int32_t result = audio_device_->StopPlayout();
|
||||
audio_device_buffer_.get()->StopPlayout();
|
||||
RTC_LOG(INFO) << "output: " << result;
|
||||
RTC_DLOG(INFO) << "output: " << result;
|
||||
RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StopPlayoutSuccess",
|
||||
static_cast<int>(result == 0));
|
||||
return result;
|
||||
}
|
||||
|
||||
bool AudioDeviceModuleIOS::Playing() const {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized__BOOL();
|
||||
return audio_device_->Playing();
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::StartRecording() {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized_();
|
||||
if (Recording()) {
|
||||
return 0;
|
||||
}
|
||||
audio_device_buffer_.get()->StartRecording();
|
||||
int32_t result = audio_device_->StartRecording();
|
||||
RTC_LOG(INFO) << "output: " << result;
|
||||
RTC_DLOG(INFO) << "output: " << result;
|
||||
RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StartRecordingSuccess",
|
||||
static_cast<int>(result == 0));
|
||||
return result;
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::StopRecording() {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized_();
|
||||
int32_t result = audio_device_->StopRecording();
|
||||
audio_device_buffer_.get()->StopRecording();
|
||||
RTC_LOG(INFO) << "output: " << result;
|
||||
RTC_DLOG(INFO) << "output: " << result;
|
||||
RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StopRecordingSuccess",
|
||||
static_cast<int>(result == 0));
|
||||
return result;
|
||||
}
|
||||
|
||||
bool AudioDeviceModuleIOS::Recording() const {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized__BOOL();
|
||||
return audio_device_->Recording();
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::RegisterAudioCallback(
|
||||
AudioTransport* audioCallback) {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
return audio_device_buffer_.get()->RegisterAudioCallback(audioCallback);
|
||||
}
|
||||
|
||||
@ -596,50 +596,50 @@ AudioDeviceModuleIOS::AudioDeviceModuleIOS(bool bypass_voice_processing)
|
||||
}
|
||||
|
||||
bool AudioDeviceModuleIOS::BuiltInAECIsAvailable() const {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized__BOOL();
|
||||
bool isAvailable = audio_device_->BuiltInAECIsAvailable();
|
||||
RTC_LOG(INFO) << "output: " << isAvailable;
|
||||
RTC_DLOG(INFO) << "output: " << isAvailable;
|
||||
return isAvailable;
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::EnableBuiltInAEC(bool enable) {
|
||||
RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
|
||||
RTC_DLOG(INFO) << __FUNCTION__ << "(" << enable << ")";
|
||||
CHECKinitialized_();
|
||||
int32_t ok = audio_device_->EnableBuiltInAEC(enable);
|
||||
RTC_LOG(INFO) << "output: " << ok;
|
||||
RTC_DLOG(INFO) << "output: " << ok;
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool AudioDeviceModuleIOS::BuiltInAGCIsAvailable() const {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized__BOOL();
|
||||
bool isAvailable = audio_device_->BuiltInAGCIsAvailable();
|
||||
RTC_LOG(INFO) << "output: " << isAvailable;
|
||||
RTC_DLOG(INFO) << "output: " << isAvailable;
|
||||
return isAvailable;
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::EnableBuiltInAGC(bool enable) {
|
||||
RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
|
||||
RTC_DLOG(INFO) << __FUNCTION__ << "(" << enable << ")";
|
||||
CHECKinitialized_();
|
||||
int32_t ok = audio_device_->EnableBuiltInAGC(enable);
|
||||
RTC_LOG(INFO) << "output: " << ok;
|
||||
RTC_DLOG(INFO) << "output: " << ok;
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool AudioDeviceModuleIOS::BuiltInNSIsAvailable() const {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized__BOOL();
|
||||
bool isAvailable = audio_device_->BuiltInNSIsAvailable();
|
||||
RTC_LOG(INFO) << "output: " << isAvailable;
|
||||
RTC_DLOG(INFO) << "output: " << isAvailable;
|
||||
return isAvailable;
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleIOS::EnableBuiltInNS(bool enable) {
|
||||
RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
|
||||
RTC_DLOG(INFO) << __FUNCTION__ << "(" << enable << ")";
|
||||
CHECKinitialized_();
|
||||
int32_t ok = audio_device_->EnableBuiltInNS(enable);
|
||||
RTC_LOG(INFO) << "output: " << ok;
|
||||
RTC_DLOG(INFO) << "output: " << ok;
|
||||
return ok;
|
||||
}
|
||||
|
||||
@ -653,17 +653,17 @@ AudioDeviceModuleIOS::AudioDeviceModuleIOS(bool bypass_voice_processing)
|
||||
#if defined(WEBRTC_IOS)
|
||||
int AudioDeviceModuleIOS::GetPlayoutAudioParameters(
|
||||
AudioParameters* params) const {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
int r = audio_device_->GetPlayoutAudioParameters(params);
|
||||
RTC_LOG(INFO) << "output: " << r;
|
||||
RTC_DLOG(INFO) << "output: " << r;
|
||||
return r;
|
||||
}
|
||||
|
||||
int AudioDeviceModuleIOS::GetRecordAudioParameters(
|
||||
AudioParameters* params) const {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
RTC_DLOG(INFO) << __FUNCTION__;
|
||||
int r = audio_device_->GetRecordAudioParameters(params);
|
||||
RTC_LOG(INFO) << "output: " << r;
|
||||
RTC_DLOG(INFO) << "output: " << r;
|
||||
return r;
|
||||
}
|
||||
#endif // WEBRTC_IOS
|
||||
|
||||
Reference in New Issue
Block a user