Index: webrtc/api/audio_codecs/test/audio_encoder_factory_template_unittest.cc |
diff --git a/webrtc/api/audio_codecs/test/audio_encoder_factory_template_unittest.cc b/webrtc/api/audio_codecs/test/audio_encoder_factory_template_unittest.cc |
index 19c3071bef3d7b8a68519c83c9e9dcf440850298..4120978291aa408f8f7db74a82befec1a19e29b1 100644 |
--- a/webrtc/api/audio_codecs/test/audio_encoder_factory_template_unittest.cc |
+++ b/webrtc/api/audio_codecs/test/audio_encoder_factory_template_unittest.cc |
@@ -13,6 +13,7 @@ |
#include "webrtc/api/audio_codecs/g711/audio_encoder_g711.h" |
#include "webrtc/api/audio_codecs/g722/audio_encoder_g722.h" |
#include "webrtc/api/audio_codecs/ilbc/audio_encoder_ilbc.h" |
+#include "webrtc/api/audio_codecs/isac/audio_encoder_isac_fix.h" |
#include "webrtc/api/audio_codecs/opus/audio_encoder_opus.h" |
#include "webrtc/rtc_base/ptr_util.h" |
#include "webrtc/test/gmock.h" |
@@ -171,6 +172,26 @@ TEST(AudioEncoderFactoryTemplateTest, Ilbc) { |
EXPECT_EQ(8000, enc->SampleRateHz()); |
} |
+TEST(AudioEncoderFactoryTemplateTest, IsacFix) { |
+ auto factory = CreateAudioEncoderFactory<AudioEncoderIsacFix>(); |
+ EXPECT_THAT(factory->GetSupportedEncoders(), |
+ testing::ElementsAre(AudioCodecSpec{ |
+ {"ISAC", 16000, 1}, {16000, 1, 32000, 10000, 32000}})); |
+ EXPECT_EQ(rtc::Optional<AudioCodecInfo>(), |
+ factory->QueryAudioEncoder({"isac", 16000, 2})); |
+ EXPECT_EQ(rtc::Optional<AudioCodecInfo>({16000, 1, 32000, 10000, 32000}), |
+ factory->QueryAudioEncoder({"isac", 16000, 1})); |
+ EXPECT_EQ(nullptr, factory->MakeAudioEncoder(17, {"isac", 8000, 1})); |
+ auto enc1 = factory->MakeAudioEncoder(17, {"isac", 16000, 1}); |
+ ASSERT_NE(nullptr, enc1); |
+ EXPECT_EQ(16000, enc1->SampleRateHz()); |
+ EXPECT_EQ(3u, enc1->Num10MsFramesInNextPacket()); |
+ auto enc2 = |
+ factory->MakeAudioEncoder(17, {"isac", 16000, 1, {{"ptime", "60"}}}); |
+ ASSERT_NE(nullptr, enc2); |
+ EXPECT_EQ(6u, enc2->Num10MsFramesInNextPacket()); |
+} |
+ |
TEST(AudioEncoderFactoryTemplateTest, L16) { |
auto factory = CreateAudioEncoderFactory<AudioEncoderL16>(); |
EXPECT_THAT( |