Chromium Code Reviews

Unified Diff: webrtc/modules/audio_coding/acm2/acm_receive_test.cc

Issue 2388153004: Stop using old AudioCodingModule::RegisterReceiveCodec overloads (Closed)
Patch Set: rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: webrtc/modules/audio_coding/acm2/acm_receive_test.cc
diff --git a/webrtc/modules/audio_coding/acm2/acm_receive_test.cc b/webrtc/modules/audio_coding/acm2/acm_receive_test.cc
index 056ff2273ce8062eb62257e7b99f37da8f4f2b90..c2549323c77231c385e1d4eac265cb8d82241745 100644
--- a/webrtc/modules/audio_coding/acm2/acm_receive_test.cc
+++ b/webrtc/modules/audio_coding/acm2/acm_receive_test.cc
@@ -15,6 +15,7 @@
#include <memory>
+#include "webrtc/modules/audio_coding/codecs/audio_format_conversion.h"
#include "webrtc/modules/audio_coding/codecs/builtin_audio_decoder_factory.h"
#include "webrtc/modules/audio_coding/include/audio_coding_module.h"
#include "webrtc/modules/audio_coding/neteq/tools/audio_sink.h"
@@ -132,7 +133,9 @@ void AcmReceiveTestOldApi::RegisterDefaultCodecs() {
for (int n = 0; n < acm_->NumberOfCodecs(); n++) {
ASSERT_EQ(0, acm_->Codec(n, &my_codec_param)) << "Failed to get codec.";
if (ModifyAndUseThisCodec(&my_codec_param)) {
- ASSERT_EQ(0, acm_->RegisterReceiveCodec(my_codec_param))
+ ASSERT_EQ(true,
+ acm_->RegisterReceiveCodec(my_codec_param.pltype,
+ CodecInstToSdp(my_codec_param)))
<< "Couldn't register receive codec.\n";
}
}
@@ -151,22 +154,14 @@ void AcmReceiveTestOldApi::RegisterNetEqTestCodecs() {
my_codec_param.plfreq,
my_codec_param.channels,
&my_codec_param.pltype)) {
- ASSERT_EQ(0, acm_->RegisterReceiveCodec(my_codec_param))
+ ASSERT_EQ(true,
+ acm_->RegisterReceiveCodec(my_codec_param.pltype,
+ CodecInstToSdp(my_codec_param)))
<< "Couldn't register receive codec.\n";
}
}
}
-int AcmReceiveTestOldApi::RegisterExternalReceiveCodec(
- int rtp_payload_type,
- AudioDecoder* external_decoder,
- int sample_rate_hz,
- int num_channels,
- const std::string& name) {
- return acm_->RegisterExternalReceiveCodec(rtp_payload_type, external_decoder,
- sample_rate_hz, num_channels, name);
-}
-
void AcmReceiveTestOldApi::Run() {
for (std::unique_ptr<Packet> packet(packet_source_->NextPacket()); packet;
packet = packet_source_->NextPacket()) {

Powered by Google App Engine