Remove no-op and unused methods from AudioCodingModule

This CL removes the following no-op and/or unused methods from
AudioCodingModule and AudioCodingModuleImpl:

ConfigISACBandwidthEstimator
DecoderEstimatedBandwidth
IsInternalDTXReplacedWithWebRtc
REDPayloadISAC
ReplaceInternalDTXWithWebRtc
ResetDecoder
ResetEncoder
SendBitrate
SetReceivedEstimatedBandwidth

R=henrik.lundin@webrtc.org

Review URL: https://codereview.webrtc.org/1308283003 .

Cr-Commit-Position: refs/heads/master@{#9773}
This commit is contained in:
Karl Wiberg
2015-08-25 09:37:04 +02:00
parent 7ef9d9104d
commit dd00f113a9
8 changed files with 9 additions and 334 deletions

View File

@ -1129,7 +1129,6 @@ void APITest::ChangeCodec(char side) {
myChannel = _channel_B2A;
}
myACM->ResetEncoder();
Wait(100);
// Register the next codec

View File

@ -137,7 +137,6 @@ void TestVadDtx::Run(std::string in_filename, int frequency, int channels,
TestWebRtcVadDtx::TestWebRtcVadDtx()
: vad_enabled_(false),
dtx_enabled_(false),
use_webrtc_dtx_(false),
output_file_num_(0) {
}
@ -191,7 +190,7 @@ void TestWebRtcVadDtx::RunTestCases() {
// Set the expectation and run the test.
void TestWebRtcVadDtx::Test(bool new_outfile) {
int expects[] = {-1, 1, use_webrtc_dtx_, 0, 0};
int expects[] = {-1, 1, dtx_enabled_, 0, 0};
if (new_outfile) {
output_file_num_++;
}
@ -219,17 +218,10 @@ void TestWebRtcVadDtx::SetVAD(bool enable_dtx, bool enable_vad,
EXPECT_EQ(dtx_enabled_ , enable_dtx); // DTX should be set as expected.
bool replaced = false;
acm_send_->IsInternalDTXReplacedWithWebRtc(&replaced);
use_webrtc_dtx_ = dtx_enabled_ && replaced;
if (use_webrtc_dtx_) {
if (dtx_enabled_) {
EXPECT_TRUE(vad_enabled_); // WebRTC DTX cannot run without WebRTC VAD.
}
if (!dtx_enabled_ || !use_webrtc_dtx_) {
// Using no DTX or codec Internal DTX should not affect setting of VAD.
} else {
// Using no DTX should not affect setting of VAD.
EXPECT_EQ(enable_vad, vad_enabled_);
}
}

View File

@ -88,7 +88,6 @@ class TestWebRtcVadDtx final : public TestVadDtx {
bool vad_enabled_;
bool dtx_enabled_;
bool use_webrtc_dtx_;
int output_file_num_;
};

View File

@ -279,8 +279,8 @@ void TwoWayCommunication::Perform() {
// In the following loop we tests that the code can handle misuse of the APIs.
// In the middle of a session with data flowing between two sides, called A
// and B, APIs will be called, like ResetEncoder(), and the code should
// continue to run, and be able to recover.
// and B, APIs will be called, and the code should continue to run, and be
// able to recover.
while (!_inFileA.EndOfFile() && !_inFileB.EndOfFile()) {
msecPassed += 10;
EXPECT_GT(_inFileA.Read10MsData(audioFrame), 0);
@ -305,21 +305,14 @@ void TwoWayCommunication::Perform() {
msecPassed = 0;
secPassed++;
}
// Call RestEncoder for ACM on side A, and InitializeSender for ACM on
// side B.
if (((secPassed % 5) == 4) && (msecPassed == 0)) {
EXPECT_EQ(0, _acmA->ResetEncoder());
}
// Re-register send codec on side B.
if (((secPassed % 5) == 4) && (msecPassed >= 990)) {
EXPECT_EQ(0, _acmB->RegisterSendCodec(codecInst_B));
EXPECT_EQ(0, _acmB->SendCodec(&dummy));
}
// Reset decoder on side B, and initialize receiver on side A.
if (((secPassed % 7) == 6) && (msecPassed == 0)) {
EXPECT_EQ(0, _acmB->ResetDecoder());
// Initialize receiver on side A.
if (((secPassed % 7) == 6) && (msecPassed == 0))
EXPECT_EQ(0, _acmA->InitializeReceiver());
}
// Re-register codec on side A.
if (((secPassed % 7) == 6) && (msecPassed >= 990)) {
EXPECT_EQ(0, _acmA->RegisterReceiveCodec(codecInst_B));

View File

@ -75,13 +75,6 @@ int16_t SetISAConfig(ACMTestISACConfig& isacConfig, AudioCodingModule* acm,
// Set max payload size.
EXPECT_EQ(0, acm->SetISACMaxPayloadSize(isacConfig.maxPayloadSizeByte));
}
if ((isacConfig.initFrameSizeInMsec != 0)
|| (isacConfig.initRateBitPerSec != 0)) {
EXPECT_EQ(0, acm->ConfigISACBandwidthEstimator(
static_cast<uint8_t>(isacConfig.initFrameSizeInMsec),
static_cast<uint16_t>(isacConfig.initRateBitPerSec),
isacConfig.enforceFrameSize));
}
return 0;
}
@ -215,8 +208,6 @@ void ISACTest::Perform() {
testNr++;
EncodeDecode(testNr, wbISACConfig, swbISACConfig);
_acmA->ResetEncoder();
_acmB->ResetEncoder();
SetISACConfigDefault(wbISACConfig);
SetISACConfigDefault(swbISACConfig);