Removes unused WaveOut APIs from ADM.

Will remove default implementations as well once landed and removed
in Chrome as well.

These two AudioDeviceModule APIs are removed:

int32_t SetWaveOutVolume(uint16_t volumeLeft, uint16_t volumeRight)
int32_t WaveOutVolume(uint16_t* volumeLeft, uint16_t* volumeRight) const

BUG=webrtc:7306

Review-Url: https://codereview.webrtc.org/3006793002
Cr-Commit-Position: refs/heads/master@{#19581}
This commit is contained in:
henrika 2017-08-29 06:02:10 -07:00 committed by Commit Bot
parent 9b2f20c618
commit ecf312e603
24 changed files with 4 additions and 222 deletions

View File

@ -231,18 +231,6 @@ class AudioDeviceTemplate : public AudioDeviceGeneric {
return false;
}
int32_t SetWaveOutVolume(
uint16_t volumeLeft, uint16_t volumeRight) override {
FATAL() << "Should never be called";
return -1;
}
int32_t WaveOutVolume(
uint16_t& volumeLeft, uint16_t& volumeRight) const override {
FATAL() << "Should never be called";
return -1;
}
int32_t InitSpeaker() override {
LOG(INFO) << __FUNCTION__;
return 0;

View File

@ -179,14 +179,6 @@ class ADMWrapper : public AudioDeviceModule, public AudioTransport {
bool Recording() const override { return impl_->Recording(); }
int32_t SetAGC(bool enable) override { return impl_->SetAGC(enable); }
bool AGC() const override { return impl_->AGC(); }
int32_t SetWaveOutVolume(uint16_t volume_left,
uint16_t volume_right) override {
return impl_->SetWaveOutVolume(volume_left, volume_right);
}
int32_t WaveOutVolume(uint16_t* volume_left,
uint16_t* volume_right) const override {
return impl_->WaveOutVolume(volume_left, volume_right);
}
int32_t InitSpeaker() override { return impl_->InitSpeaker(); }
bool SpeakerIsInitialized() const override {
return impl_->SpeakerIsInitialized();

View File

@ -75,12 +75,6 @@ class AudioDeviceGeneric {
virtual int32_t SetAGC(bool enable) = 0;
virtual bool AGC() const = 0;
// Volume control based on the Windows Wave API (Windows only)
virtual int32_t SetWaveOutVolume(uint16_t volumeLeft,
uint16_t volumeRight) = 0;
virtual int32_t WaveOutVolume(uint16_t& volumeLeft,
uint16_t& volumeRight) const = 0;
// Audio mixer initialization
virtual int32_t InitSpeaker() = 0;
virtual bool SpeakerIsInitialized() const = 0;

View File

@ -575,40 +575,6 @@ int32_t AudioDeviceModuleImpl::SpeakerVolume(uint32_t* volume) const {
return (0);
}
// ----------------------------------------------------------------------------
// SetWaveOutVolume
// ----------------------------------------------------------------------------
int32_t AudioDeviceModuleImpl::SetWaveOutVolume(uint16_t volumeLeft,
uint16_t volumeRight) {
LOG(INFO) << __FUNCTION__ << "(" << volumeLeft << ", " << volumeRight << ")";
CHECK_INITIALIZED();
return (_ptrAudioDevice->SetWaveOutVolume(volumeLeft, volumeRight));
}
// ----------------------------------------------------------------------------
// WaveOutVolume
// ----------------------------------------------------------------------------
int32_t AudioDeviceModuleImpl::WaveOutVolume(uint16_t* volumeLeft,
uint16_t* volumeRight) const {
LOG(INFO) << __FUNCTION__;
CHECK_INITIALIZED();
uint16_t volLeft(0);
uint16_t volRight(0);
if (_ptrAudioDevice->WaveOutVolume(volLeft, volRight) == -1) {
return -1;
}
*volumeLeft = volLeft;
*volumeRight = volRight;
LOG(INFO) << "output: " << *volumeLeft << ", " << *volumeRight;
return (0);
}
// ----------------------------------------------------------------------------
// SpeakerIsInitialized
// ----------------------------------------------------------------------------

View File

@ -98,11 +98,6 @@ class AudioDeviceModuleImpl : public AudioDeviceModule {
int32_t SetAGC(bool enable) override;
bool AGC() const override;
// Volume control based on the Windows Wave API (Windows only)
int32_t SetWaveOutVolume(uint16_t volumeLeft, uint16_t volumeRight) override;
int32_t WaveOutVolume(uint16_t* volumeLeft,
uint16_t* volumeRight) const override;
// Audio mixer initialization
int32_t InitSpeaker() override;
bool SpeakerIsInitialized() const override;

View File

@ -83,16 +83,6 @@ int32_t AudioDeviceDummy::SetAGC(bool enable) { return -1; }
bool AudioDeviceDummy::AGC() const { return false; }
int32_t AudioDeviceDummy::SetWaveOutVolume(uint16_t volumeLeft,
uint16_t volumeRight) {
return -1;
}
int32_t AudioDeviceDummy::WaveOutVolume(uint16_t& volumeLeft,
uint16_t& volumeRight) const {
return -1;
}
int32_t AudioDeviceDummy::InitSpeaker() { return -1; }
bool AudioDeviceDummy::SpeakerIsInitialized() const { return false; }

View File

@ -69,11 +69,6 @@ class AudioDeviceDummy : public AudioDeviceGeneric {
int32_t SetAGC(bool enable) override;
bool AGC() const override;
// Volume control based on the Windows Wave API (Windows only)
int32_t SetWaveOutVolume(uint16_t volumeLeft, uint16_t volumeRight) override;
int32_t WaveOutVolume(uint16_t& volumeLeft,
uint16_t& volumeRight) const override;
// Audio mixer initialization
int32_t InitSpeaker() override;
bool SpeakerIsInitialized() const override;

View File

@ -309,16 +309,6 @@ int32_t FileAudioDevice::SetAGC(bool enable) { return -1; }
bool FileAudioDevice::AGC() const { return false; }
int32_t FileAudioDevice::SetWaveOutVolume(uint16_t volumeLeft,
uint16_t volumeRight) {
return -1;
}
int32_t FileAudioDevice::WaveOutVolume(uint16_t& volumeLeft,
uint16_t& volumeRight) const {
return -1;
}
int32_t FileAudioDevice::InitSpeaker() { return -1; }
bool FileAudioDevice::SpeakerIsInitialized() const { return false; }

View File

@ -90,11 +90,6 @@ class FileAudioDevice : public AudioDeviceGeneric {
int32_t SetAGC(bool enable) override;
bool AGC() const override;
// Volume control based on the Windows Wave API (Windows only)
int32_t SetWaveOutVolume(uint16_t volumeLeft, uint16_t volumeRight) override;
int32_t WaveOutVolume(uint16_t& volumeLeft,
uint16_t& volumeRight) const override;
// Audio mixer initialization
int32_t InitSpeaker() override;
bool SpeakerIsInitialized() const override;

View File

@ -108,11 +108,12 @@ class AudioDeviceModule : public RefCountedModule {
virtual int32_t SetAGC(bool enable) = 0;
virtual bool AGC() const = 0;
// Volume control based on the Windows Wave API (Windows only)
// Deprecated.
// TODO(henrika): to be removed.
virtual int32_t SetWaveOutVolume(uint16_t volumeLeft,
uint16_t volumeRight) = 0;
uint16_t volumeRight) { return -1; }
virtual int32_t WaveOutVolume(uint16_t* volumeLeft,
uint16_t* volumeRight) const = 0;
uint16_t* volumeRight) const { return -1; }
// Audio mixer initialization
virtual int32_t InitSpeaker() = 0;

View File

@ -83,14 +83,6 @@ class FakeAudioDeviceModule : public AudioDeviceModule {
virtual int32_t StartRecording() { return 0; }
virtual bool Recording() const { return false; }
virtual bool AGC() const { return true; }
virtual int32_t SetWaveOutVolume(uint16_t volumeLeft,
uint16_t volumeRight) {
return 0;
}
virtual int32_t WaveOutVolume(uint16_t* volumeLeft,
uint16_t* volumeRight) const {
return 0;
}
virtual bool SpeakerIsInitialized() const { return true; }
virtual bool MicrophoneIsInitialized() const { return true; }
virtual int32_t SpeakerVolumeIsAvailable(bool* available) { return 0; }

View File

@ -63,10 +63,6 @@ class MockAudioDeviceModule : public AudioDeviceModule {
MOCK_CONST_METHOD0(Recording, bool());
MOCK_METHOD1(SetAGC, int32_t(bool enable));
MOCK_CONST_METHOD0(AGC, bool());
MOCK_METHOD2(SetWaveOutVolume, int32_t(uint16_t volumeLeft,
uint16_t volumeRight));
MOCK_CONST_METHOD2(WaveOutVolume, int32_t(uint16_t* volumeLeft,
uint16_t* volumeRight));
MOCK_METHOD0(InitSpeaker, int32_t());
MOCK_CONST_METHOD0(SpeakerIsInitialized, bool());
MOCK_METHOD0(InitMicrophone, int32_t());

View File

@ -116,9 +116,6 @@ class AudioDeviceIOS : public AudioDeviceGeneric,
int32_t SetRecordingDevice(uint16_t index) override;
int32_t SetRecordingDevice(
AudioDeviceModule::WindowsDeviceType device) override;
int32_t SetWaveOutVolume(uint16_t volumeLeft, uint16_t volumeRight) override;
int32_t WaveOutVolume(uint16_t& volumeLeft,
uint16_t& volumeRight) const override;
int32_t InitSpeaker() override;
bool SpeakerIsInitialized() const override;
int32_t InitMicrophone() override;

View File

@ -67,16 +67,6 @@ int32_t AudioDeviceIOS::SpeakerVolume(uint32_t& volume) const {
return -1;
}
int32_t AudioDeviceIOS::SetWaveOutVolume(uint16_t, uint16_t) {
RTC_NOTREACHED() << "Not implemented";
return -1;
}
int32_t AudioDeviceIOS::WaveOutVolume(uint16_t&, uint16_t&) const {
RTC_NOTREACHED() << "Not implemented";
return -1;
}
int32_t AudioDeviceIOS::MaxSpeakerVolume(uint32_t& maxVolume) const {
RTC_NOTREACHED() << "Not implemented";
return -1;

View File

@ -321,24 +321,6 @@ int32_t AudioDeviceLinuxALSA::SpeakerVolume(uint32_t& volume) const
return 0;
}
int32_t AudioDeviceLinuxALSA::SetWaveOutVolume(uint16_t volumeLeft,
uint16_t volumeRight)
{
LOG(LS_WARNING) << "API call not supported on this platform";
return -1;
}
int32_t AudioDeviceLinuxALSA::WaveOutVolume(
uint16_t& /*volumeLeft*/,
uint16_t& /*volumeRight*/) const
{
LOG(LS_WARNING) << "API call not supported on this platform";
return -1;
}
int32_t AudioDeviceLinuxALSA::MaxSpeakerVolume(
uint32_t& maxVolume) const
{

View File

@ -83,12 +83,6 @@ public:
int32_t SetAGC(bool enable) override;
bool AGC() const override;
// Volume control based on the Windows Wave API (Windows only)
int32_t SetWaveOutVolume(uint16_t volumeLeft,
uint16_t volumeRight) override;
int32_t WaveOutVolume(uint16_t& volumeLeft,
uint16_t& volumeRight) const override;
// Audio mixer initialization
int32_t InitSpeaker() override;
bool SpeakerIsInitialized() const override;

View File

@ -372,18 +372,6 @@ int32_t AudioDeviceLinuxPulse::SpeakerVolume(uint32_t& volume) const {
return 0;
}
int32_t AudioDeviceLinuxPulse::SetWaveOutVolume(uint16_t volumeLeft,
uint16_t volumeRight) {
LOG(LS_WARNING) << "API call not supported on this platform";
return -1;
}
int32_t AudioDeviceLinuxPulse::WaveOutVolume(uint16_t& /*volumeLeft*/,
uint16_t& /*volumeRight*/) const {
LOG(LS_WARNING) << "API call not supported on this platform";
return -1;
}
int32_t AudioDeviceLinuxPulse::MaxSpeakerVolume(uint32_t& maxVolume) const {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
uint32_t maxVol(0);

View File

@ -145,12 +145,6 @@ public:
int32_t SetAGC(bool enable) override;
bool AGC() const override;
// Volume control based on the Windows Wave API (Windows only)
int32_t SetWaveOutVolume(uint16_t volumeLeft,
uint16_t volumeRight) override;
int32_t WaveOutVolume(uint16_t& volumeLeft,
uint16_t& volumeRight) const override;
// Audio mixer initialization
int32_t InitSpeaker() override;
bool SpeakerIsInitialized() const override;

View File

@ -548,18 +548,6 @@ int32_t AudioDeviceMac::SpeakerVolume(uint32_t& volume) const {
return 0;
}
int32_t AudioDeviceMac::SetWaveOutVolume(uint16_t volumeLeft,
uint16_t volumeRight) {
LOG(LS_WARNING) << "API call not supported on this platform";
return -1;
}
int32_t AudioDeviceMac::WaveOutVolume(uint16_t& /*volumeLeft*/,
uint16_t& /*volumeRight*/) const {
LOG(LS_WARNING) << "API call not supported on this platform";
return -1;
}
int32_t AudioDeviceMac::MaxSpeakerVolume(uint32_t& maxVolume) const {
uint32_t maxVol(0);

View File

@ -111,11 +111,6 @@ class AudioDeviceMac : public AudioDeviceGeneric {
virtual int32_t SetAGC(bool enable);
virtual bool AGC() const;
// Volume control based on the Windows Wave API (Windows only)
virtual int32_t SetWaveOutVolume(uint16_t volumeLeft, uint16_t volumeRight);
virtual int32_t WaveOutVolume(uint16_t& volumeLeft,
uint16_t& volumeRight) const;
// Audio mixer initialization
virtual int32_t InitSpeaker();
virtual bool SpeakerIsInitialized() const;

View File

@ -1044,24 +1044,6 @@ Exit:
return -1;
}
// ----------------------------------------------------------------------------
// SetWaveOutVolume
// ----------------------------------------------------------------------------
int32_t AudioDeviceWindowsCore::SetWaveOutVolume(uint16_t volumeLeft, uint16_t volumeRight)
{
return -1;
}
// ----------------------------------------------------------------------------
// WaveOutVolume
// ----------------------------------------------------------------------------
int32_t AudioDeviceWindowsCore::WaveOutVolume(uint16_t& volumeLeft, uint16_t& volumeRight) const
{
return -1;
}
// ----------------------------------------------------------------------------
// MaxSpeakerVolume
//

View File

@ -133,10 +133,6 @@ public:
virtual int32_t SetAGC(bool enable);
virtual bool AGC() const;
// Volume control based on the Windows Wave API (Windows only)
virtual int32_t SetWaveOutVolume(uint16_t volumeLeft, uint16_t volumeRight);
virtual int32_t WaveOutVolume(uint16_t& volumeLeft, uint16_t& volumeRight) const;
// Audio mixer initialization
virtual int32_t InitSpeaker();
virtual bool SpeakerIsInitialized() const;

View File

@ -276,19 +276,6 @@ bool FakeAudioCaptureModule::AGC() const {
return 0;
}
int32_t FakeAudioCaptureModule::SetWaveOutVolume(uint16_t /*volume_left*/,
uint16_t /*volume_right*/) {
RTC_NOTREACHED();
return 0;
}
int32_t FakeAudioCaptureModule::WaveOutVolume(
uint16_t* /*volume_left*/,
uint16_t* /*volume_right*/) const {
RTC_NOTREACHED();
return 0;
}
int32_t FakeAudioCaptureModule::InitSpeaker() {
// No speaker, just playing from file. Return success.
return 0;

View File

@ -104,11 +104,6 @@ class FakeAudioCaptureModule
int32_t SetAGC(bool enable) override;
bool AGC() const override;
int32_t SetWaveOutVolume(uint16_t volume_left,
uint16_t volume_right) override;
int32_t WaveOutVolume(uint16_t* volume_left,
uint16_t* volume_right) const override;
int32_t InitSpeaker() override;
bool SpeakerIsInitialized() const override;
int32_t InitMicrophone() override;