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

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

Issue 2934833002: G722 implementation of the AudioEncoderFactoryTemplate API (Closed)
Patch Set: remove, rename, nit Created 3 years, 6 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
« no previous file with comments | « webrtc/api/audio_codecs/test/BUILD.gn ('k') | webrtc/modules/audio_coding/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 05558581f500f33a7b857c516622e6cc2b27f267..ec3f28c8a399e84b384d1e342d39ed7093d6cf17 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
@@ -9,6 +9,7 @@
*/
#include "webrtc/api/audio_codecs/audio_encoder_factory_template.h"
+#include "webrtc/api/audio_codecs/g722/audio_encoder_g722.h"
#include "webrtc/api/audio_codecs/opus/audio_encoder_opus.h"
#include "webrtc/base/ptr_util.h"
#include "webrtc/test/gmock.h"
@@ -119,6 +120,21 @@ TEST(AudioEncoderFactoryTemplateTest, TwoEncoderTypes) {
EXPECT_EQ(16000, enc2->SampleRateHz());
}
+TEST(AudioEncoderFactoryTemplateTest, G722) {
the sun 2017/06/13 14:49:30 I guess the idea is to eventually move this test c
kwiberg-webrtc 2017/06/13 19:12:10 I hadn't in fact thought that far ahead, but yes,
+ auto factory = CreateAudioEncoderFactory<AudioEncoderG722>();
+ EXPECT_THAT(factory->GetSupportedEncoders(),
+ testing::ElementsAre(
+ AudioCodecSpec{{"g722", 8000, 1}, {16000, 1, 64000}}));
+ EXPECT_EQ(rtc::Optional<AudioCodecInfo>(),
+ factory->QueryAudioEncoder({"foo", 8000, 1}));
+ EXPECT_EQ(rtc::Optional<AudioCodecInfo>({16000, 1, 64000}),
+ factory->QueryAudioEncoder({"g722", 8000, 1}));
+ EXPECT_EQ(nullptr, factory->MakeAudioEncoder(17, {"bar", 16000, 1}));
+ auto enc = factory->MakeAudioEncoder(17, {"g722", 8000, 1});
+ ASSERT_NE(nullptr, enc);
+ EXPECT_EQ(16000, enc->SampleRateHz());
+}
+
TEST(AudioEncoderFactoryTemplateTest, Opus) {
auto factory = CreateAudioEncoderFactory<AudioEncoderOpus>();
AudioCodecInfo info = {48000, 1, 32000, 6000, 510000};
« no previous file with comments | « webrtc/api/audio_codecs/test/BUILD.gn ('k') | webrtc/modules/audio_coding/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698