[ACM] iSAC audio codec removed
Note: this CL has to leave behind one part of iSAC, which is its VAD
currently used by AGC1 in APM. The target visibility has been
restricted and the VAD will be removed together with AGC1 when the
time comes.
Tested: see https://chromium-review.googlesource.com/c/chromium/src/+/4013319
Bug: webrtc:14450
Change-Id: I69cc518b16280eae62a1f1977cdbfa24c08cf5f9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/282421
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38652}
diff --git a/modules/audio_coding/acm2/acm_receiver_unittest.cc b/modules/audio_coding/acm2/acm_receiver_unittest.cc
index e73acc2..6dd44b6 100644
--- a/modules/audio_coding/acm2/acm_receiver_unittest.cc
+++ b/modules/audio_coding/acm2/acm_receiver_unittest.cc
@@ -13,6 +13,7 @@
#include <algorithm> // std::min
#include <memory>
+#include "absl/types/optional.h"
#include "api/audio_codecs/builtin_audio_decoder_factory.h"
#include "api/audio_codecs/builtin_audio_encoder_factory.h"
#include "modules/audio_coding/codecs/cng/audio_encoder_cng.h"
@@ -64,12 +65,14 @@
const SdpAudioFormat& format,
const std::map<int, int> cng_payload_types = {}) {
// Create the speech encoder.
- AudioCodecInfo info = encoder_factory_->QueryAudioEncoder(format).value();
+ absl::optional<AudioCodecInfo> info =
+ encoder_factory_->QueryAudioEncoder(format);
+ RTC_CHECK(info.has_value());
std::unique_ptr<AudioEncoder> enc =
encoder_factory_->MakeAudioEncoder(payload_type, format, absl::nullopt);
// If we have a compatible CN specification, stack a CNG on top.
- auto it = cng_payload_types.find(info.sample_rate_hz);
+ auto it = cng_payload_types.find(info->sample_rate_hz);
if (it != cng_payload_types.end()) {
AudioEncoderCngConfig config;
config.speech_encoder = std::move(enc);
@@ -81,7 +84,7 @@
// Actually start using the new encoder.
acm_->SetEncoder(std::move(enc));
- return info;
+ return *info;
}
int InsertOnePacketOfSilence(const AudioCodecInfo& info) {
@@ -148,8 +151,7 @@
#define MAYBE_SampleRate SampleRate
#endif
TEST_F(AcmReceiverTestOldApi, MAYBE_SampleRate) {
- const std::map<int, SdpAudioFormat> codecs = {{0, {"ISAC", 16000, 1}},
- {1, {"ISAC", 32000, 1}}};
+ const std::map<int, SdpAudioFormat> codecs = {{0, {"OPUS", 48000, 2}}};
receiver_->SetCodecs(codecs);
constexpr int kOutSampleRateHz = 8000; // Different than codec sample rate.
@@ -233,15 +235,6 @@
}
#if defined(WEBRTC_ANDROID)
-#define MAYBE_VerifyAudioFrameISAC DISABLED_VerifyAudioFrameISAC
-#else
-#define MAYBE_VerifyAudioFrameISAC VerifyAudioFrameISAC
-#endif
-TEST_F(AcmReceiverTestFaxModeOldApi, MAYBE_VerifyAudioFrameISAC) {
- RunVerifyAudioFrame({"ISAC", 16000, 1});
-}
-
-#if defined(WEBRTC_ANDROID)
#define MAYBE_VerifyAudioFrameOpus DISABLED_VerifyAudioFrameOpus
#else
#define MAYBE_VerifyAudioFrameOpus VerifyAudioFrameOpus
@@ -310,12 +303,10 @@
#else
#define MAYBE_LastAudioCodec LastAudioCodec
#endif
-#if defined(WEBRTC_CODEC_ISAC)
+#if defined(WEBRTC_CODEC_OPUS)
TEST_F(AcmReceiverTestOldApi, MAYBE_LastAudioCodec) {
- const std::map<int, SdpAudioFormat> codecs = {{0, {"ISAC", 16000, 1}},
- {1, {"PCMA", 8000, 1}},
- {2, {"ISAC", 32000, 1}},
- {3, {"L16", 32000, 1}}};
+ const std::map<int, SdpAudioFormat> codecs = {
+ {0, {"PCMU", 8000, 1}}, {1, {"PCMA", 8000, 1}}, {2, {"L16", 32000, 1}}};
const std::map<int, int> cng_payload_types = {
{8000, 100}, {16000, 101}, {32000, 102}};
{