Let AudioCodingModule::SendCodec return Maybe<CodecInst>

And deal with the consequences thereof...

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

Cr-Commit-Position: refs/heads/master@{#10497}
This commit is contained in:
kwiberg
2015-11-03 11:20:50 -08:00
committed by Commit bot
parent 969aeb1910
commit 1fd4a4ab35
15 changed files with 72 additions and 78 deletions

View File

@ -250,10 +250,8 @@ void TwoWayCommunication::Perform() {
AudioFrame audioFrame;
CodecInst codecInst_B;
CodecInst dummy;
EXPECT_EQ(0, _acmB->SendCodec(&codecInst_B));
auto codecInst_B = _acmB->SendCodec();
ASSERT_TRUE(codecInst_B);
// 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
@ -285,15 +283,15 @@ void TwoWayCommunication::Perform() {
}
// 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));
EXPECT_EQ(0, _acmB->RegisterSendCodec(*codecInst_B));
EXPECT_TRUE(_acmB->SendCodec());
}
// 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));
EXPECT_EQ(0, _acmA->RegisterReceiveCodec(*codecInst_B));
}
}
}