Removes unused sample-rate APIs from the ADM.
The following four methods are removed: SetRecordingSampleRate(const uint32_t samplesPerSec) RecordingSampleRate(uint32_t* samplesPerSec) const SetPlayoutSampleRate(const uint32_t samplesPerSec) PlayoutSampleRate(uint32_t* samplesPerSec) const Bug: webrtc:7306 Change-Id: I2c3c2e7bd3fb1264da197699fd5de15ab6c35c1b Reviewed-on: https://webrtc-review.googlesource.com/22001 Commit-Queue: Henrik Andreassson <henrika@webrtc.org> Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#20703}
This commit is contained in:
@ -169,8 +169,6 @@ struct AudioOptions {
|
||||
SetFrom(&tx_agc_digital_compression_gain,
|
||||
change.tx_agc_digital_compression_gain);
|
||||
SetFrom(&tx_agc_limiter, change.tx_agc_limiter);
|
||||
SetFrom(&recording_sample_rate, change.recording_sample_rate);
|
||||
SetFrom(&playout_sample_rate, change.playout_sample_rate);
|
||||
SetFrom(&combined_audio_video_bwe, change.combined_audio_video_bwe);
|
||||
SetFrom(&audio_network_adaptor, change.audio_network_adaptor);
|
||||
SetFrom(&audio_network_adaptor_config, change.audio_network_adaptor_config);
|
||||
@ -202,8 +200,6 @@ struct AudioOptions {
|
||||
tx_agc_digital_compression_gain ==
|
||||
o.tx_agc_digital_compression_gain &&
|
||||
tx_agc_limiter == o.tx_agc_limiter &&
|
||||
recording_sample_rate == o.recording_sample_rate &&
|
||||
playout_sample_rate == o.playout_sample_rate &&
|
||||
combined_audio_video_bwe == o.combined_audio_video_bwe &&
|
||||
audio_network_adaptor == o.audio_network_adaptor &&
|
||||
audio_network_adaptor_config == o.audio_network_adaptor_config &&
|
||||
@ -240,8 +236,6 @@ struct AudioOptions {
|
||||
ost << ToStringIfSet("tx_agc_digital_compression_gain",
|
||||
tx_agc_digital_compression_gain);
|
||||
ost << ToStringIfSet("tx_agc_limiter", tx_agc_limiter);
|
||||
ost << ToStringIfSet("recording_sample_rate", recording_sample_rate);
|
||||
ost << ToStringIfSet("playout_sample_rate", playout_sample_rate);
|
||||
ost << ToStringIfSet("combined_audio_video_bwe", combined_audio_video_bwe);
|
||||
ost << ToStringIfSet("audio_network_adaptor", audio_network_adaptor);
|
||||
// The adaptor config is a serialized proto buffer and therefore not human
|
||||
@ -284,8 +278,6 @@ struct AudioOptions {
|
||||
rtc::Optional<uint16_t> tx_agc_target_dbov;
|
||||
rtc::Optional<uint16_t> tx_agc_digital_compression_gain;
|
||||
rtc::Optional<bool> tx_agc_limiter;
|
||||
rtc::Optional<uint32_t> recording_sample_rate;
|
||||
rtc::Optional<uint32_t> playout_sample_rate;
|
||||
// Enable combined audio+bandwidth BWE.
|
||||
// TODO(pthatcher): This flag is set from the
|
||||
// "googCombinedAudioVideoBwe", but not used anywhere. So delete it,
|
||||
|
||||
@ -625,24 +625,6 @@ bool WebRtcVoiceEngine::ApplyOptions(const AudioOptions& options_in) {
|
||||
|
||||
apm()->SetExtraOptions(config);
|
||||
apm()->ApplyConfig(apm_config);
|
||||
|
||||
if (options.recording_sample_rate) {
|
||||
RTC_LOG(LS_INFO) << "Recording sample rate is "
|
||||
<< *options.recording_sample_rate;
|
||||
if (adm()->SetRecordingSampleRate(*options.recording_sample_rate)) {
|
||||
RTC_LOG(LS_WARNING) << "SetRecordingSampleRate("
|
||||
<< *options.recording_sample_rate << ") failed.";
|
||||
}
|
||||
}
|
||||
|
||||
if (options.playout_sample_rate) {
|
||||
RTC_LOG(LS_INFO) << "Playout sample rate is "
|
||||
<< *options.playout_sample_rate;
|
||||
if (adm()->SetPlayoutSampleRate(*options.playout_sample_rate)) {
|
||||
RTC_LOG(LS_WARNING) << "SetPlayoutSampleRate("
|
||||
<< *options.playout_sample_rate << ") failed.";
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -2238,16 +2238,6 @@ TEST_F(WebRtcVoiceEngineTestFake, TxAgcConfigViaOptions) {
|
||||
SetSendParameters(send_parameters_);
|
||||
}
|
||||
|
||||
TEST_F(WebRtcVoiceEngineTestFake, SampleRatesViaOptions) {
|
||||
EXPECT_TRUE(SetupSendStream());
|
||||
EXPECT_CALL(adm_, SetRecordingSampleRate(48000)).WillOnce(Return(0));
|
||||
EXPECT_CALL(adm_, SetPlayoutSampleRate(44100)).WillOnce(Return(0));
|
||||
send_parameters_.options.recording_sample_rate =
|
||||
rtc::Optional<uint32_t>(48000);
|
||||
send_parameters_.options.playout_sample_rate = rtc::Optional<uint32_t>(44100);
|
||||
SetSendParameters(send_parameters_);
|
||||
}
|
||||
|
||||
TEST_F(WebRtcVoiceEngineTestFake, SetAudioNetworkAdaptorViaOptions) {
|
||||
EXPECT_TRUE(SetupSendStream());
|
||||
send_parameters_.options.audio_network_adaptor = rtc::Optional<bool>(true);
|
||||
|
||||
@ -385,12 +385,6 @@ class AudioDeviceTemplate : public AudioDeviceGeneric {
|
||||
input_.AttachAudioBuffer(audioBuffer);
|
||||
}
|
||||
|
||||
// TODO(henrika): remove
|
||||
int32_t SetPlayoutSampleRate(const uint32_t samplesPerSec) override {
|
||||
FATAL() << "Should never be called";
|
||||
return -1;
|
||||
}
|
||||
|
||||
int32_t SetLoudspeakerStatus(bool enable) override {
|
||||
FATAL() << "Should never be called";
|
||||
return -1;
|
||||
|
||||
@ -244,18 +244,6 @@ class ADMWrapper : public AudioDeviceModule, public AudioTransport {
|
||||
int32_t PlayoutDelay(uint16_t* delay_ms) const override {
|
||||
return impl_->PlayoutDelay(delay_ms);
|
||||
}
|
||||
int32_t SetRecordingSampleRate(const uint32_t samples_per_sec) override {
|
||||
return impl_->SetRecordingSampleRate(samples_per_sec);
|
||||
}
|
||||
int32_t RecordingSampleRate(uint32_t* samples_per_sec) const override {
|
||||
return impl_->RecordingSampleRate(samples_per_sec);
|
||||
}
|
||||
int32_t SetPlayoutSampleRate(const uint32_t samples_per_sec) override {
|
||||
return impl_->SetPlayoutSampleRate(samples_per_sec);
|
||||
}
|
||||
int32_t PlayoutSampleRate(uint32_t* samples_per_sec) const override {
|
||||
return impl_->PlayoutSampleRate(samples_per_sec);
|
||||
}
|
||||
int32_t SetLoudspeakerStatus(bool enable) override {
|
||||
return impl_->SetLoudspeakerStatus(enable);
|
||||
}
|
||||
|
||||
@ -13,17 +13,6 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
int32_t AudioDeviceGeneric::SetRecordingSampleRate(
|
||||
const uint32_t samplesPerSec) {
|
||||
RTC_LOG_F(LS_ERROR) << "Not supported on this platform";
|
||||
return -1;
|
||||
}
|
||||
|
||||
int32_t AudioDeviceGeneric::SetPlayoutSampleRate(const uint32_t samplesPerSec) {
|
||||
RTC_LOG_F(LS_ERROR) << "Not supported on this platform";
|
||||
return -1;
|
||||
}
|
||||
|
||||
int32_t AudioDeviceGeneric::SetLoudspeakerStatus(bool enable) {
|
||||
RTC_LOG_F(LS_ERROR) << "Not supported on this platform";
|
||||
return -1;
|
||||
|
||||
@ -116,10 +116,6 @@ class AudioDeviceGeneric {
|
||||
// Delay information and control
|
||||
virtual int32_t PlayoutDelay(uint16_t& delayMS) const = 0;
|
||||
|
||||
// Native sample rate controls (samples/sec)
|
||||
virtual int32_t SetRecordingSampleRate(const uint32_t samplesPerSec);
|
||||
virtual int32_t SetPlayoutSampleRate(const uint32_t samplesPerSec);
|
||||
|
||||
// Speaker audio routing (for mobile devices)
|
||||
virtual int32_t SetLoudspeakerStatus(bool enable);
|
||||
virtual int32_t GetLoudspeakerStatus(bool& enable) const;
|
||||
|
||||
@ -823,54 +823,6 @@ int32_t AudioDeviceModuleImpl::PlayoutDelay(uint16_t* delayMS) const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleImpl::SetRecordingSampleRate(
|
||||
const uint32_t samplesPerSec) {
|
||||
RTC_LOG(INFO) << __FUNCTION__ << "(" << samplesPerSec << ")";
|
||||
CHECKinitialized_();
|
||||
if (audio_device_->SetRecordingSampleRate(samplesPerSec) != 0) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleImpl::RecordingSampleRate(
|
||||
uint32_t* samplesPerSec) const {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized_();
|
||||
int32_t sampleRate = audio_device_buffer_.RecordingSampleRate();
|
||||
if (sampleRate == -1) {
|
||||
RTC_LOG(LERROR) << "failed to retrieve the sample rate";
|
||||
return -1;
|
||||
}
|
||||
*samplesPerSec = sampleRate;
|
||||
RTC_LOG(INFO) << "output: " << *samplesPerSec;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleImpl::SetPlayoutSampleRate(
|
||||
const uint32_t samplesPerSec) {
|
||||
RTC_LOG(INFO) << __FUNCTION__ << "(" << samplesPerSec << ")";
|
||||
CHECKinitialized_();
|
||||
if (audio_device_->SetPlayoutSampleRate(samplesPerSec) != 0) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleImpl::PlayoutSampleRate(
|
||||
uint32_t* samplesPerSec) const {
|
||||
RTC_LOG(INFO) << __FUNCTION__;
|
||||
CHECKinitialized_();
|
||||
int32_t sampleRate = audio_device_buffer_.PlayoutSampleRate();
|
||||
if (sampleRate == -1) {
|
||||
RTC_LOG(LERROR) << "failed to retrieve the sample rate";
|
||||
return -1;
|
||||
}
|
||||
*samplesPerSec = sampleRate;
|
||||
RTC_LOG(INFO) << "output: " << *samplesPerSec;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t AudioDeviceModuleImpl::SetLoudspeakerStatus(bool enable) {
|
||||
RTC_LOG(INFO) << __FUNCTION__ << "(" << enable << ")";
|
||||
CHECKinitialized_();
|
||||
|
||||
@ -132,12 +132,6 @@ class AudioDeviceModuleImpl : public AudioDeviceModule {
|
||||
// Delay information and control
|
||||
int32_t PlayoutDelay(uint16_t* delayMS) const override;
|
||||
|
||||
// Native sample rate controls (samples/sec)
|
||||
int32_t SetRecordingSampleRate(const uint32_t samplesPerSec) override;
|
||||
int32_t RecordingSampleRate(uint32_t* samplesPerSec) const override;
|
||||
int32_t SetPlayoutSampleRate(const uint32_t samplesPerSec) override;
|
||||
int32_t PlayoutSampleRate(uint32_t* samplesPerSec) const override;
|
||||
|
||||
// Mobile device specific functions
|
||||
int32_t SetLoudspeakerStatus(bool enable) override;
|
||||
int32_t GetLoudspeakerStatus(bool* enabled) const override;
|
||||
|
||||
@ -149,11 +149,20 @@ class AudioDeviceModule : public rtc::RefCountInterface {
|
||||
// Playout delay
|
||||
virtual int32_t PlayoutDelay(uint16_t* delayMS) const = 0;
|
||||
|
||||
// Native sample rate controls (samples/sec)
|
||||
virtual int32_t SetRecordingSampleRate(const uint32_t samplesPerSec) = 0;
|
||||
virtual int32_t RecordingSampleRate(uint32_t* samplesPerSec) const = 0;
|
||||
virtual int32_t SetPlayoutSampleRate(const uint32_t samplesPerSec) = 0;
|
||||
virtual int32_t PlayoutSampleRate(uint32_t* samplesPerSec) const = 0;
|
||||
// Deprecated. Don't use.
|
||||
// TODO(henrika): remove these methods.
|
||||
virtual int32_t SetRecordingSampleRate(const uint32_t samplesPerSec) {
|
||||
return -1;
|
||||
}
|
||||
virtual int32_t RecordingSampleRate(uint32_t* samplesPerSec) const {
|
||||
return -1;
|
||||
}
|
||||
virtual int32_t SetPlayoutSampleRate(const uint32_t samplesPerSec) {
|
||||
return -1;
|
||||
}
|
||||
virtual int32_t PlayoutSampleRate(uint32_t* samplesPerSec) const {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Mobile device specific functions
|
||||
virtual int32_t SetLoudspeakerStatus(bool enable) = 0;
|
||||
|
||||
@ -103,18 +103,6 @@ class FakeAudioDeviceModule : public AudioDeviceModule {
|
||||
*delayMS = 0;
|
||||
return 0;
|
||||
}
|
||||
int32_t SetRecordingSampleRate(const uint32_t samplesPerSec) override {
|
||||
return 0;
|
||||
}
|
||||
int32_t RecordingSampleRate(uint32_t* samplesPerSec) const override {
|
||||
return 0;
|
||||
}
|
||||
int32_t SetPlayoutSampleRate(const uint32_t samplesPerSec) override {
|
||||
return 0;
|
||||
}
|
||||
int32_t PlayoutSampleRate(uint32_t* samplesPerSec) const override {
|
||||
return 0;
|
||||
}
|
||||
int32_t SetLoudspeakerStatus(bool enable) override { return 0; }
|
||||
int32_t GetLoudspeakerStatus(bool* enabled) const override { return 0; }
|
||||
bool BuiltInAECIsAvailable() const override { return false; }
|
||||
|
||||
@ -84,10 +84,6 @@ class MockAudioDeviceModule : public AudioDeviceModule {
|
||||
MOCK_METHOD1(SetStereoRecording, int32_t(bool enable));
|
||||
MOCK_CONST_METHOD1(StereoRecording, int32_t(bool* enabled));
|
||||
MOCK_CONST_METHOD1(PlayoutDelay, int32_t(uint16_t* delayMS));
|
||||
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_METHOD1(SetLoudspeakerStatus, int32_t(bool enable));
|
||||
MOCK_CONST_METHOD1(GetLoudspeakerStatus, int32_t(bool* enabled));
|
||||
MOCK_CONST_METHOD0(BuiltInAECIsAvailable, bool());
|
||||
|
||||
@ -394,30 +394,6 @@ int32_t FakeAudioCaptureModule::PlayoutDelay(uint16_t* delay_ms) const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t FakeAudioCaptureModule::SetRecordingSampleRate(
|
||||
const uint32_t /*samples_per_sec*/) {
|
||||
RTC_NOTREACHED();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t FakeAudioCaptureModule::RecordingSampleRate(
|
||||
uint32_t* /*samples_per_sec*/) const {
|
||||
RTC_NOTREACHED();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t FakeAudioCaptureModule::SetPlayoutSampleRate(
|
||||
const uint32_t /*samples_per_sec*/) {
|
||||
RTC_NOTREACHED();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t FakeAudioCaptureModule::PlayoutSampleRate(
|
||||
uint32_t* /*samples_per_sec*/) const {
|
||||
RTC_NOTREACHED();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t FakeAudioCaptureModule::SetLoudspeakerStatus(bool /*enable*/) {
|
||||
RTC_NOTREACHED();
|
||||
return 0;
|
||||
|
||||
@ -128,11 +128,6 @@ class FakeAudioCaptureModule
|
||||
|
||||
int32_t PlayoutDelay(uint16_t* delay_ms) const 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 SetLoudspeakerStatus(bool enable) override;
|
||||
int32_t GetLoudspeakerStatus(bool* enabled) const override;
|
||||
bool BuiltInAECIsAvailable() const override { return false; }
|
||||
|
||||
Reference in New Issue
Block a user