Index: webrtc/api/audio_codecs/test/audio_decoder_factory_template_unittest.cc |
diff --git a/webrtc/api/audio_codecs/test/audio_decoder_factory_template_unittest.cc b/webrtc/api/audio_codecs/test/audio_decoder_factory_template_unittest.cc |
index c05fcd6e2f6078ce6334b86a482d3e78dfc7e1fc..283a5f5e67bac1bfcf3e72f83d61ce34615e415a 100644 |
--- a/webrtc/api/audio_codecs/test/audio_decoder_factory_template_unittest.cc |
+++ b/webrtc/api/audio_codecs/test/audio_decoder_factory_template_unittest.cc |
@@ -10,6 +10,7 @@ |
#include "webrtc/api/audio_codecs/audio_decoder_factory_template.h" |
#include "webrtc/api/audio_codecs/g722/audio_decoder_g722.h" |
+#include "webrtc/api/audio_codecs/ilbc/audio_decoder_ilbc.h" |
#include "webrtc/base/ptr_util.h" |
#include "webrtc/test/gmock.h" |
#include "webrtc/test/gtest.h" |
@@ -131,4 +132,17 @@ TEST(AudioDecoderFactoryTemplateTest, G722) { |
ASSERT_EQ(nullptr, dec3); |
} |
+TEST(AudioDecoderFactoryTemplateTest, Ilbc) { |
+ auto factory = CreateAudioDecoderFactory<AudioDecoderIlbc>(); |
+ EXPECT_THAT(factory->GetSupportedDecoders(), |
+ testing::ElementsAre( |
+ AudioCodecSpec{{"ILBC", 8000, 1}, {8000, 1, 13300}})); |
the sun
2017/06/27 12:07:19
What do you think about bitrate being 13300 here a
kwiberg-webrtc
2017/06/27 12:50:43
I hadn't caught that, actually.
For the decoder,
ossu
2017/06/27 12:53:14
Hmm... acm_codec_database.cc claims that it's 1330
|
+ EXPECT_FALSE(factory->IsSupportedDecoder({"foo", 8000, 1})); |
+ EXPECT_TRUE(factory->IsSupportedDecoder({"ilbc", 8000, 1})); |
+ EXPECT_EQ(nullptr, factory->MakeAudioDecoder({"bar", 8000, 1})); |
+ auto dec = factory->MakeAudioDecoder({"ilbc", 8000, 1}); |
+ ASSERT_NE(nullptr, dec); |
+ EXPECT_EQ(8000, dec->SampleRateHz()); |
+} |
+ |
} // namespace webrtc |