OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 } | 112 } |
113 | 113 |
114 TEST(AudioDecoderFactoryTemplateTest, G722) { | 114 TEST(AudioDecoderFactoryTemplateTest, G722) { |
115 auto factory = CreateAudioDecoderFactory<AudioDecoderG722>(); | 115 auto factory = CreateAudioDecoderFactory<AudioDecoderG722>(); |
116 EXPECT_THAT(factory->GetSupportedDecoders(), | 116 EXPECT_THAT(factory->GetSupportedDecoders(), |
117 testing::ElementsAre( | 117 testing::ElementsAre( |
118 AudioCodecSpec{{"g722", 8000, 1}, {16000, 1, 64000}})); | 118 AudioCodecSpec{{"g722", 8000, 1}, {16000, 1, 64000}})); |
119 EXPECT_FALSE(factory->IsSupportedDecoder({"foo", 8000, 1})); | 119 EXPECT_FALSE(factory->IsSupportedDecoder({"foo", 8000, 1})); |
120 EXPECT_TRUE(factory->IsSupportedDecoder({"g722", 8000, 1})); | 120 EXPECT_TRUE(factory->IsSupportedDecoder({"g722", 8000, 1})); |
121 EXPECT_EQ(nullptr, factory->MakeAudioDecoder({"bar", 16000, 1})); | 121 EXPECT_EQ(nullptr, factory->MakeAudioDecoder({"bar", 16000, 1})); |
122 auto dec = factory->MakeAudioDecoder({"g722", 8000, 1}); | 122 auto dec1 = factory->MakeAudioDecoder({"g722", 8000, 1}); |
123 ASSERT_NE(nullptr, dec); | 123 ASSERT_NE(nullptr, dec1); |
124 EXPECT_EQ(16000, dec->SampleRateHz()); | 124 EXPECT_EQ(16000, dec1->SampleRateHz()); |
| 125 EXPECT_EQ(1u, dec1->Channels()); |
| 126 auto dec2 = factory->MakeAudioDecoder({"g722", 8000, 2}); |
| 127 ASSERT_NE(nullptr, dec2); |
| 128 EXPECT_EQ(16000, dec2->SampleRateHz()); |
| 129 EXPECT_EQ(2u, dec2->Channels()); |
| 130 auto dec3 = factory->MakeAudioDecoder({"g722", 8000, 3}); |
| 131 ASSERT_EQ(nullptr, dec3); |
125 } | 132 } |
126 | 133 |
127 } // namespace webrtc | 134 } // namespace webrtc |
OLD | NEW |