Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(796)

Unified Diff: webrtc/api/audio_codecs/test/audio_decoder_factory_template_unittest.cc

Issue 3001483002: iSAC floating-point implementation of the Audio{En,De}coderFactoryTemplate APIs (Closed)
Patch Set: review comments Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 c27f24218b44605dd26edfdee9d0267b19ee6634..8d65a659a98aa96a5839dd38a2a623920c5d9765 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
@@ -14,6 +14,7 @@
#include "webrtc/api/audio_codecs/g722/audio_decoder_g722.h"
#include "webrtc/api/audio_codecs/ilbc/audio_decoder_ilbc.h"
#include "webrtc/api/audio_codecs/isac/audio_decoder_isac_fix.h"
+#include "webrtc/api/audio_codecs/isac/audio_decoder_isac_float.h"
#include "webrtc/api/audio_codecs/opus/audio_decoder_opus.h"
#include "webrtc/rtc_base/ptr_util.h"
#include "webrtc/test/gmock.h"
@@ -174,12 +175,32 @@ TEST(AudioDecoderFactoryTemplateTest, IsacFix) {
{"ISAC", 16000, 1}, {16000, 1, 32000, 10000, 32000}}));
EXPECT_FALSE(factory->IsSupportedDecoder({"isac", 16000, 2}));
EXPECT_TRUE(factory->IsSupportedDecoder({"isac", 16000, 1}));
+ EXPECT_FALSE(factory->IsSupportedDecoder({"isac", 32000, 1}));
EXPECT_EQ(nullptr, factory->MakeAudioDecoder({"isac", 8000, 1}));
auto dec = factory->MakeAudioDecoder({"isac", 16000, 1});
ASSERT_NE(nullptr, dec);
EXPECT_EQ(16000, dec->SampleRateHz());
}
+TEST(AudioDecoderFactoryTemplateTest, IsacFloat) {
+ auto factory = CreateAudioDecoderFactory<AudioDecoderIsacFloat>();
+ EXPECT_THAT(
+ factory->GetSupportedDecoders(),
+ testing::ElementsAre(
+ AudioCodecSpec{{"ISAC", 16000, 1}, {16000, 1, 32000, 10000, 32000}},
+ AudioCodecSpec{{"ISAC", 32000, 1}, {32000, 1, 56000, 10000, 56000}}));
+ EXPECT_FALSE(factory->IsSupportedDecoder({"isac", 16000, 2}));
+ EXPECT_TRUE(factory->IsSupportedDecoder({"isac", 16000, 1}));
+ EXPECT_TRUE(factory->IsSupportedDecoder({"isac", 32000, 1}));
+ EXPECT_EQ(nullptr, factory->MakeAudioDecoder({"isac", 8000, 1}));
+ auto dec1 = factory->MakeAudioDecoder({"isac", 16000, 1});
+ ASSERT_NE(nullptr, dec1);
+ EXPECT_EQ(16000, dec1->SampleRateHz());
+ auto dec2 = factory->MakeAudioDecoder({"isac", 32000, 1});
+ ASSERT_NE(nullptr, dec2);
+ EXPECT_EQ(32000, dec2->SampleRateHz());
+}
+
TEST(AudioDecoderFactoryTemplateTest, L16) {
auto factory = CreateAudioDecoderFactory<AudioDecoderL16>();
EXPECT_THAT(
« no previous file with comments | « webrtc/api/audio_codecs/test/BUILD.gn ('k') | webrtc/api/audio_codecs/test/audio_encoder_factory_template_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698