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}
diff --git a/webrtc/modules/audio_coding/main/test/TwoWayCommunication.cc b/webrtc/modules/audio_coding/main/test/TwoWayCommunication.cc
index 2ff2a85..725cbf7 100644
--- a/webrtc/modules/audio_coding/main/test/TwoWayCommunication.cc
+++ b/webrtc/modules/audio_coding/main/test/TwoWayCommunication.cc
@@ -250,10 +250,8 @@
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 @@
}
// 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));
}
}
}