Removes unused APIs from the ADM (part II).
Removes:
int32_t SpeakerVolumeStepSize(uint16_t* stepSize)
int32_t MicrophoneVolumeStepSize(uint16_t* stepSize)
int32_t MicrophoneBoostIsAvailable(bool* available)
int32_t SetMicrophoneBoost(bool enable)
int32_t MicrophoneBoost(bool* enabled)
int32_t SetPlayoutBuffer(const BufferType type, uint16_t sizeMS = 0)
int32_t PlayoutBuffer(BufferType* type, uint16_t* sizeMS)
int32_t CPULoad(uint16_t* load)
int32_t StartRawOutputFileRecording(const char pcmFileNameUTF8[kAdmMaxFileNameSize])
int32_t StopRawOutputFileRecording()
int32_t StartRawInputFileRecording(const char pcmFileNameUTF8[kAdmMaxFileNameSize])
int32_t StopRawInputFileRecording()
int32_t ResetAudioDevice()
BUG=webrtc:7306
Review-Url: https://codereview.webrtc.org/3006803002
Cr-Commit-Position: refs/heads/master@{#19632}
diff --git a/webrtc/modules/audio_device/android/audio_device_template.h b/webrtc/modules/audio_device/android/audio_device_template.h
index 6b9cc0b..dc32fef 100644
--- a/webrtc/modules/audio_device/android/audio_device_template.h
+++ b/webrtc/modules/audio_device/android/audio_device_template.h
@@ -276,11 +276,6 @@
return output_.MinSpeakerVolume(minVolume);
}
- int32_t SpeakerVolumeStepSize(uint16_t& stepSize) const override {
- FATAL() << "Should never be called";
- return -1;
- }
-
int32_t MicrophoneVolumeIsAvailable(bool& available) override{
available = false;
return -1;
@@ -306,11 +301,6 @@
return -1;
}
- int32_t MicrophoneVolumeStepSize(uint16_t& stepSize) const override {
- FATAL() << "Should never be called";
- return -1;
- }
-
int32_t SpeakerMuteIsAvailable(bool& available) override {
FATAL() << "Should never be called";
return -1;
@@ -341,21 +331,6 @@
return -1;
}
- int32_t MicrophoneBoostIsAvailable(bool& available) override {
- FATAL() << "Should never be called";
- return -1;
- }
-
- int32_t SetMicrophoneBoost(bool enable) override {
- FATAL() << "Should never be called";
- return -1;
- }
-
- int32_t MicrophoneBoost(bool& enabled) const override {
- FATAL() << "Should never be called";
- return -1;
- }
-
int32_t StereoPlayoutIsAvailable(bool& available) override {
LOG(INFO) << __FUNCTION__;
available = false;
@@ -394,18 +369,6 @@
return 0;
}
- int32_t SetPlayoutBuffer(
- const AudioDeviceModule::BufferType type, uint16_t sizeMS) override {
- FATAL() << "Should never be called";
- return -1;
- }
-
- int32_t PlayoutBuffer(
- AudioDeviceModule::BufferType& type, uint16_t& sizeMS) const override {
- FATAL() << "Should never be called";
- return -1;
- }
-
int32_t PlayoutDelay(uint16_t& delay_ms) const override {
// Best guess we can do is to use half of the estimated total delay.
delay_ms = audio_manager_->GetDelayEstimateInMilliseconds() / 2;
@@ -421,11 +384,6 @@
return 0;
}
- int32_t CPULoad(uint16_t& load) const override {
- FATAL() << "Should never be called";
- return -1;
- }
-
bool PlayoutWarning() const override {
return false;
}
diff --git a/webrtc/modules/audio_device/audio_device_buffer.cc b/webrtc/modules/audio_device/audio_device_buffer.cc
index 905c696..79a0ebc 100644
--- a/webrtc/modules/audio_device/audio_device_buffer.cc
+++ b/webrtc/modules/audio_device/audio_device_buffer.cc
@@ -280,28 +280,6 @@
clock_drift_ = clock_drift;
}
-int32_t AudioDeviceBuffer::StartInputFileRecording(
- const char fileName[kAdmMaxFileNameSize]) {
- LOG(LS_WARNING) << "Not implemented";
- return 0;
-}
-
-int32_t AudioDeviceBuffer::StopInputFileRecording() {
- LOG(LS_WARNING) << "Not implemented";
- return 0;
-}
-
-int32_t AudioDeviceBuffer::StartOutputFileRecording(
- const char fileName[kAdmMaxFileNameSize]) {
- LOG(LS_WARNING) << "Not implemented";
- return 0;
-}
-
-int32_t AudioDeviceBuffer::StopOutputFileRecording() {
- LOG(LS_WARNING) << "Not implemented";
- return 0;
-}
-
int32_t AudioDeviceBuffer::SetRecordedBuffer(const void* audio_buffer,
size_t samples_per_channel) {
RTC_DCHECK_RUN_ON(&recording_thread_checker_);
diff --git a/webrtc/modules/audio_device/audio_device_buffer.h b/webrtc/modules/audio_device/audio_device_buffer.h
index 2a5a84b..a9163ea 100644
--- a/webrtc/modules/audio_device/audio_device_buffer.h
+++ b/webrtc/modules/audio_device/audio_device_buffer.h
@@ -108,14 +108,6 @@
virtual int32_t RequestPlayoutData(size_t samples_per_channel);
virtual int32_t GetPlayoutData(void* audio_buffer);
- // TODO(henrika): these methods should not be used and does not contain any
- // valid implementation. Investigate the possibility to either remove them
- // or add a proper implementation if needed.
- int32_t StartInputFileRecording(const char fileName[kAdmMaxFileNameSize]);
- int32_t StopInputFileRecording();
- int32_t StartOutputFileRecording(const char fileName[kAdmMaxFileNameSize]);
- int32_t StopOutputFileRecording();
-
int32_t SetTypingStatus(bool typing_status);
// Called on iOS where the native audio layer can be interrupted by other
diff --git a/webrtc/modules/audio_device/audio_device_data_observer.cc b/webrtc/modules/audio_device/audio_device_data_observer.cc
index 60ea1cd..23c3b9d 100644
--- a/webrtc/modules/audio_device/audio_device_data_observer.cc
+++ b/webrtc/modules/audio_device/audio_device_data_observer.cc
@@ -202,9 +202,6 @@
int32_t MinSpeakerVolume(uint32_t* min_volume) const override {
return impl_->MinSpeakerVolume(min_volume);
}
- int32_t SpeakerVolumeStepSize(uint16_t* step_size) const override {
- return impl_->SpeakerVolumeStepSize(step_size);
- }
int32_t MicrophoneVolumeIsAvailable(bool* available) override {
return impl_->MicrophoneVolumeIsAvailable(available);
}
@@ -220,9 +217,6 @@
int32_t MinMicrophoneVolume(uint32_t* min_volume) const override {
return impl_->MinMicrophoneVolume(min_volume);
}
- int32_t MicrophoneVolumeStepSize(uint16_t* step_size) const override {
- return impl_->MicrophoneVolumeStepSize(step_size);
- }
int32_t SpeakerMuteIsAvailable(bool* available) override {
return impl_->SpeakerMuteIsAvailable(available);
}
@@ -241,15 +235,6 @@
int32_t MicrophoneMute(bool* enabled) const override {
return impl_->MicrophoneMute(enabled);
}
- int32_t MicrophoneBoostIsAvailable(bool* available) override {
- return impl_->MicrophoneBoostIsAvailable(available);
- }
- int32_t SetMicrophoneBoost(bool enable) override {
- return impl_->SetMicrophoneBoost(enable);
- }
- int32_t MicrophoneBoost(bool* enabled) const override {
- return impl_->MicrophoneBoost(enabled);
- }
int32_t StereoPlayoutIsAvailable(bool* available) const override {
return impl_->StereoPlayoutIsAvailable(available);
}
@@ -274,35 +259,12 @@
int32_t RecordingChannel(ChannelType* channel) const override {
return impl_->RecordingChannel(channel);
}
- int32_t SetPlayoutBuffer(const BufferType type, uint16_t size_ms) override {
- return impl_->SetPlayoutBuffer(type, size_ms);
- }
- int32_t PlayoutBuffer(BufferType* type, uint16_t* size_ms) const override {
- return impl_->PlayoutBuffer(type, size_ms);
- }
int32_t PlayoutDelay(uint16_t* delay_ms) const override {
return impl_->PlayoutDelay(delay_ms);
}
int32_t RecordingDelay(uint16_t* delay_ms) const override {
return impl_->RecordingDelay(delay_ms);
}
- int32_t CPULoad(uint16_t* load) const override {
- return impl_->CPULoad(load);
- }
- int32_t StartRawOutputFileRecording(
- const char pcm_file_name_utf8[kAdmMaxFileNameSize]) override {
- return impl_->StartRawOutputFileRecording(pcm_file_name_utf8);
- }
- int32_t StopRawOutputFileRecording() override {
- return impl_->StopRawOutputFileRecording();
- }
- int32_t StartRawInputFileRecording(
- const char pcm_file_name_utf8[kAdmMaxFileNameSize]) override {
- return impl_->StartRawInputFileRecording(pcm_file_name_utf8);
- }
- int32_t StopRawInputFileRecording() override {
- return impl_->StopRawInputFileRecording();
- }
int32_t SetRecordingSampleRate(const uint32_t samples_per_sec) override {
return impl_->SetRecordingSampleRate(samples_per_sec);
}
@@ -315,7 +277,6 @@
int32_t PlayoutSampleRate(uint32_t* samples_per_sec) const override {
return impl_->PlayoutSampleRate(samples_per_sec);
}
- int32_t ResetAudioDevice() override { return impl_->ResetAudioDevice(); }
int32_t SetLoudspeakerStatus(bool enable) override {
return impl_->SetLoudspeakerStatus(enable);
}
diff --git a/webrtc/modules/audio_device/audio_device_generic.cc b/webrtc/modules/audio_device/audio_device_generic.cc
index e1c6e6f..f865d03 100644
--- a/webrtc/modules/audio_device/audio_device_generic.cc
+++ b/webrtc/modules/audio_device/audio_device_generic.cc
@@ -34,19 +34,6 @@
return -1;
}
-int32_t AudioDeviceGeneric::ResetAudioDevice() {
- LOG_F(LS_ERROR) << "Not supported on this platform";
- return -1;
-}
-
-int32_t AudioDeviceGeneric::SoundDeviceControl(unsigned int par1,
- unsigned int par2,
- unsigned int par3,
- unsigned int par4) {
- LOG_F(LS_ERROR) << "Not supported on this platform";
- return -1;
-}
-
bool AudioDeviceGeneric::BuiltInAECIsAvailable() const {
LOG_F(LS_ERROR) << "Not supported on this platform";
return false;
diff --git a/webrtc/modules/audio_device/audio_device_generic.h b/webrtc/modules/audio_device/audio_device_generic.h
index ca31327..cdcb934 100644
--- a/webrtc/modules/audio_device/audio_device_generic.h
+++ b/webrtc/modules/audio_device/audio_device_generic.h
@@ -87,7 +87,6 @@
virtual int32_t SpeakerVolume(uint32_t& volume) const = 0;
virtual int32_t MaxSpeakerVolume(uint32_t& maxVolume) const = 0;
virtual int32_t MinSpeakerVolume(uint32_t& minVolume) const = 0;
- virtual int32_t SpeakerVolumeStepSize(uint16_t& stepSize) const = 0;
// Microphone volume controls
virtual int32_t MicrophoneVolumeIsAvailable(bool& available) = 0;
@@ -95,7 +94,6 @@
virtual int32_t MicrophoneVolume(uint32_t& volume) const = 0;
virtual int32_t MaxMicrophoneVolume(uint32_t& maxVolume) const = 0;
virtual int32_t MinMicrophoneVolume(uint32_t& minVolume) const = 0;
- virtual int32_t MicrophoneVolumeStepSize(uint16_t& stepSize) const = 0;
// Speaker mute control
virtual int32_t SpeakerMuteIsAvailable(bool& available) = 0;
@@ -107,11 +105,6 @@
virtual int32_t SetMicrophoneMute(bool enable) = 0;
virtual int32_t MicrophoneMute(bool& enabled) const = 0;
- // Microphone boost control
- virtual int32_t MicrophoneBoostIsAvailable(bool& available) = 0;
- virtual int32_t SetMicrophoneBoost(bool enable) = 0;
- virtual int32_t MicrophoneBoost(bool& enabled) const = 0;
-
// Stereo support
virtual int32_t StereoPlayoutIsAvailable(bool& available) = 0;
virtual int32_t SetStereoPlayout(bool enable) = 0;
@@ -121,16 +114,9 @@
virtual int32_t StereoRecording(bool& enabled) const = 0;
// Delay information and control
- virtual int32_t SetPlayoutBuffer(const AudioDeviceModule::BufferType type,
- uint16_t sizeMS = 0) = 0;
- virtual int32_t PlayoutBuffer(AudioDeviceModule::BufferType& type,
- uint16_t& sizeMS) const = 0;
virtual int32_t PlayoutDelay(uint16_t& delayMS) const = 0;
virtual int32_t RecordingDelay(uint16_t& delayMS) const = 0;
- // CPU load
- virtual int32_t CPULoad(uint16_t& load) const = 0;
-
// Native sample rate controls (samples/sec)
virtual int32_t SetRecordingSampleRate(const uint32_t samplesPerSec);
virtual int32_t SetPlayoutSampleRate(const uint32_t samplesPerSec);
@@ -139,15 +125,6 @@
virtual int32_t SetLoudspeakerStatus(bool enable);
virtual int32_t GetLoudspeakerStatus(bool& enable) const;
- // Reset Audio Device (for mobile devices)
- virtual int32_t ResetAudioDevice();
-
- // Sound Audio Device control (for WinCE only)
- virtual int32_t SoundDeviceControl(unsigned int par1 = 0,
- unsigned int par2 = 0,
- unsigned int par3 = 0,
- unsigned int par4 = 0);
-
// Android only
virtual bool BuiltInAECIsAvailable() const;
virtual bool BuiltInAGCIsAvailable() const;
diff --git a/webrtc/modules/audio_device/audio_device_impl.cc b/webrtc/modules/audio_device/audio_device_impl.cc
index bae4f6a..e8a3a72 100644
--- a/webrtc/modules/audio_device/audio_device_impl.cc
+++ b/webrtc/modules/audio_device/audio_device_impl.cc
@@ -636,26 +636,6 @@
}
// ----------------------------------------------------------------------------
-// SpeakerVolumeStepSize
-// ----------------------------------------------------------------------------
-
-int32_t AudioDeviceModuleImpl::SpeakerVolumeStepSize(uint16_t* stepSize) const {
- LOG(INFO) << __FUNCTION__;
- CHECK_INITIALIZED();
-
- uint16_t delta(0);
-
- if (_ptrAudioDevice->SpeakerVolumeStepSize(delta) == -1) {
- LOG(LERROR) << "failed to retrieve the speaker-volume step size";
- return -1;
- }
-
- *stepSize = delta;
- LOG(INFO) << "output: " << *stepSize;
- return (0);
-}
-
-// ----------------------------------------------------------------------------
// SpeakerMuteIsAvailable
// ----------------------------------------------------------------------------
@@ -752,54 +732,6 @@
}
// ----------------------------------------------------------------------------
-// MicrophoneBoostIsAvailable
-// ----------------------------------------------------------------------------
-
-int32_t AudioDeviceModuleImpl::MicrophoneBoostIsAvailable(bool* available) {
- LOG(INFO) << __FUNCTION__;
- CHECK_INITIALIZED();
-
- bool isAvailable(0);
-
- if (_ptrAudioDevice->MicrophoneBoostIsAvailable(isAvailable) == -1) {
- return -1;
- }
-
- *available = isAvailable;
- LOG(INFO) << "output: " << isAvailable;
- return (0);
-}
-
-// ----------------------------------------------------------------------------
-// SetMicrophoneBoost
-// ----------------------------------------------------------------------------
-
-int32_t AudioDeviceModuleImpl::SetMicrophoneBoost(bool enable) {
- LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
- CHECK_INITIALIZED();
- return (_ptrAudioDevice->SetMicrophoneBoost(enable));
-}
-
-// ----------------------------------------------------------------------------
-// MicrophoneBoost
-// ----------------------------------------------------------------------------
-
-int32_t AudioDeviceModuleImpl::MicrophoneBoost(bool* enabled) const {
- LOG(INFO) << __FUNCTION__;
- CHECK_INITIALIZED();
-
- bool onOff(false);
-
- if (_ptrAudioDevice->MicrophoneBoost(onOff) == -1) {
- return -1;
- }
-
- *enabled = onOff;
- LOG(INFO) << "output: " << onOff;
- return (0);
-}
-
-// ----------------------------------------------------------------------------
// MicrophoneVolumeIsAvailable
// ----------------------------------------------------------------------------
@@ -1121,26 +1053,6 @@
}
// ----------------------------------------------------------------------------
-// MicrophoneVolumeStepSize
-// ----------------------------------------------------------------------------
-
-int32_t AudioDeviceModuleImpl::MicrophoneVolumeStepSize(
- uint16_t* stepSize) const {
- LOG(INFO) << __FUNCTION__;
- CHECK_INITIALIZED();
-
- uint16_t delta(0);
-
- if (_ptrAudioDevice->MicrophoneVolumeStepSize(delta) == -1) {
- return -1;
- }
-
- *stepSize = delta;
- LOG(INFO) << "output: " << *stepSize;
- return (0);
-}
-
-// ----------------------------------------------------------------------------
// PlayoutDevices
// ----------------------------------------------------------------------------
@@ -1433,123 +1345,6 @@
}
// ----------------------------------------------------------------------------
-// StartRawInputFileRecording
-// ----------------------------------------------------------------------------
-
-int32_t AudioDeviceModuleImpl::StartRawInputFileRecording(
- const char pcmFileNameUTF8[kAdmMaxFileNameSize]) {
- LOG(INFO) << __FUNCTION__;
- CHECK_INITIALIZED();
-
- if (NULL == pcmFileNameUTF8) {
- return -1;
- }
-
- return (_audioDeviceBuffer.StartInputFileRecording(pcmFileNameUTF8));
-}
-
-// ----------------------------------------------------------------------------
-// StopRawInputFileRecording
-// ----------------------------------------------------------------------------
-
-int32_t AudioDeviceModuleImpl::StopRawInputFileRecording() {
- LOG(INFO) << __FUNCTION__;
- CHECK_INITIALIZED();
-
- return (_audioDeviceBuffer.StopInputFileRecording());
-}
-
-// ----------------------------------------------------------------------------
-// StartRawOutputFileRecording
-// ----------------------------------------------------------------------------
-
-int32_t AudioDeviceModuleImpl::StartRawOutputFileRecording(
- const char pcmFileNameUTF8[kAdmMaxFileNameSize]) {
- LOG(INFO) << __FUNCTION__;
- CHECK_INITIALIZED();
-
- if (NULL == pcmFileNameUTF8) {
- return -1;
- }
-
- return (_audioDeviceBuffer.StartOutputFileRecording(pcmFileNameUTF8));
-}
-
-// ----------------------------------------------------------------------------
-// StopRawOutputFileRecording
-// ----------------------------------------------------------------------------
-
-int32_t AudioDeviceModuleImpl::StopRawOutputFileRecording() {
- LOG(INFO) << __FUNCTION__;
- CHECK_INITIALIZED();
-
- return (_audioDeviceBuffer.StopOutputFileRecording());
-}
-
-// ----------------------------------------------------------------------------
-// SetPlayoutBuffer
-// ----------------------------------------------------------------------------
-
-int32_t AudioDeviceModuleImpl::SetPlayoutBuffer(const BufferType type,
- uint16_t sizeMS) {
- if (type == kFixedBufferSize) {
- LOG(INFO) << __FUNCTION__ << "(fixed buffer, " << sizeMS << "ms)";
- } else if (type == kAdaptiveBufferSize) {
- LOG(INFO) << __FUNCTION__ << "(adaptive buffer, " << sizeMS << "ms)";
- } else {
- LOG(INFO) << __FUNCTION__ << "(?, " << sizeMS << "ms)";
- }
- CHECK_INITIALIZED();
-
- if (_ptrAudioDevice->PlayoutIsInitialized()) {
- LOG(LERROR) << "unable to modify the playout buffer while playing side is "
- "initialized";
- return -1;
- }
-
- int32_t ret(0);
-
- if (kFixedBufferSize == type) {
- if (sizeMS < kAdmMinPlayoutBufferSizeMs ||
- sizeMS > kAdmMaxPlayoutBufferSizeMs) {
- LOG(LERROR) << "size parameter is out of range";
- return -1;
- }
- }
-
- if ((ret = _ptrAudioDevice->SetPlayoutBuffer(type, sizeMS)) == -1) {
- LOG(LERROR) << "failed to set the playout buffer (error: " << LastError()
- << ")";
- }
-
- return ret;
-}
-
-// ----------------------------------------------------------------------------
-// PlayoutBuffer
-// ----------------------------------------------------------------------------
-
-int32_t AudioDeviceModuleImpl::PlayoutBuffer(BufferType* type,
- uint16_t* sizeMS) const {
- LOG(INFO) << __FUNCTION__;
- CHECK_INITIALIZED();
-
- BufferType bufType;
- uint16_t size(0);
-
- if (_ptrAudioDevice->PlayoutBuffer(bufType, size) == -1) {
- LOG(LERROR) << "failed to retrieve the buffer type and size";
- return -1;
- }
-
- *type = bufType;
- *sizeMS = size;
-
- LOG(INFO) << "output: type = " << *type << ", sizeMS = " << *sizeMS;
- return (0);
-}
-
-// ----------------------------------------------------------------------------
// PlayoutDelay
// ----------------------------------------------------------------------------
@@ -1588,26 +1383,6 @@
}
// ----------------------------------------------------------------------------
-// CPULoad
-// ----------------------------------------------------------------------------
-
-int32_t AudioDeviceModuleImpl::CPULoad(uint16_t* load) const {
- LOG(INFO) << __FUNCTION__;
- CHECK_INITIALIZED();
-
- uint16_t cpuLoad(0);
-
- if (_ptrAudioDevice->CPULoad(cpuLoad) == -1) {
- LOG(LERROR) << "failed to retrieve the CPU load";
- return -1;
- }
-
- *load = cpuLoad;
- LOG(INFO) << "output: " << *load;
- return (0);
-}
-
-// ----------------------------------------------------------------------------
// SetRecordingSampleRate
// ----------------------------------------------------------------------------
@@ -1682,16 +1457,6 @@
}
// ----------------------------------------------------------------------------
-// ResetAudioDevice
-// ----------------------------------------------------------------------------
-
-int32_t AudioDeviceModuleImpl::ResetAudioDevice() {
- LOG(INFO) << __FUNCTION__;
- FATAL() << "Should never be called";
- return -1;
-}
-
-// ----------------------------------------------------------------------------
// SetLoudspeakerStatus
// ----------------------------------------------------------------------------
diff --git a/webrtc/modules/audio_device/audio_device_impl.h b/webrtc/modules/audio_device/audio_device_impl.h
index 9fdc93b..69e32d4 100644
--- a/webrtc/modules/audio_device/audio_device_impl.h
+++ b/webrtc/modules/audio_device/audio_device_impl.h
@@ -110,7 +110,6 @@
int32_t SpeakerVolume(uint32_t* volume) const override;
int32_t MaxSpeakerVolume(uint32_t* maxVolume) const override;
int32_t MinSpeakerVolume(uint32_t* minVolume) const override;
- int32_t SpeakerVolumeStepSize(uint16_t* stepSize) const override;
// Microphone volume controls
int32_t MicrophoneVolumeIsAvailable(bool* available) override;
@@ -118,7 +117,6 @@
int32_t MicrophoneVolume(uint32_t* volume) const override;
int32_t MaxMicrophoneVolume(uint32_t* maxVolume) const override;
int32_t MinMicrophoneVolume(uint32_t* minVolume) const override;
- int32_t MicrophoneVolumeStepSize(uint16_t* stepSize) const override;
// Speaker mute control
int32_t SpeakerMuteIsAvailable(bool* available) override;
@@ -130,11 +128,6 @@
int32_t SetMicrophoneMute(bool enable) override;
int32_t MicrophoneMute(bool* enabled) const override;
- // Microphone boost control
- int32_t MicrophoneBoostIsAvailable(bool* available) override;
- int32_t SetMicrophoneBoost(bool enable) override;
- int32_t MicrophoneBoost(bool* enabled) const override;
-
// Stereo support
int32_t StereoPlayoutIsAvailable(bool* available) const override;
int32_t SetStereoPlayout(bool enable) override;
@@ -146,22 +139,9 @@
int32_t RecordingChannel(ChannelType* channel) const override;
// Delay information and control
- int32_t SetPlayoutBuffer(const BufferType type, uint16_t sizeMS = 0) override;
- int32_t PlayoutBuffer(BufferType* type, uint16_t* sizeMS) const override;
int32_t PlayoutDelay(uint16_t* delayMS) const override;
int32_t RecordingDelay(uint16_t* delayMS) const override;
- // CPU load
- int32_t CPULoad(uint16_t* load) const override;
-
- // Recording of raw PCM data
- int32_t StartRawOutputFileRecording(
- const char pcmFileNameUTF8[kAdmMaxFileNameSize]) override;
- int32_t StopRawOutputFileRecording() override;
- int32_t StartRawInputFileRecording(
- const char pcmFileNameUTF8[kAdmMaxFileNameSize]) override;
- int32_t StopRawInputFileRecording() override;
-
// Native sample rate controls (samples/sec)
int32_t SetRecordingSampleRate(const uint32_t samplesPerSec) override;
int32_t RecordingSampleRate(uint32_t* samplesPerSec) const override;
@@ -169,7 +149,6 @@
int32_t PlayoutSampleRate(uint32_t* samplesPerSec) const override;
// Mobile device specific functions
- int32_t ResetAudioDevice() override;
int32_t SetLoudspeakerStatus(bool enable) override;
int32_t GetLoudspeakerStatus(bool* enabled) const override;
diff --git a/webrtc/modules/audio_device/dummy/audio_device_dummy.cc b/webrtc/modules/audio_device/dummy/audio_device_dummy.cc
index d954a27..91033b7 100644
--- a/webrtc/modules/audio_device/dummy/audio_device_dummy.cc
+++ b/webrtc/modules/audio_device/dummy/audio_device_dummy.cc
@@ -107,10 +107,6 @@
return -1;
}
-int32_t AudioDeviceDummy::SpeakerVolumeStepSize(uint16_t& stepSize) const {
- return -1;
-}
-
int32_t AudioDeviceDummy::MicrophoneVolumeIsAvailable(bool& available) {
return -1;
}
@@ -129,10 +125,6 @@
return -1;
}
-int32_t AudioDeviceDummy::MicrophoneVolumeStepSize(uint16_t& stepSize) const {
- return -1;
-}
-
int32_t AudioDeviceDummy::SpeakerMuteIsAvailable(bool& available) { return -1; }
int32_t AudioDeviceDummy::SetSpeakerMute(bool enable) { return -1; }
@@ -147,14 +139,6 @@
int32_t AudioDeviceDummy::MicrophoneMute(bool& enabled) const { return -1; }
-int32_t AudioDeviceDummy::MicrophoneBoostIsAvailable(bool& available) {
- return -1;
-}
-
-int32_t AudioDeviceDummy::SetMicrophoneBoost(bool enable) { return -1; }
-
-int32_t AudioDeviceDummy::MicrophoneBoost(bool& enabled) const { return -1; }
-
int32_t AudioDeviceDummy::StereoPlayoutIsAvailable(bool& available) {
return -1;
}
@@ -170,23 +154,10 @@
int32_t AudioDeviceDummy::StereoRecording(bool& enabled) const { return -1; }
-int32_t AudioDeviceDummy::SetPlayoutBuffer(
- const AudioDeviceModule::BufferType type,
- uint16_t sizeMS) {
- return -1;
-}
-
-int32_t AudioDeviceDummy::PlayoutBuffer(AudioDeviceModule::BufferType& type,
- uint16_t& sizeMS) const {
- return -1;
-}
-
int32_t AudioDeviceDummy::PlayoutDelay(uint16_t& delayMS) const { return -1; }
int32_t AudioDeviceDummy::RecordingDelay(uint16_t& delayMS) const { return -1; }
-int32_t AudioDeviceDummy::CPULoad(uint16_t& load) const { return -1; }
-
bool AudioDeviceDummy::PlayoutWarning() const { return false; }
bool AudioDeviceDummy::PlayoutError() const { return false; }
diff --git a/webrtc/modules/audio_device/dummy/audio_device_dummy.h b/webrtc/modules/audio_device/dummy/audio_device_dummy.h
index fd9a915..bbadbdd 100644
--- a/webrtc/modules/audio_device/dummy/audio_device_dummy.h
+++ b/webrtc/modules/audio_device/dummy/audio_device_dummy.h
@@ -81,7 +81,6 @@
int32_t SpeakerVolume(uint32_t& volume) const override;
int32_t MaxSpeakerVolume(uint32_t& maxVolume) const override;
int32_t MinSpeakerVolume(uint32_t& minVolume) const override;
- int32_t SpeakerVolumeStepSize(uint16_t& stepSize) const override;
// Microphone volume controls
int32_t MicrophoneVolumeIsAvailable(bool& available) override;
@@ -89,7 +88,6 @@
int32_t MicrophoneVolume(uint32_t& volume) const override;
int32_t MaxMicrophoneVolume(uint32_t& maxVolume) const override;
int32_t MinMicrophoneVolume(uint32_t& minVolume) const override;
- int32_t MicrophoneVolumeStepSize(uint16_t& stepSize) const override;
// Speaker mute control
int32_t SpeakerMuteIsAvailable(bool& available) override;
@@ -101,11 +99,6 @@
int32_t SetMicrophoneMute(bool enable) override;
int32_t MicrophoneMute(bool& enabled) const override;
- // Microphone boost control
- int32_t MicrophoneBoostIsAvailable(bool& available) override;
- int32_t SetMicrophoneBoost(bool enable) override;
- int32_t MicrophoneBoost(bool& enabled) const override;
-
// Stereo support
int32_t StereoPlayoutIsAvailable(bool& available) override;
int32_t SetStereoPlayout(bool enable) override;
@@ -115,16 +108,9 @@
int32_t StereoRecording(bool& enabled) const override;
// Delay information and control
- int32_t SetPlayoutBuffer(const AudioDeviceModule::BufferType type,
- uint16_t sizeMS) override;
- int32_t PlayoutBuffer(AudioDeviceModule::BufferType& type,
- uint16_t& sizeMS) const override;
int32_t PlayoutDelay(uint16_t& delayMS) const override;
int32_t RecordingDelay(uint16_t& delayMS) const override;
- // CPU load
- int32_t CPULoad(uint16_t& load) const override;
-
bool PlayoutWarning() const override;
bool PlayoutError() const override;
bool RecordingWarning() const override;
diff --git a/webrtc/modules/audio_device/dummy/file_audio_device.cc b/webrtc/modules/audio_device/dummy/file_audio_device.cc
index 0d9885d..4d8e11a 100644
--- a/webrtc/modules/audio_device/dummy/file_audio_device.cc
+++ b/webrtc/modules/audio_device/dummy/file_audio_device.cc
@@ -333,10 +333,6 @@
return -1;
}
-int32_t FileAudioDevice::SpeakerVolumeStepSize(uint16_t& stepSize) const {
- return -1;
-}
-
int32_t FileAudioDevice::MicrophoneVolumeIsAvailable(bool& available) {
return -1;
}
@@ -355,10 +351,6 @@
return -1;
}
-int32_t FileAudioDevice::MicrophoneVolumeStepSize(uint16_t& stepSize) const {
- return -1;
-}
-
int32_t FileAudioDevice::SpeakerMuteIsAvailable(bool& available) { return -1; }
int32_t FileAudioDevice::SetSpeakerMute(bool enable) { return -1; }
@@ -373,14 +365,6 @@
int32_t FileAudioDevice::MicrophoneMute(bool& enabled) const { return -1; }
-int32_t FileAudioDevice::MicrophoneBoostIsAvailable(bool& available) {
- return -1;
-}
-
-int32_t FileAudioDevice::SetMicrophoneBoost(bool enable) { return -1; }
-
-int32_t FileAudioDevice::MicrophoneBoost(bool& enabled) const { return -1; }
-
int32_t FileAudioDevice::StereoPlayoutIsAvailable(bool& available) {
available = true;
return 0;
@@ -408,26 +392,12 @@
return 0;
}
-int32_t FileAudioDevice::SetPlayoutBuffer(
- const AudioDeviceModule::BufferType type,
- uint16_t sizeMS) {
- return 0;
-}
-
-int32_t FileAudioDevice::PlayoutBuffer(AudioDeviceModule::BufferType& type,
- uint16_t& sizeMS) const {
- type = _playBufType;
- return 0;
-}
-
int32_t FileAudioDevice::PlayoutDelay(uint16_t& delayMS) const {
return 0;
}
int32_t FileAudioDevice::RecordingDelay(uint16_t& delayMS) const { return -1; }
-int32_t FileAudioDevice::CPULoad(uint16_t& load) const { return -1; }
-
bool FileAudioDevice::PlayoutWarning() const { return false; }
bool FileAudioDevice::PlayoutError() const { return false; }
diff --git a/webrtc/modules/audio_device/dummy/file_audio_device.h b/webrtc/modules/audio_device/dummy/file_audio_device.h
index 63e7e79..615c137 100644
--- a/webrtc/modules/audio_device/dummy/file_audio_device.h
+++ b/webrtc/modules/audio_device/dummy/file_audio_device.h
@@ -102,7 +102,6 @@
int32_t SpeakerVolume(uint32_t& volume) const override;
int32_t MaxSpeakerVolume(uint32_t& maxVolume) const override;
int32_t MinSpeakerVolume(uint32_t& minVolume) const override;
- int32_t SpeakerVolumeStepSize(uint16_t& stepSize) const override;
// Microphone volume controls
int32_t MicrophoneVolumeIsAvailable(bool& available) override;
@@ -110,7 +109,6 @@
int32_t MicrophoneVolume(uint32_t& volume) const override;
int32_t MaxMicrophoneVolume(uint32_t& maxVolume) const override;
int32_t MinMicrophoneVolume(uint32_t& minVolume) const override;
- int32_t MicrophoneVolumeStepSize(uint16_t& stepSize) const override;
// Speaker mute control
int32_t SpeakerMuteIsAvailable(bool& available) override;
@@ -122,11 +120,6 @@
int32_t SetMicrophoneMute(bool enable) override;
int32_t MicrophoneMute(bool& enabled) const override;
- // Microphone boost control
- int32_t MicrophoneBoostIsAvailable(bool& available) override;
- int32_t SetMicrophoneBoost(bool enable) override;
- int32_t MicrophoneBoost(bool& enabled) const override;
-
// Stereo support
int32_t StereoPlayoutIsAvailable(bool& available) override;
int32_t SetStereoPlayout(bool enable) override;
@@ -136,16 +129,9 @@
int32_t StereoRecording(bool& enabled) const override;
// Delay information and control
- int32_t SetPlayoutBuffer(const AudioDeviceModule::BufferType type,
- uint16_t sizeMS) override;
- int32_t PlayoutBuffer(AudioDeviceModule::BufferType& type,
- uint16_t& sizeMS) const override;
int32_t PlayoutDelay(uint16_t& delayMS) const override;
int32_t RecordingDelay(uint16_t& delayMS) const override;
- // CPU load
- int32_t CPULoad(uint16_t& load) const override;
-
bool PlayoutWarning() const override;
bool PlayoutError() const override;
bool RecordingWarning() const override;
@@ -165,7 +151,6 @@
int32_t _playout_index;
int32_t _record_index;
- AudioDeviceModule::BufferType _playBufType;
AudioDeviceBuffer* _ptrAudioBuffer;
int8_t* _recordingBuffer; // In bytes.
int8_t* _playoutBuffer; // In bytes.
diff --git a/webrtc/modules/audio_device/include/audio_device.h b/webrtc/modules/audio_device/include/audio_device.h
index a1276d9..1eedf1e 100644
--- a/webrtc/modules/audio_device/include/audio_device.h
+++ b/webrtc/modules/audio_device/include/audio_device.h
@@ -40,6 +40,8 @@
kDefaultDevice = -2
};
+ // Deprecated.
+ // TODO(henrika): to be removed.
enum BufferType {
kFixedBufferSize = 0,
kAdaptiveBufferSize = 1
@@ -127,7 +129,9 @@
virtual int32_t SpeakerVolume(uint32_t* volume) const = 0;
virtual int32_t MaxSpeakerVolume(uint32_t* maxVolume) const = 0;
virtual int32_t MinSpeakerVolume(uint32_t* minVolume) const = 0;
- virtual int32_t SpeakerVolumeStepSize(uint16_t* stepSize) const = 0;
+ // Deprecated.
+ // TODO(henrika): to be removed.
+ virtual int32_t SpeakerVolumeStepSize(uint16_t* stepSize) const { return -1; }
// Microphone volume controls
virtual int32_t MicrophoneVolumeIsAvailable(bool* available) = 0;
@@ -135,7 +139,11 @@
virtual int32_t MicrophoneVolume(uint32_t* volume) const = 0;
virtual int32_t MaxMicrophoneVolume(uint32_t* maxVolume) const = 0;
virtual int32_t MinMicrophoneVolume(uint32_t* minVolume) const = 0;
- virtual int32_t MicrophoneVolumeStepSize(uint16_t* stepSize) const = 0;
+ // Deprecated.
+ // TODO(henrika): to be removed.
+ virtual int32_t MicrophoneVolumeStepSize(uint16_t* stepSize) const {
+ return -1;
+ }
// Speaker mute control
virtual int32_t SpeakerMuteIsAvailable(bool* available) = 0;
@@ -147,10 +155,11 @@
virtual int32_t SetMicrophoneMute(bool enable) = 0;
virtual int32_t MicrophoneMute(bool* enabled) const = 0;
- // Microphone boost control
- virtual int32_t MicrophoneBoostIsAvailable(bool* available) = 0;
- virtual int32_t SetMicrophoneBoost(bool enable) = 0;
- virtual int32_t MicrophoneBoost(bool* enabled) const = 0;
+ // Deprecated.
+ // TODO(henrika): to be removed.
+ virtual int32_t MicrophoneBoostIsAvailable(bool* available) { return -1; }
+ virtual int32_t SetMicrophoneBoost(bool enable) { return -1; }
+ virtual int32_t MicrophoneBoost(bool* enabled) const { return -1; }
// Stereo support
virtual int32_t StereoPlayoutIsAvailable(bool* available) const = 0;
@@ -162,23 +171,29 @@
virtual int32_t SetRecordingChannel(const ChannelType channel) = 0;
virtual int32_t RecordingChannel(ChannelType* channel) const = 0;
- // Delay information and control
+ // Deprecated.
+ // TODO(henrika): to be removed.
virtual int32_t SetPlayoutBuffer(const BufferType type,
- uint16_t sizeMS = 0) = 0;
- virtual int32_t PlayoutBuffer(BufferType* type, uint16_t* sizeMS) const = 0;
+ uint16_t sizeMS = 0) { return -1; }
+ virtual int32_t PlayoutBuffer(BufferType* type, uint16_t* sizeMS) const {
+ return -1;
+ }
+ // Delay information and control
virtual int32_t PlayoutDelay(uint16_t* delayMS) const = 0;
virtual int32_t RecordingDelay(uint16_t* delayMS) const = 0;
- // CPU load
- virtual int32_t CPULoad(uint16_t* load) const = 0;
+ // Deprecated.
+ // TODO(henrika): to be removed.
+ virtual int32_t CPULoad(uint16_t* load) const { return -1; }
- // Recording of raw PCM data
+ // Deprecated.
+ // TODO(henrika): to be removed.
virtual int32_t StartRawOutputFileRecording(
- const char pcmFileNameUTF8[kAdmMaxFileNameSize]) = 0;
- virtual int32_t StopRawOutputFileRecording() = 0;
+ const char pcmFileNameUTF8[kAdmMaxFileNameSize]) { return -1; }
+ virtual int32_t StopRawOutputFileRecording() { return -1; }
virtual int32_t StartRawInputFileRecording(
- const char pcmFileNameUTF8[kAdmMaxFileNameSize]) = 0;
- virtual int32_t StopRawInputFileRecording() = 0;
+ const char pcmFileNameUTF8[kAdmMaxFileNameSize]) { return -1; }
+ virtual int32_t StopRawInputFileRecording() { return -1; }
// Native sample rate controls (samples/sec)
virtual int32_t SetRecordingSampleRate(const uint32_t samplesPerSec) = 0;
@@ -186,8 +201,11 @@
virtual int32_t SetPlayoutSampleRate(const uint32_t samplesPerSec) = 0;
virtual int32_t PlayoutSampleRate(uint32_t* samplesPerSec) const = 0;
+ // Deprecated.
+ // TODO(henrika): to be removed.
+ virtual int32_t ResetAudioDevice() { return -1; }
+
// Mobile device specific functions
- virtual int32_t ResetAudioDevice() = 0;
virtual int32_t SetLoudspeakerStatus(bool enable) = 0;
virtual int32_t GetLoudspeakerStatus(bool* enabled) const = 0;
diff --git a/webrtc/modules/audio_device/include/fake_audio_device.h b/webrtc/modules/audio_device/include/fake_audio_device.h
index 444b65c..8b38088 100644
--- a/webrtc/modules/audio_device/include/fake_audio_device.h
+++ b/webrtc/modules/audio_device/include/fake_audio_device.h
@@ -90,24 +90,17 @@
virtual int32_t SpeakerVolume(uint32_t* volume) const { return 0; }
virtual int32_t MaxSpeakerVolume(uint32_t* maxVolume) const { return 0; }
virtual int32_t MinSpeakerVolume(uint32_t* minVolume) const { return 0; }
- virtual int32_t SpeakerVolumeStepSize(uint16_t* stepSize) const { return 0; }
virtual int32_t MicrophoneVolumeIsAvailable(bool* available) { return 0; }
virtual int32_t SetMicrophoneVolume(uint32_t volume) { return 0; }
virtual int32_t MicrophoneVolume(uint32_t* volume) const { return 0; }
virtual int32_t MaxMicrophoneVolume(uint32_t* maxVolume) const { return 0; }
virtual int32_t MinMicrophoneVolume(uint32_t* minVolume) const { return 0; }
- virtual int32_t MicrophoneVolumeStepSize(uint16_t* stepSize) const {
- return 0;
- }
virtual int32_t SpeakerMuteIsAvailable(bool* available) { return 0; }
virtual int32_t SetSpeakerMute(bool enable) { return 0; }
virtual int32_t SpeakerMute(bool* enabled) const { return 0; }
virtual int32_t MicrophoneMuteIsAvailable(bool* available) { return 0; }
virtual int32_t SetMicrophoneMute(bool enable) { return 0; }
virtual int32_t MicrophoneMute(bool* enabled) const { return 0; }
- virtual int32_t MicrophoneBoostIsAvailable(bool* available) { return 0; }
- virtual int32_t SetMicrophoneBoost(bool enable) { return 0; }
- virtual int32_t MicrophoneBoost(bool* enabled) const { return 0; }
virtual int32_t StereoPlayoutIsAvailable(bool* available) const {
*available = false;
return 0;
@@ -120,29 +113,11 @@
virtual int32_t StereoRecording(bool* enabled) const { return 0; }
virtual int32_t SetRecordingChannel(const ChannelType channel) { return 0; }
virtual int32_t RecordingChannel(ChannelType* channel) const { return 0; }
- virtual int32_t SetPlayoutBuffer(const BufferType type,
- uint16_t sizeMS = 0) {
- return 0;
- }
- virtual int32_t PlayoutBuffer(BufferType* type, uint16_t* sizeMS) const {
- return 0;
- }
virtual int32_t PlayoutDelay(uint16_t* delayMS) const {
*delayMS = 0;
return 0;
}
virtual int32_t RecordingDelay(uint16_t* delayMS) const { return 0; }
- virtual int32_t CPULoad(uint16_t* load) const { return 0; }
- virtual int32_t StartRawOutputFileRecording(
- const char pcmFileNameUTF8[kAdmMaxFileNameSize]) {
- return 0;
- }
- virtual int32_t StopRawOutputFileRecording() { return 0; }
- virtual int32_t StartRawInputFileRecording(
- const char pcmFileNameUTF8[kAdmMaxFileNameSize]) {
- return 0;
- }
- virtual int32_t StopRawInputFileRecording() { return 0; }
virtual int32_t SetRecordingSampleRate(const uint32_t samplesPerSec) {
return 0;
}
@@ -153,7 +128,6 @@
return 0;
}
virtual int32_t PlayoutSampleRate(uint32_t* samplesPerSec) const { return 0; }
- virtual int32_t ResetAudioDevice() { return 0; }
virtual int32_t SetLoudspeakerStatus(bool enable) { return 0; }
virtual int32_t GetLoudspeakerStatus(bool* enabled) const { return 0; }
virtual bool BuiltInAECIsAvailable() const { return false; }
diff --git a/webrtc/modules/audio_device/include/mock_audio_device.h b/webrtc/modules/audio_device/include/mock_audio_device.h
index 424e5d5..1b80f7e 100644
--- a/webrtc/modules/audio_device/include/mock_audio_device.h
+++ b/webrtc/modules/audio_device/include/mock_audio_device.h
@@ -72,22 +72,17 @@
MOCK_CONST_METHOD1(SpeakerVolume, int32_t(uint32_t* volume));
MOCK_CONST_METHOD1(MaxSpeakerVolume, int32_t(uint32_t* maxVolume));
MOCK_CONST_METHOD1(MinSpeakerVolume, int32_t(uint32_t* minVolume));
- MOCK_CONST_METHOD1(SpeakerVolumeStepSize, int32_t(uint16_t* stepSize));
MOCK_METHOD1(MicrophoneVolumeIsAvailable, int32_t(bool* available));
MOCK_METHOD1(SetMicrophoneVolume, int32_t(uint32_t volume));
MOCK_CONST_METHOD1(MicrophoneVolume, int32_t(uint32_t* volume));
MOCK_CONST_METHOD1(MaxMicrophoneVolume, int32_t(uint32_t* maxVolume));
MOCK_CONST_METHOD1(MinMicrophoneVolume, int32_t(uint32_t* minVolume));
- MOCK_CONST_METHOD1(MicrophoneVolumeStepSize, int32_t(uint16_t* stepSize));
MOCK_METHOD1(SpeakerMuteIsAvailable, int32_t(bool* available));
MOCK_METHOD1(SetSpeakerMute, int32_t(bool enable));
MOCK_CONST_METHOD1(SpeakerMute, int32_t(bool* enabled));
MOCK_METHOD1(MicrophoneMuteIsAvailable, int32_t(bool* available));
MOCK_METHOD1(SetMicrophoneMute, int32_t(bool enable));
MOCK_CONST_METHOD1(MicrophoneMute, int32_t(bool* enabled));
- MOCK_METHOD1(MicrophoneBoostIsAvailable, int32_t(bool* available));
- MOCK_METHOD1(SetMicrophoneBoost, int32_t(bool enable));
- MOCK_CONST_METHOD1(MicrophoneBoost, int32_t(bool* enabled));
MOCK_CONST_METHOD1(StereoPlayoutIsAvailable, int32_t(bool* available));
MOCK_METHOD1(SetStereoPlayout, int32_t(bool enable));
MOCK_CONST_METHOD1(StereoPlayout, int32_t(bool* enabled));
@@ -96,24 +91,12 @@
MOCK_CONST_METHOD1(StereoRecording, int32_t(bool* enabled));
MOCK_METHOD1(SetRecordingChannel, int32_t(const ChannelType channel));
MOCK_CONST_METHOD1(RecordingChannel, int32_t(ChannelType* channel));
- MOCK_METHOD2(SetPlayoutBuffer, int32_t(const BufferType type,
- uint16_t sizeMS));
- MOCK_CONST_METHOD2(PlayoutBuffer, int32_t(BufferType* type,
- uint16_t* sizeMS));
MOCK_CONST_METHOD1(PlayoutDelay, int32_t(uint16_t* delayMS));
MOCK_CONST_METHOD1(RecordingDelay, int32_t(uint16_t* delayMS));
- MOCK_CONST_METHOD1(CPULoad, int32_t(uint16_t* load));
- MOCK_METHOD1(StartRawOutputFileRecording,
- int32_t(const char pcmFileNameUTF8[kAdmMaxFileNameSize]));
- MOCK_METHOD0(StopRawOutputFileRecording, int32_t());
- MOCK_METHOD1(StartRawInputFileRecording,
- int32_t(const char pcmFileNameUTF8[kAdmMaxFileNameSize]));
- MOCK_METHOD0(StopRawInputFileRecording, int32_t());
MOCK_METHOD1(SetRecordingSampleRate, int32_t(const uint32_t samplesPerSec));
MOCK_CONST_METHOD1(RecordingSampleRate, int32_t(uint32_t* samplesPerSec));
MOCK_METHOD1(SetPlayoutSampleRate, int32_t(const uint32_t samplesPerSec));
MOCK_CONST_METHOD1(PlayoutSampleRate, int32_t(uint32_t* samplesPerSec));
- MOCK_METHOD0(ResetAudioDevice, int32_t());
MOCK_METHOD1(SetLoudspeakerStatus, int32_t(bool enable));
MOCK_CONST_METHOD1(GetLoudspeakerStatus, int32_t(bool* enabled));
MOCK_CONST_METHOD0(BuiltInAECIsAvailable, bool());
diff --git a/webrtc/modules/audio_device/ios/audio_device_ios.h b/webrtc/modules/audio_device/ios/audio_device_ios.h
index 6ce2c69..7cccc16 100644
--- a/webrtc/modules/audio_device/ios/audio_device_ios.h
+++ b/webrtc/modules/audio_device/ios/audio_device_ios.h
@@ -93,11 +93,8 @@
// These methods are currently not fully implemented on iOS:
// See audio_device_not_implemented.cc for trivial implementations.
- int32_t PlayoutBuffer(AudioDeviceModule::BufferType& type,
- uint16_t& sizeMS) const override;
int32_t ActiveAudioLayer(
AudioDeviceModule::AudioLayer& audioLayer) const override;
- int32_t ResetAudioDevice() override;
int32_t PlayoutIsAvailable(bool& available) override;
int32_t RecordingIsAvailable(bool& available) override;
int32_t SetAGC(bool enable) override;
@@ -125,31 +122,23 @@
int32_t SpeakerVolume(uint32_t& volume) const override;
int32_t MaxSpeakerVolume(uint32_t& maxVolume) const override;
int32_t MinSpeakerVolume(uint32_t& minVolume) const override;
- int32_t SpeakerVolumeStepSize(uint16_t& stepSize) const override;
int32_t MicrophoneVolumeIsAvailable(bool& available) override;
int32_t SetMicrophoneVolume(uint32_t volume) override;
int32_t MicrophoneVolume(uint32_t& volume) const override;
int32_t MaxMicrophoneVolume(uint32_t& maxVolume) const override;
int32_t MinMicrophoneVolume(uint32_t& minVolume) const override;
- int32_t MicrophoneVolumeStepSize(uint16_t& stepSize) const override;
int32_t MicrophoneMuteIsAvailable(bool& available) override;
int32_t SetMicrophoneMute(bool enable) override;
int32_t MicrophoneMute(bool& enabled) const override;
int32_t SpeakerMuteIsAvailable(bool& available) override;
int32_t SetSpeakerMute(bool enable) override;
int32_t SpeakerMute(bool& enabled) const override;
- int32_t MicrophoneBoostIsAvailable(bool& available) override;
- int32_t SetMicrophoneBoost(bool enable) override;
- int32_t MicrophoneBoost(bool& enabled) const override;
int32_t StereoPlayoutIsAvailable(bool& available) override;
int32_t SetStereoPlayout(bool enable) override;
int32_t StereoPlayout(bool& enabled) const override;
int32_t StereoRecordingIsAvailable(bool& available) override;
int32_t SetStereoRecording(bool enable) override;
int32_t StereoRecording(bool& enabled) const override;
- int32_t SetPlayoutBuffer(const AudioDeviceModule::BufferType type,
- uint16_t sizeMS) override;
- int32_t CPULoad(uint16_t& load) const override;
bool PlayoutWarning() const override;
bool PlayoutError() const override;
bool RecordingWarning() const override;
diff --git a/webrtc/modules/audio_device/ios/audio_device_not_implemented_ios.mm b/webrtc/modules/audio_device/ios/audio_device_not_implemented_ios.mm
index e975f4d..f67c0a9 100644
--- a/webrtc/modules/audio_device/ios/audio_device_not_implemented_ios.mm
+++ b/webrtc/modules/audio_device/ios/audio_device_not_implemented_ios.mm
@@ -15,23 +15,12 @@
namespace webrtc {
-int32_t AudioDeviceIOS::PlayoutBuffer(AudioDeviceModule::BufferType& type,
- uint16_t& sizeMS) const {
- RTC_NOTREACHED() << "Not implemented";
- return -1;
-}
-
int32_t AudioDeviceIOS::ActiveAudioLayer(
AudioDeviceModule::AudioLayer& audioLayer) const {
audioLayer = AudioDeviceModule::kPlatformDefaultAudio;
return 0;
}
-int32_t AudioDeviceIOS::ResetAudioDevice() {
- RTC_NOTREACHED() << "Not implemented";
- return -1;
-}
-
int16_t AudioDeviceIOS::PlayoutDevices() {
// TODO(henrika): improve.
LOG_F(LS_WARNING) << "Not implemented";
@@ -77,11 +66,6 @@
return -1;
}
-int32_t AudioDeviceIOS::SpeakerVolumeStepSize(uint16_t& stepSize) const {
- RTC_NOTREACHED() << "Not implemented";
- return -1;
-}
-
int32_t AudioDeviceIOS::SpeakerMuteIsAvailable(bool& available) {
available = false;
return 0;
@@ -146,21 +130,6 @@
return -1;
}
-int32_t AudioDeviceIOS::MicrophoneBoostIsAvailable(bool& available) {
- available = false;
- return 0;
-}
-
-int32_t AudioDeviceIOS::SetMicrophoneBoost(bool enable) {
- RTC_NOTREACHED() << "Not implemented";
- return -1;
-}
-
-int32_t AudioDeviceIOS::MicrophoneBoost(bool& enabled) const {
- enabled = false;
- return 0;
-}
-
int32_t AudioDeviceIOS::StereoRecordingIsAvailable(bool& available) {
available = false;
return 0;
@@ -227,11 +196,6 @@
return -1;
}
-int32_t AudioDeviceIOS::MicrophoneVolumeStepSize(uint16_t& stepSize) const {
- RTC_NOTREACHED() << "Not implemented";
- return -1;
-}
-
int32_t AudioDeviceIOS::PlayoutDeviceName(uint16_t index,
char name[kAdmMaxDeviceNameSize],
char guid[kAdmMaxGuidSize]) {
@@ -267,16 +231,4 @@
return 0;
}
-int32_t AudioDeviceIOS::SetPlayoutBuffer(
- const AudioDeviceModule::BufferType type,
- uint16_t sizeMS) {
- RTC_NOTREACHED() << "Not implemented";
- return -1;
-}
-
-int32_t AudioDeviceIOS::CPULoad(uint16_t&) const {
- RTC_NOTREACHED() << "Not implemented";
- return -1;
-}
-
} // namespace webrtc
diff --git a/webrtc/modules/audio_device/linux/audio_device_alsa_linux.cc b/webrtc/modules/audio_device/linux/audio_device_alsa_linux.cc
index cd13466..9e2c5b1 100644
--- a/webrtc/modules/audio_device/linux/audio_device_alsa_linux.cc
+++ b/webrtc/modules/audio_device/linux/audio_device_alsa_linux.cc
@@ -82,7 +82,6 @@
_playoutBuffer(NULL),
_recordingFramesLeft(0),
_playoutFramesLeft(0),
- _playBufType(AudioDeviceModule::kFixedBufferSize),
_initialized(false),
_recording(false),
_playing(false),
@@ -94,9 +93,7 @@
_playWarning(0),
_playError(0),
_recWarning(0),
- _recError(0),
- _playBufDelay(80),
- _playBufDelayFixed(80)
+ _recError(0)
{
memset(_oldKeyState, 0, sizeof(_oldKeyState));
LOG(LS_INFO) << __FUNCTION__ << " created";
@@ -353,22 +350,6 @@
return 0;
}
-int32_t AudioDeviceLinuxALSA::SpeakerVolumeStepSize(
- uint16_t& stepSize) const
-{
-
- uint16_t delta(0);
-
- if (_mixerManager.SpeakerVolumeStepSize(delta) == -1)
- {
- return -1;
- }
-
- stepSize = delta;
-
- return 0;
-}
-
int32_t AudioDeviceLinuxALSA::SpeakerMuteIsAvailable(bool& available)
{
@@ -477,58 +458,6 @@
return 0;
}
-int32_t AudioDeviceLinuxALSA::MicrophoneBoostIsAvailable(bool& available)
-{
-
- bool isAvailable(false);
- bool wasInitialized = _mixerManager.MicrophoneIsInitialized();
-
- // Enumerate all avaliable microphone and make an attempt to open up the
- // input mixer corresponding to the currently selected input device.
- //
- if (!wasInitialized && InitMicrophone() == -1)
- {
- // If we end up here it means that the selected microphone has no volume
- // control, hence it is safe to state that there is no boost control
- // already at this stage.
- available = false;
- return 0;
- }
-
- // Check if the selected microphone has a boost control
- _mixerManager.MicrophoneBoostIsAvailable(isAvailable);
- available = isAvailable;
-
- // Close the initialized input mixer
- if (!wasInitialized)
- {
- _mixerManager.CloseMicrophone();
- }
-
- return 0;
-}
-
-int32_t AudioDeviceLinuxALSA::SetMicrophoneBoost(bool enable)
-{
-
- return (_mixerManager.SetMicrophoneBoost(enable));
-}
-
-int32_t AudioDeviceLinuxALSA::MicrophoneBoost(bool& enabled) const
-{
-
- bool onOff(0);
-
- if (_mixerManager.MicrophoneBoost(onOff) == -1)
- {
- return -1;
- }
-
- enabled = onOff;
-
- return 0;
-}
-
int32_t AudioDeviceLinuxALSA::StereoRecordingIsAvailable(bool& available)
{
@@ -769,22 +698,6 @@
return 0;
}
-int32_t AudioDeviceLinuxALSA::MicrophoneVolumeStepSize(
- uint16_t& stepSize) const
-{
-
- uint16_t delta(0);
-
- if (_mixerManager.MicrophoneVolumeStepSize(delta) == -1)
- {
- return -1;
- }
-
- stepSize = delta;
-
- return 0;
-}
-
int16_t AudioDeviceLinuxALSA::PlayoutDevices()
{
@@ -1533,45 +1446,6 @@
{
return (_playing);
}
-// ----------------------------------------------------------------------------
-// SetPlayoutBuffer
-// ----------------------------------------------------------------------------
-
-int32_t AudioDeviceLinuxALSA::SetPlayoutBuffer(
- const AudioDeviceModule::BufferType type,
- uint16_t sizeMS)
-{
- _playBufType = type;
- if (type == AudioDeviceModule::kFixedBufferSize)
- {
- _playBufDelayFixed = sizeMS;
- }
- return 0;
-}
-
-int32_t AudioDeviceLinuxALSA::PlayoutBuffer(
- AudioDeviceModule::BufferType& type,
- uint16_t& sizeMS) const
-{
- type = _playBufType;
- if (type == AudioDeviceModule::kFixedBufferSize)
- {
- sizeMS = _playBufDelayFixed;
- }
- else
- {
- sizeMS = _playBufDelay;
- }
-
- return 0;
-}
-
-int32_t AudioDeviceLinuxALSA::CPULoad(uint16_t& load) const
-{
-
- LOG(LS_WARNING) << "API call not supported on this platform";
- return -1;
-}
bool AudioDeviceLinuxALSA::PlayoutWarning() const
{
diff --git a/webrtc/modules/audio_device/linux/audio_device_alsa_linux.h b/webrtc/modules/audio_device/linux/audio_device_alsa_linux.h
index f7fb9a9..2648465 100644
--- a/webrtc/modules/audio_device/linux/audio_device_alsa_linux.h
+++ b/webrtc/modules/audio_device/linux/audio_device_alsa_linux.h
@@ -95,7 +95,6 @@
int32_t SpeakerVolume(uint32_t& volume) const override;
int32_t MaxSpeakerVolume(uint32_t& maxVolume) const override;
int32_t MinSpeakerVolume(uint32_t& minVolume) const override;
- int32_t SpeakerVolumeStepSize(uint16_t& stepSize) const override;
// Microphone volume controls
int32_t MicrophoneVolumeIsAvailable(bool& available) override;
@@ -103,7 +102,6 @@
int32_t MicrophoneVolume(uint32_t& volume) const override;
int32_t MaxMicrophoneVolume(uint32_t& maxVolume) const override;
int32_t MinMicrophoneVolume(uint32_t& minVolume) const override;
- int32_t MicrophoneVolumeStepSize(uint16_t& stepSize) const override;
// Speaker mute control
int32_t SpeakerMuteIsAvailable(bool& available) override;
@@ -115,11 +113,6 @@
int32_t SetMicrophoneMute(bool enable) override;
int32_t MicrophoneMute(bool& enabled) const override;
- // Microphone boost control
- int32_t MicrophoneBoostIsAvailable(bool& available) override;
- int32_t SetMicrophoneBoost(bool enable) override;
- int32_t MicrophoneBoost(bool& enabled) const override;
-
// Stereo support
int32_t StereoPlayoutIsAvailable(bool& available) override;
int32_t SetStereoPlayout(bool enable) override;
@@ -129,26 +122,19 @@
int32_t StereoRecording(bool& enabled) const override;
// Delay information and control
- int32_t SetPlayoutBuffer(const AudioDeviceModule::BufferType type,
- uint16_t sizeMS) override;
- int32_t PlayoutBuffer(AudioDeviceModule::BufferType& type,
- uint16_t& sizeMS) const override;
int32_t PlayoutDelay(uint16_t& delayMS) const override;
int32_t RecordingDelay(uint16_t& delayMS) const override;
- // CPU load
- int32_t CPULoad(uint16_t& load) const override;
+ bool PlayoutWarning() const override;
+ bool PlayoutError() const override;
+ bool RecordingWarning() const override;
+ bool RecordingError() const override;
+ void ClearPlayoutWarning() override;
+ void ClearPlayoutError() override;
+ void ClearRecordingWarning() override;
+ void ClearRecordingError() override;
- bool PlayoutWarning() const override;
- bool PlayoutError() const override;
- bool RecordingWarning() const override;
- bool RecordingError() const override;
- void ClearPlayoutWarning() override;
- void ClearPlayoutError() override;
- void ClearRecordingWarning() override;
- void ClearRecordingError() override;
-
- void AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) override;
+ void AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) override;
private:
int32_t GetDevicesInfo(const int32_t function,
@@ -210,8 +196,6 @@
uint32_t _recordingFramesLeft;
uint32_t _playoutFramesLeft;
- AudioDeviceModule::BufferType _playBufType;
-
bool _initialized;
bool _recording;
bool _playing;
@@ -227,9 +211,6 @@
uint16_t _recWarning;
uint16_t _recError;
- uint16_t _playBufDelay; // playback delay
- uint16_t _playBufDelayFixed; // fixed playback delay
-
char _oldKeyState[32];
#if defined(USE_X11)
Display* _XDisplay;
diff --git a/webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc b/webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc
index 8760980..0e03932 100644
--- a/webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc
+++ b/webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc
@@ -40,7 +40,6 @@
sample_rate_hz_(0),
_recChannels(1),
_playChannels(1),
- _playBufType(AudioDeviceModule::kFixedBufferSize),
_initialized(false),
_recording(false),
_playing(false),
@@ -52,7 +51,6 @@
_stopPlay(false),
_AGC(false),
update_speaker_volume_at_startup_(false),
- _playBufDelayFixed(20),
_sndCardPlayDelay(0),
_sndCardRecDelay(0),
_writeErrors(0),
@@ -398,19 +396,6 @@
return 0;
}
-int32_t AudioDeviceLinuxPulse::SpeakerVolumeStepSize(uint16_t& stepSize) const {
- RTC_DCHECK(thread_checker_.CalledOnValidThread());
- uint16_t delta(0);
-
- if (_mixerManager.SpeakerVolumeStepSize(delta) == -1) {
- return -1;
- }
-
- stepSize = delta;
-
- return 0;
-}
-
int32_t AudioDeviceLinuxPulse::SpeakerMuteIsAvailable(bool& available) {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
bool isAvailable(false);
@@ -502,52 +487,6 @@
return 0;
}
-int32_t AudioDeviceLinuxPulse::MicrophoneBoostIsAvailable(bool& available) {
- RTC_DCHECK(thread_checker_.CalledOnValidThread());
- bool isAvailable(false);
- bool wasInitialized = _mixerManager.MicrophoneIsInitialized();
-
- // Enumerate all avaliable microphone and make an attempt to open up the
- // input mixer corresponding to the currently selected input device.
- //
- if (!wasInitialized && InitMicrophone() == -1) {
- // If we end up here it means that the selected microphone has no
- // volume control, hence it is safe to state that there is no
- // boost control already at this stage.
- available = false;
- return 0;
- }
-
- // Check if the selected microphone has a boost control
- _mixerManager.MicrophoneBoostIsAvailable(isAvailable);
- available = isAvailable;
-
- // Close the initialized input mixer
- if (!wasInitialized) {
- _mixerManager.CloseMicrophone();
- }
-
- return 0;
-}
-
-int32_t AudioDeviceLinuxPulse::SetMicrophoneBoost(bool enable) {
- RTC_DCHECK(thread_checker_.CalledOnValidThread());
- return (_mixerManager.SetMicrophoneBoost(enable));
-}
-
-int32_t AudioDeviceLinuxPulse::MicrophoneBoost(bool& enabled) const {
- RTC_DCHECK(thread_checker_.CalledOnValidThread());
- bool onOff(0);
-
- if (_mixerManager.MicrophoneBoost(onOff) == -1) {
- return -1;
- }
-
- enabled = onOff;
-
- return 0;
-}
-
int32_t AudioDeviceLinuxPulse::StereoRecordingIsAvailable(bool& available) {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
if (_recChannels == 2 && _recording) {
@@ -727,20 +666,6 @@
return 0;
}
-int32_t AudioDeviceLinuxPulse::MicrophoneVolumeStepSize(
- uint16_t& stepSize) const {
- RTC_DCHECK(thread_checker_.CalledOnValidThread());
- uint16_t delta(0);
-
- if (_mixerManager.MicrophoneVolumeStepSize(delta) == -1) {
- return -1;
- }
-
- stepSize = delta;
-
- return 0;
-}
-
int16_t AudioDeviceLinuxPulse::PlayoutDevices() {
PaLock();
@@ -1367,36 +1292,6 @@
return (_playing);
}
-int32_t AudioDeviceLinuxPulse::SetPlayoutBuffer(
- const AudioDeviceModule::BufferType type,
- uint16_t sizeMS) {
- RTC_DCHECK(thread_checker_.CalledOnValidThread());
- if (type != AudioDeviceModule::kFixedBufferSize) {
- LOG(LS_ERROR) << "Adaptive buffer size not supported on this platform";
- return -1;
- }
-
- _playBufType = type;
- _playBufDelayFixed = sizeMS;
-
- return 0;
-}
-
-int32_t AudioDeviceLinuxPulse::PlayoutBuffer(
- AudioDeviceModule::BufferType& type,
- uint16_t& sizeMS) const {
- RTC_DCHECK(thread_checker_.CalledOnValidThread());
- type = _playBufType;
- sizeMS = _playBufDelayFixed;
-
- return 0;
-}
-
-int32_t AudioDeviceLinuxPulse::CPULoad(uint16_t& /*load*/) const {
- LOG(LS_WARNING) << "API call not supported on this platform";
- return -1;
-}
-
bool AudioDeviceLinuxPulse::PlayoutWarning() const {
rtc::CritScope lock(&_critSect);
return (_playWarning > 0);
diff --git a/webrtc/modules/audio_device/linux/audio_device_pulse_linux.h b/webrtc/modules/audio_device/linux/audio_device_pulse_linux.h
index 00ed547..7e8d683 100644
--- a/webrtc/modules/audio_device/linux/audio_device_pulse_linux.h
+++ b/webrtc/modules/audio_device/linux/audio_device_pulse_linux.h
@@ -157,7 +157,6 @@
int32_t SpeakerVolume(uint32_t& volume) const override;
int32_t MaxSpeakerVolume(uint32_t& maxVolume) const override;
int32_t MinSpeakerVolume(uint32_t& minVolume) const override;
- int32_t SpeakerVolumeStepSize(uint16_t& stepSize) const override;
// Microphone volume controls
int32_t MicrophoneVolumeIsAvailable(bool& available) override;
@@ -165,7 +164,6 @@
int32_t MicrophoneVolume(uint32_t& volume) const override;
int32_t MaxMicrophoneVolume(uint32_t& maxVolume) const override;
int32_t MinMicrophoneVolume(uint32_t& minVolume) const override;
- int32_t MicrophoneVolumeStepSize(uint16_t& stepSize) const override;
// Speaker mute control
int32_t SpeakerMuteIsAvailable(bool& available) override;
@@ -177,11 +175,6 @@
int32_t SetMicrophoneMute(bool enable) override;
int32_t MicrophoneMute(bool& enabled) const override;
- // Microphone boost control
- int32_t MicrophoneBoostIsAvailable(bool& available) override;
- int32_t SetMicrophoneBoost(bool enable) override;
- int32_t MicrophoneBoost(bool& enabled) const override;
-
// Stereo support
int32_t StereoPlayoutIsAvailable(bool& available) override;
int32_t SetStereoPlayout(bool enable) override;
@@ -191,16 +184,9 @@
int32_t StereoRecording(bool& enabled) const override;
// Delay information and control
- int32_t SetPlayoutBuffer(const AudioDeviceModule::BufferType type,
- uint16_t sizeMS) override;
- int32_t PlayoutBuffer(AudioDeviceModule::BufferType& type,
- uint16_t& sizeMS) const override;
int32_t PlayoutDelay(uint16_t& delayMS) const override;
int32_t RecordingDelay(uint16_t& delayMS) const override;
- // CPU load
- int32_t CPULoad(uint16_t& load) const override;
-
bool PlayoutWarning() const override;
bool PlayoutError() const override;
bool RecordingWarning() const override;
@@ -295,8 +281,6 @@
uint8_t _recChannels;
uint8_t _playChannels;
- AudioDeviceModule::BufferType _playBufType;
-
// Stores thread ID in constructor.
// We can then use ThreadChecker::CalledOnValidThread() to ensure that
// other methods are called from the same thread.
@@ -315,8 +299,6 @@
bool _AGC;
bool update_speaker_volume_at_startup_;
- uint16_t _playBufDelayFixed; // fixed playback delay
-
uint32_t _sndCardPlayDelay;
uint32_t _sndCardRecDelay;
diff --git a/webrtc/modules/audio_device/linux/audio_mixer_manager_alsa_linux.cc b/webrtc/modules/audio_device/linux/audio_mixer_manager_alsa_linux.cc
index 8bc63c3..9ce0ca1 100644
--- a/webrtc/modules/audio_device/linux/audio_mixer_manager_alsa_linux.cc
+++ b/webrtc/modules/audio_device/linux/audio_mixer_manager_alsa_linux.cc
@@ -534,22 +534,6 @@
}
*/
-int32_t AudioMixerManagerLinuxALSA::SpeakerVolumeStepSize(
- uint16_t& stepSize) const
-{
-
- if (_outputMixerHandle == NULL)
- {
- LOG(LS_WARNING) << "no avaliable output mixer exists";
- return -1;
- }
-
- // The step size is always 1 for ALSA
- stepSize = 1;
-
- return 0;
-}
-
int32_t AudioMixerManagerLinuxALSA::SpeakerVolumeIsAvailable(
bool& available)
{
@@ -743,63 +727,6 @@
return 0;
}
-int32_t AudioMixerManagerLinuxALSA::MicrophoneBoostIsAvailable(
- bool& available)
-{
- if (_inputMixerHandle == NULL)
- {
- LOG(LS_WARNING) << "no avaliable input mixer exists";
- return -1;
- }
-
- // Microphone boost cannot be enabled through ALSA Simple Mixer Interface
- available = false;
-
- return 0;
-}
-
-int32_t AudioMixerManagerLinuxALSA::SetMicrophoneBoost(bool enable)
-{
- LOG(LS_VERBOSE) << "AudioMixerManagerLinuxALSA::SetMicrophoneBoost(enable="
- << enable << ")";
-
- rtc::CritScope lock(&_critSect);
-
- if (_inputMixerHandle == NULL)
- {
- LOG(LS_WARNING) << "no avaliable input mixer exists";
- return -1;
- }
-
- // Ensure that the selected microphone destination has a valid mute control.
- bool available(false);
- MicrophoneMuteIsAvailable(available);
- if (!available)
- {
- LOG(LS_WARNING) << "it is not possible to enable microphone boost";
- return -1;
- }
-
- // It is assumed that the call above fails!
-
- return (0);
-}
-
-int32_t AudioMixerManagerLinuxALSA::MicrophoneBoost(bool& enabled) const
-{
-
- if (_inputMixerHandle == NULL)
- {
- LOG(LS_WARNING) << "no avaliable input mixer exists";
- return -1;
- }
-
- // Microphone boost cannot be enabled on this platform!
- enabled = false;
-
- return 0;
-}
-
int32_t AudioMixerManagerLinuxALSA::MicrophoneVolumeIsAvailable(
bool& available)
{
@@ -1027,22 +954,6 @@
return 0;
}
-int32_t AudioMixerManagerLinuxALSA::MicrophoneVolumeStepSize(
- uint16_t& stepSize) const
-{
-
- if (_inputMixerHandle == NULL)
- {
- LOG(LS_WARNING) << "no avaliable input mixer exists";
- return -1;
- }
-
- // The step size is always 1 for ALSA
- stepSize = 1;
-
- return 0;
-}
-
// ============================================================================
// Private Methods
// ============================================================================
diff --git a/webrtc/modules/audio_device/linux/audio_mixer_manager_alsa_linux.h b/webrtc/modules/audio_device/linux/audio_mixer_manager_alsa_linux.h
index 532b66a..58fb400 100644
--- a/webrtc/modules/audio_device/linux/audio_mixer_manager_alsa_linux.h
+++ b/webrtc/modules/audio_device/linux/audio_mixer_manager_alsa_linux.h
@@ -30,7 +30,6 @@
int32_t SpeakerVolume(uint32_t& volume) const;
int32_t MaxSpeakerVolume(uint32_t& maxVolume) const;
int32_t MinSpeakerVolume(uint32_t& minVolume) const;
- int32_t SpeakerVolumeStepSize(uint16_t& stepSize) const;
int32_t SpeakerVolumeIsAvailable(bool& available);
int32_t SpeakerMuteIsAvailable(bool& available);
int32_t SetSpeakerMute(bool enable);
@@ -38,15 +37,11 @@
int32_t MicrophoneMuteIsAvailable(bool& available);
int32_t SetMicrophoneMute(bool enable);
int32_t MicrophoneMute(bool& enabled) const;
- int32_t MicrophoneBoostIsAvailable(bool& available);
- int32_t SetMicrophoneBoost(bool enable);
- int32_t MicrophoneBoost(bool& enabled) const;
int32_t MicrophoneVolumeIsAvailable(bool& available);
int32_t SetMicrophoneVolume(uint32_t volume);
int32_t MicrophoneVolume(uint32_t& volume) const;
int32_t MaxMicrophoneVolume(uint32_t& maxVolume) const;
int32_t MinMicrophoneVolume(uint32_t& minVolume) const;
- int32_t MicrophoneVolumeStepSize(uint16_t& stepSize) const;
int32_t Close();
int32_t CloseSpeaker();
int32_t CloseMicrophone();
diff --git a/webrtc/modules/audio_device/linux/audio_mixer_manager_pulse_linux.cc b/webrtc/modules/audio_device/linux/audio_mixer_manager_pulse_linux.cc
index c7899a9..afffc1d 100644
--- a/webrtc/modules/audio_device/linux/audio_mixer_manager_pulse_linux.cc
+++ b/webrtc/modules/audio_device/linux/audio_mixer_manager_pulse_linux.cc
@@ -344,27 +344,6 @@
}
int32_t
-AudioMixerManagerLinuxPulse::SpeakerVolumeStepSize(uint16_t& stepSize) const
-{
- RTC_DCHECK(thread_checker_.CalledOnValidThread());
- if (_paOutputDeviceIndex == -1)
- {
- LOG(LS_WARNING) << "output device index has not been set";
- return -1;
- }
-
- // The sink input (stream) will always have step size = 1
- // There are PA_VOLUME_NORM+1 steps
- stepSize = 1;
-
- LOG(LS_VERBOSE)
- << "AudioMixerManagerLinuxPulse::SpeakerVolumeStepSize() => size="
- << stepSize;
-
- return 0;
-}
-
-int32_t
AudioMixerManagerLinuxPulse::SpeakerVolumeIsAvailable(bool& available)
{
RTC_DCHECK(thread_checker_.CalledOnValidThread());
@@ -653,65 +632,6 @@
return 0;
}
-int32_t
-AudioMixerManagerLinuxPulse::MicrophoneBoostIsAvailable(bool& available)
-{
- RTC_DCHECK(thread_checker_.CalledOnValidThread());
- if (_paInputDeviceIndex == -1)
- {
- LOG(LS_WARNING) << "input device index has not been set";
- return -1;
- }
-
- // Always unavailable in Pulse Audio
- // Could make it possible to use PA_VOLUME_MAX
- // but that gives bad audio with some sound cards
- available = false;
-
- return 0;
-}
-
-int32_t AudioMixerManagerLinuxPulse::SetMicrophoneBoost(bool enable)
-{
- RTC_DCHECK(thread_checker_.CalledOnValidThread());
- LOG(LS_VERBOSE) << "AudioMixerManagerLinuxPulse::SetMicrophoneBoost(enable="
- << enable << ")";
-
- if (_paInputDeviceIndex == -1)
- {
- LOG(LS_WARNING) << "input device index has not been set";
- return -1;
- }
-
- // Ensure the selected microphone destination has a valid boost control
- bool available(false);
- MicrophoneBoostIsAvailable(available);
- if (!available)
- {
- LOG(LS_WARNING) << "it is not possible to enable microphone boost";
- return -1;
- }
-
- // It is assumed that the call above fails!
-
- return 0;
-}
-
-int32_t AudioMixerManagerLinuxPulse::MicrophoneBoost(bool& enabled) const
-{
- RTC_DCHECK(thread_checker_.CalledOnValidThread());
- if (_paInputDeviceIndex == -1)
- {
- LOG(LS_WARNING) << "input device index has not been set";
- return -1;
- }
-
- // Microphone boost cannot be enabled on this platform!
- enabled = false;
-
- return 0;
-}
-
int32_t AudioMixerManagerLinuxPulse::MicrophoneVolumeIsAvailable(
bool& available)
{
@@ -875,48 +795,6 @@
return 0;
}
-int32_t AudioMixerManagerLinuxPulse::MicrophoneVolumeStepSize(
- uint16_t& stepSize) const
-{
- RTC_DCHECK(thread_checker_.CalledOnValidThread());
- if (_paInputDeviceIndex == -1)
- {
- LOG(LS_WARNING) << "input device index has not been set";
- return -1;
- }
-
- uint32_t deviceIndex = (uint32_t) _paInputDeviceIndex;
-
- AutoPulseLock auto_lock(_paMainloop);
-
- // Get the actual stream device index if we have a connected stream
- // The device used by the stream can be changed
- // during the call
- if (_paRecStream && (LATE(pa_stream_get_state)(_paRecStream)
- != PA_STREAM_UNCONNECTED))
- {
- deviceIndex = LATE(pa_stream_get_device_index)(_paRecStream);
- }
-
- pa_operation* paOperation = NULL;
-
- // Get info for this source
- paOperation
- = LATE(pa_context_get_source_info_by_index)(_paContext, deviceIndex,
- PaSourceInfoCallback,
- (void*) this);
-
- WaitForOperationCompletion(paOperation);
-
- stepSize = static_cast<uint16_t> ((PA_VOLUME_NORM + 1) / _paVolSteps);
-
- LOG(LS_VERBOSE)
- << "AudioMixerManagerLinuxPulse::MicrophoneVolumeStepSize() => size="
- << stepSize;
-
- return 0;
-}
-
// ===========================================================================
// Private Methods
// ===========================================================================
diff --git a/webrtc/modules/audio_device/linux/audio_mixer_manager_pulse_linux.h b/webrtc/modules/audio_device/linux/audio_mixer_manager_pulse_linux.h
index 40265d6..f639e82 100644
--- a/webrtc/modules/audio_device/linux/audio_mixer_manager_pulse_linux.h
+++ b/webrtc/modules/audio_device/linux/audio_mixer_manager_pulse_linux.h
@@ -37,7 +37,6 @@
int32_t SpeakerVolume(uint32_t& volume) const;
int32_t MaxSpeakerVolume(uint32_t& maxVolume) const;
int32_t MinSpeakerVolume(uint32_t& minVolume) const;
- int32_t SpeakerVolumeStepSize(uint16_t& stepSize) const;
int32_t SpeakerVolumeIsAvailable(bool& available);
int32_t SpeakerMuteIsAvailable(bool& available);
int32_t SetSpeakerMute(bool enable);
@@ -47,15 +46,11 @@
int32_t MicrophoneMuteIsAvailable(bool& available);
int32_t SetMicrophoneMute(bool enable);
int32_t MicrophoneMute(bool& enabled) const;
- int32_t MicrophoneBoostIsAvailable(bool& available);
- int32_t SetMicrophoneBoost(bool enable);
- int32_t MicrophoneBoost(bool& enabled) const;
int32_t MicrophoneVolumeIsAvailable(bool& available);
int32_t SetMicrophoneVolume(uint32_t volume);
int32_t MicrophoneVolume(uint32_t& volume) const;
int32_t MaxMicrophoneVolume(uint32_t& maxVolume) const;
int32_t MinMicrophoneVolume(uint32_t& minVolume) const;
- int32_t MicrophoneVolumeStepSize(uint16_t& stepSize) const;
int32_t SetPulseAudioObjects(pa_threaded_mainloop* mainloop,
pa_context* context);
int32_t Close();
diff --git a/webrtc/modules/audio_device/mac/audio_device_mac.cc b/webrtc/modules/audio_device/mac/audio_device_mac.cc
index 2b48930..0de5009 100644
--- a/webrtc/modules/audio_device/mac/audio_device_mac.cc
+++ b/webrtc/modules/audio_device/mac/audio_device_mac.cc
@@ -125,7 +125,6 @@
_playChannels(N_PLAY_CHANNELS),
_captureBufData(NULL),
_renderBufData(NULL),
- _playBufType(AudioDeviceModule::kFixedBufferSize),
_initialized(false),
_isShutDown(false),
_recording(false),
@@ -145,7 +144,6 @@
_captureDelayUs(0),
_renderDelayUs(0),
_renderDelayOffsetSamples(0),
- _playBufDelayFixed(20),
_playWarning(0),
_playError(0),
_recWarning(0),
@@ -570,17 +568,6 @@
return 0;
}
-int32_t AudioDeviceMac::SpeakerVolumeStepSize(uint16_t& stepSize) const {
- uint16_t delta(0);
-
- if (_mixerManager.SpeakerVolumeStepSize(delta) == -1) {
- return -1;
- }
-
- stepSize = delta;
- return 0;
-}
-
int32_t AudioDeviceMac::SpeakerMuteIsAvailable(bool& available) {
bool isAvailable(false);
bool wasInitialized = _mixerManager.SpeakerIsInitialized();
@@ -670,50 +657,6 @@
return 0;
}
-int32_t AudioDeviceMac::MicrophoneBoostIsAvailable(bool& available) {
- bool isAvailable(false);
- bool wasInitialized = _mixerManager.MicrophoneIsInitialized();
-
- // Enumerate all avaliable microphone and make an attempt to open up the
- // input mixer corresponding to the currently selected input device.
- //
- if (!wasInitialized && InitMicrophone() == -1) {
- // If we end up here it means that the selected microphone has no volume
- // control, hence it is safe to state that there is no boost control
- // already at this stage.
- available = false;
- return 0;
- }
-
- // Check if the selected microphone has a boost control
- //
- _mixerManager.MicrophoneBoostIsAvailable(isAvailable);
- available = isAvailable;
-
- // Close the initialized input mixer
- //
- if (!wasInitialized) {
- _mixerManager.CloseMicrophone();
- }
-
- return 0;
-}
-
-int32_t AudioDeviceMac::SetMicrophoneBoost(bool enable) {
- return (_mixerManager.SetMicrophoneBoost(enable));
-}
-
-int32_t AudioDeviceMac::MicrophoneBoost(bool& enabled) const {
- bool onOff(0);
-
- if (_mixerManager.MicrophoneBoost(onOff) == -1) {
- return -1;
- }
-
- enabled = onOff;
- return 0;
-}
-
int32_t AudioDeviceMac::StereoRecordingIsAvailable(bool& available) {
bool isAvailable(false);
bool wasInitialized = _mixerManager.MicrophoneIsInitialized();
@@ -873,17 +816,6 @@
return 0;
}
-int32_t AudioDeviceMac::MicrophoneVolumeStepSize(uint16_t& stepSize) const {
- uint16_t delta(0);
-
- if (_mixerManager.MicrophoneVolumeStepSize(delta) == -1) {
- return -1;
- }
-
- stepSize = delta;
- return 0;
-}
-
int16_t AudioDeviceMac::PlayoutDevices() {
AudioDeviceID playDevices[MaxNumberDevices];
return GetNumberDevices(kAudioDevicePropertyScopeOutput, playDevices,
@@ -1623,34 +1555,6 @@
return (_playing);
}
-int32_t AudioDeviceMac::SetPlayoutBuffer(
- const AudioDeviceModule::BufferType type,
- uint16_t sizeMS) {
- if (type != AudioDeviceModule::kFixedBufferSize) {
- LOG(LS_ERROR) << "Adaptive buffer size not supported on this platform";
- return -1;
- }
-
- _playBufType = type;
- _playBufDelayFixed = sizeMS;
- return 0;
-}
-
-int32_t AudioDeviceMac::PlayoutBuffer(AudioDeviceModule::BufferType& type,
- uint16_t& sizeMS) const {
- type = _playBufType;
- sizeMS = _playBufDelayFixed;
-
- return 0;
-}
-
-// Not implemented for Mac.
-int32_t AudioDeviceMac::CPULoad(uint16_t& /*load*/) const {
- LOG(LS_WARNING) << "API call not supported on this platform";
-
- return -1;
-}
-
bool AudioDeviceMac::PlayoutWarning() const {
return (_playWarning > 0);
}
@@ -1978,9 +1882,10 @@
WEBRTC_CA_RETURN_ON_ERR(AudioConverterNew(
&_outDesiredFormat, &_outStreamFormat, &_renderConverter));
- // Try to set buffer size to desired value (_playBufDelayFixed).
+ // Try to set buffer size to desired value set to 20ms.
+ const uint16_t kPlayBufDelayFixed = 20;
UInt32 bufByteCount = static_cast<UInt32>(
- (_outStreamFormat.mSampleRate / 1000.0) * _playBufDelayFixed *
+ (_outStreamFormat.mSampleRate / 1000.0) * kPlayBufDelayFixed *
_outStreamFormat.mChannelsPerFrame * sizeof(Float32));
if (_outStreamFormat.mFramesPerPacket != 0) {
if (bufByteCount % _outStreamFormat.mFramesPerPacket != 0) {
diff --git a/webrtc/modules/audio_device/mac/audio_device_mac.h b/webrtc/modules/audio_device/mac/audio_device_mac.h
index c8a4b20..bdd8d83 100644
--- a/webrtc/modules/audio_device/mac/audio_device_mac.h
+++ b/webrtc/modules/audio_device/mac/audio_device_mac.h
@@ -123,7 +123,6 @@
virtual int32_t SpeakerVolume(uint32_t& volume) const;
virtual int32_t MaxSpeakerVolume(uint32_t& maxVolume) const;
virtual int32_t MinSpeakerVolume(uint32_t& minVolume) const;
- virtual int32_t SpeakerVolumeStepSize(uint16_t& stepSize) const;
// Microphone volume controls
virtual int32_t MicrophoneVolumeIsAvailable(bool& available);
@@ -131,7 +130,6 @@
virtual int32_t MicrophoneVolume(uint32_t& volume) const;
virtual int32_t MaxMicrophoneVolume(uint32_t& maxVolume) const;
virtual int32_t MinMicrophoneVolume(uint32_t& minVolume) const;
- virtual int32_t MicrophoneVolumeStepSize(uint16_t& stepSize) const;
// Microphone mute control
virtual int32_t MicrophoneMuteIsAvailable(bool& available);
@@ -143,11 +141,6 @@
virtual int32_t SetSpeakerMute(bool enable);
virtual int32_t SpeakerMute(bool& enabled) const;
- // Microphone boost control
- virtual int32_t MicrophoneBoostIsAvailable(bool& available);
- virtual int32_t SetMicrophoneBoost(bool enable);
- virtual int32_t MicrophoneBoost(bool& enabled) const;
-
// Stereo support
virtual int32_t StereoPlayoutIsAvailable(bool& available);
virtual int32_t SetStereoPlayout(bool enable);
@@ -157,16 +150,9 @@
virtual int32_t StereoRecording(bool& enabled) const;
// Delay information and control
- virtual int32_t SetPlayoutBuffer(const AudioDeviceModule::BufferType type,
- uint16_t sizeMS);
- virtual int32_t PlayoutBuffer(AudioDeviceModule::BufferType& type,
- uint16_t& sizeMS) const;
virtual int32_t PlayoutDelay(uint16_t& delayMS) const;
virtual int32_t RecordingDelay(uint16_t& delayMS) const;
- // CPU load
- virtual int32_t CPULoad(uint16_t& load) const;
-
virtual bool PlayoutWarning() const;
virtual bool PlayoutError() const;
virtual bool RecordingWarning() const;
@@ -312,8 +298,6 @@
SInt16 _renderConvertData[PLAY_BUF_SIZE_IN_SAMPLES];
- AudioDeviceModule::BufferType _playBufType;
-
bool _initialized;
bool _isShutDown;
bool _recording;
@@ -349,8 +333,6 @@
int32_t _renderDelayOffsetSamples;
- uint16_t _playBufDelayFixed; // fixed playback delay
-
uint16_t _playWarning;
uint16_t _playError;
uint16_t _recWarning;
diff --git a/webrtc/modules/audio_device/mac/audio_mixer_manager_mac.cc b/webrtc/modules/audio_device/mac/audio_mixer_manager_mac.cc
index 457fd9e..6bf6dbd 100644
--- a/webrtc/modules/audio_device/mac/audio_mixer_manager_mac.cc
+++ b/webrtc/modules/audio_device/mac/audio_mixer_manager_mac.cc
@@ -337,19 +337,6 @@
return 0;
}
-int32_t AudioMixerManagerMac::SpeakerVolumeStepSize(uint16_t& stepSize) const {
- if (_outputDeviceID == kAudioObjectUnknown) {
- LOG(LS_WARNING) << "device ID has not been set";
- return -1;
- }
-
- // volume range is 0.0 to 1.0
- // we convert that to 0 - 255
- stepSize = 1;
-
- return 0;
-}
-
int32_t AudioMixerManagerMac::SpeakerVolumeIsAvailable(bool& available) {
if (_outputDeviceID == kAudioObjectUnknown) {
LOG(LS_WARNING) << "device ID has not been set";
@@ -704,52 +691,6 @@
return 0;
}
-int32_t AudioMixerManagerMac::MicrophoneBoostIsAvailable(bool& available) {
- if (_inputDeviceID == kAudioObjectUnknown) {
- LOG(LS_WARNING) << "device ID has not been set";
- return -1;
- }
-
- available = false; // No AudioObjectPropertySelector value for Mic Boost
-
- return 0;
-}
-
-int32_t AudioMixerManagerMac::SetMicrophoneBoost(bool enable) {
- LOG(LS_VERBOSE) << "AudioMixerManagerMac::SetMicrophoneBoost(enable="
- << enable << ")";
-
- rtc::CritScope lock(&_critSect);
-
- if (_inputDeviceID == kAudioObjectUnknown) {
- LOG(LS_WARNING) << "device ID has not been set";
- return -1;
- }
-
- // Ensure that the selected microphone has a valid boost control.
- bool available(false);
- MicrophoneBoostIsAvailable(available);
- if (!available) {
- LOG(LS_WARNING) << "it is not possible to enable microphone boost";
- return -1;
- }
-
- // It is assumed that the call above fails!
- return 0;
-}
-
-int32_t AudioMixerManagerMac::MicrophoneBoost(bool& enabled) const {
- if (_inputDeviceID == kAudioObjectUnknown) {
- LOG(LS_WARNING) << "device ID has not been set";
- return -1;
- }
-
- // Microphone boost cannot be enabled on this platform!
- enabled = false;
-
- return 0;
-}
-
int32_t AudioMixerManagerMac::MicrophoneVolumeIsAvailable(bool& available) {
if (_inputDeviceID == kAudioObjectUnknown) {
LOG(LS_WARNING) << "device ID has not been set";
@@ -929,20 +870,6 @@
return 0;
}
-int32_t AudioMixerManagerMac::MicrophoneVolumeStepSize(
- uint16_t& stepSize) const {
- if (_inputDeviceID == kAudioObjectUnknown) {
- LOG(LS_WARNING) << "device ID has not been set";
- return -1;
- }
-
- // volume range is 0.0 to 1.0
- // we convert that to 0 - 10
- stepSize = 1;
-
- return 0;
-}
-
// ============================================================================
// Private Methods
// ============================================================================
diff --git a/webrtc/modules/audio_device/mac/audio_mixer_manager_mac.h b/webrtc/modules/audio_device/mac/audio_mixer_manager_mac.h
index b74fe66..74d17ba 100644
--- a/webrtc/modules/audio_device/mac/audio_mixer_manager_mac.h
+++ b/webrtc/modules/audio_device/mac/audio_mixer_manager_mac.h
@@ -28,7 +28,6 @@
int32_t SpeakerVolume(uint32_t& volume) const;
int32_t MaxSpeakerVolume(uint32_t& maxVolume) const;
int32_t MinSpeakerVolume(uint32_t& minVolume) const;
- int32_t SpeakerVolumeStepSize(uint16_t& stepSize) const;
int32_t SpeakerVolumeIsAvailable(bool& available);
int32_t SpeakerMuteIsAvailable(bool& available);
int32_t SetSpeakerMute(bool enable);
@@ -38,15 +37,11 @@
int32_t MicrophoneMuteIsAvailable(bool& available);
int32_t SetMicrophoneMute(bool enable);
int32_t MicrophoneMute(bool& enabled) const;
- int32_t MicrophoneBoostIsAvailable(bool& available);
- int32_t SetMicrophoneBoost(bool enable);
- int32_t MicrophoneBoost(bool& enabled) const;
int32_t MicrophoneVolumeIsAvailable(bool& available);
int32_t SetMicrophoneVolume(uint32_t volume);
int32_t MicrophoneVolume(uint32_t& volume) const;
int32_t MaxMicrophoneVolume(uint32_t& maxVolume) const;
int32_t MinMicrophoneVolume(uint32_t& minVolume) const;
- int32_t MicrophoneVolumeStepSize(uint16_t& stepSize) const;
int32_t Close();
int32_t CloseSpeaker();
int32_t CloseMicrophone();
diff --git a/webrtc/modules/audio_device/win/audio_device_core_win.cc b/webrtc/modules/audio_device/win/audio_device_core_win.cc
index c77eacc..0c6d34e 100644
--- a/webrtc/modules/audio_device/win/audio_device_core_win.cc
+++ b/webrtc/modules/audio_device/win/audio_device_core_win.cc
@@ -438,7 +438,6 @@
_sndCardRecDelay(0),
_writtenSamples(0),
_readSamples(0),
- _playAcc(0),
_recAudioFrameSize(0),
_recSampleRate(0),
_recBlockSize(0),
@@ -469,9 +468,7 @@
_playError(0),
_recWarning(0),
_recError(0),
- _playBufType(AudioDeviceModule::kAdaptiveBufferSize),
_playBufDelay(80),
- _playBufDelayFixed(80),
_usingInputDeviceIndex(false),
_usingOutputDeviceIndex(false),
_inputDevice(AudioDeviceModule::kDefaultCommunicationDevice),
@@ -530,7 +527,6 @@
_perfCounterFreq.QuadPart = 1;
_perfCounterFactor = 0.0;
- _avgCPULoad = 0.0;
// list of number of channels to use on recording side
_recChannelsPrioList[0] = 2; // stereo is prio 1
@@ -1084,23 +1080,6 @@
}
// ----------------------------------------------------------------------------
-// SpeakerVolumeStepSize
-// ----------------------------------------------------------------------------
-
-int32_t AudioDeviceWindowsCore::SpeakerVolumeStepSize(uint16_t& stepSize) const
-{
-
- if (!_speakerIsInitialized)
- {
- return -1;
- }
-
- stepSize = CORE_SPEAKER_VOLUME_STEP_SIZE;
-
- return 0;
-}
-
-// ----------------------------------------------------------------------------
// SpeakerMuteIsAvailable
// ----------------------------------------------------------------------------
@@ -1328,47 +1307,6 @@
}
// ----------------------------------------------------------------------------
-// MicrophoneBoostIsAvailable
-// ----------------------------------------------------------------------------
-
-int32_t AudioDeviceWindowsCore::MicrophoneBoostIsAvailable(bool& available)
-{
-
- available = false;
- return 0;
-}
-
-// ----------------------------------------------------------------------------
-// SetMicrophoneBoost
-// ----------------------------------------------------------------------------
-
-int32_t AudioDeviceWindowsCore::SetMicrophoneBoost(bool enable)
-{
-
- if (!_microphoneIsInitialized)
- {
- return -1;
- }
-
- return -1;
-}
-
-// ----------------------------------------------------------------------------
-// MicrophoneBoost
-// ----------------------------------------------------------------------------
-
-int32_t AudioDeviceWindowsCore::MicrophoneBoost(bool& enabled) const
-{
-
- if (!_microphoneIsInitialized)
- {
- return -1;
- }
-
- return -1;
-}
-
-// ----------------------------------------------------------------------------
// StereoRecordingIsAvailable
// ----------------------------------------------------------------------------
@@ -1651,23 +1589,6 @@
}
// ----------------------------------------------------------------------------
-// MicrophoneVolumeStepSize
-// ----------------------------------------------------------------------------
-
-int32_t AudioDeviceWindowsCore::MicrophoneVolumeStepSize(uint16_t& stepSize) const
-{
-
- if (!_microphoneIsInitialized)
- {
- return -1;
- }
-
- stepSize = CORE_MICROPHONE_VOLUME_STEP_SIZE;
-
- return 0;
-}
-
-// ----------------------------------------------------------------------------
// PlayoutDevices
// ----------------------------------------------------------------------------
@@ -2827,8 +2748,6 @@
}
LOG(LS_VERBOSE) << "capture audio stream has now started...";
- _avgCPULoad = 0.0f;
- _playAcc = 0;
_recording = true;
return 0;
@@ -3141,58 +3060,6 @@
{
return (_playing);
}
-// ----------------------------------------------------------------------------
-// SetPlayoutBuffer
-// ----------------------------------------------------------------------------
-
-int32_t AudioDeviceWindowsCore::SetPlayoutBuffer(const AudioDeviceModule::BufferType type, uint16_t sizeMS)
-{
-
- rtc::CritScope lock(&_critSect);
-
- _playBufType = type;
-
- if (type == AudioDeviceModule::kFixedBufferSize)
- {
- _playBufDelayFixed = sizeMS;
- }
-
- return 0;
-}
-
-// ----------------------------------------------------------------------------
-// PlayoutBuffer
-// ----------------------------------------------------------------------------
-
-int32_t AudioDeviceWindowsCore::PlayoutBuffer(AudioDeviceModule::BufferType& type, uint16_t& sizeMS) const
-{
- rtc::CritScope lock(&_critSect);
- type = _playBufType;
-
- if (type == AudioDeviceModule::kFixedBufferSize)
- {
- sizeMS = _playBufDelayFixed;
- }
- else
- {
- // Use same value as for PlayoutDelay
- sizeMS = static_cast<uint16_t>(_sndCardPlayDelay);
- }
-
- return 0;
-}
-
-// ----------------------------------------------------------------------------
-// CPULoad
-// ----------------------------------------------------------------------------
-
-int32_t AudioDeviceWindowsCore::CPULoad(uint16_t& load) const
-{
-
- load = static_cast<uint16_t> (100*_avgCPULoad);
-
- return 0;
-}
// ----------------------------------------------------------------------------
// PlayoutWarning
@@ -3388,10 +3255,6 @@
HRESULT hr = S_OK;
HANDLE hMmTask = NULL;
- LARGE_INTEGER t1;
- LARGE_INTEGER t2;
- int32_t time(0);
-
// Initialize COM as MTA in this thread.
ScopedCOMInitializer comInit(ScopedCOMInitializer::kMTA);
if (!comInit.succeeded()) {
@@ -3558,8 +3421,6 @@
_ptrRenderClient->GetBuffer(_playBlockSizeInFrames, &pData);
EXIT_ON_ERROR(hr);
- QueryPerformanceCounter(&t1); // measure time: START
-
if (_ptrAudioBuffer)
{
// Request data to be played out (#bytes =
@@ -3596,10 +3457,6 @@
nSamples = _ptrAudioBuffer->GetPlayoutData((int8_t*)pData);
}
- QueryPerformanceCounter(&t2); // measure time: STOP
- time = (int)(t2.QuadPart-t1.QuadPart);
- _playAcc += time;
-
DWORD dwFlags(0);
hr = _ptrRenderClient->ReleaseBuffer(_playBlockSizeInFrames,
dwFlags);
@@ -3878,8 +3735,6 @@
HRESULT hr = S_OK;
LARGE_INTEGER t1;
- LARGE_INTEGER t2;
- int32_t time(0);
BYTE* syncBuffer = NULL;
UINT32 syncBufIndex = 0;
@@ -4068,22 +3923,10 @@
_ptrAudioBuffer->SetTypingStatus(KeyPressed());
- QueryPerformanceCounter(&t1); // measure time: START
-
_UnLock(); // release lock while making the callback
_ptrAudioBuffer->DeliverRecordedData();
_Lock(); // restore the lock
- QueryPerformanceCounter(&t2); // measure time: STOP
-
- // Measure "average CPU load".
- // Basically what we do here is to measure how many percent of our 10ms period
- // is used for encoding and decoding. This value shuld be used as a warning indicator
- // only and not seen as an absolute value. Running at ~100% will lead to bad QoS.
- time = (int)(t2.QuadPart - t1.QuadPart);
- _avgCPULoad = (float)(_avgCPULoad*.99 + (time + _playAcc) / (double)(_perfCounterFreq.QuadPart));
- _playAcc = 0;
-
// Sanity check to ensure that essential states are not modified during the unlocked period
if (_ptrCaptureClient == NULL || _ptrClientIn == NULL)
{
diff --git a/webrtc/modules/audio_device/win/audio_device_core_win.h b/webrtc/modules/audio_device/win/audio_device_core_win.h
index b95da22..34dfee6 100644
--- a/webrtc/modules/audio_device/win/audio_device_core_win.h
+++ b/webrtc/modules/audio_device/win/audio_device_core_win.h
@@ -145,7 +145,6 @@
virtual int32_t SpeakerVolume(uint32_t& volume) const;
virtual int32_t MaxSpeakerVolume(uint32_t& maxVolume) const;
virtual int32_t MinSpeakerVolume(uint32_t& minVolume) const;
- virtual int32_t SpeakerVolumeStepSize(uint16_t& stepSize) const;
// Microphone volume controls
virtual int32_t MicrophoneVolumeIsAvailable(bool& available);
@@ -153,7 +152,6 @@
virtual int32_t MicrophoneVolume(uint32_t& volume) const;
virtual int32_t MaxMicrophoneVolume(uint32_t& maxVolume) const;
virtual int32_t MinMicrophoneVolume(uint32_t& minVolume) const;
- virtual int32_t MicrophoneVolumeStepSize(uint16_t& stepSize) const;
// Speaker mute control
virtual int32_t SpeakerMuteIsAvailable(bool& available);
@@ -165,11 +163,6 @@
virtual int32_t SetMicrophoneMute(bool enable);
virtual int32_t MicrophoneMute(bool& enabled) const;
- // Microphone boost control
- virtual int32_t MicrophoneBoostIsAvailable(bool& available);
- virtual int32_t SetMicrophoneBoost(bool enable);
- virtual int32_t MicrophoneBoost(bool& enabled) const;
-
// Stereo support
virtual int32_t StereoPlayoutIsAvailable(bool& available);
virtual int32_t SetStereoPlayout(bool enable);
@@ -179,14 +172,9 @@
virtual int32_t StereoRecording(bool& enabled) const;
// Delay information and control
- virtual int32_t SetPlayoutBuffer(const AudioDeviceModule::BufferType type, uint16_t sizeMS);
- virtual int32_t PlayoutBuffer(AudioDeviceModule::BufferType& type, uint16_t& sizeMS) const;
virtual int32_t PlayoutDelay(uint16_t& delayMS) const;
virtual int32_t RecordingDelay(uint16_t& delayMS) const;
- // CPU load
- virtual int32_t CPULoad(uint16_t& load) const;
-
virtual int32_t EnableBuiltInAEC(bool enable);
public:
@@ -312,7 +300,6 @@
uint32_t _playChannels;
uint32_t _sndCardPlayDelay;
UINT64 _writtenSamples;
- LONGLONG _playAcc;
UINT _recAudioFrameSize;
uint32_t _recSampleRate;
@@ -326,7 +313,6 @@
LARGE_INTEGER _perfCounterFreq;
double _perfCounterFactor;
- float _avgCPULoad;
private:
bool _initialized;
@@ -351,9 +337,7 @@
uint16_t _recWarning;
uint16_t _recError;
- AudioDeviceModule::BufferType _playBufType;
uint16_t _playBufDelay;
- uint16_t _playBufDelayFixed;
uint16_t _newMicLevel;
diff --git a/webrtc/pc/test/fakeaudiocapturemodule.cc b/webrtc/pc/test/fakeaudiocapturemodule.cc
index c1ac489..0d367cb 100644
--- a/webrtc/pc/test/fakeaudiocapturemodule.cc
+++ b/webrtc/pc/test/fakeaudiocapturemodule.cc
@@ -323,12 +323,6 @@
return 0;
}
-int32_t FakeAudioCaptureModule::SpeakerVolumeStepSize(
- uint16_t* /*step_size*/) const {
- RTC_NOTREACHED();
- return 0;
-}
-
int32_t FakeAudioCaptureModule::MicrophoneVolumeIsAvailable(
bool* /*available*/) {
RTC_NOTREACHED();
@@ -359,12 +353,6 @@
return 0;
}
-int32_t FakeAudioCaptureModule::MicrophoneVolumeStepSize(
- uint16_t* /*step_size*/) const {
- RTC_NOTREACHED();
- return 0;
-}
-
int32_t FakeAudioCaptureModule::SpeakerMuteIsAvailable(bool* /*available*/) {
RTC_NOTREACHED();
return 0;
@@ -395,22 +383,6 @@
return 0;
}
-int32_t FakeAudioCaptureModule::MicrophoneBoostIsAvailable(
- bool* /*available*/) {
- RTC_NOTREACHED();
- return 0;
-}
-
-int32_t FakeAudioCaptureModule::SetMicrophoneBoost(bool /*enable*/) {
- RTC_NOTREACHED();
- return 0;
-}
-
-int32_t FakeAudioCaptureModule::MicrophoneBoost(bool* /*enabled*/) const {
- RTC_NOTREACHED();
- return 0;
-}
-
int32_t FakeAudioCaptureModule::StereoPlayoutIsAvailable(
bool* available) const {
// No recording device, just dropping audio. Stereo can be dropped just
@@ -467,18 +439,6 @@
return 0;
}
-int32_t FakeAudioCaptureModule::SetPlayoutBuffer(const BufferType /*type*/,
- uint16_t /*size_ms*/) {
- RTC_NOTREACHED();
- return 0;
-}
-
-int32_t FakeAudioCaptureModule::PlayoutBuffer(BufferType* /*type*/,
- uint16_t* /*size_ms*/) const {
- RTC_NOTREACHED();
- return 0;
-}
-
int32_t FakeAudioCaptureModule::PlayoutDelay(uint16_t* delay_ms) const {
// No delay since audio frames are dropped.
*delay_ms = 0;
@@ -490,33 +450,6 @@
return 0;
}
-int32_t FakeAudioCaptureModule::CPULoad(uint16_t* /*load*/) const {
- RTC_NOTREACHED();
- return 0;
-}
-
-int32_t FakeAudioCaptureModule::StartRawOutputFileRecording(
- const char /*pcm_file_name_utf8*/[webrtc::kAdmMaxFileNameSize]) {
- RTC_NOTREACHED();
- return 0;
-}
-
-int32_t FakeAudioCaptureModule::StopRawOutputFileRecording() {
- RTC_NOTREACHED();
- return 0;
-}
-
-int32_t FakeAudioCaptureModule::StartRawInputFileRecording(
- const char /*pcm_file_name_utf8*/[webrtc::kAdmMaxFileNameSize]) {
- RTC_NOTREACHED();
- return 0;
-}
-
-int32_t FakeAudioCaptureModule::StopRawInputFileRecording() {
- RTC_NOTREACHED();
- return 0;
-}
-
int32_t FakeAudioCaptureModule::SetRecordingSampleRate(
const uint32_t /*samples_per_sec*/) {
RTC_NOTREACHED();
@@ -541,11 +474,6 @@
return 0;
}
-int32_t FakeAudioCaptureModule::ResetAudioDevice() {
- RTC_NOTREACHED();
- return 0;
-}
-
int32_t FakeAudioCaptureModule::SetLoudspeakerStatus(bool /*enable*/) {
RTC_NOTREACHED();
return 0;
diff --git a/webrtc/pc/test/fakeaudiocapturemodule.h b/webrtc/pc/test/fakeaudiocapturemodule.h
index 1440821..91879b0 100644
--- a/webrtc/pc/test/fakeaudiocapturemodule.h
+++ b/webrtc/pc/test/fakeaudiocapturemodule.h
@@ -114,7 +114,6 @@
int32_t SpeakerVolume(uint32_t* volume) const override;
int32_t MaxSpeakerVolume(uint32_t* max_volume) const override;
int32_t MinSpeakerVolume(uint32_t* min_volume) const override;
- int32_t SpeakerVolumeStepSize(uint16_t* step_size) const override;
int32_t MicrophoneVolumeIsAvailable(bool* available) override;
int32_t SetMicrophoneVolume(uint32_t volume) override;
@@ -122,7 +121,6 @@
int32_t MaxMicrophoneVolume(uint32_t* max_volume) const override;
int32_t MinMicrophoneVolume(uint32_t* min_volume) const override;
- int32_t MicrophoneVolumeStepSize(uint16_t* step_size) const override;
int32_t SpeakerMuteIsAvailable(bool* available) override;
int32_t SetSpeakerMute(bool enable) override;
@@ -132,10 +130,6 @@
int32_t SetMicrophoneMute(bool enable) override;
int32_t MicrophoneMute(bool* enabled) const override;
- int32_t MicrophoneBoostIsAvailable(bool* available) override;
- int32_t SetMicrophoneBoost(bool enable) override;
- int32_t MicrophoneBoost(bool* enabled) const override;
-
int32_t StereoPlayoutIsAvailable(bool* available) const override;
int32_t SetStereoPlayout(bool enable) override;
int32_t StereoPlayout(bool* enabled) const override;
@@ -145,27 +139,14 @@
int32_t SetRecordingChannel(const ChannelType channel) override;
int32_t RecordingChannel(ChannelType* channel) const override;
- int32_t SetPlayoutBuffer(const BufferType type,
- uint16_t size_ms = 0) override;
- int32_t PlayoutBuffer(BufferType* type, uint16_t* size_ms) const override;
int32_t PlayoutDelay(uint16_t* delay_ms) const override;
int32_t RecordingDelay(uint16_t* delay_ms) const override;
- int32_t CPULoad(uint16_t* load) const override;
-
- int32_t StartRawOutputFileRecording(
- const char pcm_file_name_utf8[webrtc::kAdmMaxFileNameSize]) override;
- int32_t StopRawOutputFileRecording() override;
- int32_t StartRawInputFileRecording(
- const char pcm_file_name_utf8[webrtc::kAdmMaxFileNameSize]) override;
- int32_t StopRawInputFileRecording() override;
-
int32_t SetRecordingSampleRate(const uint32_t samples_per_sec) override;
int32_t RecordingSampleRate(uint32_t* samples_per_sec) const override;
int32_t SetPlayoutSampleRate(const uint32_t samples_per_sec) override;
int32_t PlayoutSampleRate(uint32_t* samples_per_sec) const override;
- int32_t ResetAudioDevice() override;
int32_t SetLoudspeakerStatus(bool enable) override;
int32_t GetLoudspeakerStatus(bool* enabled) const override;
bool BuiltInAECIsAvailable() const override { return false; }