Remove unused AEC delay offset API
Bug: webrtc:5298 Change-Id: If490dba3c95b1d6aeaa7b110dd1ffc23ee7a96c9 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166440 Reviewed-by: Per Åhgren <peah@webrtc.org> Commit-Queue: Sam Zackrisson <saza@webrtc.org> Cr-Commit-Position: refs/heads/master@{#30297}
This commit is contained in:

committed by
Commit Bot

parent
a3d4252a01
commit
2d31aea481
@ -1235,7 +1235,7 @@ int AudioProcessingImpl::ProcessCaptureStreamLocked() {
|
|||||||
if (submodules_.echo_control_mobile) {
|
if (submodules_.echo_control_mobile) {
|
||||||
// Ensure that the stream delay was set before the call to the
|
// Ensure that the stream delay was set before the call to the
|
||||||
// AECM ProcessCaptureAudio function.
|
// AECM ProcessCaptureAudio function.
|
||||||
if (!was_stream_delay_set()) {
|
if (!capture_.was_stream_delay_set) {
|
||||||
return AudioProcessing::kStreamParameterNotSetError;
|
return AudioProcessing::kStreamParameterNotSetError;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1252,7 +1252,7 @@ int AudioProcessingImpl::ProcessCaptureStreamLocked() {
|
|||||||
if (submodules_.echo_controller) {
|
if (submodules_.echo_controller) {
|
||||||
data_dumper_->DumpRaw("stream_delay", stream_delay_ms());
|
data_dumper_->DumpRaw("stream_delay", stream_delay_ms());
|
||||||
|
|
||||||
if (was_stream_delay_set()) {
|
if (capture_.was_stream_delay_set) {
|
||||||
submodules_.echo_controller->SetAudioBufferDelay(stream_delay_ms());
|
submodules_.echo_controller->SetAudioBufferDelay(stream_delay_ms());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1553,7 +1553,6 @@ int AudioProcessingImpl::set_stream_delay_ms(int delay) {
|
|||||||
rtc::CritScope cs(&crit_capture_);
|
rtc::CritScope cs(&crit_capture_);
|
||||||
Error retval = kNoError;
|
Error retval = kNoError;
|
||||||
capture_.was_stream_delay_set = true;
|
capture_.was_stream_delay_set = true;
|
||||||
delay += capture_.delay_offset_ms;
|
|
||||||
|
|
||||||
if (delay < 0) {
|
if (delay < 0) {
|
||||||
delay = 0;
|
delay = 0;
|
||||||
@ -1600,26 +1599,11 @@ int AudioProcessingImpl::stream_delay_ms() const {
|
|||||||
return capture_nonlocked_.stream_delay_ms;
|
return capture_nonlocked_.stream_delay_ms;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AudioProcessingImpl::was_stream_delay_set() const {
|
|
||||||
// Used as callback from submodules, hence locking is not allowed.
|
|
||||||
return capture_.was_stream_delay_set;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AudioProcessingImpl::set_stream_key_pressed(bool key_pressed) {
|
void AudioProcessingImpl::set_stream_key_pressed(bool key_pressed) {
|
||||||
rtc::CritScope cs(&crit_capture_);
|
rtc::CritScope cs(&crit_capture_);
|
||||||
capture_.key_pressed = key_pressed;
|
capture_.key_pressed = key_pressed;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioProcessingImpl::set_delay_offset_ms(int offset) {
|
|
||||||
rtc::CritScope cs(&crit_capture_);
|
|
||||||
capture_.delay_offset_ms = offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
int AudioProcessingImpl::delay_offset_ms() const {
|
|
||||||
rtc::CritScope cs(&crit_capture_);
|
|
||||||
return capture_.delay_offset_ms;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AudioProcessingImpl::set_stream_analog_level(int level) {
|
void AudioProcessingImpl::set_stream_analog_level(int level) {
|
||||||
rtc::CritScope cs_capture(&crit_capture_);
|
rtc::CritScope cs_capture(&crit_capture_);
|
||||||
|
|
||||||
@ -2107,8 +2091,7 @@ void AudioProcessingImpl::RecordAudioProcessingState() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
AudioProcessingImpl::ApmCaptureState::ApmCaptureState()
|
AudioProcessingImpl::ApmCaptureState::ApmCaptureState()
|
||||||
: delay_offset_ms(0),
|
: was_stream_delay_set(false),
|
||||||
was_stream_delay_set(false),
|
|
||||||
output_will_be_muted(false),
|
output_will_be_muted(false),
|
||||||
key_pressed(false),
|
key_pressed(false),
|
||||||
capture_processing_format(kSampleRate16kHz),
|
capture_processing_format(kSampleRate16kHz),
|
||||||
|
@ -89,8 +89,6 @@ class AudioProcessingImpl : public AudioProcessing {
|
|||||||
rtc::ArrayView<std::array<float, 160>> linear_output) const override;
|
rtc::ArrayView<std::array<float, 160>> linear_output) const override;
|
||||||
void set_output_will_be_muted(bool muted) override;
|
void set_output_will_be_muted(bool muted) override;
|
||||||
int set_stream_delay_ms(int delay) override;
|
int set_stream_delay_ms(int delay) override;
|
||||||
void set_delay_offset_ms(int offset) override;
|
|
||||||
int delay_offset_ms() const override;
|
|
||||||
void set_stream_key_pressed(bool key_pressed) override;
|
void set_stream_key_pressed(bool key_pressed) override;
|
||||||
void set_stream_analog_level(int level) override;
|
void set_stream_analog_level(int level) override;
|
||||||
int recommended_stream_analog_level() const override;
|
int recommended_stream_analog_level() const override;
|
||||||
@ -115,8 +113,6 @@ class AudioProcessingImpl : public AudioProcessing {
|
|||||||
size_t num_output_channels() const override;
|
size_t num_output_channels() const override;
|
||||||
size_t num_reverse_channels() const override;
|
size_t num_reverse_channels() const override;
|
||||||
int stream_delay_ms() const override;
|
int stream_delay_ms() const override;
|
||||||
bool was_stream_delay_set() const override
|
|
||||||
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
|
|
||||||
|
|
||||||
AudioProcessingStats GetStatistics(bool has_remote_tracks) override {
|
AudioProcessingStats GetStatistics(bool has_remote_tracks) override {
|
||||||
return GetStatistics();
|
return GetStatistics();
|
||||||
@ -394,7 +390,6 @@ class AudioProcessingImpl : public AudioProcessing {
|
|||||||
struct ApmCaptureState {
|
struct ApmCaptureState {
|
||||||
ApmCaptureState();
|
ApmCaptureState();
|
||||||
~ApmCaptureState();
|
~ApmCaptureState();
|
||||||
int delay_offset_ms;
|
|
||||||
bool was_stream_delay_set;
|
bool was_stream_delay_set;
|
||||||
bool output_will_be_muted;
|
bool output_will_be_muted;
|
||||||
bool key_pressed;
|
bool key_pressed;
|
||||||
|
@ -816,15 +816,10 @@ void CaptureProcessor::ApplyRuntimeSettingScheme() {
|
|||||||
ASSERT_EQ(AudioProcessing::Error::kNoError,
|
ASSERT_EQ(AudioProcessing::Error::kNoError,
|
||||||
apm_->set_stream_delay_ms(30));
|
apm_->set_stream_delay_ms(30));
|
||||||
apm_->set_stream_key_pressed(true);
|
apm_->set_stream_key_pressed(true);
|
||||||
apm_->set_delay_offset_ms(15);
|
|
||||||
EXPECT_EQ(apm_->delay_offset_ms(), 15);
|
|
||||||
} else {
|
} else {
|
||||||
ASSERT_EQ(AudioProcessing::Error::kNoError,
|
ASSERT_EQ(AudioProcessing::Error::kNoError,
|
||||||
apm_->set_stream_delay_ms(50));
|
apm_->set_stream_delay_ms(50));
|
||||||
apm_->set_stream_key_pressed(false);
|
apm_->set_stream_key_pressed(false);
|
||||||
apm_->set_delay_offset_ms(20);
|
|
||||||
EXPECT_EQ(apm_->delay_offset_ms(), 20);
|
|
||||||
apm_->delay_offset_ms();
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -732,30 +732,6 @@ TEST_F(ApmTest, StreamParametersFloat) {
|
|||||||
StreamParametersTest(kFloatFormat);
|
StreamParametersTest(kFloatFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(ApmTest, DefaultDelayOffsetIsZero) {
|
|
||||||
EXPECT_EQ(0, apm_->delay_offset_ms());
|
|
||||||
EXPECT_EQ(apm_->kNoError, apm_->set_stream_delay_ms(50));
|
|
||||||
EXPECT_EQ(50, apm_->stream_delay_ms());
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_F(ApmTest, DelayOffsetWithLimitsIsSetProperly) {
|
|
||||||
// High limit of 500 ms.
|
|
||||||
apm_->set_delay_offset_ms(100);
|
|
||||||
EXPECT_EQ(100, apm_->delay_offset_ms());
|
|
||||||
EXPECT_EQ(apm_->kBadStreamParameterWarning, apm_->set_stream_delay_ms(450));
|
|
||||||
EXPECT_EQ(500, apm_->stream_delay_ms());
|
|
||||||
EXPECT_EQ(apm_->kNoError, apm_->set_stream_delay_ms(100));
|
|
||||||
EXPECT_EQ(200, apm_->stream_delay_ms());
|
|
||||||
|
|
||||||
// Low limit of 0 ms.
|
|
||||||
apm_->set_delay_offset_ms(-50);
|
|
||||||
EXPECT_EQ(-50, apm_->delay_offset_ms());
|
|
||||||
EXPECT_EQ(apm_->kBadStreamParameterWarning, apm_->set_stream_delay_ms(20));
|
|
||||||
EXPECT_EQ(0, apm_->stream_delay_ms());
|
|
||||||
EXPECT_EQ(apm_->kNoError, apm_->set_stream_delay_ms(100));
|
|
||||||
EXPECT_EQ(50, apm_->stream_delay_ms());
|
|
||||||
}
|
|
||||||
|
|
||||||
void ApmTest::TestChangingChannelsInt16Interface(
|
void ApmTest::TestChangingChannelsInt16Interface(
|
||||||
size_t num_channels,
|
size_t num_channels,
|
||||||
AudioProcessing::Error expected_return) {
|
AudioProcessing::Error expected_return) {
|
||||||
|
@ -611,20 +611,11 @@ class RTC_EXPORT AudioProcessing : public rtc::RefCountInterface {
|
|||||||
// ProcessStream().
|
// ProcessStream().
|
||||||
virtual int set_stream_delay_ms(int delay) = 0;
|
virtual int set_stream_delay_ms(int delay) = 0;
|
||||||
virtual int stream_delay_ms() const = 0;
|
virtual int stream_delay_ms() const = 0;
|
||||||
virtual bool was_stream_delay_set() const = 0;
|
|
||||||
|
|
||||||
// Call to signal that a key press occurred (true) or did not occur (false)
|
// Call to signal that a key press occurred (true) or did not occur (false)
|
||||||
// with this chunk of audio.
|
// with this chunk of audio.
|
||||||
virtual void set_stream_key_pressed(bool key_pressed) = 0;
|
virtual void set_stream_key_pressed(bool key_pressed) = 0;
|
||||||
|
|
||||||
// Sets a delay |offset| in ms to add to the values passed in through
|
|
||||||
// set_stream_delay_ms(). May be positive or negative.
|
|
||||||
//
|
|
||||||
// Note that this could cause an otherwise valid value passed to
|
|
||||||
// set_stream_delay_ms() to return an error.
|
|
||||||
virtual void set_delay_offset_ms(int offset) = 0;
|
|
||||||
virtual int delay_offset_ms() const = 0;
|
|
||||||
|
|
||||||
// Attaches provided webrtc::AecDump for recording debugging
|
// Attaches provided webrtc::AecDump for recording debugging
|
||||||
// information. Log file and maximum file size logic is supposed to
|
// information. Log file and maximum file size logic is supposed to
|
||||||
// be handled by implementing instance of AecDump. Calling this
|
// be handled by implementing instance of AecDump. Calling this
|
||||||
|
Reference in New Issue
Block a user