ACM: Removing runtime APIs related to playout mode

The playout mode in NetEq can still be set through the constructor
configuration.

BUG=webrtc:3520

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

Cr-Commit-Position: refs/heads/master@{#10089}
This commit is contained in:
henrik.lundin
2015-09-28 06:12:17 -07:00
committed by Commit bot
parent d417523194
commit 1bd0e03ce5
11 changed files with 13 additions and 258 deletions

View File

@ -424,7 +424,7 @@ void APITest::RunTest(char thread) {
{
WriteLockScoped cs(_apiTestRWLock);
if (thread == 'A') {
_testNumA = (_testNumB + 1 + (rand() % 4)) % 5;
_testNumA = (_testNumB + 1 + (rand() % 3)) % 4;
testNum = _testNumA;
_movingDot[_dotPositionA] = ' ';
@ -437,7 +437,7 @@ void APITest::RunTest(char thread) {
_dotPositionA += _dotMoveDirectionA;
_movingDot[_dotPositionA] = (_dotMoveDirectionA > 0) ? '>' : '<';
} else {
_testNumB = (_testNumA + 1 + (rand() % 4)) % 5;
_testNumB = (_testNumA + 1 + (rand() % 3)) % 4;
testNum = _testNumB;
_movingDot[_dotPositionB] = ' ';
@ -459,18 +459,15 @@ void APITest::RunTest(char thread) {
ChangeCodec('A');
break;
case 1:
TestPlayout('B');
break;
case 2:
if (!_randomTest) {
fprintf(stdout, "\nTesting Delay ...\n");
}
TestDelay('A');
break;
case 3:
case 2:
TestSendVAD('A');
break;
case 4:
case 3:
TestRegisteration('A');
break;
default:
@ -493,7 +490,6 @@ bool APITest::APIRunA() {
} else {
CurrentCodec('A');
ChangeCodec('A');
TestPlayout('B');
if (_codecCntrA == 0) {
fprintf(stdout, "\nTesting Delay ...\n");
TestDelay('A');
@ -922,67 +918,6 @@ void APITest::TestRegisteration(char sendSide) {
}
}
// Playout Mode, background noise mode.
// Receiver Frequency, playout frequency.
void APITest::TestPlayout(char receiveSide) {
AudioCodingModule* receiveACM;
AudioPlayoutMode* playoutMode = NULL;
switch (receiveSide) {
case 'A': {
receiveACM = _acmA.get();
playoutMode = &_playoutModeA;
break;
}
case 'B': {
receiveACM = _acmB.get();
playoutMode = &_playoutModeB;
break;
}
default:
receiveACM = _acmA.get();
}
int32_t receiveFreqHz = receiveACM->ReceiveFrequency();
int32_t playoutFreqHz = receiveACM->PlayoutFrequency();
CHECK_ERROR_MT(receiveFreqHz);
CHECK_ERROR_MT(playoutFreqHz);
char playoutString[25];
switch (*playoutMode) {
case voice: {
*playoutMode = fax;
strncpy(playoutString, "FAX", 25);
break;
}
case fax: {
*playoutMode = streaming;
strncpy(playoutString, "Streaming", 25);
break;
}
case streaming: {
*playoutMode = voice;
strncpy(playoutString, "Voice", 25);
break;
}
default:
*playoutMode = voice;
strncpy(playoutString, "Voice", 25);
}
CHECK_ERROR_MT(receiveACM->SetPlayoutMode(*playoutMode));
playoutString[24] = '\0';
if (!_randomTest) {
fprintf(stdout, "\n");
fprintf(stdout, "In Side %c\n", receiveSide);
fprintf(stdout, "---------------------------------\n");
fprintf(stdout, "Receive Frequency....... %d Hz\n", receiveFreqHz);
fprintf(stdout, "Playout Frequency....... %d Hz\n", playoutFreqHz);
fprintf(stdout, "Audio Playout Mode...... %s\n", playoutString);
}
}
void APITest::TestSendVAD(char side) {
if (_randomTest) {
return;

View File

@ -141,9 +141,6 @@ class APITest : public ACMTest {
int32_t _minDelayB;
bool _payloadUsed[32];
AudioPlayoutMode _playoutModeA;
AudioPlayoutMode _playoutModeB;
bool _verbose;
int _dotPositionA;

View File

@ -32,10 +32,16 @@ namespace webrtc {
TwoWayCommunication::TwoWayCommunication(int testMode)
: _acmA(AudioCodingModule::Create(1)),
_acmB(AudioCodingModule::Create(2)),
_acmRefA(AudioCodingModule::Create(3)),
_acmRefB(AudioCodingModule::Create(4)),
_testMode(testMode) {}
_testMode(testMode) {
AudioCodingModule::Config config;
// The clicks will be more obvious in FAX mode. TODO(henrik.lundin) Really?
config.neteq_config.playout_mode = kPlayoutFax;
config.id = 2;
_acmB.reset(AudioCodingModule::Create(config));
config.id = 4;
_acmRefB.reset(AudioCodingModule::Create(config));
}
TwoWayCommunication::~TwoWayCommunication() {
delete _channel_A2B;
@ -159,11 +165,6 @@ void TwoWayCommunication::SetUp() {
_channelRef_B2A = new Channel;
_acmRefB->RegisterTransportCallback(_channelRef_B2A);
_channelRef_B2A->RegisterReceiverACM(_acmRefA.get());
// The clicks will be more obvious when we
// are in FAX mode.
EXPECT_EQ(_acmB->SetPlayoutMode(fax), 0);
EXPECT_EQ(_acmRefB->SetPlayoutMode(fax), 0);
}
void TwoWayCommunication::SetUpAutotest() {
@ -233,11 +234,6 @@ void TwoWayCommunication::SetUpAutotest() {
_channelRef_B2A = new Channel;
_acmRefB->RegisterTransportCallback(_channelRef_B2A);
_channelRef_B2A->RegisterReceiverACM(_acmRefA.get());
// The clicks will be more obvious when we
// are in FAX mode.
EXPECT_EQ(0, _acmB->SetPlayoutMode(fax));
EXPECT_EQ(0, _acmRefB->SetPlayoutMode(fax));
}
void TwoWayCommunication::Perform() {