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

Side by Side Diff: webrtc/modules/audio_coding/codecs/builtin_audio_decoder_factory_unittest.cc

Issue 2762153002: Don't expect factory to create iLBC decoder if it isn't supported (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 EXPECT_TRUE(adf->MakeAudioDecoder(SdpAudioFormat("pcma", 8000, 3))); 45 EXPECT_TRUE(adf->MakeAudioDecoder(SdpAudioFormat("pcma", 8000, 3)));
46 EXPECT_FALSE(adf->MakeAudioDecoder(SdpAudioFormat("pcma", 16000, 1))); 46 EXPECT_FALSE(adf->MakeAudioDecoder(SdpAudioFormat("pcma", 16000, 1)));
47 } 47 }
48 48
49 TEST(AudioDecoderFactoryTest, CreateIlbc) { 49 TEST(AudioDecoderFactoryTest, CreateIlbc) {
50 rtc::scoped_refptr<AudioDecoderFactory> adf = 50 rtc::scoped_refptr<AudioDecoderFactory> adf =
51 CreateBuiltinAudioDecoderFactory(); 51 CreateBuiltinAudioDecoderFactory();
52 ASSERT_TRUE(adf); 52 ASSERT_TRUE(adf);
53 // iLBC supports 8 kHz, 1 channel. 53 // iLBC supports 8 kHz, 1 channel.
54 EXPECT_FALSE(adf->MakeAudioDecoder(SdpAudioFormat("ilbc", 8000, 0))); 54 EXPECT_FALSE(adf->MakeAudioDecoder(SdpAudioFormat("ilbc", 8000, 0)));
55 #ifdef WEBRTC_CODEC_ILBC
55 EXPECT_TRUE(adf->MakeAudioDecoder(SdpAudioFormat("ilbc", 8000, 1))); 56 EXPECT_TRUE(adf->MakeAudioDecoder(SdpAudioFormat("ilbc", 8000, 1)));
57 #endif
56 EXPECT_FALSE(adf->MakeAudioDecoder(SdpAudioFormat("ilbc", 8000, 2))); 58 EXPECT_FALSE(adf->MakeAudioDecoder(SdpAudioFormat("ilbc", 8000, 2)));
57 EXPECT_FALSE(adf->MakeAudioDecoder(SdpAudioFormat("ilbc", 16000, 1))); 59 EXPECT_FALSE(adf->MakeAudioDecoder(SdpAudioFormat("ilbc", 16000, 1)));
58 } 60 }
59 61
60 TEST(AudioDecoderFactoryTest, CreateIsac) { 62 TEST(AudioDecoderFactoryTest, CreateIsac) {
61 rtc::scoped_refptr<AudioDecoderFactory> adf = 63 rtc::scoped_refptr<AudioDecoderFactory> adf =
62 CreateBuiltinAudioDecoderFactory(); 64 CreateBuiltinAudioDecoderFactory();
63 ASSERT_TRUE(adf); 65 ASSERT_TRUE(adf);
64 // iSAC supports 16 kHz, 1 channel. The float implementation additionally 66 // iSAC supports 16 kHz, 1 channel. The float implementation additionally
65 // supports 32 kHz, 1 channel. 67 // supports 32 kHz, 1 channel.
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 const bool good = (hz == 48000 && channels == 2 && 127 const bool good = (hz == 48000 && channels == 2 &&
126 (stereo == "XX" || stereo == "0" || stereo == "1")); 128 (stereo == "XX" || stereo == "0" || stereo == "1"));
127 EXPECT_EQ(good, static_cast<bool>(adf->MakeAudioDecoder(SdpAudioFormat( 129 EXPECT_EQ(good, static_cast<bool>(adf->MakeAudioDecoder(SdpAudioFormat(
128 "opus", hz, channels, std::move(params))))); 130 "opus", hz, channels, std::move(params)))));
129 } 131 }
130 } 132 }
131 } 133 }
132 } 134 }
133 135
134 } // namespace webrtc 136 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698