Reland "Remove CodecInst pt.1"
This is a reland of 056f9738bf7a3d16da45398239656e165c4e0851
Original change's description:
> Remove CodecInst pt.1
>
> Update audio_coding tests to not use CodecInst.
>
> Bug: webrtc:7626
> Change-Id: I880fb8d72d7d0a915d274e67feb6106f023697c2
> Reviewed-on: https://webrtc-review.googlesource.com/c/112594
> Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#25879}
Bug: webrtc:7626
Change-Id: I5d6ca0baf6230bfe9bf95c2c25496d2a56812d90
Reviewed-on: https://webrtc-review.googlesource.com/c/112942
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25902}
diff --git a/modules/audio_coding/test/TestRedFec.cc b/modules/audio_coding/test/TestRedFec.cc
index 8bb3971..ac51666 100644
--- a/modules/audio_coding/test/TestRedFec.cc
+++ b/modules/audio_coding/test/TestRedFec.cc
@@ -10,8 +10,9 @@
#include "modules/audio_coding/test/TestRedFec.h"
-#include <assert.h>
+#include <utility>
+#include "absl/strings/match.h"
#include "api/audio_codecs/L16/audio_decoder_L16.h"
#include "api/audio_codecs/L16/audio_encoder_L16.h"
#include "api/audio_codecs/audio_decoder_factory_template.h"
@@ -24,12 +25,11 @@
#include "api/audio_codecs/isac/audio_encoder_isac_float.h"
#include "api/audio_codecs/opus/audio_decoder_opus.h"
#include "api/audio_codecs/opus/audio_encoder_opus.h"
-#include "common_types.h" // NOLINT(build/include)
#include "modules/audio_coding/codecs/cng/audio_encoder_cng.h"
#include "modules/audio_coding/codecs/red/audio_encoder_copy_red.h"
#include "modules/audio_coding/include/audio_coding_module_typedefs.h"
-#include "modules/audio_coding/test/utility.h"
#include "rtc_base/strings/string_builder.h"
+#include "test/gtest.h"
#include "test/testsupport/fileutils.h"
namespace webrtc {
@@ -173,6 +173,7 @@
auto encoder = encoder_factory_->MakeAudioEncoder(payload_type, codec_format,
absl::nullopt);
EXPECT_NE(encoder, nullptr);
+ std::map<int, SdpAudioFormat> receive_codecs = {{payload_type, codec_format}};
if (!absl::EqualsIgnoreCase(codec_format.name, "opus")) {
if (vad_mode.has_value()) {
AudioEncoderCngConfig config;
@@ -181,22 +182,22 @@
config.payload_type = cn_payload_type;
config.vad_mode = vad_mode.value();
encoder = CreateComfortNoiseEncoder(std::move(config));
- EXPECT_EQ(true,
- other_acm->RegisterReceiveCodec(
- cn_payload_type, {"CN", codec_format.clockrate_hz, 1}));
+ receive_codecs.emplace(
+ std::make_pair(cn_payload_type,
+ SdpAudioFormat("CN", codec_format.clockrate_hz, 1)));
}
if (use_red) {
AudioEncoderCopyRed::Config config;
config.payload_type = red_payload_type;
config.speech_encoder = std::move(encoder);
encoder = absl::make_unique<AudioEncoderCopyRed>(std::move(config));
- EXPECT_EQ(true,
- other_acm->RegisterReceiveCodec(
- red_payload_type, {"red", codec_format.clockrate_hz, 1}));
+ receive_codecs.emplace(
+ std::make_pair(red_payload_type,
+ SdpAudioFormat("red", codec_format.clockrate_hz, 1)));
}
}
acm->SetEncoder(std::move(encoder));
- EXPECT_EQ(true, other_acm->RegisterReceiveCodec(payload_type, codec_format));
+ other_acm->SetReceiveCodecs(receive_codecs);
}
void TestRedFec::Run() {